Compare commits

2 Commits
Author SHA1 Message Date
Johann Barbie 610e6e83ac testing the test page 2023-06-24 21:07:22 +02:00
Johann Barbie d4af7da669 fix versions 2023-06-24 20:49:25 +02:00
43 changed files with 944 additions and 9630 deletions
-1
View File
@@ -1 +0,0 @@
VITE_GOERLI_KEY= "0-W9tOm6v_QP1PfRV8RuBCpWr-qoEbkN"
+9 -9
View File
@@ -1,12 +1,12 @@
/* eslint-env node */
module.exports = {
root: true,
extends: ["plugin:vue/vue3-essential", "eslint:recommended"],
parserOptions: {
ecmaVersion: "latest",
},
global: {
BigInt: true,
},
};
root: true,
extends: [
'plugin:vue/vue3-essential',
'eslint:recommended',
],
parserOptions: {
ecmaVersion: 'latest'
}
}
+124 -7199
View File
File diff suppressed because it is too large Load Diff
+1 -9
View File
@@ -13,23 +13,15 @@
"@fortawesome/free-brands-svg-icons": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@fortawesome/vue-fontawesome": "^3.0.3",
"@walletconnect/ethereum-provider": "^2.9.0",
"@walletconnect/modal": "^2.6.0",
"@walletconnect/web3-provider": "^1.8.0",
"@web3modal/html": "^2.7.0",
"abi-decoder": "^2.4.0",
"ethers": "^6.6.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": "^v1.9.0"
"web3": "^1.7.1"
},
"devDependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"@vitejs/plugin-vue": "^4.2.3",
"eslint": "^8.39.0",
"eslint-plugin-vue": "^9.11.0",
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

