diff --git a/package-lock.json b/package-lock.json index 50374ae..39a2334 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,11 +9,13 @@ "version": "0.0.0", "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.4.0", + "@fortawesome/free-brands-svg-icons": "^6.4.0", "@fortawesome/free-solid-svg-icons": "^6.4.0", "@fortawesome/vue-fontawesome": "^3.0.3", "pinia": "^2.0.36", "pinia-plugin-persistedstate": "^3.1.0", "sass": "^1.62.1", + "swiper": "^9.4.1", "vue": "^3.3.2", "vue-router": "^4.2.0", "web3": "^1.7.1" @@ -531,6 +533,18 @@ "node": ">=6" } }, + "node_modules/@fortawesome/free-brands-svg-icons": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.4.0.tgz", + "integrity": "sha512-qvxTCo0FQ5k2N+VCXb/PZQ+QMhqRVM4OORiO6MXdG6bKolIojGU/srQ1ptvKk0JTbRgaJOfL2qMqGvBEZG7Z6g==", + "hasInstallScript": true, + "dependencies": { + "@fortawesome/fontawesome-common-types": "6.4.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/@fortawesome/free-solid-svg-icons": { "version": "6.4.0", "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.4.0.tgz", @@ -4355,6 +4369,11 @@ "node": ">=0.10.0" } }, + "node_modules/ssr-window": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-4.0.2.tgz", + "integrity": "sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ==" + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -4516,6 +4535,27 @@ "node": ">=8" } }, + "node_modules/swiper": { + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/swiper/-/swiper-9.4.1.tgz", + "integrity": "sha512-1nT2T8EzUpZ0FagEqaN/YAhRj33F2x/lN6cyB0/xoYJDMf8KwTFT3hMOeoB8Tg4o3+P/CKqskP+WX0Df046fqA==", + "funding": [ + { + "type": "patreon", + "url": "https://www.patreon.com/swiperjs" + }, + { + "type": "open_collective", + "url": "http://opencollective.com/swiper" + } + ], + "dependencies": { + "ssr-window": "^4.0.2" + }, + "engines": { + "node": ">= 4.7.0" + } + }, "node_modules/tar": { "version": "4.4.19", "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz", @@ -5705,6 +5745,14 @@ "@fortawesome/fontawesome-common-types": "6.4.0" } }, + "@fortawesome/free-brands-svg-icons": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.4.0.tgz", + "integrity": "sha512-qvxTCo0FQ5k2N+VCXb/PZQ+QMhqRVM4OORiO6MXdG6bKolIojGU/srQ1ptvKk0JTbRgaJOfL2qMqGvBEZG7Z6g==", + "requires": { + "@fortawesome/fontawesome-common-types": "6.4.0" + } + }, "@fortawesome/free-solid-svg-icons": { "version": "6.4.0", "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.4.0.tgz", @@ -8620,6 +8668,11 @@ "tweetnacl": "~0.14.0" } }, + "ssr-window": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-4.0.2.tgz", + "integrity": "sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ==" + }, "statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -8740,6 +8793,14 @@ } } }, + "swiper": { + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/swiper/-/swiper-9.4.1.tgz", + "integrity": "sha512-1nT2T8EzUpZ0FagEqaN/YAhRj33F2x/lN6cyB0/xoYJDMf8KwTFT3hMOeoB8Tg4o3+P/CKqskP+WX0Df046fqA==", + "requires": { + "ssr-window": "^4.0.2" + } + }, "tar": { "version": "4.4.19", "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz", diff --git a/package.json b/package.json index bfa9678..e0b1f29 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,13 @@ }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.4.0", + "@fortawesome/free-brands-svg-icons": "^6.4.0", "@fortawesome/free-solid-svg-icons": "^6.4.0", "@fortawesome/vue-fontawesome": "^3.0.3", "pinia": "^2.0.36", "pinia-plugin-persistedstate": "^3.1.0", "sass": "^1.62.1", + "swiper": "^9.4.1", "vue": "^3.3.2", "vue-router": "^4.2.0", "web3": "^1.7.1" @@ -25,4 +27,4 @@ "eslint-plugin-vue": "^9.11.0", "vite": "^4.3.5" } -} \ No newline at end of file +} diff --git a/src/App.vue b/src/App.vue index 2b0516b..59768d1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,13 +2,34 @@ import { onMounted } from "vue"; import { storeToRefs } from "pinia"; +import Web3 from "web3"; import Navbar from "./components/Navbar.vue"; import { useWalletStore } from "@/stores/wallet"; const walletStore = useWalletStore(); +import { useTokenStore } from "@/stores/tokens"; +import { useContractStore } from "@/stores/contracts"; +const tokenStore = useTokenStore(); +const contractStore = useContractStore(); +const { memeBurner } = storeToRefs(tokenStore); +const { list } = storeToRefs(contractStore); + onMounted(async () => { var test = await walletStore.isConnected(); console.log("test", test); + + let web3 = new Web3("https://eth-goerli.g.alchemy.com/v2/0-W9tOm6v_QP1PfRV8RuBCpWr-qoEbkN"); + + const contract = new web3.eth.Contract(memeBurner.value.config.abi, memeBurner.value.config.contractAddress); + list.value.memeBurnerPublic = new web3.eth.Contract( + memeBurner.value.config.abi, + memeBurner.value.config.contractAddress + ); + console.log("list", list.value); + const currentRound = await contract.methods.currentRound().call(); + const rounds = await contract.methods.rounds("0x0e349D42C125acA39ea58024FFC23ED0fE5feE32").call(); + console.log("currentRound", currentRound); + console.log("rounds", rounds); }); @@ -19,6 +40,4 @@ onMounted(async () => { - + diff --git a/src/assets/contracts/LiquidityOwner.json b/src/assets/contracts/LiquidityOwner.json index 77484f6..8aa5996 100644 --- a/src/assets/contracts/LiquidityOwner.json +++ b/src/assets/contracts/LiquidityOwner.json @@ -1,6 +1,6 @@ { "contractName": "LiquidityOwner", - "contractAddress": "0xF58FC44A2862335F3577253EC544488006aF676A", + "contractAddress": "0x0ce1d955f2a2658d6ca1CF61Fa300234fD8A262c", "abi": [ { "inputs": [ @@ -83,7 +83,7 @@ "inputs": [ { "internalType": "uint256[]", - "name": "tokenIds", + "name": "liquidityTokenIds", "type": "uint256[]" } ], @@ -198,7 +198,7 @@ "inputs": [ { "internalType": "uint256[]", - "name": "tokenIds", + "name": "positionsToCancel", "type": "uint256[]" }, { @@ -240,22 +240,22 @@ "inputs": [ { "internalType": "address", - "name": "operator", + "name": "", "type": "address" }, { "internalType": "address", - "name": "from", + "name": "", "type": "address" }, { "internalType": "uint256", - "name": "tokenId", + "name": "", "type": "uint256" }, { "internalType": "bytes", - "name": "data", + "name": "", "type": "bytes" } ], @@ -267,7 +267,7 @@ "type": "bytes4" } ], - "stateMutability": "nonpayable", + "stateMutability": "pure", "type": "function" }, { diff --git a/src/assets/contracts/MemeBurner.json b/src/assets/contracts/MemeBurner.json index 16eddb0..75101a0 100644 --- a/src/assets/contracts/MemeBurner.json +++ b/src/assets/contracts/MemeBurner.json @@ -1,6 +1,6 @@ { "contractName": "MemeBurner", - "contractAddress": "0x5c7077b0424c0e425B16363AdA59f1D72914C5c5", + "contractAddress": "0x6eEAe97975e156400DD1DDD8eFc4CcB167BaAFC3", "abi": [ { "inputs": [ @@ -146,35 +146,6 @@ "name": "MemeSacrificed", "type": "event" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "goal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "achieved", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountOfAsset", - "type": "uint256" - } - ], - "name": "_calculateLinearDecreasingReward", - "outputs": [ - { - "internalType": "uint256", - "name": "reward", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, { "inputs": [ { @@ -206,6 +177,59 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "memeToSacrifice", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountToSacrifice", + "type": "uint256" + } + ], + "name": "getRewardFor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "roundNumber", + "type": "uint256" + }, + { + "internalType": "address", + "name": "meme", + "type": "address" + } + ], + "name": "getSacrificedMeme", + "outputs": [ + { + "internalType": "bool", + "name": "participation", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "amountAchieved", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "liquidityAmountLimit", diff --git a/src/assets/contracts/MemeToken.json b/src/assets/contracts/MemeToken.json index 145b585..6a269f7 100644 --- a/src/assets/contracts/MemeToken.json +++ b/src/assets/contracts/MemeToken.json @@ -1,6 +1,6 @@ { "contractName": "MemeToken", - "contractAddress": "0x0e349D42C125acA39ea58024FFC23ED0fE5feE32", + "contractAddress": "0xeC73Ec89897a36E9Ca36B2190964bBd8C46748AD", "abi": [ { "inputs": [ diff --git a/src/assets/contracts/RewardLocker.json b/src/assets/contracts/RewardLocker.json index 02f662f..0c278ee 100644 --- a/src/assets/contracts/RewardLocker.json +++ b/src/assets/contracts/RewardLocker.json @@ -1,6 +1,6 @@ { "contractName": "RewardLocker", - "contractAddress": "0x6749F75Ece2755d38f209Da1cBab07A1caD69554", + "contractAddress": "0x3bEc26159dbA0A32210eaDF6A938F1BbE8bfDAA0", "abi": [ { "inputs": [ @@ -15,7 +15,7 @@ }, { "inputs": [], - "name": "MemeBurnerAlreadyInitialized", + "name": "MemeAltarAlreadyInitialized", "type": "error" }, { @@ -23,6 +23,21 @@ "name": "MemeTokenAlreadyInitialized", "type": "error" }, + { + "inputs": [], + "name": "RoundIsNotCompletedYet", + "type": "error" + }, + { + "inputs": [], + "name": "TooEarlyToUnstake", + "type": "error" + }, + { + "inputs": [], + "name": "Unsynchronized", + "type": "error" + }, { "anonymous": false, "inputs": [ @@ -33,7 +48,7 @@ "type": "address" }, { - "indexed": false, + "indexed": true, "internalType": "uint256", "name": "amount", "type": "uint256" @@ -42,6 +57,56 @@ "name": "ClaimedReward", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "stakedRound", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + } + ], + "name": "RewardStaked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "unstaker", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "unstakeRound", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "unstakedAmount", + "type": "uint256" + } + ], + "name": "RewardUnstaked", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -106,23 +171,29 @@ "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "_burnedToken", + "name": "unstaker", "type": "address" - } - ], - "name": "claim", - "outputs": [ + }, { + "indexed": true, "internalType": "uint256", - "name": "claimedAmount", + "name": "unstakeRound", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "unstakedAmount", "type": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "name": "UnstakeOrdered", + "type": "event" }, { "inputs": [ @@ -133,7 +204,7 @@ }, { "internalType": "address[]", - "name": "_burnedTokens", + "name": "_sacrificedTokens", "type": "address[]" } ], @@ -148,81 +219,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_burnedTokens", - "type": "address[]" - } - ], - "name": "claim", - "outputs": [ - { - "internalType": "uint256", - "name": "claimedAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_round", - "type": "uint256" - } - ], - "name": "claim", - "outputs": [ - { - "internalType": "uint256", - "name": "claimedAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_round", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "_burnedTokens", - "type": "address[]" - } - ], - "name": "claim", - "outputs": [ - { - "internalType": "uint256", - "name": "claimedAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "claim", - "outputs": [ - { - "internalType": "uint256", - "name": "claimedAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -251,7 +247,7 @@ }, { "internalType": "address", - "name": "_burnedToken", + "name": "_sacrificedToken", "type": "address" } ], @@ -269,32 +265,32 @@ { "inputs": [ { - "internalType": "uint256", - "name": "_round", - "type": "uint256" + "internalType": "address", + "name": "beneficiary", + "type": "address" }, { - "internalType": "address", - "name": "_burnedToken", - "type": "address" + "internalType": "uint256[]", + "name": "roundNumbers", + "type": "uint256[]" } ], - "name": "claim", + "name": "getTotalRewardsOf", "outputs": [ { "internalType": "uint256", - "name": "claimedAmount", + "name": "totalRewardsAmount", "type": "uint256" } ], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", - "name": "_memeBurner", + "name": "_memeAltar", "type": "address" }, { @@ -323,7 +319,7 @@ }, { "inputs": [], - "name": "memeBurner", + "name": "memeAltar", "outputs": [ { "internalType": "address", @@ -347,6 +343,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "orderUnstake", + "outputs": [ + { + "internalType": "uint256", + "name": "unstakeRound", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -356,7 +365,7 @@ }, { "internalType": "address[]", - "name": "burnableTokens", + "name": "sacrificableTokens", "type": "address[]" } ], @@ -380,7 +389,7 @@ }, { "internalType": "address", - "name": "_burnedToken", + "name": "_sacrificedToken", "type": "address" }, { @@ -468,6 +477,11 @@ "name": "roundCompleted", "type": "bool" }, + { + "internalType": "uint256", + "name": "totalDefaultRewards", + "type": "uint256" + }, { "internalType": "uint256", "name": "totalRewards", @@ -476,6 +490,150 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "stakeToBeSecured", + "outputs": [ + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "_rounds", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "_sacrificedTokens", + "type": "address[]" + } + ], + "name": "stakeToBeSecured", + "outputs": [ + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "stakeToBeSecured", + "outputs": [ + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "staked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "unstakeRound", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [ + { + "internalType": "uint256", + "name": "unstakedAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "unstakeOrdered", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" } ] } diff --git a/src/assets/fonts/Inter-Regular.ttf b/src/assets/fonts/Inter-Regular.ttf new file mode 100644 index 0000000..8d4eebf Binary files /dev/null and b/src/assets/fonts/Inter-Regular.ttf differ diff --git a/src/assets/fonts/Vampire.ttf b/src/assets/fonts/Vampire.ttf new file mode 100644 index 0000000..7bf466b Binary files /dev/null and b/src/assets/fonts/Vampire.ttf differ diff --git a/src/assets/img/fuel-noozle.png b/src/assets/img/fuel-noozle.png new file mode 100644 index 0000000..64ccf5e Binary files /dev/null and b/src/assets/img/fuel-noozle.png differ diff --git a/src/assets/img/tokenomics.png b/src/assets/img/tokenomics.png index 8574d90..0ceb567 100644 Binary files a/src/assets/img/tokenomics.png and b/src/assets/img/tokenomics.png differ diff --git a/src/assets/sass/cards.sass b/src/assets/sass/base.sass similarity index 58% rename from src/assets/sass/cards.sass rename to src/assets/sass/base.sass index e87140b..e0dccbd 100644 --- a/src/assets/sass/cards.sass +++ b/src/assets/sass/base.sass @@ -1,3 +1,21 @@ +.bloodline-devider + font-size: 42px + margin: 24px 0 + text-align: center + +.bloodline-border + padding: 24px 32px + border: 4px solid #000000 + border-radius: 16px + +.bloodline-badge + padding: 8px 16px 8px 16px + border-radius: 14px + background-color: #0F0F0F + display: flex + .bloodline-badge-icon + margin-right: 8px + .card display: block overflow: hidden @@ -14,3 +32,4 @@ border-width: 0 border-radius: 4px box-shadow: 0 2px 1px -1px rgba(0, 0, 0, .2),0 1px 1px 0rgba(0, 0, 0, .14),0 1px 3px 0 rgba(0, 0, 0, .12) + background-color: $darkgrey diff --git a/src/assets/sass/bubbles.sass b/src/assets/sass/bubbles.sass new file mode 100644 index 0000000..bf540f5 --- /dev/null +++ b/src/assets/sass/bubbles.sass @@ -0,0 +1,106 @@ +.wrapper + height: 100% + width: 100% + position: absolute + overflow: hidden + div + height: 15px + width: 15px + border: 2px solid rgba(139, 0, 0, 0.7) + border-radius: 50px + position: absolute + top: 10% + left: 10% + animation: 4s linear infinite + +div .dot + height: 10px + width: 10px + border-radius: 50px + background: rgba(138, 62, 62, 0.5) + position: absolute + top: 20% + right: 20% + +.wrapper div + &:nth-child(1) + top: 20% + left: 20% + animation: animate 8s linear infinite + + &:nth-child(2) + top: 60% + left: 55% + animation: animate 10s linear infinite + + &:nth-child(3) + top: 40% + left: 40% + animation: animate 3s linear infinite + + &:nth-child(4) + top: 66% + left: 30% + animation: animate 7s linear infinite + + &:nth-child(5) + top: 90% + left: 10% + animation: animate 9s linear infinite + + &:nth-child(6) + top: 30% + left: 20% + animation: animate 5s linear infinite + + &:nth-child(7) + top: 70% + left: 20% + animation: animate 8s linear infinite + + &:nth-child(8) + top: 75% + left: 30% + animation: animate 10s linear infinite + + &:nth-child(9) + top: 50% + left: 50% + animation: animate 6s linear infinite + + &:nth-child(10) + top: 45% + left: 20% + animation: animate 10s linear infinite + + &:nth-child(11) + top: 10% + left: 90% + animation: animate 9s linear infinite + + &:nth-child(12) + top: 20% + left: 50% + animation: animate 7s linear infinite + + &:nth-child(13) + top: 20% + left: 20% + animation: animate 8s linear infinite + + &:nth-child(14) + top: 60% + left: 5% + animation: animate 6s linear infinite + + &:nth-child(15) + top: 90% + left: 50% + animation: animate 9s linear infinite + +@keyframes animate + 0% + transform: scale(0) translateY(0) rotate(70deg) + + 100% + transform: scale(1.3) translateY(-50px) rotate(360deg) diff --git a/src/assets/sass/buttons.sass b/src/assets/sass/buttons.sass index 0800e4c..9127f6f 100644 --- a/src/assets/sass/buttons.sass +++ b/src/assets/sass/buttons.sass @@ -1,10 +1,12 @@ .btn &.btn-immortal - padding: 6px 24px - background-color: $button-background-color + background-color: $red color: $button-color font-size: 24px + padding: 16px 24px + gap: 8px + border-radius: 14px &:hover,&:focus,&:active background-color: lighten($button-background-color, 10%), color: darken($button-color, 10%), diff --git a/src/assets/sass/main.sass b/src/assets/sass/main.sass index 8e0c077..4518ac0 100644 --- a/src/assets/sass/main.sass +++ b/src/assets/sass/main.sass @@ -1,10 +1,22 @@ @import 'variables' @import 'buttons' -@import 'cards' +@import 'base' +@import 'wave' +@import 'bubbles' +@font-face + font-family: 'Inter' + src: url("@/assets/fonts/Inter-Regular.ttf") + +@font-face + font-family: 'Vampire' + src: url("@/assets/fonts/Vampire.ttf") +* + box-sizing: border-box body - background-color: $secondary - color: $color2 + background-color: #2D2D2D + color: $white + font-family: 'Inter', sans-serif .main padding-top: 120px @@ -30,7 +42,13 @@ body margin-right: auto margin-left: auto @media (min-width: 992px) - max-width: 1140px + max-width: 800px +.section-header-container + width: 655px + text-align: center + font-size: 24px + margin-top: 64px + margin-bottom: 64px h1 font-weight: 700 diff --git a/src/assets/sass/variables.sass b/src/assets/sass/variables.sass index d542c95..c8a756f 100644 --- a/src/assets/sass/variables.sass +++ b/src/assets/sass/variables.sass @@ -8,11 +8,16 @@ $tertiary: #A8A8A8 $tertiary-dark: darken($tertiary, 20%) $tertiary-light: lighten($tertiary, 20%) -$color2: white -$color1: black +$white: #F9F9FA +$black: #0F0F0F +$grey: #808080 +$red: #8B0000 +$purple: #4B0082 -$button-color: $color2 -$button-background-color: $color1 +$darkgrey: #202020 + +$button-color: $white +$button-background-color: $black :root --primary: #{$primary} --primary-light: #{$primary-light} @@ -23,6 +28,9 @@ $button-background-color: $color1 --tertiary: #{$tertiary} --tertiary-light: #{$tertiary-light} --tertiary-dark: #{$tertiary-dark} + --grey: #{$grey} + --purple: #{$purple} + --blood-color: #{$red} // :root // --font-size-text: 16px // --font-size-title: 32px diff --git a/src/assets/sass/wave.sass b/src/assets/sass/wave.sass new file mode 100644 index 0000000..7b94dd0 --- /dev/null +++ b/src/assets/sass/wave.sass @@ -0,0 +1,26 @@ +/* Animation + +.parallax > use + animation: move-forever 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite + &:nth-child(1) + animation-delay: -2s + animation-duration: 7s + + &:nth-child(2) + animation-delay: -3s + animation-duration: 10s + + &:nth-child(3) + animation-delay: -4s + animation-duration: 13s + + &:nth-child(4) + animation-delay: -5s + animation-duration: 20s + +@keyframes move-forever + 0% + transform: translate3d(-90px, 0, 0) + + 100% + transform: translate3d(85px, 0, 0) diff --git a/src/components/BloodChart.vue b/src/components/BloodChart.vue index d162d96..9ebe204 100644 --- a/src/components/BloodChart.vue +++ b/src/components/BloodChart.vue @@ -1,17 +1,50 @@ @@ -20,76 +53,72 @@ const dataPoints = [ { name: "PEPE", - percentage: 34.4, + percentage: 62.2, }, { name: "Shiba", - percentage: 50.4, + percentage: 31.2, }, { name: "Doge", - percentage: 42.4, + percentage: 54.5, }, ]; diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 835c84c..97ac3f3 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -36,9 +36,31 @@ onBeforeUnmount(() => { - + + @@ -52,39 +74,41 @@ header position: fixed z-index: 3 box-sizing: border-box - background-color: grey + background-color: #202020 width: 100% transform: translate3d(0,0,0) transition: transform .3s ease,visibility 0s .3s linear + height: 128px &.navbar--hidden transform: translate3d(0,-100%,0) .navbar-inner display: flex - justify-content: space-between - padding: 0 20px + padding: 16px 24px + box-sizing: border-box + height: 100% + align-items: center @media (min-width: 992px) - padding: 10px 80px + padding: 16px 24px + .navbar-text + font-family: 'Vampire', sans-serif + font-size: 64px + letter-spacing: 0.138em .navbar-center display: flex - align-items: center - .main-menu-links - margin-right: 48px - &:hover, &:active, &:focus - color: lighten(black, 20%) - .main-menu-link - cursor: pointer + margin-left: auto + .navbar-social-links + display: flex + gap: 18px + .social-bloodline-badge + font-size: 16px + padding: 8px 16px 8px 16px + border-radius: 14px + background-color: #0F0F0F + display: flex + .social-bloodline-badge-icon + margin-right: 8px .navbar-end display: flex - align-items: center - align-self: center - a - color: black - &:hover,&:focus, &:active - color: lighten(black, 20%) - - .navbar-hamburger-open - font-size: 35px - .parry-twitter - font-size: 30px - margin-left: 32px + flex: 0 0 200px + justify-content: flex-end diff --git a/src/components/SacrificeToken.vue b/src/components/SacrificeToken.vue index 21b56df..0c3e1b2 100644 --- a/src/components/SacrificeToken.vue +++ b/src/components/SacrificeToken.vue @@ -1,5 +1,6 @@ @@ -72,12 +82,13 @@ import { ref, defineProps, watch } from "vue"; import { useWalletStore } from "@/stores/wallet"; import { useTokenStore } from "@/stores/tokens"; import { storeToRefs } from "pinia"; +import Helper from "@/utils/helper.js"; const walletStore = useWalletStore(); const { contract, connected } = storeToRefs(walletStore); const tokenStore = useTokenStore(); -const { activeToken } = storeToRefs(tokenStore); +const { activeToken, loading } = storeToRefs(tokenStore); const props = defineProps({ data: Array, @@ -86,14 +97,21 @@ const props = defineProps({ watch( activeToken, () => { - tokenNumber.value = 0; + tokenNumber.value = null; }, { deep: true } ); const tokenNumber = ref(0); +const output = ref(0); const approvalData = ref(null); +const processChange = Helper.debounce((e) => test(e)); + +async function test(e) { + console.log("hier", e); + output.value = await tokenStore.getRewardsFor(parseInt(e.target.value)); +} function addTokens(value) { tokenNumber.value = tokenNumber.value + value; } @@ -102,8 +120,6 @@ function addTokens(value) { diff --git a/src/main.js b/src/main.js index c5a8419..0713bce 100644 --- a/src/main.js +++ b/src/main.js @@ -14,10 +14,12 @@ import { library } from '@fortawesome/fontawesome-svg-core' import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' /* import specific icons */ -import { faArrowDown } from '@fortawesome/free-solid-svg-icons' +import { faArrowDown, faSpinner ,faPlus } from "@fortawesome/free-solid-svg-icons"; +import { faDiscord, faTwitter, faTelegram } from "@fortawesome/free-brands-svg-icons"; + /* add icons to the library */ -library.add(faArrowDown); +library.add(faArrowDown, faDiscord, faTwitter, faTelegram, faSpinner, faPlus); const app = createApp(App) diff --git a/src/stores/contracts.js b/src/stores/contracts.js new file mode 100644 index 0000000..940ec16 --- /dev/null +++ b/src/stores/contracts.js @@ -0,0 +1,12 @@ +import { defineStore } from "pinia"; +export const useContractStore = defineStore("contracts", { + state: () => ({ + list: { + + } + }), + getters: { + }, + actions: { + } +}); diff --git a/src/stores/tokens.js b/src/stores/tokens.js index f4c950d..1c4111e 100644 --- a/src/stores/tokens.js +++ b/src/stores/tokens.js @@ -1,6 +1,7 @@ import { defineStore } from "pinia"; import Web3 from "web3"; import { useWalletStore } from "./wallet"; +import { useContractStore } from "./contracts"; import Meme1Json from "@/assets/contracts/Meme1.json"; import Meme2Json from "@/assets/contracts/Meme2.json"; import MemeBurnerJson from "@/assets/contracts/MemeBurner.json"; @@ -411,8 +412,9 @@ export const useTokenStore = defineStore("token", { abi: null, balance: null, contract: null, - allowance: null + allowance: null, }, + loading: false, memeBurner: { config: MemeBurnerJson, contract: null @@ -440,23 +442,42 @@ export const useTokenStore = defineStore("token", { }, async approveToken(amount) { const walletStore = useWalletStore(); + this.loading = true; var approve = await this.contract.methods .approve(this.memeBurner.config.contractAddress, amount) - .send({ from: walletStore.address }); - console.log("approve", approve); - console.log("this.contract", this.contract); + .send({ from: walletStore.address }); + console.log("approve", approve); + this.loading = false; + return approve; }, async sacrificeToken(amount) { - console.log("this.activeToken.", this.activeToken.contractAddress); - const walletStore = useWalletStore(); - console.log("walletStore.address", walletStore.address); - var reward = await this.memeBurner.contract.methods - .sacrificeMeme(this.activeToken.contractAddress, "400000000000000000") - .call({ from: walletStore.address }); - console.log("reward", reward); - }, - getTokenContract(token) { + try { + this.loading = true; + console.log("this.activeToken.", this.activeToken.contractAddress); + const walletStore = useWalletStore(); + console.log("walletStore.address", walletStore.address); + var reward = await this.memeBurner.contract.methods + .sacrificeMeme(this.activeToken.contractAddress, "400000000000000000") + .send({ from: walletStore.address }); + console.log("reward", reward); + } catch (error) { + error.log(error); + + } finally { + this.loading = false; + } + }, + async getRewardsFor(amount) { + const contractsStore = useContractStore(); + var rewards = await contractsStore.list.memeBurnerPublic.methods + .getRewardFor(this.activeToken.contractAddress, amount) + .call(); + return rewards + }, + getTokenContract(token) { + console.log("token", token); const contractAddress = token.contractAddress; + console.log("contractAddress", contractAddress); const activeToken = this.token.find((obj) => obj.contractAddress === contractAddress); console.log("activeToken", activeToken); const web3 = new Web3(window.ethereum); diff --git a/src/stores/wallet.js b/src/stores/wallet.js index e8f1166..df929c6 100644 --- a/src/stores/wallet.js +++ b/src/stores/wallet.js @@ -15,17 +15,6 @@ export const useWalletStore = defineStore("wallet", { increment() { this.count++; }, - async disconnectWallet() { - // const permissions = await window.ethereum.request({ - // method: 'wallet_requestPermissions', - // params: [{ - // eth_accounts: {}, - // }] - // }); - // console.log("permissions", permissions); - this.connected = false; - this.address = null; - }, connectWallet() { console.log("window.ethereum", window.ethereum); // if (window.ethereum) { @@ -33,15 +22,16 @@ export const useWalletStore = defineStore("wallet", { .request({ method: "eth_requestAccounts" }) .then((data) => { console.log("data", data); - this.address = data[0]; - this.connected = true; - const tokenStore = useTokenStore(); - if (tokenStore.activeToken.address) { - //Token selected but not refreshed - this.getTokenBalance(tokenStore.activeToken.address).then( - (data) => (tokenStore.activeToken.balance = data) - ); - } + this.isConnected(); + // this.address = data[0]; + // this.connected = true; + // const tokenStore = useTokenStore(); + // if (tokenStore.activeToken.address) { + // //Token selected but not refreshed + // this.getTokenBalance(tokenStore.activeToken.address).then( + // (data) => (tokenStore.activeToken.balance = data) + // ); + // } // console.log("permissions", permissions); }) .catch((error) => { @@ -62,23 +52,33 @@ export const useWalletStore = defineStore("wallet", { }, async isConnected() { try { + this.loading = true; const accounts = await window.ethereum.request({ method: "eth_accounts" }); if (accounts.length) { this.connected = true; - + this.address = accounts[0]; console.log(`You're connected to: ${accounts[0]}`); const web3 = new Web3(window.ethereum); const tokenStore = useTokenStore(); + console.log("tokenStore.activeToken", tokenStore.activeToken); + if (tokenStore.activeToken.contractAddress) { + tokenStore.activeToken.balance = await this.getTokenBalance( + tokenStore.activeToken + ); + tokenStore.activeToken.allowance = await tokenStore.allowance(); + } tokenStore.memeBurner.contract = new web3.eth.Contract( tokenStore.memeBurner.config.abi, tokenStore.memeBurner.config.contractAddress ); } else { - this.disconnectWallet(); console.log("Metamask is not connected"); + this.connected = false; } } catch (error) { console.log("error", error); + } finally { + this.loading = false; } } diff --git a/src/utils/helper.js b/src/utils/helper.js new file mode 100644 index 0000000..e316c01 --- /dev/null +++ b/src/utils/helper.js @@ -0,0 +1,22 @@ + +export default class Helper { + static debounce(func, timeout = 300) { + let timer; + return (...args) => { + clearTimeout(timer); + timer = setTimeout(() => { + func.apply(this, args); + }, timeout); + }; + } + + static createDebounce() { + let timeout = null; + return function (fnc, delayMs) { + clearTimeout(timeout); + timeout = setTimeout(() => { + fnc(); + }, delayMs || 500); + }; + } +} diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 0d10990..8f69b09 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -2,13 +2,17 @@ import { storeToRefs } from "pinia"; import SacrificeToken from "@/components/SacrificeToken.vue"; import BloodChart from "@/components/BloodChart.vue"; +import TokenClaim from "@/components/TokenClaim.vue"; // import Web3 from "web3"; - // import { useWalletStore } from "@/stores/wallet"; import { useTokenStore } from "@/stores/tokens"; const tokenStore = useTokenStore(); const { token } = storeToRefs(tokenStore); - +import { Navigation } from "swiper"; +// Import Swiper Vue.js components +import { Swiper, SwiperSlide } from "swiper/vue"; +import "swiper/css"; +import "swiper/css/navigation"; // let web3 = new Web3( // "https://eth-goerli.g.alchemy.com/v2/0-W9tOm6v_QP1PfRV8RuBCpWr-qoEbkN" // ); @@ -17,28 +21,37 @@ const { token } = storeToRefs(tokenStore);