+19 -60
View File
@@ -1,60 +1,35 @@
<script setup>
import { onMounted, onUnmounted, provide, ref } from "vue";
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";
import { useMemeburnerStore } from "@/stores/memeburner";
import { useRewardLockerStore } from "@/stores/rewardlocker";
import { useMultiCallStore } from "@/stores/multicall";
import { useRoundsStore } from "@/stores/rounds";
const tokenStore = useTokenStore();
const contractStore = useContractStore();
const memeBurnerStore = useMemeburnerStore();
const rewardLockerStore = useRewardLockerStore();
const multiCallStore = useMultiCallStore();
const roundsStore = useRoundsStore();
const { memeBurner, token } = storeToRefs(tokenStore);
const { memeBurner } = storeToRefs(tokenStore);
const { list } = storeToRefs(contractStore);
const isMobile = ref(false);
isMobile.value = isMobileFunc();
onUnmounted(() => {
window.removeEventListener("resize", handleWindowSizeChange);
});
const handleWindowSizeChange = () => {
isMobile.value = isMobileFunc();
// your code
};
function isMobileFunc() {
if (screen.width <= 760) {
return true;
} else {
return false;
}
}
provide("isMobile", isMobile);
onMounted(async () => {
window.addEventListener("resize", handleWindowSizeChange);
handleWindowSizeChange();
// initContracts
await walletStore.init();
await tokenStore.init();
await memeBurnerStore.init();
await rewardLockerStore.init();
await memeBurnerStore.init();
await multiCallStore.init();
//Memeburner Contract
var test = await walletStore.isConnected();
console.log("test", test);
//init
roundsStore.currentRound = parseInt(await memeBurnerStore.getCurrentRound());
console.log("roundsStore.currentRound", roundsStore.currentRound);
roundsStore.activeRound = roundsStore.currentRound;
await roundsStore.fillRound(roundsStore.activeRound);
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);
});
</script>
@@ -63,22 +38,6 @@ onMounted(async () => {
<div class="main">
<RouterView />
</div>
<div class="footer">
<div class="footer-inner">
$BLOOD is 100%<br />
community owned.<br />
No team %, no pre-mine.
</div>
</div>
</template>
<style lang="sass">
.footer
height: 450px
min-height: 450px
background-color: var(--grey2)
.footer-inner
padding: 24px
font-size: 24px
text-align: center
</style>
<style lang="sass"></style>
+7 -152
View File
@@ -1,6 +1,6 @@
{
"contractName": "LiquidityOwner",
"contractAddress": "0x88E69D5CE691644F7cE151a2b085798194DAFEa1",
"contractAddress": "0x0ce1d955f2a2658d6ca1CF61Fa300234fD8A262c",
"abi": [
{
"inputs": [
@@ -38,65 +38,6 @@
"stateMutability": "payable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "int24",
"name": "tickLower",
"type": "int24"
},
{
"internalType": "int24",
"name": "tickUpper",
"type": "int24"
}
],
"name": "_concatenateTicks",
"outputs": [
{
"internalType": "int48",
"name": "",
"type": "int48"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "int24",
"name": "tickLower",
"type": "int24"
},
{
"internalType": "int24",
"name": "tickUpper",
"type": "int24"
},
{
"internalType": "uint128",
"name": "liquidity",
"type": "uint128"
},
{
"internalType": "uint80",
"name": "tokenId",
"type": "uint80"
}
],
"internalType": "struct LiquidityOwner.Position",
"name": "position",
"type": "tuple"
}
],
"name": "addETHPositionToLinkedList",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
@@ -125,32 +66,6 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "int48",
"name": "",
"type": "int48"
}
],
"name": "allRangesLinkedList",
"outputs": [
{
"internalType": "int48",
"name": "",
"type": "int48"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "burn",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "chunk",
@@ -365,6 +280,11 @@
],
"name": "positions",
"outputs": [
{
"internalType": "uint128",
"name": "liquidity",
"type": "uint128"
},
{
"internalType": "int24",
"name": "tickLower",
@@ -374,16 +294,6 @@
"internalType": "int24",
"name": "tickUpper",
"type": "int24"
},
{
"internalType": "uint128",
"name": "liquidity",
"type": "uint128"
},
{
"internalType": "uint80",
"name": "tokenId",
"type": "uint80"
}
],
"stateMutability": "view",
@@ -398,26 +308,7 @@
}
],
"name": "provideLiquidity",
"outputs": [
{
"internalType": "uint256",
"name": "ethSpentOnGas",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "rebalance",
"outputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
@@ -440,35 +331,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "payForGas",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "memeAltarGasPrice",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "consumedGasByMemeAltar",
"type": "uint256"
}
],
"name": "triggeredByMemeAltar",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "uniV3Pool",
@@ -518,13 +380,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "withdrawETH",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
+40 -379
View File
@@ -1,6 +1,6 @@
{
"contractName": "MemeBurner",
"contractAddress": "0xc9cC73C414f122f85EfE20382EB753d29C5a0351",
"contractAddress": "0x6eEAe97975e156400DD1DDD8eFc4CcB167BaAFC3",
"abi": [
{
"inputs": [
@@ -24,11 +24,6 @@
"name": "_developer",
"type": "address"
},
{
"internalType": "address",
"name": "_admin",
"type": "address"
},
{
"internalType": "address",
"name": "_rewardLocker",
@@ -43,6 +38,11 @@
"internalType": "uint256[]",
"name": "roundGoals",
"type": "uint256[]"
},
{
"internalType": "uint256",
"name": "_liquidityAmountLimit",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
@@ -63,41 +63,27 @@
"name": "LiquidityOwnerAlreadyInitialized",
"type": "error"
},
{
"inputs": [],
"name": "LiquidityOwnerTriggerFailed",
"type": "error"
},
{
"inputs": [],
"name": "MemeIsNotInAList",
"type": "error"
},
{
"inputs": [],
"name": "NextRoundRegistrationFailed",
"type": "error"
},
{
"inputs": [],
"name": "NothingToSacrifice",
"type": "error"
},
{
"inputs": [],
"name": "RewardRegistrationFailed",
"type": "error"
},
{
"inputs": [],
"name": "RoundCompletedRegistrationFailed",
"type": "error"
},
{
"inputs": [],
"name": "TokenIsNotInSacrificableList",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "memeToTransfer",
"type": "address"
}
],
"name": "TokenTransferFailed",
"type": "error"
},
{
"inputs": [
{
@@ -113,44 +99,26 @@
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "roundNumber",
"type": "uint256"
},
{
"indexed": true,
"indexed": false,
"internalType": "address",
"name": "meme",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "memeMarket",
"type": "address"
}
],
"name": "MemeAddedToSacrificableList",
"name": "MemeAddedToSacrificeList",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "roundNumber",
"type": "uint256"
},
{
"indexed": true,
"indexed": false,
"internalType": "address",
"name": "meme",
"type": "address"
}
],
"name": "MemeRemovedFromSacrificableList",
"name": "MemeRemovedFromSacrificeList",
"type": "event"
},
{
@@ -178,90 +146,6 @@
"name": "MemeSacrificed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "NewAdmin",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"components": [
{
"internalType": "uint8",
"name": "b1",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "m1",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "b2",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "m2",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "b3",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "m4",
"type": "uint8"
}
],
"indexed": true,
"internalType": "struct MemeBurner.BM",
"name": "_bm",
"type": "tuple"
}
],
"name": "NewBM",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "newDefaultGoal",
"type": "uint256"
}
],
"name": "NewDefaultRoundGoal",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "newDurationLimit",
"type": "uint256"
}
],
"name": "NewRoundDurationLimit",
"type": "event"
},
{
"inputs": [
{
@@ -276,156 +160,10 @@
}
],
"name": "addMemeToList",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "uint8",
"name": "b1",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "m1",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "b2",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "m2",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "b3",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "m4",
"type": "uint8"
}
],
"internalType": "struct MemeBurner.BM",
"name": "newBM",
"type": "tuple"
}
],
"name": "adjustBM",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "newDefaultGoal",
"type": "uint256"
}
],
"name": "adjustDefaultGoal",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "newDurationLimit",
"type": "uint256"
}
],
"name": "adjustRoundDurationLimit",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "admin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "bm",
"outputs": [
{
"internalType": "uint8",
"name": "b1",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "m1",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "b2",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "m2",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "b3",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "m4",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "currentRound",
@@ -439,57 +177,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "defaultGoal",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "memeToSacrifice",
"type": "address"
}
],
"name": "getAmountToReachGoal",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "roundNumber",
"type": "uint256"
}
],
"name": "getGoalInBLD",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
@@ -543,6 +230,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "liquidityAmountLimit",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "liquidityOwner",
@@ -603,13 +303,7 @@
}
],
"name": "removeMemeFromList",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
@@ -626,19 +320,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "roundDurationLimit",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
@@ -653,11 +334,6 @@
"internalType": "uint256",
"name": "goal",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "expirationTimestamp",
"type": "uint256"
}
],
"stateMutability": "view",
@@ -700,25 +376,6 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "switchAdmin",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "weth",
@@ -731,6 +388,10 @@
],
"stateMutability": "view",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"contractName": "MemeToken",
"contractAddress": "0x9dcD7Cd83ED0Fe69DDfE3c2A265a1207F2Bc3219",
"contractAddress": "0xeC73Ec89897a36E9Ca36B2190964bBd8C46748AD",
"abi": [
{
"inputs": [
-444
View File
@@ -1,444 +0,0 @@
{
"contractName": "Multicall3",
"contractAddress": "0xcA11bde05977b3631167028862bE2a173976CA11",
"abi": [
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
}
],
"internalType": "struct Multicall3.Call[]",
"name": "calls",
"type": "tuple[]"
}
],
"name": "aggregate",
"outputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
},
{
"internalType": "bytes[]",
"name": "returnData",
"type": "bytes[]"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "bool",
"name": "allowFailure",
"type": "bool"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
}
],
"internalType": "struct Multicall3.Call3[]",
"name": "calls",
"type": "tuple[]"
}
],
"name": "aggregate3",
"outputs": [
{
"components": [
{
"internalType": "bool",
"name": "success",
"type": "bool"
},
{
"internalType": "bytes",
"name": "returnData",
"type": "bytes"
}
],
"internalType": "struct Multicall3.Result[]",
"name": "returnData",
"type": "tuple[]"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "bool",
"name": "allowFailure",
"type": "bool"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
}
],
"internalType": "struct Multicall3.Call3Value[]",
"name": "calls",
"type": "tuple[]"
}
],
"name": "aggregate3Value",
"outputs": [
{
"components": [
{
"internalType": "bool",
"name": "success",
"type": "bool"
},
{
"internalType": "bytes",
"name": "returnData",
"type": "bytes"
}
],
"internalType": "struct Multicall3.Result[]",
"name": "returnData",
"type": "tuple[]"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
}
],
"internalType": "struct Multicall3.Call[]",
"name": "calls",
"type": "tuple[]"
}
],
"name": "blockAndAggregate",
"outputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "blockHash",
"type": "bytes32"
},
{
"components": [
{
"internalType": "bool",
"name": "success",
"type": "bool"
},
{
"internalType": "bytes",
"name": "returnData",
"type": "bytes"
}
],
"internalType": "struct Multicall3.Result[]",
"name": "returnData",
"type": "tuple[]"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "getBasefee",
"outputs": [
{
"internalType": "uint256",
"name": "basefee",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "getBlockHash",
"outputs": [
{
"internalType": "bytes32",
"name": "blockHash",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getBlockNumber",
"outputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getChainId",
"outputs": [
{
"internalType": "uint256",
"name": "chainid",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getCurrentBlockCoinbase",
"outputs": [
{
"internalType": "address",
"name": "coinbase",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getCurrentBlockDifficulty",
"outputs": [
{
"internalType": "uint256",
"name": "difficulty",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getCurrentBlockGasLimit",
"outputs": [
{
"internalType": "uint256",
"name": "gaslimit",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getCurrentBlockTimestamp",
"outputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "addr",
"type": "address"
}
],
"name": "getEthBalance",
"outputs": [
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getLastBlockHash",
"outputs": [
{
"internalType": "bytes32",
"name": "blockHash",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bool",
"name": "requireSuccess",
"type": "bool"
},
{
"components": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
}
],
"internalType": "struct Multicall3.Call[]",
"name": "calls",
"type": "tuple[]"
}
],
"name": "tryAggregate",
"outputs": [
{
"components": [
{
"internalType": "bool",
"name": "success",
"type": "bool"
},
{
"internalType": "bytes",
"name": "returnData",
"type": "bytes"
}
],
"internalType": "struct Multicall3.Result[]",
"name": "returnData",
"type": "tuple[]"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bool",
"name": "requireSuccess",
"type": "bool"
},
{
"components": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
}
],
"internalType": "struct Multicall3.Call[]",
"name": "calls",
"type": "tuple[]"
}
],
"name": "tryBlockAndAggregate",
"outputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "blockHash",
"type": "bytes32"
},
{
"components": [
{
"internalType": "bool",
"name": "success",
"type": "bool"
},
{
"internalType": "bytes",
"name": "returnData",
"type": "bytes"
}
],
"internalType": "struct Multicall3.Result[]",
"name": "returnData",
"type": "tuple[]"
}
],
"stateMutability": "payable",
"type": "function"
}
]
}
+6 -147
View File
@@ -1,6 +1,6 @@
{
"contractName": "RewardLocker",
"contractAddress": "0x7C3D5a19878d550D0c6c2b0BFC884ef410F6e440",
"contractAddress": "0x3bEc26159dbA0A32210eaDF6A938F1BbE8bfDAA0",
"abi": [
{
"inputs": [
@@ -116,12 +116,6 @@
"name": "user",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "roundNumber",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
@@ -129,7 +123,7 @@
"type": "address"
},
{
"indexed": false,
"indexed": true,
"internalType": "uint256",
"name": "reward",
"type": "uint256"
@@ -154,7 +148,7 @@
"type": "address"
},
{
"indexed": true,
"indexed": false,
"internalType": "uint256",
"name": "totalRoundRewards",
"type": "uint256"
@@ -268,78 +262,6 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "roundNumber",
"type": "uint256"
}
],
"name": "getSacrificableTokens",
"outputs": [
{
"internalType": "address[]",
"name": "",
"type": "address[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "roundNumber",
"type": "uint256"
},
{
"internalType": "address",
"name": "sacrificedToken",
"type": "address"
}
],
"name": "getSacrificedTokenCoefficient",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "roundNumber",
"type": "uint256"
},
{
"internalType": "address",
"name": "sacrificedToken",
"type": "address"
}
],
"name": "getSacrificedTokenTotalRewards",
"outputs": [
{
"internalType": "uint256",
"name": "totalDefaultRewardsForToken",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "totalRewardsForToken",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
@@ -487,35 +409,6 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
},
{
"internalType": "address",
"name": "_sacrificedToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "reward",
"type": "uint256"
}
],
"name": "registerRewardNextRound",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
@@ -580,9 +473,9 @@
"name": "rounds",
"outputs": [
{
"internalType": "uint256",
"name": "roundCompletedTimestamp",
"type": "uint256"
"internalType": "bool",
"name": "roundCompleted",
"type": "bool"
},
{
"internalType": "uint256",
@@ -598,40 +491,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "stakeCoefficient",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "_rounds",
"type": "uint256[]"
},
{
"internalType": "address[]",
"name": "_sacrificedTokens",
"type": "address[]"
}
],
"name": "stakeAndClaim",
"outputs": [
{
"internalType": "uint256",
"name": "stakedAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "claimedAmount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

+4 -27
View File
@@ -1,21 +1,12 @@
.bloodline-devider
font-size: 42px
margin: 24px 0
text-align: center
margin: 16px 0
@media (min-width: 992px)
margin: 24px 0
.bloodline-border
padding: 16px
padding: 24px 32px
border: 4px solid #000000
border-radius: 16px
border: 2px solid #000
&.bloodline-border--variant1
border: 4px solid var(--midnight-black)
@media (min-width: 992px)
padding: 24px 32px
border: 4px solid #000
&.purple
border-color: var(--purple)
.bloodline-badge
padding: 8px 16px 8px 16px
@@ -39,20 +30,6 @@
border-color: rgba(var(--v-border-color),var(--v-border-opacity))
border-style: solid
border-width: 0
border-radius: 16px
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
@media (min-width: 992px)
border-radius: 4px
&.card--variant1
border-radius: 0
.bloodline-token
height: 50px
width: 50px
@media (min-width: 992px)
height: auto
width: auto
.bloodline-container
padding: 0 24px
+3 -7
View File
@@ -1,17 +1,13 @@
.btn
&.btn-immortal
background-color: $purple
background-color: $red
color: $button-color
font-size: 24px
padding: 16px 24px
gap: 8px
border-radius: 14px
&:hover,&:focus,&:active
background-color: darken($purple, 10%),
background-color: lighten($button-background-color, 10%),
color: darken($button-color, 10%),
cursor: pointer
&.btn--disabled
background-color: #151515
color: #808080
cursor: not-allowed
+9 -12
View File
@@ -37,12 +37,18 @@ body
margin-top: auto
.container
padding-right: 15px
padding-left: 15px
margin-right: auto
margin-left: auto
@media (min-width: 992px)
max-width: 800px
padding-right: 15px
padding-left: 15px
.section-header-container
width: 655px
text-align: center
font-size: 24px
margin-top: 64px
margin-bottom: 64px
h1
font-weight: 700
@@ -51,16 +57,7 @@ h1
@media (min-width: 992px)
font-size: 60px
@media (min-width: 1200px)
h2
font-size: 40px
font-weight: 200
@media (min-width: 992px)
font-size: 40px
h3
font-size: 32px
font-weight: 200
@media (min-width: 992px)
font-size: 40px
.page-head
margin-bottom: 80px
.page-body
+1 -5
View File
@@ -13,9 +13,8 @@ $black: #0F0F0F
$grey: #808080
$red: #8B0000
$purple: #4B0082
$midnight-black: #0F0F0F
$darkgrey: #202020
$grey2: #2D2D2D
$button-color: $white
$button-background-color: $black
@@ -30,11 +29,8 @@ $button-background-color: $black
--tertiary-light: #{$tertiary-light}
--tertiary-dark: #{$tertiary-dark}
--grey: #{$grey}
--grey2: #{$grey2}
--purple: #{$purple}
--blood-color: #{$red}
--midnight-black: #{$midnight-black}
--darkgrey: #{$darkgrey}
// :root
// --font-size-text: 16px
// --font-size-title: 32px
+27 -57
View File
@@ -1,15 +1,13 @@
<template>
<div class="blood-chart-wrapper" v-if="props.data">
<div class="blood-chart-element" v-for="coin in props.data.token" :key="coin.name">
<div class="blood-chart-wrapper">
<div class="blood-chart-element" v-for="coin in dataPoints" :key="coin.name">
<div class="blood-chart-element-header">
<div class="blood-chart-coin">
<img :src="getImageUrl(coin.vamplogo)" alt="logo" />
</div>
<div class="blood-chart-coin"></div>
<div class="blood-chart-coin-title">{{ coin.name }}</div>
</div>
<div class="blood-chart-element-body">
<div class="blood-chart-bar-wrapper">
<div class="blood-chart-bar" :style="`height: ${getPercentage(coin.amount, props.data.goal)}%`">
<div class="blood-chart-bar" :style="`height: ${coin.percentage}%`">
<svg
class="waves"
xmlns="http://www.w3.org/2000/svg"
@@ -39,14 +37,12 @@
<div><span class="dot"></span></div>
<div><span class="dot"></span></div>
</div>
<div class="blood-chart-bar-percentage">{{ getPercentage(coin.amount, props.data.goal) }}%</div>
<div class="blood-chart-bar-percentage">{{ coin.percentage }}%</div>
</div>
</div>
</div>
<div class="blood-chart-element-footer">
<div class="blood-chart-amount">
{{ compactNumber(coin.amount) }}
</div>
<div class="blood-chart-amount">130,4b</div>
<div class="blood-chart-coin">$BLOOD</div>
</div>
</div>
@@ -54,51 +50,27 @@
</template>
<script setup>
import { getPercentage, compactNumber } from "@/helper/helper.js";
import { useMemeburnerStore } from "@/stores/memeburner";
const memeBurnerStore = useMemeburnerStore();
const props = defineProps({
data: Array,
});
console.log(props.data);
function getImageUrl(url) {
return new URL(url, import.meta.url).href;
}
// const dataPoints = [
// {
// name: "$PEPE",
// percentage: 62.2,
// icon: "/assets/img/token/pepevamp.png",
// },
// {
// name: "$SHIB",
// percentage: 31.2,
// icon: "/assets/img/token/shibvamp.png",
// },
// {
// name: "$ELON",
// percentage: 54.5,
// icon: "/assets/img/token/elonvamp.png",
// },
// ];
const dataPoints = [
{
name: "PEPE",
percentage: 62.2,
},
{
name: "Shiba",
percentage: 31.2,
},
{
name: "Doge",
percentage: 54.5,
},
];
</script>
<style lang="sass">
.blood-chart-wrapper
height: 750px
width: 100%
justify-content: space-around
display: inline-flex
@media (min-width: 992px)
gap: 96px
width: unset
justify-content: unset
gap: 96px
.blood-chart-element
height: 100%
width: 80px
@@ -110,22 +82,19 @@ function getImageUrl(url) {
height: 80px
width: 80px
border-radius: 80px
background-color: grey
margin-left: auto
margin-right: auto
position: relative
margin-bottom: 16px
overflow: hidden
.blood-chart-coin-title
text-align: center
margin-bottom: 32px
font-size: 16px
@media (min-width: 992px)
font-size: 24px
font-size: 24px
.blood-chart-element-body
background-color: rgba(233, 233, 233, 0.2)
flex: 0 0 500px
flex: 1 1 auto
border-radius: 8px 8px 40px 40px
text-align: left
.blood-chart-bar-wrapper
height: 100%
display: flex
@@ -134,13 +103,14 @@ function getImageUrl(url) {
margin-top: auto
background-color: var(--blood-color)
position: relative
border-radius: 0 0 40px 40px
border-radius: 8px 8px 40px 40px
.blood-chart-bar-percentage
font-size: 14px
text-align: center
margin-top: 16px
.waves
position: absolute
top: -10px
top: -8px
width: 100%
height: 10px
.blood-chart-element-footer
+11 -32
View File
@@ -1,17 +1,15 @@
<script setup>
import { storeToRefs } from "pinia";
import { ref, onMounted, onBeforeUnmount, inject } from "vue";
import { ref, onMounted, onBeforeUnmount } from "vue";
import { useWalletStore } from "@/stores/wallet";
const walletStore = useWalletStore();
const { connected, address } = storeToRefs(walletStore);
const isMobile = inject("isMobile");
const showNavbar = ref(true);
const lastScrollPosition = ref(0);
function onScroll() {
const currentScrollPosition =
window.pageYOffset || document.documentElement.scrollTop;
const currentScrollPosition = window.pageYOffset || document.documentElement.scrollTop;
if (currentScrollPosition < 0) {
return;
}
@@ -34,11 +32,12 @@ onBeforeUnmount(() => {
<div class="navbar-inner">
<div class="navbar-icon">
<router-link to="/">
<img alt="logo" class="logo" src="/assets/img/vampir.png" />
<!-- <img alt="Parry logo" class="logo" src="@/assets/img/logo.svg" /> -->
<img alt="logo" class="logo" src="@/assets/img/vampir.png" />
</router-link>
</div>
<div class="navbar-text">Bloodline</div>
<div class="navbar-center" v-if="!isMobile">
<div class="navbar-center">
<div class="navbar-social-links">
<div class="social-bloodline-badge">
<div class="social-bloodline-badge-icon">
@@ -61,13 +60,8 @@ onBeforeUnmount(() => {
</div>
</div>
<div class="navbar-end">
<div v-if="!isMobile">
<div v-if="!connected" class="btn btn-immortal" @click="walletStore.connectWallet">connect</div>
<span v-else> {{ address }}</span>
</div>
<div v-else class="hamburger-menu">
<font-awesome-icon :icon="['fas', 'bars']" />
</div>
<div v-if="!connected" class="btn btn-immortal" @click="walletStore.connectWallet">connect</div>
<span v-else> {{ address }}</span>
</div>
</div>
</div>
@@ -84,9 +78,7 @@ header
width: 100%
transform: translate3d(0,0,0)
transition: transform .3s ease,visibility 0s .3s linear
height: 82px
@media (min-width: 992px)
height: 128px
height: 128px
&.navbar--hidden
transform: translate3d(0,-100%,0)
.navbar-inner
@@ -97,18 +89,10 @@ header
align-items: center
@media (min-width: 992px)
padding: 16px 24px
.navbar-icon
img
height: 50px
width: 50px
.navbar-text
font-family: 'Vampire', sans-serif
font-size: 36px
margin-left: 16px
font-size: 64px
letter-spacing: 0.138em
line-height: 73.107px
@media (min-width: 992px)
font-size: 64px
.navbar-center
display: flex
margin-left: auto
@@ -121,15 +105,10 @@ header
border-radius: 14px
background-color: #0F0F0F
display: flex
&:hover,&:active,&:focus
background-color: lighten(#0F0F0F, 10%)
cursor: pointer
.social-bloodline-badge-icon
margin-right: 8px
.navbar-end
display: flex
margin-left: auto
.hamburger-menu
color: var(--purple)
font-size: 42px
flex: 0 0 200px
justify-content: flex-end
</style>
-54
View File
@@ -1,54 +0,0 @@
<template>
<div class="rewards-wrapper">
<div class="rewards-header">
<div class="rewards-header-title">
{{ props.title }}
</div>
<div class="rewards-header-info">{{ props.info }}</div>
</div>
<div class="rewards-sacrifice-wrapper bloodline-border bloodline-border--variant1">
<div class="rewards-body">
<div class="rewards-coin">$BLOOD</div>
<div class="rewards-amount">{{ props.amount }}</div>
</div>
<img class="bloodline-token" :src="props.image" alt="vampir" />
</div>
</div>
</template>
<script setup>
const props = defineProps({
title: String,
info: String,
amount: String,
image: String,
});
</script>
<style lang="sass">
.rewards-header
font-size: 16px
padding: 8px
display: flex
@media (min-width: 992px)
font-size: 24px
.rewards-header-info
margin-left: auto
.rewards-sacrifice-wrapper, .rewards-clan-wrapper
display: flex
.rewards-body
align-self: center
.rewards-coin
font-size: 16px
@media (min-width: 992px)
font-size: 24px
.rewards-amount
font-size: 24px
margin-top: 8px
@media (min-width: 992px)
font-size: 40px
margin-top: 0
img
margin-left: auto
align-self: center
</style>
+135 -236
View File
@@ -1,112 +1,76 @@
<template>
<div class="sacrifice-wrapper card bloodline-wrapper">
{{ activeToken.allowance }}
<div class="sacrifice-inner">
<div class="sacrifice-headline">Select Sacrifice</div>
<div class="sacrifice-select-tokens">
<div class="sacrifice-tokens">
<div
class="sacrifice-token"
:class="[
{
'sacrifice-token--active': token.contractAddress === activeToken.contractAddress,
'bloodline-border': token.contractAddress === activeToken.contractAddress,
'bloodline-border--variant1': token.contractAddress === activeToken.contractAddress,
},
]"
v-for="token in props.data"
:key="token.contractAddress"
@click="tokenStore.changeActiveToken(token)"
>
<div class="sacrifice-token-logo">
<img v-if="isMobile" :src="token.logoMobile" alt="token logo" />
<img v-if="!isMobile" :src="token.logo" alt="token logo" />
</div>
<div class="sacrifice-token-name">{{ token.name }}</div>
</div>
<div class="sacrifice-headline">Select Token</div>
<div class="sacrifice-select-tokens">
<div class="sacrifice-tokens">
<div
class="sacrifice-token"
:class="[{ 'sacrifice-token--active': token.contractAddress === activeToken.contractAddress }]"
v-for="token in props.data"
:key="token.contractAddress"
@click="tokenStore.changeActiveToken(token)"
>
{{ token.name }}
</div>
</div>
<div class="sacrifice-from-to-wrapper" v-if="activeToken.contractAddress">
<div
:class="{
'sacrifice-from-wrapper': true,
'bloodline-border': true,
'bloodline-border--variant1': true,
purple: isMobile,
}"
>
<div class="sarcrifice-from-input">
<input @input="processChange" v-model="tokenNumber" :placeholder="0" />
<div class="sacrifice-logo">
<img :src="activeToken.logo" alt="vampir" />
</div>
</div>
<div class="sacrifice-from-to-wrapper" v-if="activeToken.contractAddress">
<div class="sacrifice-from-wrapper bloodline-border">
<div class="sarcrifice-from-input">
<input @input="processChange" type="number" v-model="tokenNumber" :placeholder="0" /><img
src="@/assets/img/vampir.png"
alt="vampir"
/>
</div>
<div class="value-adder">
<div class="sacrifice-adder-step bloodline-badge" @click="addTokens(1000000)">+1m</div>
<div class="sacrifice-adder-step bloodline-badge" @click="addTokens(10000000)">+10m</div>
<div class="sacrifice-adder-step bloodline-badge" @click="addTokens(100000000)">+100m</div>
<div class="sacrifice-adder-balance">Balance: {{ parseFloat(activeToken.balance) }}</div>
<div class="sacrifice-adder-max" @click="tokenNumber = parseFloat(activeToken.balance)">Max</div>
</div>
</div>
<div class="sacrifice-divider bloodline-devider">
<font-awesome-icon :icon="['fas', 'arrow-down']" />
</div>
<div class="sacrifice-to-wrapper bloodline-border">
<div class="sarcrifice-from-input">
<div class="sacrifice-to-output">
<div class="sacrifice-to-output-coin">{{ activeToken.name }}</div>
<div class="sacrifice-to-output-rewards">{{ output }}</div>
</div>
<div class="value-adder">
<div class="sacrifice-adder-step bloodline-badge" @click="addTokens(10000000)">+10m</div>
<div class="sacrifice-adder-step bloodline-badge" @click="addTokens(100000000)">+100m</div>
<div class="sacrifice-adder-step bloodline-badge" @click="addTokens(1000000000)">+1b</div>
<!-- <div class="sacrifice-adder-balance">Balance: {{ parseFloat(activeToken.balance) }}</div>
<div class="sacrifice-adder-max" @click="tokenNumber = parseFloat(activeToken.balance)">
Max
</div> -->
<img src="@/assets/img/vampir.png" alt="vampir" />
</div>
</div>
<div class="sacrifice-fees-info-wrapper">
<div class="sacrifice-fees-img">
<img src="@/assets/img/fuel-noozle.png" alt="fuel noozle" />
</div>
<div class="sacrifice-fees-body">
<div class="sacrifice-fees-body-header">
<div class="sacrifice-fees-body-header-title">Gas Support</div>
<div class="sacrifice-fees-body-header-amount">42Gwei</div>
</div>
<div class="sacrifice-fees-body-subheader">Increase amount to pay 97% less network fees.</div>
</div>
</div>
<div class="sacrifice-buttons-function-wrapper">
<div v-if="connected">
<div
class="btn btn-immortal"
v-if="activeToken.allowance > 0 && activeToken.allowance >= tokenNumber"
@click="approvalData = tokenStore.sacrificeToken(1)"
>
<font-awesome-icon v-if="loading" icon="spinner" spin />
Sacrifce {{ activeToken.name }}
</div>
<div class="btn btn-immortal" v-else @click="approvalData = tokenStore.approveToken(1)">
Approve {{ activeToken.name }}
</div>
</div>
<div class="sacrifice-divider bloodline-devider">
<font-awesome-icon :icon="['fas', 'arrow-down']" />
</div>
<div
:class="{
'sacrifice-from-wrapper': true,
'bloodline-border': true,
'bloodline-border--variant1': true,
purple: isMobile && output && output > 0,
}"
>
<div class="sarcrifice-from-input">
<div class="sacrifice-to-output">
<div class="sacrifice-to-output-coin">$BLOOD</div>
<div class="sacrifice-to-output-rewards">{{ output }}</div>
</div>
<div class="sacrifice-logo">
<img :src="activeToken.vamp.logo" :alt="activeToken.vamp.name" />
</div>
</div>
</div>
<div class="sacrifice-fees-info-wrapper">
<div class="sacrifice-fees-img">
<img src="/assets/img/fuel-noozle.png" alt="fuel noozle" />
</div>
<div class="sacrifice-fees-body">
<div class="sacrifice-fees-body-header">
<div class="sacrifice-fees-body-header-title">Gas Support</div>
<div class="sacrifice-fees-body-header-amount">42Gwei</div>
</div>
<div class="sacrifice-fees-body-subheader">Increase amount to pay 97% less network fees.</div>
</div>
</div>
<div class="sacrifice-buttons-function-wrapper">
<div v-if="connected">
<div
class="btn btn-immortal"
v-if="activeToken.allowance > 0 && activeToken.allowance >= tokenNumber"
@click="approvalData = memeburnerStore.sacrificeMeme(tokenNumber)"
>
<font-awesome-icon v-if="memeburnerStore.loading" icon="spinner" spin />
Sacrifce {{ activeToken.name }}
</div>
<div
class="btn btn-immortal"
v-else
@click="approvalData = tokenStore.approveToken(tokenNumber)"
>
<font-awesome-icon v-if="loading" icon="spinner" spin />
Approve {{ activeToken.name }}
</div>
</div>
<div v-else>
<div class="btn btn-immortal" @click="walletStore.connectWallet">Connect</div>
</div>
<div v-else>
<div class="btn btn-immortal" @click="walletStore.connectWallet">Connect</div>
</div>
</div>
</div>
@@ -114,13 +78,11 @@
</template>
<script setup>
import { ref, defineProps, watch, inject, computed } from "vue";
import { ref, defineProps, watch } from "vue";
import { useWalletStore } from "@/stores/wallet";
import { useTokenStore } from "@/stores/tokens";
import { useMemeburnerStore } from "@/stores/memeBurner";
import { storeToRefs } from "pinia";
import Helper from "@/utils/helper.js";
const isMobile = inject("isMobile");
const walletStore = useWalletStore();
const { contract, connected } = storeToRefs(walletStore);
@@ -128,8 +90,6 @@ const { contract, connected } = storeToRefs(walletStore);
const tokenStore = useTokenStore();
const { activeToken, loading } = storeToRefs(tokenStore);
const memeburnerStore = useMemeburnerStore();
const props = defineProps({
data: Array,
});
@@ -146,153 +106,91 @@ const tokenNumber = ref(0);
const output = ref(0);
const approvalData = ref(null);
const processChange = Helper.debounce((e) => getRewardsFor(e));
const processChange = Helper.debounce((e) => test(e));
async function getRewardsFor(e) {
if (!e.target.value || isNaN(e.target.value)) {
output.value = 0;
return;
}
console.log("activeToken.value.decimals", activeToken.value.decimals);
const rewardsForResult = await memeburnerStore.getRewardsFor(
BigInt(e.target.value * Math.pow(10, activeToken.value.decimals))
);
// var test = await memeburnerStore.getRewardsFor(10000);
// console.log("test", test);
// const rewardsForResult = await tokenStore.getRewardsFor(10000);
console.log("rewardsForResult", rewardsForResult);
console.log("tokenStore.memeToken.decimals", tokenStore.memeToken.decimals);
console.log(
"Math.pow(10, tokenStore.memeToken.decimals)",
Math.pow(10, tokenStore.memeToken.decimals)
);
output.value =
rewardsForResult / Math.pow(10, tokenStore.memeToken.decimals);
async function test(e) {
console.log("hier", e);
output.value = await tokenStore.getRewardsFor(parseInt(e.target.value));
}
async function addTokens(value) {
function addTokens(value) {
tokenNumber.value = tokenNumber.value + value;
output.value = await memeburnerStore.getRewardsFor(
parseInt(tokenNumber.value)
);
}
</script>
<style lang="sass">
.sacrifice-wrapper
display: flex
flex-direction: column
margin-left: auto
margin-right: auto
background-color: var(--primary)
.sacrifice-inner
padding: 48px 24px
@media (min-width: 992px)
padding: 48px 64px
.sacrifice-headline
text-align: center
font-size: 24px
margin-bottom: 32px
@media (min-width: 992px)
font-size: 36px
.sacrifice-select-tokens
display: flex
margin-bottom: 32px
.sacrifice-tokens
display: flex
width: 100%
justify-content: space-between
@media (min-width: 992px)
justify-content: space-evenly
.sacrifice-token
border-radius: 16px
padding: 12px
cursor: pointer
background-color: #0F0F0F
text-align: center
user-select: none
border: 4px solid transparent
.sacrifice-token-logo
pointer-events: none
// @media (min-width: 992px)
// padding: 0
// background-color: unset
&.sacrifice-token--active
border-color: var(--purple)
.sacrifice-token-name
padding: 5px 26px
font-size: 16px
@media (min-width: 992px)
font-size: 24px
.sacrifice-buttons-function-wrapper
text-align: center
justify-content: center
margin-top: 24px
display: block
@media (min-width: 992px)
display: flex
.btn
padding: 16px 64px
.sacrifice-fees-info-wrapper
display: flex
border: 2px dashed var(--grey)
color: var(--grey)
.sacrifice-headline
text-align: center
font-size: 36px
.sacrifice-select-tokens
padding: 24px
display: flex
margin-bottom: 32px
.sacrifice-tokens
display: flex
width: 100%
justify-content: space-evenly
.sacrifice-token
width: 132px
height: 132px
border-radius: 16px
padding: 16px 24px
margin-top: 24px
font-size: 16px
.sacrifice-fees-img
flex: 0 0 15%
.sacrifice-fees-body
flex: 1 1 auto
.sacrifice-fees-body-header
display: flex
flex-direction: row
justify-content: space-between
margin-bottom: 8px
@media (min-width: 992px)
font-size: 24px
margin-bottom: 0
padding: 12px
border: 1px solid lightgrey
cursor: pointer
background-color: var(--tertiary)
&:hover,
&:active,
&:focus
background-color: var(--tertiary-dark)
&.sacrifice-token--active
background-color: var(--tertiary-dark)
.sacrifice-buttons-function-wrapper
text-align: center
display: flex
justify-content: center
margin-top: 24px
.btn
padding: 16px 64px
.sacrifice-fees-info-wrapper
display: flex
border: 2px dashed var(--grey)
border-radius: 16px
padding: 16px 24px
margin-top: 24px
.sacrifice-fees-img
flex: 0 0 15%
.sacrifice-fees-body
flex: 1 1 auto
.sacrifice-fees-body-header
font-size: 24px
display: flex
flex-direction: row
justify-content: space-between
.sacrifice-from-to-wrapper
.sacrifice-from-wrapper,.sacrifice-to-wrapper
.sarcrifice-from-input
display: flex
margin-bottom: 8px
// height: 60px
height: 60px
input
width: 100%
height: 45px
font-size: 24px
border-radius: 16px
padding: 0 16px
@media (min-width: 992px)
font-size: 32px
height: auto
.sacrifice-logo
margin-left: 16px
font-size: 32px
img
width: 45px
height: 45px
border-radius: 50%
pointer-events: none
@media (min-width: 992px)
height: 83px
width: auto
margin-left: 16px
.sacrifice-to-output
flex: 1 1 auto
text-align: left
.sacrifice-to-output-coin
font-size: 16px
@media (min-width: 992px)
font-size: 24px
.sacrifice-to-output-rewards
font-size: 24px
@media (min-width: 992px)
font-size: 42px
.sacrifice-to-output-rewards
font-size: 42px
.value-adder
display: flex
gap: 6px
@@ -302,16 +200,17 @@ async function addTokens(value) {
&:active,
&:focus
background-color: var(--secondary)
border: 1px solid var(--secondary-dark)
cursor: pointer
// .sacrifice-adder-balance
// margin-left: auto
// .sacrifice-adder-max
// margin-left: 12px
// color: red
// &:hover,
// &:focus,
// &:active
// color: darken(red, 10%)
// transform: scale(1.1)
// transition: transform 0s
.sacrifice-adder-balance
margin-left: auto
.sacrifice-adder-max
margin-left: 12px
color: red
&:hover,
&:focus,
&:active
color: darken(red, 10%)
transform: scale(1.1)
transition: transform 0s
</style>
+39 -81
View File
@@ -1,99 +1,57 @@
<template>
<div class="claim bloodline-border">
<div class="rewards-wrapper" v-if="!isMobile">
<rewards-wrapper
title="Sacrafice Reward"
coin="$BLOOD"
:amount="getCurrentRoundData?.rewards_sacrifice"
image="/assets/img/vampir.png"
/>
<div class="rewards-wrapper">
<div class="rewards-headline">Sacrafice Reward</div>
<div class="rewards-sacrifice-wrapper bloodline-border">
<div class="rewards-body">
<div class="rewards-coin">$BLOOD</div>
<div class="rewards-amount">0</div>
</div>
<img src="@/assets/img/vampir.png" alt="vampir" />
</div>
<div class="rewards-divider bloodline-devider">
<font-awesome-icon icon="fa-solid fa-plus" />
</div>
<rewards-wrapper
title="Clan Reward"
coin="$BLOOD"
:amount="getCurrentRoundData?.rewards_clan"
image="/assets/img/vampir.png"
/>
</div>
<div class="rewards-list" v-else>
<rewards-wrapper
title="Total Sacrafice Reward"
coin="$BLOOD"
amount="0"
image="/assets/img/vampir.png"
/>
<rewards-wrapper
title="Total Stake Reward"
coin="$BLOOD"
amount="0"
info="max: 312m"
image="/assets/img/vampir.png"
/>
<rewards-wrapper title="Clan Bonus" coin="$BLOOD" amount="0" image="/assets/img/vampir.png" />
<rewards-wrapper title="Total Reward" coin="$BLOOD" amount="0" image="/assets/img/vampir.png" />
</div>
<div class="claim-button">
<div v-if="activeRound === currentRound" class="btn btn-immortal btn--disabled">Cycle Active</div>
<div v-else-if="getCurrentRoundData?.rewards_total > 0" class="btn btn-immortal" @click="claimRewards">
Claim
<div class="rewards-headline">Clan Reward</div>
<div class="rewards-clan-wrapper bloodline-border">
<div class="rewards-body">
<div class="rewards-coin">$BLOOD</div>
<div class="rewards-amount">0</div>
</div>
<img src="@/assets/img/vampir.png" alt="vampir" />
</div>
<div class="claim-button">
<div class="btn btn-immortal">Claim</div>
</div>
<div v-else class="btn btn-immortal btn--disabled">Nothing to claim</div>
</div>
<div class="stake-buttons">
<div class="btn btn-immortal">Stake</div>
<div class="btn btn-immortal">Unstake</div>
</div>
</div>
</template>
<script setup>
import { storeToRefs } from "pinia";
import RewardsWrapper from "@/components/RewardsWrapper.vue";
import { inject, ref, onMounted } from "vue";
import { useRewardLockerStore } from "@/stores/rewardlocker";
import { useWalletStore } from "@/stores/wallet";
import { useRoundsStore } from "@/stores/rounds";
const clanRewards = ref(0);
const rewards = ref(0);
const isMobile = inject("isMobile");
const rewardLockerStore = useRewardLockerStore();
const walletStore = useWalletStore();
const roundStore = useRoundsStore();
const { address } = storeToRefs(walletStore);
const { activeRound, currentRound, getCurrentRoundData } =
storeToRefs(roundStore);
onMounted(async () => {});
async function claimRewards() {
console.log("getCurrentRoundData", getCurrentRoundData);
console.log("activeRound.value", activeRound.value);
var result = await rewardLockerStore.claim([activeRound.value]);
console.log("result", result);
}
</script>
<script setup></script>
<style lang="sass">
.claim
display: flex
padding: 32px 20px
flex-direction: column
@media (min-width: 992px)
padding: 32px 40px
padding: 32px 40px
.claim-button
text-align: center
margin: 32px 0
.stake-buttons
display: flex
text-align: center
gap: 32px
div
flex: 1 1 50%
.rewards-wrapper
margin-bottom: 16px
.rewards-divider
text-align: center
margin-top: 32px
.rewards-wrapper
width: 100%
.rewards-headline
font-size: 24px
padding: 0 0 4px 8px
.rewards-divider
text-align: center
.rewards-sacrifice-wrapper, .rewards-clan-wrapper
display: flex
.rewards-body
align-self: center
.rewards-coin
font-size: 24px
.rewards-amount
font-size: 40px
img
margin-left: auto
</style>
-18
View File
@@ -1,18 +0,0 @@
export function getImageUrl(url) {
return new URL(url, import.meta.url).href;
}
export function getPercentage(amount, goal) {
console.log("amount", amount);
console.log("goal", goal);
return ((amount / goal) * 100).toFixed(2);
}
export function compactNumber(number) {
return Intl.NumberFormat("en-US", {
notation: "compact",
maximumFractionDigits: 2,
}).format(parseInt(number));
}
+2 -2
View File
@@ -14,12 +14,12 @@ import { library } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
/* import specific icons */
import { faArrowDown, faSpinner ,faPlus, faCaretLeft, faCaretRight, faBars } 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, faDiscord, faTwitter, faTelegram, faSpinner, faPlus, faCaretLeft, faCaretRight, faBars);
library.add(faArrowDown, faDiscord, faTwitter, faTelegram, faSpinner, faPlus);
const app = createApp(App)
-106
View File
@@ -1,106 +0,0 @@
import { defineStore } from "pinia";
import MemeBurnerJson from "@/assets/contracts/MemeBurner.json";
import { useTokenStore } from "./tokens";
import { useMultiCallStore } from "./multicall";
import { useWalletStore } from "./wallet";
import { useRoundsStore } from "@/stores/rounds";
export const useMemeburnerStore = defineStore("memeburner", {
state: () => ({
config: MemeBurnerJson,
contract: null,
loading: false,
}),
getters: {},
actions: {
async init() {
console.log("-----------init memeburner-------------");
const walletStore = useWalletStore();
const roundsStore = useRoundsStore();
this.contract = new walletStore.web3.eth.Contract(this.config.abi, this.config.contractAddress);
const websocketMemeBurner = new walletStore.web3socket.eth.Contract(
this.config.abi,
this.config.contractAddress
);
websocketMemeBurner.events
.MemeSacrificed()
.on("data", async (event) => {
console.log("sacrificedAmount", event.returnValues.sacrificedAmount);
console.log("sacrificedToken", event.returnValues.sacrificedToken);
await roundsStore.updateCurrentRound(
event.returnValues.sacrificedToken,
event.returnValues.sacrificedAmount
);
})
.on("error", (error) => console.log("MemeSacrificederror", error));
},
async getRewardsFor(amount) {
const tokenStore = useTokenStore();
var rewards = await this.contract.methods
.getRewardFor(tokenStore.activeToken.contractAddress, amount)
.call();
return rewards;
},
async getCurrentRound() {
return await this.contract.methods.currentRound().call();
},
async getGoal(roundnumber) {
return await this.contract.methods.rounds(roundnumber).call();
},
//returns participated, amount achieved
async getSacrificedMeme(roundnumber, tokenAddress) {
return await this.contract.methods.getSacrificedMeme(roundnumber, tokenAddress).call();
},
async getAmountToReachGoal(tokenAddress) {
return await this.contract.methods.getAmountToReachGoal(tokenAddress).call();
},
async getSacrificedRound(roundnumber) {
console.log("getSacrificedRound", roundnumber);
const tokenStore = useTokenStore();
const calls = [];
// const calls1 = [];
for (let index = 0; index < tokenStore.token.length; index++) {
const token = tokenStore.token[index];
console.log("token.contractAddress", token.contractAddress);
console.log("roundnumber", roundnumber);
var test = await this.getSacrificedMeme(roundnumber, token.contractAddress);
console.log(token.name, test);
calls.push(this.contract.methods.getSacrificedMeme(roundnumber, token.contractAddress));
// calls1.push(this.contract.methods.getAmountToReachGoal(token.contractAddress));
}
console.log("this.contract", this.contract);
const multicallStore = useMultiCallStore();
return await multicallStore.aggregate(calls);
},
async sacrificeMeme(amount) {
const walletStore = useWalletStore();
const tokenStore = useTokenStore();
try {
if (!amount || amount == 0) {
//todo error
console.error("amount is 0 or null or undefined");
return;
}
this.loading = true;
const amountDecimal = BigInt(amount * Math.pow(10, tokenStore.activeToken.decimals));
var reward = await this.contract.methods
.sacrificeMeme(tokenStore.activeToken.contractAddress, amountDecimal)
.send({ from: walletStore.address });
console.log("reward", reward);
tokenStore.activeToken.allowance = await tokenStore.allowance();
} catch (error) {
console.error(error);
} finally {
this.loading = false;
}
},
async getGoalInBLD(roundNumber) {
return await this.contract.methods.getGoalInBLD(roundNumber).call();
}
},
});
-49
View File
@@ -1,49 +0,0 @@
import { defineStore } from "pinia";
import MulticallJson from "@/assets/contracts/Multicall.json";
import { useWalletStore } from "./wallet";
export const useMultiCallStore = defineStore("multicall", {
state: () => ({
config: MulticallJson,
contract: null,
}),
getters: {},
actions: {
async init() {
console.log("-----------init multicall-------------");
const walletStore = useWalletStore();
this.contract = new walletStore.web3.eth.Contract(
this.config.abi,
this.config.contractAddress
);
},
async aggregate(calls, parameters = {}) {
const callRequests = calls.map((call) => {
const callData = call.encodeABI();
return {
target: call._parent._address,
callData,
};
});
const { returnData } = await this.contract.methods.aggregate(callRequests).call(parameters);
return returnData.map((hex, index) => {
const types = calls[index]._method.outputs.map((o) =>
o.internalType !== o.type && o.internalType !== undefined ? o : o.type
);
const walletStore = useWalletStore();
let result = walletStore.web3.eth.abi.decodeParameters(types, hex);
delete result.__length__;
result = Object.values(result);
return result.length === 1 ? result[0] : result;
});
}
}
}
);
-58
View File
@@ -1,58 +0,0 @@
import { defineStore } from "pinia";
import RewardLockerJson from "@/assets/contracts/RewardLocker.json";
import { useTokenStore } from "./tokens";
import { useMultiCallStore } from "./multicall";
import { useWalletStore } from "./wallet";
import { ethers } from "ethers";
export const useRewardLockerStore = defineStore("rewardlocker", {
state: () => ({
config: RewardLockerJson,
contract: null,
ethcontract: null,
}),
getters: {},
actions: {
async init() {
console.log("-----------init rewardlocker-------------");
const walletStore = useWalletStore();
this.contract = new walletStore.web3.eth.Contract(this.config.abi, this.config.contractAddress);
},
/*
* @param {*} walletAddress
* @param {*} roundNumber
* @param {*} tokenAddress
* @returns Rewards for specific token and specific round
*/
async getRewards(walletAddress, roundNumber, tokenAddress) {
return await this.contract.methods.rewards(walletAddress, roundNumber, tokenAddress).call();
},
async getRewardsForAllToken(roundNumber) {
console.log("getRewardsForAllToken");
const tokenStore = useTokenStore();
const walletStore = useWalletStore();
const calls = [];
for (let index = 0; index < tokenStore.token.length; index++) {
const token = tokenStore.token[index];
calls.push(this.contract.methods.rewards(walletStore.address, roundNumber, token.contractAddress));
}
const multicallStore = useMultiCallStore();
return await multicallStore.aggregate(calls);
},
async getSacrificedTokenCoefficient(roundNumber, sacrificedToken) {
return await this.contract.methods.getSacrificedTokenCoefficient(roundNumber, sacrificedToken).call();
},
async lastCompletedRound() {
return await this.contract.methods.lastCompletedRound().call();
},
async claim(round) {
const walletStore = useWalletStore();
// return await this.contract.methods.claim(round).call();
console.log(this.contract.methods.claim(round));
return await this.contract.methods.claim(round).send({from: walletStore.address, to: this.contractAddress});
},
async getTotalRewardsOf(address, rounds) {
return await this.contract.methods.getTotalRewardsOf(address, rounds).call();
},
},
});
-100
View File
@@ -1,100 +0,0 @@
import { defineStore } from "pinia";
import { useMemeburnerStore } from "./memeburner";
import { useTokenStore } from "./tokens";
import { useRewardLockerStore } from "./rewardlocker";
import { useWalletStore } from "./wallet";
export const useRoundsStore = defineStore("rounds", {
state: () => ({
rounds: [
],
activeRound: null,
currentRound: null
}),
getters: {
getCurrentRoundData() {
return this.rounds[this.activeRound];
}
},
actions: {
async init() {
//fill initial round
},
async updateCurrentRound(sacrificedToken, sacrificedAmount) {
const tokenStore = useTokenStore();
const memeBurnerStore = useMemeburnerStore();
var data = await memeBurnerStore.getSacrificedRound(this.currentRound)
console.log("data123", data);
var tokenIndex = this.rounds[this.currentRound].token.findIndex((tokenData) => tokenData.contractAddress === sacrificedToken);
this.rounds[this.currentRound].token[tokenIndex].amount = data[tokenIndex][1];
},
async fillRound() {
console.log("fillRound");
const memeBurnerStore = useMemeburnerStore();
const tokenStore = useTokenStore();
const walletStore = useWalletStore();
const rewardLockerStore = useRewardLockerStore();
// if (this.activeRound === this.currentRound) {
// console.log("activeRound is not completed");
// } else
if (!this.rounds[this.activeRound]) {
console.log("round not filled --> fill round");
console.log("vor error");
var data = await memeBurnerStore.getSacrificedRound(this.activeRound)
let rewardData = null;
if (await walletStore.isConnected()) {
rewardData = await rewardLockerStore.getRewardsForAllToken(this.activeRound);
}
console.log("rewardData123", rewardData);
var goal = await memeBurnerStore.getGoal(this.activeRound);
var tokenArray = []
var rewards_clan = BigInt(0);
var rewards_sacrifice = BigInt(0);
for (let index = 0; index < data.length; index++) {
var tokenData = {};
const token = tokenStore.token[index];
var testcoef = await rewardLockerStore.getSacrificedTokenCoefficient(this.activeRound, token.contractAddress);
tokenData.name = token.name;
tokenData.contractAddress = token.contractAddress;
tokenData.vamplogo = token.vamp.logo;
tokenData.vampname = token.vamp.name;
tokenData.amount = data[index][1];
tokenData.getAmountToReachGoal= await memeBurnerStore.getAmountToReachGoal(token.contractAddress);
if (this.currentRound !== this.activeRound && await walletStore.isConnected()) {
const clanwin = BigInt((testcoef / 10000 - 1) * rewardData[index]);
const sacrificeRewards = BigInt(rewardData[index]) - clanwin;
tokenData.rewards_ges = rewardData[index];
tokenData.rewards_clan = clanwin;
tokenData.rewards_sacrifice = sacrificeRewards;
rewards_clan = rewards_clan + BigInt(clanwin / BigInt(Math.pow(10, token.decimals)));
rewards_sacrifice =
rewards_sacrifice + BigInt(sacrificeRewards / BigInt(Math.pow(10, token.decimals)));
}
tokenArray.push(tokenData);
}
const goalInBLD = await memeBurnerStore.getGoalInBLD(this.activeRound);
this.rounds[this.activeRound] = {
goal: goal.goal,
goalInBLD: goalInBLD /Math.pow(10, tokenStore.memeToken.decimals),
expirationTimestamp: goal.expirationTimestamp,
rewards_clan: rewards_clan,
rewards_sacrifice: rewards_sacrifice,
rewards_total: rewards_clan + rewards_sacrifice,
token: tokenArray,
};
} else {
console.log("round already filled");
}
console.log("this.rounds123", this.rounds);
},
},
});
+441 -89
View File
@@ -1,133 +1,485 @@
import { defineStore } from "pinia";
import { markRaw } from "vue";
import Web3 from "web3";
import { useWalletStore } from "./wallet";
import { useContractStore } from "./contracts";
import { ethers } from "ethers";
import { useMemeburnerStore } from "./memeburner";
import Meme1Json from "@/assets/contracts/Meme1.json";
import Meme2Json from "@/assets/contracts/Meme2.json";
import MemeToken from "@/assets/contracts/MemeToken.json";
import MemeBurnerJson from "@/assets/contracts/MemeBurner.json";
export const useTokenStore = defineStore("token", {
state: () => ({
token: [
// {
// name: "PEPE",
// contractAddress: "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
// abi: [
// {
// inputs: [{ internalType: "uint256", name: "_totalSupply", type: "uint256" }],
// stateMutability: "nonpayable",
// type: "constructor",
// },
// {
// anonymous: false,
// inputs: [
// { indexed: true, internalType: "address", name: "owner", type: "address" },
// { indexed: true, internalType: "address", name: "spender", type: "address" },
// { indexed: false, internalType: "uint256", name: "value", type: "uint256" },
// ],
// name: "Approval",
// type: "event",
// },
// {
// anonymous: false,
// inputs: [
// { indexed: true, internalType: "address", name: "previousOwner", type: "address" },
// { indexed: true, internalType: "address", name: "newOwner", type: "address" },
// ],
// name: "OwnershipTransferred",
// type: "event",
// },
// {
// anonymous: false,
// inputs: [
// { indexed: true, internalType: "address", name: "from", type: "address" },
// { indexed: true, internalType: "address", name: "to", type: "address" },
// { indexed: false, internalType: "uint256", name: "value", type: "uint256" },
// ],
// name: "Transfer",
// type: "event",
// },
// {
// inputs: [
// { internalType: "address", name: "owner", type: "address" },
// { internalType: "address", name: "spender", type: "address" },
// ],
// name: "allowance",
// outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
// stateMutability: "view",
// type: "function",
// },
// {
// inputs: [
// { internalType: "address", name: "spender", type: "address" },
// { internalType: "uint256", name: "amount", type: "uint256" },
// ],
// name: "approve",
// outputs: [{ internalType: "bool", name: "", type: "bool" }],
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// inputs: [{ internalType: "address", name: "account", type: "address" }],
// name: "balanceOf",
// outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
// stateMutability: "view",
// type: "function",
// },
// {
// inputs: [
// { internalType: "address", name: "_address", type: "address" },
// { internalType: "bool", name: "_isBlacklisting", type: "bool" },
// ],
// name: "blacklist",
// outputs: [],
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// inputs: [{ internalType: "address", name: "", type: "address" }],
// name: "blacklists",
// outputs: [{ internalType: "bool", name: "", type: "bool" }],
// stateMutability: "view",
// type: "function",
// },
// {
// inputs: [{ internalType: "uint256", name: "value", type: "uint256" }],
// name: "burn",
// outputs: [],
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// inputs: [],
// name: "decimals",
// outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
// stateMutability: "view",
// type: "function",
// },
// {
// inputs: [
// { internalType: "address", name: "spender", type: "address" },
// { internalType: "uint256", name: "subtractedValue", type: "uint256" },
// ],
// name: "decreaseAllowance",
// outputs: [{ internalType: "bool", name: "", type: "bool" }],
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// inputs: [
// { internalType: "address", name: "spender", type: "address" },
// { internalType: "uint256", name: "addedValue", type: "uint256" },
// ],
// name: "increaseAllowance",
// outputs: [{ internalType: "bool", name: "", type: "bool" }],
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// inputs: [],
// name: "limited",
// outputs: [{ internalType: "bool", name: "", type: "bool" }],
// stateMutability: "view",
// type: "function",
// },
// {
// inputs: [],
// name: "maxHoldingAmount",
// outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
// stateMutability: "view",
// type: "function",
// },
// {
// inputs: [],
// name: "minHoldingAmount",
// outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
// stateMutability: "view",
// type: "function",
// },
// {
// inputs: [],
// name: "name",
// outputs: [{ internalType: "string", name: "", type: "string" }],
// stateMutability: "view",
// type: "function",
// },
// {
// inputs: [],
// name: "owner",
// outputs: [{ internalType: "address", name: "", type: "address" }],
// stateMutability: "view",
// type: "function",
// },
// {
// inputs: [],
// name: "renounceOwnership",
// outputs: [],
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// inputs: [
// { internalType: "bool", name: "_limited", type: "bool" },
// { internalType: "address", name: "_uniswapV2Pair", type: "address" },
// { internalType: "uint256", name: "_maxHoldingAmount", type: "uint256" },
// { internalType: "uint256", name: "_minHoldingAmount", type: "uint256" },
// ],
// name: "setRule",
// outputs: [],
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// inputs: [],
// name: "symbol",
// outputs: [{ internalType: "string", name: "", type: "string" }],
// stateMutability: "view",
// type: "function",
// },
// {
// inputs: [],
// name: "totalSupply",
// outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
// stateMutability: "view",
// type: "function",
// },
// {
// inputs: [
// { internalType: "address", name: "recipient", type: "address" },
// { internalType: "uint256", name: "amount", type: "uint256" },
// ],
// name: "transfer",
// outputs: [{ internalType: "bool", name: "", type: "bool" }],
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// inputs: [
// { internalType: "address", name: "sender", type: "address" },
// { internalType: "address", name: "recipient", type: "address" },
// { internalType: "uint256", name: "amount", type: "uint256" },
// ],
// name: "transferFrom",
// outputs: [{ internalType: "bool", name: "", type: "bool" }],
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
// name: "transferOwnership",
// outputs: [],
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// inputs: [],
// name: "uniswapV2Pair",
// outputs: [{ internalType: "address", name: "", type: "address" }],
// stateMutability: "view",
// type: "function",
// },
// ],
// },
// {
// name: "SHIBA INU",
// contractAddress: "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",
// abi: [
// {
// constant: true,
// inputs: [],
// name: "name",
// outputs: [{ name: "", type: "string" }],
// payable: false,
// stateMutability: "view",
// type: "function",
// },
// {
// constant: false,
// inputs: [
// { name: "spender", type: "address" },
// { name: "value", type: "uint256" },
// ],
// name: "approve",
// outputs: [{ name: "", type: "bool" }],
// payable: false,
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// constant: true,
// inputs: [],
// name: "totalSupply",
// outputs: [{ name: "", type: "uint256" }],
// payable: false,
// stateMutability: "view",
// type: "function",
// },
// {
// constant: false,
// inputs: [
// { name: "sender", type: "address" },
// { name: "recipient", type: "address" },
// { name: "amount", type: "uint256" },
// ],
// name: "transferFrom",
// outputs: [{ name: "", type: "bool" }],
// payable: false,
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// constant: true,
// inputs: [],
// name: "decimals",
// outputs: [{ name: "", type: "uint8" }],
// payable: false,
// stateMutability: "view",
// type: "function",
// },
// {
// constant: false,
// inputs: [
// { name: "spender", type: "address" },
// { name: "addedValue", type: "uint256" },
// ],
// name: "increaseAllowance",
// outputs: [{ name: "", type: "bool" }],
// payable: false,
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// constant: false,
// inputs: [{ name: "value", type: "uint256" }],
// name: "burn",
// outputs: [],
// payable: false,
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// constant: true,
// inputs: [{ name: "account", type: "address" }],
// name: "balanceOf",
// outputs: [{ name: "", type: "uint256" }],
// payable: false,
// stateMutability: "view",
// type: "function",
// },
// {
// constant: true,
// inputs: [],
// name: "symbol",
// outputs: [{ name: "", type: "string" }],
// payable: false,
// stateMutability: "view",
// type: "function",
// },
// {
// constant: false,
// inputs: [
// { name: "spender", type: "address" },
// { name: "subtractedValue", type: "uint256" },
// ],
// name: "decreaseAllowance",
// outputs: [{ name: "", type: "bool" }],
// payable: false,
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// constant: false,
// inputs: [
// { name: "recipient", type: "address" },
// { name: "amount", type: "uint256" },
// ],
// name: "transfer",
// outputs: [{ name: "", type: "bool" }],
// payable: false,
// stateMutability: "nonpayable",
// type: "function",
// },
// {
// constant: true,
// inputs: [
// { name: "owner", type: "address" },
// { name: "spender", type: "address" },
// ],
// name: "allowance",
// outputs: [{ name: "", type: "uint256" }],
// payable: false,
// stateMutability: "view",
// type: "function",
// },
// {
// inputs: [
// { name: "name", type: "string" },
// { name: "symbol", type: "string" },
// { name: "decimals", type: "uint8" },
// { name: "totalSupply", type: "uint256" },
// { name: "feeReceiver", type: "address" },
// { name: "tokenOwnerAddress", type: "address" },
// ],
// payable: true,
// stateMutability: "payable",
// type: "constructor",
// },
// {
// anonymous: false,
// inputs: [
// { indexed: true, name: "from", type: "address" },
// { indexed: true, name: "to", type: "address" },
// { indexed: false, name: "value", type: "uint256" },
// ],
// name: "Transfer",
// type: "event",
// },
// {
// anonymous: false,
// inputs: [
// { indexed: true, name: "owner", type: "address" },
// { indexed: true, name: "spender", type: "address" },
// { indexed: false, name: "value", type: "uint256" },
// ],
// name: "Approval",
// type: "event",
// },
// ],
// },
{
name: "$PEPE",
logo: "/assets/img/token/pepe.png",
logoMobile: "/assets/img/token/pepeMobile.png",
vamp: {
logo: "/assets/img/token/pepevamp.png",
name: "$PEPE Vamp Token",
},
backgroundColor: "#4b8501",
name: "Meme1",
abi: Meme1Json.abi,
contractAddress: Meme1Json.contractAddress,
ethcontract: null,
},
{
name: "$SHIB",
logo: "/assets/img/token/shib.png",
logoMobile: "/assets/img/token/shibMobile.png",
vamp: {
logo: "/assets/img/token/shibvamp.png",
name: "$SHIBA Vamp Token",
},
name: "Meme2",
abi: Meme2Json.abi,
contractAddress: Meme2Json.contractAddress,
},
// {
// name: "$ELON",
// logo: "/assets/img/token/elon.png",
// logoMobile: "/assets/img/token/elonMobile.png",
// vamp: {
// logo: "/assets/img/token/shibvamp.png",
// name: "$ELON Vamp Token",
// },
// abi: null,
// contractAddress: null,
// },
],
activeToken: {
address: null,
abi: null,
balance: null,
contract: null,
allowance: null,
},
loading: false,
memeToken: {
config: {
abi: MemeToken.abi,
contractAddress: MemeToken.contractAddress,
},
contract: null,
allowance: null,
},
loading: false,
memeBurner: {
config: MemeBurnerJson,
contract: null
}
}),
getters: {},
actions: {
async init() {
console.log("-----------init token-------------");
const walletStore = useWalletStore();
for (let index = 0; index < this.token.length; index++) {
const token = this.token[index];
token.contract = new walletStore.web3.eth.Contract(token.abi, token.contractAddress);
token.decimals = parseInt(await token.contract.methods.decimals().call());
}
//MemeToken init
this.memeToken.contract = new walletStore.web3.eth.Contract(
this.memeToken.config.abi,
this.memeToken.config.contractAddress
);
this.memeToken.decimals = parseInt(await this.memeToken.contract.methods.decimals().call());
},
async changeActiveToken(token) {
this.activeToken = token;
const web3 = new Web3(window.ethereum);
this.contract = new web3.eth.Contract(token.abi, token.contractAddress);
const walletStore = useWalletStore();
if (walletStore.connected) {
this.activeToken.balance = await walletStore.getTokenBalance(token);
this.activeToken.allowance = await this.allowance();
this.activeToken.balance = await walletStore.getTokenBalance(token);
this.activeToken.allowance = await this.allowance();
}
},
async allowance() {
console.log("allowance");
},
async allowance() {
const walletStore = useWalletStore();
console.log("walletStore.address", walletStore.address);
const allowance = await this.contract.methods.allowance(walletStore.address, MemeBurnerJson.contractAddress).call();
console.log("allowance", allowance);
return allowance;
},
async approveToken(amount) {
const walletStore = useWalletStore();
const memeBurnerStore = useMemeburnerStore();
var allowance = await this.contract.methods
.allowance(walletStore.address, memeBurnerStore.config.contractAddress)
.call();
var decimals = await this.contract.methods.decimals().call();
console.log("decimals", decimals);
console.log("Math.pow(10, decimals)", Math.pow(10, decimals));
allowance = BigInt(allowance / Math.pow(10, decimals));
return allowance;
this.loading = true;
var approve = await this.contract.methods
.approve(this.memeBurner.config.contractAddress, amount)
.send({ from: walletStore.address });
console.log("approve", approve);
this.loading = false;
return approve;
},
async approveToken(amount) {
try {
this.loading = true;
async sacrificeToken(amount) {
try {
this.loading = true;
console.log("this.activeToken.", this.activeToken.contractAddress);
const walletStore = useWalletStore();
const memeBurnerStore = useMemeburnerStore();
var approve = await this.contract.methods
.approve(memeBurnerStore.config.contractAddress, amount)
.send({ from: walletStore.address});
//todo parameter value übergeben in eth web3.utils.toHex(web3.utils.toWei(amount, 'ether'))
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);
// .send({ from: walletStore.address, value: 0.5 });
this.activeToken.allowance = await this.allowance();
return approve;
} catch (error) {
console.error(error);
} finally {
this.loading = false;
}
},
getTokenContract(token) {
console.log("token", token);
} 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);
const contract = new web3.eth.Contract(activeToken.abi, contractAddress);
return contract;
+30 -61
View File
@@ -1,5 +1,4 @@
import { defineStore } from "pinia";
import { markRaw } from "vue";
import { useTokenStore } from "./tokens";
import Web3 from "web3";
export const useWalletStore = defineStore("wallet", {
@@ -7,56 +6,33 @@ export const useWalletStore = defineStore("wallet", {
count: 0,
alchemy: null,
connected: false,
address: null,
web3: null,
provider: null
address: null,
}),
getters: {
double: (state) => state.count * 2,
},
actions: {
async init() {
console.log("wallet init");
await this.isConnected();
const goerliKey = import.meta.env.VITE_GOERLI_KEY;
if (this.connected) {
const web3 = new Web3(window.ethereum);
this.web3 = markRaw(web3);
console.log("hierabc");
window.ethereum.on("accountsChanged", async (data) => {
console.log("accountsChanged", data);
console.log("data", data);
if (data.length > 0) {
this.address = data[0]
this.connected = true;
} else {
this.address = null;
this.connected = false;
}
});
// provider = new ethers.BrowserProvider(window.ethereum);
} else {
const url = `https://eth-goerli.g.alchemy.com/v2/${goerliKey}`;
this.web3 = new Web3(url);
// provider = new ethers.AlchemyProvider("goerli", goerliKey);
}
//Websocket
this.web3socket = new Web3(
new Web3.providers.WebsocketProvider(`wss://eth-goerli.g.alchemy.com/v2/${goerliKey}`)
);
actions: {
increment() {
this.count++;
},
connectWallet() {
const tokenStore = useTokenStore();
console.log("window.ethereum", window.ethereum);
// if (window.ethereum) {
window.ethereum
.request({ method: "eth_requestAccounts" })
.then((data) => {
console.log("data", data);
this.address = data[0];
this.connected = true;
this.init();
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) => {
if (error.code === 4001) {
@@ -77,30 +53,24 @@ export const useWalletStore = defineStore("wallet", {
async isConnected() {
try {
this.loading = true;
if (!window.ethereum) {
console.warn("Metamask not installed"),
this.connected = false;
return;
}
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
// );
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 {
console.log("Metamask is not connected");
this.connected = false;
@@ -109,7 +79,6 @@ export const useWalletStore = defineStore("wallet", {
console.log("error", error);
} finally {
this.loading = false;
return this.connected
}
}
+27 -189
View File
@@ -1,5 +1,4 @@
<script setup>
import { ref, computed, inject, onMounted, onBeforeUnmount } from "vue";
import { storeToRefs } from "pinia";
import SacrificeToken from "@/components/SacrificeToken.vue";
import BloodChart from "@/components/BloodChart.vue";
@@ -7,74 +6,16 @@ import TokenClaim from "@/components/TokenClaim.vue";
// import Web3 from "web3";
// import { useWalletStore } from "@/stores/wallet";
import { useTokenStore } from "@/stores/tokens";
import { useRoundsStore } from "@/stores/rounds";
const tokenStore = useTokenStore();
const roundsStore = useRoundsStore();
const { token } = storeToRefs(tokenStore);
const { getCurrentRoundData } = storeToRefs(roundsStore);
const { currentRound, activeRound, rounds } = storeToRefs(roundsStore);
const days = ref(null);
const hours = ref(null);
const minutes = ref(null);
const seconds = ref(null);
const timer = ref(null);
const modules = [Navigation];
const isMobile = inject("isMobile");
async function prevSlide() {
if (activeRound.value > 1) {
activeRound.value--;
await roundsStore.fillRound();
}
}
async function nextSlide() {
if (activeRound.value < currentRound.value) {
activeRound.value++;
await roundsStore.fillRound();
}
}
onMounted(() => {
console.log("getCurrentRoundData", getCurrentRoundData);
timer.value = setInterval(function () {
timeBetweenDates();
}, 1000);
});
onBeforeUnmount(() => {
clearInterval(timer.value);
});
function timeBetweenDates() {
const dateEntered = new Date(
getCurrentRoundData.value?.expirationTimestamp * 1000
);
if (dateEntered) {
var now = new Date();
var difference = dateEntered.getTime() - now.getTime();
if (difference <= 0) {
clearInterval(timer.value);
} else {
var _seconds = Math.floor(difference / 1000);
var _minutes = Math.floor(_seconds / 60);
var _hours = Math.floor(_minutes / 60);
var _days = Math.floor(_hours / 24);
days.value = _days;
hours.value = _hours % 24;
minutes.value = _minutes % 60;
seconds.value = _seconds % 60;
days.value = ("0" + days.value).slice(-2) + "d";
hours.value = ("0" + hours.value).slice(-2) + "h";
minutes.value = ("0" + minutes.value).slice(-2) + "m";
}
}
}
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"
// );
</script>
<template>
@@ -90,37 +31,28 @@ function timeBetweenDates() {
<sacrifice-token :data="token"></sacrifice-token>
</section>
<swiper :slides-per-view="1" :navigation="true" :space-between="50">
<swiper-slide>Slide 1</swiper-slide>
<swiper-slide>Slide 2</swiper-slide>
<swiper-slide>Slide 3</swiper-slide>
<swiper-slide>Slide 4</swiper-slide>
<swiper-slide>Slide 5</swiper-slide>
</swiper>
<div class="container section-header-container">
<h3>Bloodline Cycle</h3>
<h2>Bloodline Cycle</h2>
Become the most powerful clan each cycle and claim extra rewards.<br />Claim and trade your $BLOOD at
each cycle's end.
</div>
<section id="cycle-section" class="container">
<div class="slider-wrapper">
<font-awesome-icon
:class="{ 'slider-prev': true, disabled: roundsStore.activeRound <= 1 }"
@click="prevSlide"
:icon="['fas', 'caret-left']"
/>
<div class="slider-text">Cycle {{ roundsStore.activeRound }}</div>
<font-awesome-icon
:class="{ 'slider-next': true, disabled: currentRound === roundsStore.activeRound }"
@click="nextSlide"
:icon="['fas', 'caret-right']"
/>
</div>
<div class="cycle card bloodline-wrapper">
<div class="bloodline-inner">
<token-claim></token-claim>
</div>
<div class="bloodline-clan">
<h3>Bloodline Clan</h3>
<token-claim></token-claim>
<div>
<h2>Bloodline Clan</h2>
<p>
Win extra rewards for you and your clan. Increase the strength of your bloodline by
sacrificing more memes.
</p>
<table class="bonus-table" v-if="!isMobile">
<table class="bonus-table">
<tbody>
<tr>
<th scope="row">1st</th>
@@ -136,36 +68,8 @@ function timeBetweenDates() {
</tr>
</tbody>
</table>
<div class="bloodline-container" v-else>
<div class="bloodline-border purple">
Get up to +100% Clan Bonus <br />on your sacrifice.
</div>
</div>
<div class="blood-chart">
<blood-chart :data="rounds[activeRound]"></blood-chart>
</div>
<div class="cycle-end-wrapper">
<div class="cycle-end-inner">
<h2>Cycle End</h2>
<div class="cycle-end-text">A cycle ends when only one of these goals is reached.</div>
<div class="bloodline-border">
<table>
<tr>
<td>Sacrifice:</td>
<td class="divider"></td>
<td>{{ getCurrentRoundData?.goalInBLD?.toFixed(2) }} $BDL</td>
</tr>
<tr>
<td>Time left:</td>
<td class="divider"></td>
<td v-if="currentRound === roundsStore.activeRound">
{{ days }} {{ hours }} {{ minutes }}
</td>
<td v-else>0</td>
</tr>
</table>
</div>
</div>
<blood-chart></blood-chart>
</div>
</div>
</div>
@@ -179,8 +83,7 @@ function timeBetweenDates() {
<div class="card">
<h2>Tokenomics</h2>
<p>100% clan owned. No team %, no pre-mine</p>
<img v-if="isMobile" src="/assets/img/tokenomics_footer.png" alt="tokenomics" />
<img v-else src="/assets/img/tokenomics.png" alt="tokenomics" />
<img src="@/assets/img/tokenomics.png" alt="tokenomics" />
</div>
</section>
</div>
@@ -189,25 +92,17 @@ function timeBetweenDates() {
<style lang="sass">
.blood-chart
margin-top: 56px
display: flex
justify-content: center
margin-bottom: 80px
.bloodline-wrapper
padding: 48px 64px
.header-text
text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25)
font-size: 32px
font-size: 64px
line-height: 80px
font-weight: 600
text-align: center
margin-top: 64px
margin-bottom: 100px
@media (min-width: 992px)
font-size: 64px
margin-top: 0px
line-height: unset
text-shadow: unset
line-height: 80px
font-weight: 600
.chart-wrapper-coin
display: flex
justify-content: space-evenly
@@ -231,16 +126,12 @@ function timeBetweenDates() {
th
padding-right: 16px
#tokenomics
background-color: var(--darkgrey)
padding-bottom: 32px
>div
text-align: center
img
display: block
margin-left: auto
margin-right: auto
pointer-events: none
user-select: none
.chart-wrapper
width: 600px
height: 600px
@@ -258,57 +149,4 @@ function timeBetweenDates() {
margin-top: auto
text-align: center
padding-top: 10px
.slider-wrapper
display: flex
justify-content: center
font-size: 24px
user-select: none
.slider-text
margin: 0 24px
margin-top: auto
margin-bottom: auto
.slider-prev, .slider-next
color: var(--purple)
font-size: 40px
cursor: pointer
&:hover,&:active, &:focus
filter: brightness(0.80)
&.disabled
opacity: .35
pointer-events: none
.section-header-container
text-align: center
font-size: 24px
margin-top: 64px
margin-bottom: 64px
@media (min-width: 992px)
width: 655px
.bloodline-wrapper
.bloodline-inner
padding: 4px
@media (min-width: 992px)
padding: 20px
.bloodline-clan
text-align: center
.cycle-end-wrapper
.cycle-end-inner
text-align: center
font-size: 24px
padding: 0 24px 48px 24px
.cycle-end-text
margin-bottom: 32px
table
width: 100%
tr
td
text-align: left
&.divider
width: 10px
h2
font-size: 40px
</style>
+1 -21
View File
@@ -1,7 +1,6 @@
<template>
<div>
<button @click="mintToken">mint</button>
<button @click="mintToken2">mint2</button>
<button @click="sacrificeMeme">sacrifice Meme</button>
<button @click="approveMeme1">approve Meme1</button>
<button @click="tokenStore.approveToken(MemeBurnerJson, 10)">wallet approve</button>
@@ -31,7 +30,6 @@ console.log("RewardLockerJson", RewardLockerJson);
// );
// console.log("balanceOf", balanceOf);
const web3 = ref(null);
const contractMeme2 = ref(null);
const contractMeme1 = ref(null);
const contractBurner = ref(null);
@@ -44,7 +42,6 @@ onMounted(async () => {
web3.value.eth.Contract.defaultAccount = accounts[0];
contractMeme1.value = new web3.value.eth.Contract(Meme1Json.abi, Meme1Json.contractAddress);
contractMeme2.value = new web3.value.eth.Contract(Meme2Json.abi, Meme2Json.contractAddress);
contractBurner.value = new web3.value.eth.Contract(MemeBurnerJson.abi, MemeBurnerJson.contractAddress);
});
@@ -64,24 +61,7 @@ async function approveMeme1() {
// change this value to make yourself rich quick
async function mintToken() {
try {
var mint = await contractMeme1.value.methods
.mint("100000000000000000000000")
.send({ from: web3.value.eth.Contract.defaultAccount });
console.log("mint", mint);
} catch (error) {
console.log(error);
}
// var balanceOf = await contract.methods.balanceOf("0x66422602B2f4885c57EE794174f98d9E4DDBBBC6").call();
// console.log("balanceOf", balanceOf);
// var totalSupply = await contract.methods.totalSupply().call();
// console.log("totalSupply", totalSupply);
}
async function mintToken2() {
try {
var mint = await contractMeme2.value.methods
.mint("100000000000000000000")
.send({ from: web3.value.eth.Contract.defaultAccount });
var mint = await contractMeme1.value.methods.mint("1000000000000000").send({ from: web3.value.eth.Contract.defaultAccount });
console.log("mint", mint);
} catch (error) {
console.log(error);
+7 -25
View File
@@ -1,32 +1,14 @@
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import GlobalsPolyfills from "@esbuild-plugins/node-globals-polyfill";
import NodeModulesPolyfills from "@esbuild-plugins/node-modules-polyfill";
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
base: "./",
plugins: [vue()],
optimizeDeps: {
esbuildOptions: {
plugins: [
NodeModulesPolyfills(),
GlobalsPolyfills({
process: true,
buffer: true,
}),
],
define: {
global: "globalThis",
},
},
},
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
});
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})