update profilepage
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 798 B |
+37
-15
@@ -19,6 +19,7 @@ import {
|
|||||||
watchNetwork,
|
watchNetwork,
|
||||||
watchContractEvent,
|
watchContractEvent,
|
||||||
watchWalletClient,
|
watchWalletClient,
|
||||||
|
watchPublicClient,
|
||||||
getAccount,
|
getAccount,
|
||||||
getNetwork,
|
getNetwork,
|
||||||
getPublicClient,
|
getPublicClient,
|
||||||
@@ -85,19 +86,42 @@ onMounted(async () => {
|
|||||||
window.addEventListener("resize", handleWindowSizeChange);
|
window.addEventListener("resize", handleWindowSizeChange);
|
||||||
handleWindowSizeChange();
|
handleWindowSizeChange();
|
||||||
|
|
||||||
// initContracts
|
const showPanel = ref(false);
|
||||||
|
const eventWatch = ref(null);
|
||||||
|
const netWorkEvent = ref(null);
|
||||||
|
const memeSacrificedEvent = ref(null);
|
||||||
|
const clientClientEvent = ref(null);
|
||||||
|
console.log("beforeEach");
|
||||||
|
const tokenStore = useTokenStore();
|
||||||
|
const memeBurnerStore = useMemeburnerStore();
|
||||||
|
const rewardLockerStore = useRewardLockerStore();
|
||||||
|
const roundsStore = useRoundsStore();
|
||||||
|
const walletStore = useWalletStoreV2();
|
||||||
|
console.log("walletStore.initialized", walletStore.initialized);
|
||||||
|
walletStore.initialized = true;
|
||||||
|
console.log("hier");
|
||||||
// await walletStore.init();
|
// await walletStore.init();
|
||||||
// await tokenStore.initV2();
|
// await tokenStore.initV2();
|
||||||
// await memeBurnerStore.init();
|
// await memeBurnerStore.init();
|
||||||
// await rewardLockerStore.init();
|
// await rewardLockerStore.init();
|
||||||
// await memeBurnerStore.init();
|
// await memeBurnerStore.init();
|
||||||
// await multiCallStore.init();
|
console.log("init router");
|
||||||
//Memeburner Contract
|
console.log("roundsStore.currentRound", roundsStore.currentRound);
|
||||||
|
if (!roundsStore.currentRound) {
|
||||||
|
roundsStore.currentRound = parseInt(await memeBurnerStore.getCurrentRound());
|
||||||
|
console.log("roundsStore.currentRound", roundsStore.currentRound);
|
||||||
|
roundsStore.activeRound = roundsStore.currentRound;
|
||||||
|
}
|
||||||
|
|
||||||
//init
|
const { chain, chains } = getNetwork();
|
||||||
// roundsStore.currentRound = parseInt(await memeBurnerStore.getCurrentRound());
|
console.log("chain", chain?.id);
|
||||||
// console.log("roundsStore.currentRound", roundsStore.currentRound);
|
console.log("chains", chains);
|
||||||
// roundsStore.activeRound = roundsStore.currentRound;
|
|
||||||
|
await roundsStore.fillRound(roundsStore.activeRound);
|
||||||
|
// await walletStore.loadWalletData();
|
||||||
|
|
||||||
|
// initContracts
|
||||||
|
//Memeburner Contract
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -110,11 +134,8 @@ onMounted(async () => {
|
|||||||
<RouterView />
|
<RouterView />
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<div class="footer-inner">
|
<!-- <div class="footer-inner">
|
||||||
<div class="footer-headline">Follow Bloodline</div>
|
<div class="footer-headline">Follow Bloodline</div>
|
||||||
<!-- $BLOOD is 100%<br />
|
|
||||||
community owned.<br />
|
|
||||||
No team %, no pre-mine. -->
|
|
||||||
<div class="footer-social-links">
|
<div class="footer-social-links">
|
||||||
<div class="social-bloodline-badge">
|
<div class="social-bloodline-badge">
|
||||||
<div class="social-bloodline-badge-icon">
|
<div class="social-bloodline-badge-icon">
|
||||||
@@ -132,7 +153,7 @@ onMounted(async () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="mobile-navigation-bar" v-if="isMobile">
|
<div class="mobile-navigation-bar" v-if="isMobile">
|
||||||
<div @click="changeRoute('home')" :class="{ active: route.name === 'home' }">
|
<div @click="changeRoute('home')" :class="{ active: route.name === 'home' }">
|
||||||
@@ -151,6 +172,7 @@ onMounted(async () => {
|
|||||||
.footer
|
.footer
|
||||||
height: auto
|
height: auto
|
||||||
background-color: var(--midnight-black)
|
background-color: var(--midnight-black)
|
||||||
|
min-height: 72px
|
||||||
@media (min-width: 992px)
|
@media (min-width: 992px)
|
||||||
height: 450px
|
height: 450px
|
||||||
min-height: 450px
|
min-height: 450px
|
||||||
@@ -186,14 +208,14 @@ onMounted(async () => {
|
|||||||
height: 72px
|
height: 72px
|
||||||
width: 100%
|
width: 100%
|
||||||
padding: 16px 48px
|
padding: 16px 48px
|
||||||
border-radius: 24px 24px 0px 0px
|
border-radius: 16px 16px 0px 0px
|
||||||
background: var(--grey, #858585)
|
box-shadow: 0px -4px 6px 0px rgba(0, 0, 0, 0.25)
|
||||||
|
background: var(--midnight-black, #0F0F0F)
|
||||||
bottom: -1px
|
bottom: -1px
|
||||||
position: fixed
|
position: fixed
|
||||||
display: flex
|
display: flex
|
||||||
justify-content: space-around
|
justify-content: space-around
|
||||||
align-items: center
|
align-items: center
|
||||||
color: black
|
|
||||||
div
|
div
|
||||||
font-size: 40px
|
font-size: 40px
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
|
|||||||
@@ -0,0 +1,992 @@
|
|||||||
|
{
|
||||||
|
"contractName": "OurUniV3Pool",
|
||||||
|
"contractAddress": "0xCc08EECAD5cE5c47bD7B51385b701d00c8Bdfa90",
|
||||||
|
"abi": [
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "constructor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "owner",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickLower",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickUpper",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "amount0",
|
||||||
|
"type": "uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "amount1",
|
||||||
|
"type": "uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "Burn",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "owner",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "recipient",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickLower",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickUpper",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount0",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount1",
|
||||||
|
"type": "uint128"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "Collect",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "sender",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "recipient",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount0",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount1",
|
||||||
|
"type": "uint128"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "CollectProtocol",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "sender",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "recipient",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "amount0",
|
||||||
|
"type": "uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "amount1",
|
||||||
|
"type": "uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "paid0",
|
||||||
|
"type": "uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "paid1",
|
||||||
|
"type": "uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "Flash",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint16",
|
||||||
|
"name": "observationCardinalityNextOld",
|
||||||
|
"type": "uint16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint16",
|
||||||
|
"name": "observationCardinalityNextNew",
|
||||||
|
"type": "uint16"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "IncreaseObservationCardinalityNext",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint160",
|
||||||
|
"name": "sqrtPriceX96",
|
||||||
|
"type": "uint160"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tick",
|
||||||
|
"type": "int24"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "Initialize",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "sender",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "owner",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickLower",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickUpper",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "amount0",
|
||||||
|
"type": "uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "amount1",
|
||||||
|
"type": "uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "Mint",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint8",
|
||||||
|
"name": "feeProtocol0Old",
|
||||||
|
"type": "uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint8",
|
||||||
|
"name": "feeProtocol1Old",
|
||||||
|
"type": "uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint8",
|
||||||
|
"name": "feeProtocol0New",
|
||||||
|
"type": "uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint8",
|
||||||
|
"name": "feeProtocol1New",
|
||||||
|
"type": "uint8"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "SetFeeProtocol",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "sender",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": true,
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "recipient",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "int256",
|
||||||
|
"name": "amount0",
|
||||||
|
"type": "int256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "int256",
|
||||||
|
"name": "amount1",
|
||||||
|
"type": "int256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint160",
|
||||||
|
"name": "sqrtPriceX96",
|
||||||
|
"type": "uint160"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "liquidity",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tick",
|
||||||
|
"type": "int24"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "Swap",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickLower",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickUpper",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount",
|
||||||
|
"type": "uint128"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "burn",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "amount0",
|
||||||
|
"type": "uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "amount1",
|
||||||
|
"type": "uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "recipient",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickLower",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickUpper",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount0Requested",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount1Requested",
|
||||||
|
"type": "uint128"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "collect",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount0",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount1",
|
||||||
|
"type": "uint128"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "recipient",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount0Requested",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount1Requested",
|
||||||
|
"type": "uint128"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "collectProtocol",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount0",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount1",
|
||||||
|
"type": "uint128"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "factory",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "",
|
||||||
|
"type": "address"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "fee",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint24",
|
||||||
|
"name": "",
|
||||||
|
"type": "uint24"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "feeGrowthGlobal0X128",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "",
|
||||||
|
"type": "uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "feeGrowthGlobal1X128",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "",
|
||||||
|
"type": "uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "recipient",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "amount0",
|
||||||
|
"type": "uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "amount1",
|
||||||
|
"type": "uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "bytes",
|
||||||
|
"name": "data",
|
||||||
|
"type": "bytes"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "flash",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint16",
|
||||||
|
"name": "observationCardinalityNext",
|
||||||
|
"type": "uint16"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "increaseObservationCardinalityNext",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint160",
|
||||||
|
"name": "sqrtPriceX96",
|
||||||
|
"type": "uint160"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "initialize",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "liquidity",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "",
|
||||||
|
"type": "uint128"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "maxLiquidityPerTick",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "",
|
||||||
|
"type": "uint128"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "recipient",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickLower",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickUpper",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "amount",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "bytes",
|
||||||
|
"name": "data",
|
||||||
|
"type": "bytes"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "mint",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "amount0",
|
||||||
|
"type": "uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "amount1",
|
||||||
|
"type": "uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "",
|
||||||
|
"type": "uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "observations",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint32",
|
||||||
|
"name": "blockTimestamp",
|
||||||
|
"type": "uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int56",
|
||||||
|
"name": "tickCumulative",
|
||||||
|
"type": "int56"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint160",
|
||||||
|
"name": "secondsPerLiquidityCumulativeX128",
|
||||||
|
"type": "uint160"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "bool",
|
||||||
|
"name": "initialized",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint32[]",
|
||||||
|
"name": "secondsAgos",
|
||||||
|
"type": "uint32[]"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "observe",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int56[]",
|
||||||
|
"name": "tickCumulatives",
|
||||||
|
"type": "int56[]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint160[]",
|
||||||
|
"name": "secondsPerLiquidityCumulativeX128s",
|
||||||
|
"type": "uint160[]"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "bytes32",
|
||||||
|
"name": "",
|
||||||
|
"type": "bytes32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "positions",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "liquidity",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "feeGrowthInside0LastX128",
|
||||||
|
"type": "uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "feeGrowthInside1LastX128",
|
||||||
|
"type": "uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "tokensOwed0",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "tokensOwed1",
|
||||||
|
"type": "uint128"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "protocolFees",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "token0",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "token1",
|
||||||
|
"type": "uint128"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint8",
|
||||||
|
"name": "feeProtocol0",
|
||||||
|
"type": "uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint8",
|
||||||
|
"name": "feeProtocol1",
|
||||||
|
"type": "uint8"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "setFeeProtocol",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "slot0",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint160",
|
||||||
|
"name": "sqrtPriceX96",
|
||||||
|
"type": "uint160"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tick",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint16",
|
||||||
|
"name": "observationIndex",
|
||||||
|
"type": "uint16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint16",
|
||||||
|
"name": "observationCardinality",
|
||||||
|
"type": "uint16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint16",
|
||||||
|
"name": "observationCardinalityNext",
|
||||||
|
"type": "uint16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint8",
|
||||||
|
"name": "feeProtocol",
|
||||||
|
"type": "uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "bool",
|
||||||
|
"name": "unlocked",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickLower",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickUpper",
|
||||||
|
"type": "int24"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "snapshotCumulativesInside",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int56",
|
||||||
|
"name": "tickCumulativeInside",
|
||||||
|
"type": "int56"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint160",
|
||||||
|
"name": "secondsPerLiquidityInsideX128",
|
||||||
|
"type": "uint160"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint32",
|
||||||
|
"name": "secondsInside",
|
||||||
|
"type": "uint32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "recipient",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "bool",
|
||||||
|
"name": "zeroForOne",
|
||||||
|
"type": "bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int256",
|
||||||
|
"name": "amountSpecified",
|
||||||
|
"type": "int256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint160",
|
||||||
|
"name": "sqrtPriceLimitX96",
|
||||||
|
"type": "uint160"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "bytes",
|
||||||
|
"name": "data",
|
||||||
|
"type": "bytes"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "swap",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int256",
|
||||||
|
"name": "amount0",
|
||||||
|
"type": "int256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int256",
|
||||||
|
"name": "amount1",
|
||||||
|
"type": "int256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int16",
|
||||||
|
"name": "",
|
||||||
|
"type": "int16"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "tickBitmap",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "",
|
||||||
|
"type": "uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "tickSpacing",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "",
|
||||||
|
"type": "int24"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "",
|
||||||
|
"type": "int24"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "ticks",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint128",
|
||||||
|
"name": "liquidityGross",
|
||||||
|
"type": "uint128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int128",
|
||||||
|
"name": "liquidityNet",
|
||||||
|
"type": "int128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "feeGrowthOutside0X128",
|
||||||
|
"type": "uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "feeGrowthOutside1X128",
|
||||||
|
"type": "uint256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int56",
|
||||||
|
"name": "tickCumulativeOutside",
|
||||||
|
"type": "int56"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint160",
|
||||||
|
"name": "secondsPerLiquidityOutsideX128",
|
||||||
|
"type": "uint160"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "uint32",
|
||||||
|
"name": "secondsOutside",
|
||||||
|
"type": "uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "bool",
|
||||||
|
"name": "initialized",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "token0",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "",
|
||||||
|
"type": "address"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "token1",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "address",
|
||||||
|
"name": "",
|
||||||
|
"type": "address"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
.bloodline-devider
|
.bloodline-devider
|
||||||
font-size: 42px
|
font-size: 42px
|
||||||
text-align: center
|
text-align: center
|
||||||
margin: 16px 0
|
|
||||||
@media (min-width: 992px)
|
@media (min-width: 992px)
|
||||||
margin: 24px 0
|
margin: 24px 0
|
||||||
|
|
||||||
@@ -33,28 +32,6 @@
|
|||||||
&.grey
|
&.grey
|
||||||
background-color: var(--grey)
|
background-color: var(--grey)
|
||||||
|
|
||||||
.card
|
|
||||||
display: block
|
|
||||||
overflow: hidden
|
|
||||||
overflow-wrap: break-word
|
|
||||||
position: relative
|
|
||||||
padding: 0
|
|
||||||
text-decoration: none
|
|
||||||
transition-duration: .28s
|
|
||||||
transition-property: box-shadow,opacity,background
|
|
||||||
transition-timing-function: cubic-bezier(.4,0,.2,1)
|
|
||||||
z-index: 0
|
|
||||||
border-color: rgba(var(--v-border-color),var(--v-border-opacity))
|
|
||||||
border-style: solid
|
|
||||||
border-width: 0
|
|
||||||
border-radius: 16px
|
|
||||||
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
|
.bloodline-token
|
||||||
height: 50px
|
height: 50px
|
||||||
width: 50px
|
width: 50px
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
|
|
||||||
.btn
|
.btn
|
||||||
&.btn-immortal
|
|
||||||
|
|
||||||
background-color: $purple
|
|
||||||
color: $button-color
|
|
||||||
font-size: 24px
|
|
||||||
padding: 16px 24px
|
padding: 16px 24px
|
||||||
gap: 8px
|
gap: 8px
|
||||||
border-radius: 14px
|
border-radius: 14px
|
||||||
&:hover,&:focus,&:active
|
|
||||||
background-color: darken($purple, 10%),
|
|
||||||
cursor: pointer
|
|
||||||
&.btn--disabled
|
&.btn--disabled
|
||||||
background-color: #151515
|
background-color: #151515
|
||||||
color: #808080
|
color: #808080
|
||||||
cursor: not-allowed
|
cursor: not-allowed
|
||||||
&.black
|
&.black
|
||||||
background-color: var(--midnight-black)
|
background-color: var(--midnight-black)
|
||||||
|
&.btn-immortal
|
||||||
|
background-color: $purple
|
||||||
|
color: $button-color
|
||||||
|
font-size: 24px
|
||||||
|
&:hover,&:focus,&:active
|
||||||
|
background-color: darken($purple, 10%),
|
||||||
|
cursor: pointer
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ body
|
|||||||
font-family: 'Inter', sans-serif
|
font-family: 'Inter', sans-serif
|
||||||
|
|
||||||
.main
|
.main
|
||||||
padding-top: 120px
|
padding-top: 106px
|
||||||
@media (min-width: 992px)
|
@media (min-width: 992px)
|
||||||
padding-top: 208px
|
padding-top: 208px
|
||||||
html
|
html
|
||||||
@@ -39,8 +39,8 @@ body
|
|||||||
.container
|
.container
|
||||||
margin-right: auto
|
margin-right: auto
|
||||||
margin-left: auto
|
margin-left: auto
|
||||||
padding-right: 15px
|
padding-right: 16px
|
||||||
padding-left: 15px
|
padding-left: 16px
|
||||||
@media (min-width: 992px)
|
@media (min-width: 992px)
|
||||||
max-width: 800px
|
max-width: 800px
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ $purple: #4B0082
|
|||||||
$midnight-black: #0F0F0F
|
$midnight-black: #0F0F0F
|
||||||
$darkgrey: #202020
|
$darkgrey: #202020
|
||||||
$grey2: #2D2D2D
|
$grey2: #2D2D2D
|
||||||
|
$dark-grey: #2D2D2D
|
||||||
|
|
||||||
$button-color: $white
|
$button-color: $white
|
||||||
$button-background-color: $black
|
$button-background-color: $black
|
||||||
@@ -32,14 +33,55 @@ $button-background-color: $black
|
|||||||
--white: #{#F9F9FA}
|
--white: #{#F9F9FA}
|
||||||
--grey: #{#858585}
|
--grey: #{#858585}
|
||||||
--grey2: #{$grey2}
|
--grey2: #{$grey2}
|
||||||
|
--dark-grey: #{$dark-grey}
|
||||||
--purple: #{$purple}
|
--purple: #{$purple}
|
||||||
--blood-color: #{$red}
|
--blood-color: #{$red}
|
||||||
--midnight-black: #{$midnight-black}
|
--midnight-black: #{$midnight-black}
|
||||||
--black: #{$midnight-black}
|
--black: #{$midnight-black}
|
||||||
--darkgrey: #{$darkgrey}
|
--darkgrey: #{$darkgrey}
|
||||||
|
|
||||||
|
//fonts
|
||||||
|
.low-mid-text
|
||||||
|
font-family: Inter
|
||||||
|
font-size: 16px
|
||||||
|
font-style: normal
|
||||||
|
font-weight: 400
|
||||||
|
line-height: normal
|
||||||
|
.mid-mid-text
|
||||||
|
font-family: Inter
|
||||||
|
font-size: 18px
|
||||||
|
font-style: normal
|
||||||
|
font-weight: 400
|
||||||
|
line-height: normal
|
||||||
|
.mid-text
|
||||||
|
font-family: Inter
|
||||||
|
font-size: 24px
|
||||||
|
font-style: normal
|
||||||
|
font-weight: 400
|
||||||
|
line-height: normal
|
||||||
|
.small-text
|
||||||
|
font-family: Inter
|
||||||
|
font-size: 14px
|
||||||
|
font-style: normal
|
||||||
|
font-weight: 400
|
||||||
|
line-height: normal
|
||||||
|
.number-mobile
|
||||||
|
font-family: Inter
|
||||||
|
font-size: 24px
|
||||||
|
font-style: normal
|
||||||
|
font-weight: 400
|
||||||
|
line-height: normal
|
||||||
|
letter-spacing: 4.32px
|
||||||
|
|
||||||
// :root
|
// :root
|
||||||
// --font-size-text: 16px
|
// --font-size-text: 16px
|
||||||
// --font-size-title: 32px
|
// --font-size-title: 32px
|
||||||
// @media (min-width: 992px)
|
// @media (min-width: 992px)
|
||||||
// --font-size-text: 24px
|
// --font-size-text: 24px
|
||||||
// --font-size-title: 36px
|
// --font-size-title: 36px
|
||||||
|
|
||||||
|
.text-center
|
||||||
|
text-align: center
|
||||||
|
|
||||||
|
.transparent
|
||||||
|
background-color: transparent
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
<template>
|
||||||
|
<stake-component v-if="walletStore.memeToken?.unclaimedRewards > 0">
|
||||||
|
<template v-slot:headline> Unclaimed </template>
|
||||||
|
<template v-slot:body>
|
||||||
|
<token-name-price
|
||||||
|
:name="tokenStore.getToken(walletStore.memeToken?.contractAddress)?.name"
|
||||||
|
:price="walletStore.memeToken?.unclaimedRewards"
|
||||||
|
></token-name-price>
|
||||||
|
<token-logo img="/assets/img/token/bloodline.png" :alt="'todo'"></token-logo>
|
||||||
|
</template>
|
||||||
|
<template v-slot:actions>
|
||||||
|
<Transition name="smooth">
|
||||||
|
<div class="connected-stake-buttons" v-show="!stakeMenu">
|
||||||
|
<div class="btn btn-immortal" @click="rewardLockerStore.claimAll">Claim</div>
|
||||||
|
<div class="btn btn-immortal" @click="openStake">Stake</div>
|
||||||
|
</div>
|
||||||
|
</Transition>
|
||||||
|
<Transition name="smooth">
|
||||||
|
<stake-menu v-model="tokenNumber" @close="stakeMenu = false" :stake="stake" v-if="stakeMenu">
|
||||||
|
<template v-slot:body>
|
||||||
|
<div class="btn btn-immortal stake-button" @click="stakeBloodline">Stake & Claim Rest</div>
|
||||||
|
<div class="btn transparent small-text cancel-button text-center" @click="stakeMenu = false">
|
||||||
|
Cancel
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</stake-menu>
|
||||||
|
</Transition>
|
||||||
|
<div class="connected-stake-first-round small-text text-center">You can claim, once the cycle is over.</div>
|
||||||
|
</template>
|
||||||
|
</stake-component>
|
||||||
|
<stake-component dense v-else>
|
||||||
|
<div class="text-center">All Claimed</div>
|
||||||
|
</stake-component>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from "vue";
|
||||||
|
import StakeComponent from "@/components/StakeComponent.vue";
|
||||||
|
import StakeMenu from "@/components/StakeMenu.vue";
|
||||||
|
import TokenNamePrice from "@/components/TokenNamePrice.vue";
|
||||||
|
import TokenLogo from "@/components/TokenLogo.vue";
|
||||||
|
|
||||||
|
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||||
|
import { useTokenStore } from "@/stores/tokens";
|
||||||
|
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||||
|
|
||||||
|
const rewardLockerStore = useRewardLockerStore();
|
||||||
|
const walletStore = useWalletStoreV2();
|
||||||
|
const tokenStore = useTokenStore();
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
stakeonly: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const stakeMenu = ref(false);
|
||||||
|
const stake = ref(null);
|
||||||
|
const tokenNumber = ref(null);
|
||||||
|
|
||||||
|
function openStake() {
|
||||||
|
stake.value = true;
|
||||||
|
stakeMenu.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function openUnstake() {
|
||||||
|
stake.value = false;
|
||||||
|
stakeMenu.value = true;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="sass">
|
||||||
|
// .smooth-enter-active, .smooth-leave-active
|
||||||
|
// transition: opacity 0.1s
|
||||||
|
|
||||||
|
// .smooth-enter, .smooth-leave-to
|
||||||
|
// height: 0
|
||||||
|
</style>
|
||||||
@@ -38,14 +38,37 @@
|
|||||||
:price="token.balanceOf"
|
:price="token.balanceOf"
|
||||||
></token-name-price>
|
></token-name-price>
|
||||||
<div class="connected-token-button">
|
<div class="connected-token-button">
|
||||||
<div class="bloodline-badge grey">
|
<div class="bloodline-badge grey" @click="badgeClick(token)">
|
||||||
<div class="bloodline-badge-text">Sacrifice</div>
|
<div
|
||||||
|
class="bloodline-badge-text"
|
||||||
|
v-if="tokenStore.memeToken.contractAddress === token.contractAddress"
|
||||||
|
>
|
||||||
|
Buy
|
||||||
|
</div>
|
||||||
|
<div v-else class="bloodline-badge-text">Sacrifice</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<token-logo :img="tokenStore.getToken(token.contractAddress).logo" :alt="'test'"></token-logo>
|
<token-logo :img="tokenStore.getToken(token.contractAddress).logo" :alt="'test'"></token-logo>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<stake-component></stake-component>
|
<!-- <stake-component>
|
||||||
|
<template v-slot:headline> Staked </template>
|
||||||
|
<template v-slot:subheadline>
|
||||||
|
Stake for a 25% bonus on your sacrifice. Upper limit is your stake.
|
||||||
|
</template>
|
||||||
|
<template v-slot:actions>
|
||||||
|
<div class="connected-stake-buttons" v-if="!stakeMenu">
|
||||||
|
<div class="btn btn-immortal" @click="openStake">Stake</div>
|
||||||
|
<div
|
||||||
|
v-if="walletStore.memeToken?.staked === 0 && !stakeonly"
|
||||||
|
class="btn btn-immortal btn--disabled"
|
||||||
|
>
|
||||||
|
Unstake
|
||||||
|
</div>
|
||||||
|
<div v-else-if="!stakeonly" class="btn btn-immortal" @click="openUnstake">Unstake</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</stake-component> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -59,9 +82,12 @@ import TokenLogo from "./TokenLogo.vue";
|
|||||||
import StakeComponent from "./StakeComponent.vue";
|
import StakeComponent from "./StakeComponent.vue";
|
||||||
import TokenInput from "./TokenInput.vue";
|
import TokenInput from "./TokenInput.vue";
|
||||||
import { getAddressShortName, getblocky } from "@/helper/helper.js";
|
import { getAddressShortName, getblocky } from "@/helper/helper.js";
|
||||||
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
|
||||||
import { disconnect } from "@wagmi/core";
|
import { disconnect } from "@wagmi/core";
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
const walletStore = useWalletStoreV2();
|
const walletStore = useWalletStoreV2();
|
||||||
const tokenStore = useTokenStore();
|
const tokenStore = useTokenStore();
|
||||||
|
|
||||||
@@ -85,6 +111,14 @@ async function disconnectWallet() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function badgeClick(token) {
|
||||||
|
var tokenData = tokenStore.getToken(token.contractAddress);
|
||||||
|
tokenStore.activeToken = tokenData;
|
||||||
|
// router.push({ name: "home", hash: `#${tokenData.name}` });
|
||||||
|
router.push({ name: "home" });
|
||||||
|
instance.parent.emit("update:modelValue", false);
|
||||||
|
}
|
||||||
|
|
||||||
async function connectWallet(connector) {
|
async function connectWallet(connector) {
|
||||||
instance.parent.emit("update:modelValue", false);
|
instance.parent.emit("update:modelValue", false);
|
||||||
await walletStore.connectWallet(toRaw(connector));
|
await walletStore.connectWallet(toRaw(connector));
|
||||||
@@ -149,23 +183,4 @@ async function connectWallet(connector) {
|
|||||||
padding: 4px 16px
|
padding: 4px 16px
|
||||||
color: black
|
color: black
|
||||||
font-size: 14px
|
font-size: 14px
|
||||||
|
|
||||||
.connected-stake
|
|
||||||
.connected-stake-headline
|
|
||||||
margin-bottom: 8px
|
|
||||||
.connected-stake-subheadline
|
|
||||||
margin-bottom: 16px
|
|
||||||
.connected-stake-body
|
|
||||||
display: flex
|
|
||||||
gap: 16px
|
|
||||||
margin-bottom: 16px
|
|
||||||
.stake-reward
|
|
||||||
margin-left: auto
|
|
||||||
.connected-stake-buttons
|
|
||||||
display: flex
|
|
||||||
text-align: center
|
|
||||||
gap: 16px
|
|
||||||
div
|
|
||||||
flex: 1 1 50%
|
|
||||||
font-size: 18px
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="sacrifice-wrapper card bloodline-wrapper">
|
<div class="sacrifice-wrapper card bloodline-wrapper">
|
||||||
{{ activeToken.allowance }}
|
<!-- {{ activeToken.allowance }} -->
|
||||||
|
|
||||||
<div class="sacrifice-inner">
|
<div class="sacrifice-inner">
|
||||||
<div class="sacrifice-headline">Select Sacrifice</div>
|
<div class="sacrifice-headline">Select Sacrifice</div>
|
||||||
<div class="sacrifice-select-tokens">
|
<div class="sacrifice-select-tokens">
|
||||||
@@ -72,6 +71,28 @@
|
|||||||
<img :src="activeToken.vamp.logo" :alt="activeToken.vamp.name" />
|
<img :src="activeToken.vamp.logo" :alt="activeToken.vamp.name" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="sacrifice-staking-bonus">
|
||||||
|
<div
|
||||||
|
class="sacrifice-staking-bonus-inner"
|
||||||
|
@click="
|
||||||
|
(e) => {
|
||||||
|
showStakingMenu = !showStakingMenu;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<div class="mid-mid-text">No Staking Bonus</div>
|
||||||
|
<div class="icon">
|
||||||
|
<font-awesome-icon icon="chevron-down" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<stake-component v-if="showStakingMenu" stakeonly class="variant1"></stake-component>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sacrificed-info">
|
||||||
|
<div class="left low-mid-text">You can claim your $BLOOD when the cycle is finished.</div>
|
||||||
|
<div class="right">
|
||||||
|
<img src="/assets/img/moon.png" alt="moon" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sacrifice-fees-info-wrapper">
|
<div class="sacrifice-fees-info-wrapper">
|
||||||
<div class="sacrifice-fees-img">
|
<div class="sacrifice-fees-img">
|
||||||
@@ -79,10 +100,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="sacrifice-fees-body">
|
<div class="sacrifice-fees-body">
|
||||||
<div class="sacrifice-fees-body-header">
|
<div class="sacrifice-fees-body-header">
|
||||||
<div class="sacrifice-fees-body-header-title">Gas Support</div>
|
<div class="sacrifice-fees-body-header-title">Gas Subsidy</div>
|
||||||
<div class="sacrifice-fees-body-header-amount">42Gwei</div>
|
<div class="sacrifice-fees-body-header-amount">≤30 Gwei</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sacrifice-fees-body-subheader">Increase amount to pay 97% less network fees.</div>
|
<div class="sacrifice-fees-body-subheader">The clan pays your transaction.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sacrifice-buttons-function-wrapper">
|
<div class="sacrifice-buttons-function-wrapper">
|
||||||
@@ -119,6 +140,7 @@ import { ref, defineProps, watch, inject, computed } from "vue";
|
|||||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||||
import { useTokenStore } from "@/stores/tokens";
|
import { useTokenStore } from "@/stores/tokens";
|
||||||
import { useMemeburnerStore } from "@/stores/memeburner";
|
import { useMemeburnerStore } from "@/stores/memeburner";
|
||||||
|
import StakeComponent from "./StakeComponent.vue";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import Helper from "@/utils/helper.js";
|
import Helper from "@/utils/helper.js";
|
||||||
const isMobile = inject("isMobile");
|
const isMobile = inject("isMobile");
|
||||||
@@ -146,37 +168,29 @@ watch(
|
|||||||
|
|
||||||
const tokenNumber = ref(0);
|
const tokenNumber = ref(0);
|
||||||
const output = ref(0);
|
const output = ref(0);
|
||||||
|
const showStakingMenu = ref(false);
|
||||||
const approvalData = ref(null);
|
const approvalData = ref(null);
|
||||||
|
|
||||||
const processChange = Helper.debounce((e) => getRewardsFor(e));
|
const processChange = Helper.debounce((e) => getRewardsFor(e.target.value));
|
||||||
|
|
||||||
async function getRewardsFor(e) {
|
async function getRewardsFor(value) {
|
||||||
if (!e.target.value || isNaN(e.target.value)) {
|
if (!value || isNaN(value)) {
|
||||||
output.value = 0;
|
output.value = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log("activeToken.value.decimals", activeToken.value.decimals);
|
|
||||||
const rewardsForResult = await memeburnerStore.getRewardFor(
|
const rewardsForResult = await memeburnerStore.getRewardFor(
|
||||||
BigInt(e.target.value * Math.pow(10, activeToken.value.decimals))
|
BigInt(value * Math.pow(10, activeToken.value.decimals))
|
||||||
);
|
);
|
||||||
// var test = await memeburnerStore.getRewardsFor(10000);
|
// var test = await memeburnerStore.getRewardsFor(10000);
|
||||||
// console.log("test", test);
|
// console.log("test", test);
|
||||||
// const rewardsForResult = await tokenStore.getRewardsFor(10000);
|
// const rewardsForResult = await tokenStore.getRewardsFor(10000);
|
||||||
console.log("rewardsForResult", rewardsForResult);
|
output.value = rewardsForResult / BigInt(Math.pow(10, tokenStore.memeToken.decimals));
|
||||||
console.log("tokenStore.memeToken.decimals", tokenStore.memeToken.decimals);
|
return output.value;
|
||||||
console.log(
|
|
||||||
"Math.pow(10, tokenStore.memeToken.decimals)",
|
|
||||||
Math.pow(10, tokenStore.memeToken.decimals)
|
|
||||||
);
|
|
||||||
output.value =
|
|
||||||
rewardsForResult / BigInt(Math.pow(10, tokenStore.memeToken.decimals));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addTokens(value) {
|
async function addTokens(value) {
|
||||||
tokenNumber.value = tokenNumber.value + value;
|
tokenNumber.value = Number(tokenNumber.value) + Number(value);
|
||||||
output.value = await memeburnerStore.getRewardsFor(
|
output.value = await getRewardsFor(parseInt(tokenNumber.value));
|
||||||
parseInt(tokenNumber.value)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -188,7 +202,7 @@ async function addTokens(value) {
|
|||||||
margin-right: auto
|
margin-right: auto
|
||||||
background-color: var(--primary)
|
background-color: var(--primary)
|
||||||
.sacrifice-inner
|
.sacrifice-inner
|
||||||
padding: 48px 24px
|
padding: 24px
|
||||||
@media (min-width: 992px)
|
@media (min-width: 992px)
|
||||||
padding: 48px 64px
|
padding: 48px 64px
|
||||||
.sacrifice-headline
|
.sacrifice-headline
|
||||||
@@ -232,7 +246,6 @@ async function addTokens(value) {
|
|||||||
.sacrifice-buttons-function-wrapper
|
.sacrifice-buttons-function-wrapper
|
||||||
text-align: center
|
text-align: center
|
||||||
justify-content: center
|
justify-content: center
|
||||||
margin-top: 24px
|
|
||||||
display: block
|
display: block
|
||||||
@media (min-width: 992px)
|
@media (min-width: 992px)
|
||||||
display: flex
|
display: flex
|
||||||
@@ -244,7 +257,6 @@ async function addTokens(value) {
|
|||||||
color: var(--grey)
|
color: var(--grey)
|
||||||
border-radius: 16px
|
border-radius: 16px
|
||||||
padding: 16px 24px
|
padding: 16px 24px
|
||||||
margin-top: 24px
|
|
||||||
font-size: 16px
|
font-size: 16px
|
||||||
.sacrifice-fees-img
|
.sacrifice-fees-img
|
||||||
flex: 0 0 15%
|
flex: 0 0 15%
|
||||||
@@ -260,6 +272,9 @@ async function addTokens(value) {
|
|||||||
margin-bottom: 0
|
margin-bottom: 0
|
||||||
|
|
||||||
.sacrifice-from-to-wrapper
|
.sacrifice-from-to-wrapper
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
|
gap: 16px
|
||||||
.sacrifice-from-wrapper,.sacrifice-to-wrapper
|
.sacrifice-from-wrapper,.sacrifice-to-wrapper
|
||||||
.sarcrifice-from-input
|
.sarcrifice-from-input
|
||||||
display: flex
|
display: flex
|
||||||
@@ -316,4 +331,26 @@ async function addTokens(value) {
|
|||||||
// color: darken(red, 10%)
|
// color: darken(red, 10%)
|
||||||
// transform: scale(1.1)
|
// transform: scale(1.1)
|
||||||
// transition: transform 0s
|
// transition: transform 0s
|
||||||
|
.sacrificed-info
|
||||||
|
display: flex
|
||||||
|
padding: 8px 24px
|
||||||
|
justify-content: space-between
|
||||||
|
align-items: center
|
||||||
|
align-self: stretch
|
||||||
|
border-radius: 16px
|
||||||
|
background: var(--midnight-black, #0F0F0F)
|
||||||
|
text-align: left
|
||||||
|
|
||||||
|
.sacrifice-staking-bonus
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
|
padding: 4px 8px
|
||||||
|
row-gap: 8px
|
||||||
|
border-radius: 10px
|
||||||
|
background: var(--midnight-black, #0F0F0F)
|
||||||
|
.sacrifice-staking-bonus-inner
|
||||||
|
display: flex
|
||||||
|
justify-content: space-between
|
||||||
|
.icon
|
||||||
|
margin-left: auto
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,22 +1,34 @@
|
|||||||
|
<!-- zukünftig card component -->
|
||||||
<template>
|
<template>
|
||||||
<div class="connected-stake bloodline-border white">
|
<div
|
||||||
<div class="connected-stake-headline">Staked</div>
|
class="connected-stake bloodline-border white card"
|
||||||
<div class="connected-stake-subheadline">Increase your sacrifice reward by staking.</div>
|
:class="{ 'card--dense': dense }"
|
||||||
<div class="connected-stake-body">
|
@click="
|
||||||
<token-name-price
|
(e) => {
|
||||||
:name="tokenStore.getToken(walletStore.memeToken?.contractAddress)?.name"
|
e.preventDefault();
|
||||||
:price="walletStore.memeToken?.staked"
|
e.stopPropagation();
|
||||||
></token-name-price>
|
}
|
||||||
<token-logo img="/assets/img/token/bloodline.png" :alt="'test'"></token-logo>
|
"
|
||||||
<token-name-price class="stake-reward" name="Extra Reward" price="+20%"></token-name-price>
|
>
|
||||||
|
<div class="connected-stake-headline mid-mid-text" v-if="slots.headline">
|
||||||
|
<slot name="headline"></slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="connected-stake-buttons" v-if="!stakeMenu">
|
<div class="connected-stake-subheadline" v-if="slots.subheadline">
|
||||||
|
<slot name="subheadline"></slot>
|
||||||
|
</div>
|
||||||
|
<div class="connected-stake-body" v-if="slots.body">
|
||||||
|
<slot name="body"></slot>
|
||||||
|
</div>
|
||||||
|
<slot name="actions"></slot>
|
||||||
|
<slot></slot>
|
||||||
|
|
||||||
|
<!-- <div class="connected-stake-buttons" v-if="!stakeMenu">
|
||||||
<div class="btn btn-immortal" @click="openStake">Stake</div>
|
<div class="btn btn-immortal" @click="openStake">Stake</div>
|
||||||
<div class="btn btn-immortal" @click="openUnstake">Unstake</div>
|
<div v-if="walletStore.memeToken?.staked === 0 && !stakeonly" class="btn btn-immortal btn--disabled">
|
||||||
|
Unstake
|
||||||
</div>
|
</div>
|
||||||
<Transition>
|
<div v-else-if="!stakeonly" class="btn btn-immortal" @click="openUnstake">Unstake</div>
|
||||||
<stake-menu @close="stakeMenu = false" :stake="stake" v-if="stakeMenu"></stake-menu>
|
</div> -->
|
||||||
</Transition>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -25,12 +37,23 @@ import { useTokenStore } from "@/stores/tokens";
|
|||||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||||
|
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import StakeMenu from "./StakeMenu.vue";
|
import { useSlots } from "vue";
|
||||||
import TokenNamePrice from "./TokenNamePrice.vue";
|
|
||||||
import TokenLogo from "./TokenLogo.vue";
|
|
||||||
|
|
||||||
const walletStore = useWalletStoreV2();
|
const walletStore = useWalletStoreV2();
|
||||||
const tokenStore = useTokenStore();
|
const tokenStore = useTokenStore();
|
||||||
|
const slots = useSlots();
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
stakeonly: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
dense: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const stakeMenu = ref(false);
|
const stakeMenu = ref(false);
|
||||||
const stake = ref(null);
|
const stake = ref(null);
|
||||||
@@ -46,4 +69,35 @@ function openUnstake() {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="sass"></style>
|
<style lang="sass">
|
||||||
|
.card
|
||||||
|
padding: 16px 12px
|
||||||
|
.card--dense
|
||||||
|
padding: 8px
|
||||||
|
.connected-stake
|
||||||
|
background-color: var(--darkgrey)
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
|
gap: 16px
|
||||||
|
&.variant1
|
||||||
|
background-color: transparent
|
||||||
|
border: none
|
||||||
|
padding: 16px 6px
|
||||||
|
.connected-stake-headline
|
||||||
|
text-align: center
|
||||||
|
.connected-stake-subheadline
|
||||||
|
text-align: center
|
||||||
|
.connected-stake-body
|
||||||
|
display: flex
|
||||||
|
text-align: left
|
||||||
|
gap: 16px
|
||||||
|
.token-logo
|
||||||
|
margin-left: auto
|
||||||
|
.connected-stake-buttons
|
||||||
|
display: flex
|
||||||
|
text-align: center
|
||||||
|
gap: 16px
|
||||||
|
div
|
||||||
|
flex: 1 1 50%
|
||||||
|
font-size: 18px
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,122 @@
|
|||||||
|
<template>
|
||||||
|
<stake-component>
|
||||||
|
<template v-slot:headline> Staked </template>
|
||||||
|
<template v-slot:subheadline> Stake for a 25% bonus on your sacrifice. Upper limit is your stake. </template>
|
||||||
|
<template v-slot:body>
|
||||||
|
<token-name-price
|
||||||
|
:name="tokenStore.getToken(walletStore.memeToken?.contractAddress)?.name"
|
||||||
|
:price="walletStore.memeToken?.staked"
|
||||||
|
></token-name-price>
|
||||||
|
<token-logo img="/assets/img/token/bloodline.png" :alt="'test'"></token-logo>
|
||||||
|
<token-name-price class="stake-reward" name="Extra Reward" price="+20%"></token-name-price>
|
||||||
|
</template>
|
||||||
|
<template v-slot:actions>
|
||||||
|
<div class="connected-stake-buttons" v-if="!stakeMenu">
|
||||||
|
<div class="btn btn-immortal" @click="openStake">Stake</div>
|
||||||
|
<div v-if="walletStore.memeToken?.staked === 0 && !stakeonly" class="btn btn-immortal btn--disabled">
|
||||||
|
Unstake
|
||||||
|
</div>
|
||||||
|
<div v-else-if="!stakeonly" class="btn btn-immortal" @click="openUnstake">Unstake</div>
|
||||||
|
</div>
|
||||||
|
<Transition name="smooth">
|
||||||
|
<stake-menu
|
||||||
|
v-model="tokenNumber"
|
||||||
|
@close="stakeMenu = false"
|
||||||
|
:stake="stake"
|
||||||
|
v-if="stakeMenu & !unstakeMenu"
|
||||||
|
>
|
||||||
|
<template v-slot:body>
|
||||||
|
<div
|
||||||
|
class="btn btn-immortal stake-button"
|
||||||
|
@click="rewardLockerStore.stakeBloodline(tokenNumber)"
|
||||||
|
>
|
||||||
|
Stake
|
||||||
|
</div>
|
||||||
|
<div class="btn transparent small-text cancel-button text-center" @click="stakeMenu = false">
|
||||||
|
Cancel
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</stake-menu>
|
||||||
|
<div class="unstake-menu" v-else-if="stakeMenu & unstakeMenu">
|
||||||
|
<div class="low-mid-text text-center">
|
||||||
|
To prevent users from farming rewards you can claim your stake next cycle.
|
||||||
|
</div>
|
||||||
|
<div class="unstake-menu-actions">
|
||||||
|
<div class="btn btn-immortal stake-button" v-if="!loading" @click="orderUnstake">
|
||||||
|
Unstake Next Cycle
|
||||||
|
</div>
|
||||||
|
<div class="btn btn--disabled" v-else>Sign Transaction</div>
|
||||||
|
<div class="btn transparent small-text cancel-button text-center" @click="stakeMenu = false">
|
||||||
|
Cancel
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Transition>
|
||||||
|
<!-- todo v-if activeround -->
|
||||||
|
<div class="connected-stake-first-round small-text text-center">
|
||||||
|
No $BLOOD on the market. Staking is activated after the first cycle is finished.
|
||||||
|
</div>
|
||||||
|
<div class="low-mid-text text-center">You can claim your stake next cycle.</div>
|
||||||
|
</template>
|
||||||
|
</stake-component>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from "vue";
|
||||||
|
import StakeComponent from "@/components/StakeComponent.vue";
|
||||||
|
import StakeMenu from "@/components/StakeMenu.vue";
|
||||||
|
import TokenNamePrice from "@/components/TokenNamePrice.vue";
|
||||||
|
import TokenLogo from "@/components/TokenLogo.vue";
|
||||||
|
|
||||||
|
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||||
|
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||||
|
import { useTokenStore } from "@/stores/tokens";
|
||||||
|
|
||||||
|
const walletStore = useWalletStoreV2();
|
||||||
|
const tokenStore = useTokenStore();
|
||||||
|
const rewardLockerStore = useRewardLockerStore();
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
stakeonly: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const stakeMenu = ref(false);
|
||||||
|
const unstakeMenu = ref(false);
|
||||||
|
const stake = ref(null);
|
||||||
|
const tokenNumber = ref(null);
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
function openStake() {
|
||||||
|
stake.value = true;
|
||||||
|
unstakeMenu.value = false;
|
||||||
|
stakeMenu.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function openUnstake() {
|
||||||
|
stake.value = false;
|
||||||
|
unstakeMenu.value = true;
|
||||||
|
stakeMenu.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function orderUnstake() {
|
||||||
|
loading.value = true;
|
||||||
|
var result = await rewardLockerStore.orderUnstake();
|
||||||
|
console.log("orderUnstake", result);
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="sass">
|
||||||
|
.unstake-menu
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
|
gap: 16px
|
||||||
|
.unstake-menu-actions
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
|
gap: 8px
|
||||||
|
</style>
|
||||||
@@ -1,17 +1,37 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="stake-menu">
|
||||||
<token-input v-model="tokenNumber">
|
<div class="token-input">
|
||||||
|
<div class="sarcrifice-from-input">
|
||||||
|
<input
|
||||||
|
@input="emit('update:modelValue', Number($event.target.value))"
|
||||||
|
:value="props.modelValue"
|
||||||
|
:placeholder="0"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="value-adder">
|
||||||
|
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(25)">25%</div>
|
||||||
|
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(50)">50%</div>
|
||||||
|
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(75)">75%</div>
|
||||||
|
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(100)">100%</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <token-input v-model="tokenNumber">
|
||||||
<template v-slot:message>
|
<template v-slot:message>
|
||||||
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(25)">25%</div>
|
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(25)">25%</div>
|
||||||
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(50)">50%</div>
|
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(50)">50%</div>
|
||||||
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(75)">75%</div>
|
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(75)">75%</div>
|
||||||
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(100)">100%</div>
|
<div class="stake-adder-step bloodline-badge grey" @click="addTokensPercent(100)">100%</div>
|
||||||
</template>
|
</template>
|
||||||
</token-input>
|
</token-input> -->
|
||||||
|
<div class="stake-menu-actions">
|
||||||
|
<slot name="body">
|
||||||
<div class="input-balance">Balance: {{ walletStore.memeToken.balanceOf }}</div>
|
<div class="input-balance">Balance: {{ walletStore.memeToken.balanceOf }}</div>
|
||||||
<div class="btn btn-immortal stake-button" @click="stakeBloodline" v-if="props.stake">Stake</div>
|
<div class="btn btn-immortal stake-button" @click="stakeBloodline" v-if="props.stake">Stake</div>
|
||||||
<div class="btn btn-immortal stake-button" @click="unstakeBloodline" v-else>Unstake</div>
|
<div class="btn btn-immortal stake-button" @click="unstakeBloodline" v-else>Unstake for Next Cycle</div>
|
||||||
<div class="btn btn-immortal black cancel-button" @click="emit('close')">Cancel</div>
|
<div class="btn btn-immortal black cancel-button" @click="emit('close')">Cancel</div>
|
||||||
|
</slot>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -32,11 +52,11 @@ const tokenStore = useTokenStore();
|
|||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
stake: Boolean,
|
stake: Boolean,
|
||||||
|
modelValue: Number,
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(["close"]);
|
const emit = defineEmits(["close", "update:modelValue"]);
|
||||||
|
|
||||||
const tokenNumber = ref(null);
|
|
||||||
async function addTokensPercent(value) {
|
async function addTokensPercent(value) {
|
||||||
let amount;
|
let amount;
|
||||||
if (props.stake) {
|
if (props.stake) {
|
||||||
@@ -44,11 +64,24 @@ async function addTokensPercent(value) {
|
|||||||
} else {
|
} else {
|
||||||
amount = (walletStore.memeToken.staked * value) / 100;
|
amount = (walletStore.memeToken.staked * value) / 100;
|
||||||
}
|
}
|
||||||
tokenNumber.value = amount;
|
emit("update:modelValue", Number(amount));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function unstakeBloodline() {
|
async function unstakeBloodline() {
|
||||||
alert("todo");
|
const fromAddress = walletStore.address;
|
||||||
|
|
||||||
|
var test1 = await rewardLockerStore.contract.read.unstakeOrdered([4, fromAddress]);
|
||||||
|
console.log("test1", test1);
|
||||||
|
var test = true;
|
||||||
|
if (test) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var hash = await rewardLockerStore.contract.write.orderUnstake();
|
||||||
|
console.log("hash", hash);
|
||||||
|
const data = await waitForTransaction({
|
||||||
|
hash: hash,
|
||||||
|
});
|
||||||
|
console.log("data", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function stakeBloodline() {
|
async function stakeBloodline() {
|
||||||
@@ -79,13 +112,19 @@ async function stakeBloodline() {
|
|||||||
<style lang="sass">
|
<style lang="sass">
|
||||||
.btn
|
.btn
|
||||||
&.btn-immortal
|
&.btn-immortal
|
||||||
&.cancel-button
|
|
||||||
font-size: 14px
|
|
||||||
text-align: center
|
|
||||||
&.stake-button
|
&.stake-button
|
||||||
font-size: 18px
|
font-size: 18px
|
||||||
text-align: center
|
text-align: center
|
||||||
.input-balance
|
.input-balance
|
||||||
margin: 8px 0
|
margin: 8px 0
|
||||||
color: var(--grey, #858585)
|
color: var(--grey, #858585)
|
||||||
|
|
||||||
|
.stake-menu
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
|
gap: 32px
|
||||||
|
.stake-menu-actions
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
|
gap: 8px
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -20,13 +20,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="rewards-list" v-else>
|
<div class="rewards-list" v-else>
|
||||||
<rewards-wrapper title="Sacrafice Reward" coin="$BLOOD" amount="0" image="/assets/img/vampir.png" />
|
<rewards-wrapper title="Sacrafice Reward" coin="$BLOOD" amount="0" image="/assets/img/vampir.png" />
|
||||||
<rewards-wrapper
|
<!-- <rewards-wrapper
|
||||||
title="Staking Bonus"
|
title="Staking Bonus"
|
||||||
coin="$BLOOD"
|
coin="$BLOOD"
|
||||||
amount="0 todo"
|
amount="0 todo"
|
||||||
info="max: 312m"
|
info="max: 312m"
|
||||||
image="/assets/img/vampir.png"
|
image="/assets/img/vampir.png"
|
||||||
/>
|
/> -->
|
||||||
<rewards-wrapper title="Clan Bonus" coin="$BLOOD" amount="0" image="/assets/img/vampir.png" />
|
<rewards-wrapper title="Clan Bonus" coin="$BLOOD" amount="0" image="/assets/img/vampir.png" />
|
||||||
</div>
|
</div>
|
||||||
<div class="rewards-total-wrapper">
|
<div class="rewards-total-wrapper">
|
||||||
@@ -41,15 +41,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="claim-button">
|
<div class="claim-button">
|
||||||
<div v-if="activeRound === currentRound" class="btn btn-immortal btn--disabled">Cycle Active</div>
|
<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">
|
<div class="stake-buttons" v-else-if="getCurrentRoundData?.rewards_total > 0">
|
||||||
Claim
|
<div class="btn btn-immortal" @click="claimRewards">Claim</div>
|
||||||
|
<div class="btn btn-immortal">Stake</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="btn btn-immortal btn--disabled">Nothing to claim</div>
|
<div v-else class="btn btn-immortal btn--disabled">Nothing to claim</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stake-buttons">
|
|
||||||
<div class="btn btn-immortal">Stake</div>
|
|
||||||
<div class="btn btn-immortal">Unstake</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
v-model="props.modelValue"
|
v-model="props.modelValue"
|
||||||
:placeholder="0"
|
:placeholder="0"
|
||||||
/>
|
/>
|
||||||
<token-logo img="/assets/img/token/bloodline.png" :alt="'test'"></token-logo>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="value-adder">
|
<div class="value-adder">
|
||||||
<slot class="value-adder" name="message"></slot>
|
<slot class="value-adder" name="message"></slot>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="token-price-wrapper">
|
<div class="token-price-wrapper">
|
||||||
<div class="token-name">{{ props.name }}</div>
|
<div class="token-name small-text">{{ props.name }}</div>
|
||||||
<div class="token-price">{{ props.price }}</div>
|
<div class="token-price number-mobile">{{ props.price }}</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -15,9 +15,5 @@ const props = defineProps({
|
|||||||
<style lang="sass">
|
<style lang="sass">
|
||||||
.token-price-wrapper
|
.token-price-wrapper
|
||||||
.token-name
|
.token-name
|
||||||
font-size: 14px
|
|
||||||
margin-bottom: 4px
|
margin-bottom: 4px
|
||||||
.token-price
|
|
||||||
font-size: 24px
|
|
||||||
letter-spacing: 4.32px
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -25,6 +25,14 @@ export function getAddressShortName(address) {
|
|||||||
return addressBegin + "..." + addressEnd;
|
return addressBegin + "..." + addressEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function numberWithCommas(x) {
|
||||||
|
x = x.toString();
|
||||||
|
var pattern = /(-?\d+)(\d{3})/;
|
||||||
|
while (pattern.test(x)) x = x.replace(pattern, "$1,$2");
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
export function getblocky(address) {
|
export function getblocky(address) {
|
||||||
var blockiesData = blockies
|
var blockiesData = blockies
|
||||||
.create({
|
.create({
|
||||||
|
|||||||
+102
-1
@@ -1,5 +1,9 @@
|
|||||||
import './assets/sass/main.sass'
|
import './assets/sass/main.sass'
|
||||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||||
|
import { useTokenStore } from "@/stores/tokens";
|
||||||
|
import { useMemeburnerStore } from "@/stores/memeburner";
|
||||||
|
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||||
|
import { useRoundsStore } from "@/stores/rounds";
|
||||||
|
|
||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import { createPinia } from 'pinia'
|
import { createPinia } from 'pinia'
|
||||||
@@ -9,11 +13,16 @@ import {
|
|||||||
createConfig,
|
createConfig,
|
||||||
configureChains,
|
configureChains,
|
||||||
getAccount,
|
getAccount,
|
||||||
|
getNetwork,
|
||||||
getContract,
|
getContract,
|
||||||
connect,
|
connect,
|
||||||
disconnect,
|
disconnect,
|
||||||
InjectedConnector,
|
InjectedConnector,
|
||||||
watchAccount,
|
watchAccount,
|
||||||
|
watchWalletClient,
|
||||||
|
watchPublicClient,
|
||||||
|
watchContractEvent,
|
||||||
|
watchNetwork,
|
||||||
getWalletClient,
|
getWalletClient,
|
||||||
fetchBalance,
|
fetchBalance,
|
||||||
multicall,
|
multicall,
|
||||||
@@ -71,8 +80,12 @@ pinia.use(piniaPluginPersistedstate);
|
|||||||
app.use(pinia);
|
app.use(pinia);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const walletStore = useWalletStoreV2();
|
const walletStore = useWalletStoreV2();
|
||||||
|
const tokenStore = useTokenStore();
|
||||||
|
const memeBurnerStore = useMemeburnerStore();
|
||||||
|
const rewardLockerStore = useRewardLockerStore();
|
||||||
|
const roundsStore = useRoundsStore();
|
||||||
|
|
||||||
|
|
||||||
const goerliKey = import.meta.env.VITE_GOERLI_KEY;
|
const goerliKey = import.meta.env.VITE_GOERLI_KEY;
|
||||||
const projectId = "d8e5ecb0353c02e21d4c0867d4473ac5";
|
const projectId = "d8e5ecb0353c02e21d4c0867d4473ac5";
|
||||||
@@ -82,6 +95,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains(
|
|||||||
[alchemyProvider({ apiKey: goerliKey }), publicProvider()]
|
[alchemyProvider({ apiKey: goerliKey }), publicProvider()]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
walletStore.config = createConfig({
|
walletStore.config = createConfig({
|
||||||
autoConnect: true,
|
autoConnect: true,
|
||||||
connectors: [
|
connectors: [
|
||||||
@@ -111,6 +125,93 @@ walletStore.config = createConfig({
|
|||||||
});
|
});
|
||||||
walletStore.publicClient = publicClient;
|
walletStore.publicClient = publicClient;
|
||||||
|
|
||||||
|
const networkId = getNetwork()?.chain?.id;
|
||||||
|
|
||||||
|
watchWalletClient(
|
||||||
|
{
|
||||||
|
chainId: networkId,
|
||||||
|
},
|
||||||
|
async (walletClient) => {
|
||||||
|
walletStore.walletClient = walletClient;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watchPublicClient(
|
||||||
|
{
|
||||||
|
chainId: networkId,
|
||||||
|
},
|
||||||
|
(publicClient) => console.log("publicClient", publicClient)
|
||||||
|
);
|
||||||
|
|
||||||
|
watchContractEvent(
|
||||||
|
{
|
||||||
|
address: memeBurnerStore.config.contractAddress,
|
||||||
|
abi: memeBurnerStore.config.abi,
|
||||||
|
eventName: "MemeSacrificed",
|
||||||
|
},
|
||||||
|
async (log) => {
|
||||||
|
console.log("memeSacrificedEvent", log);
|
||||||
|
const token = log[0].args.sacrificedToken;
|
||||||
|
await roundsStore.updateCurrentRound(token);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watchAccount(async (account) => {
|
||||||
|
console.log("watchAccount", account);
|
||||||
|
|
||||||
|
// {chainId: }
|
||||||
|
if (account.address) {
|
||||||
|
walletStore.address = account.address;
|
||||||
|
walletStore.connected = true;
|
||||||
|
let chainObject = walletStore.chain;
|
||||||
|
if (!walletStore.chain) {
|
||||||
|
const { chain, chains } = getNetwork();
|
||||||
|
chainObject = chain;
|
||||||
|
}
|
||||||
|
// var walletClient = await getWalletClient({
|
||||||
|
// account: account.address,
|
||||||
|
// chainId: chainObject.id,
|
||||||
|
// });
|
||||||
|
|
||||||
|
// walletStore.walletClient = walletClient;
|
||||||
|
|
||||||
|
await memeBurnerStore.init();
|
||||||
|
await tokenStore.initV2();
|
||||||
|
await rewardLockerStore.init();
|
||||||
|
await walletStore.loadWalletData();
|
||||||
|
} else {
|
||||||
|
walletStore.address = null;
|
||||||
|
walletStore.connected = false;
|
||||||
|
walletStore.walletClient = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
watchNetwork((network) => {
|
||||||
|
console.log("network123", network);
|
||||||
|
if (network.chain) {
|
||||||
|
walletStore.chain = network.chain;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
watchContractEvent(
|
||||||
|
{
|
||||||
|
address: memeBurnerStore.config.contractAddress,
|
||||||
|
abi: memeBurnerStore.config.abi,
|
||||||
|
eventName: "MemeSacrificed",
|
||||||
|
},
|
||||||
|
async (log) => {
|
||||||
|
console.log("memeSacrificedEvent", log);
|
||||||
|
const token = log[0].args.sacrificedToken;
|
||||||
|
await roundsStore.updateCurrentRound(token);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
await walletStore.init();
|
||||||
|
await tokenStore.initV2();
|
||||||
|
await memeBurnerStore.init();
|
||||||
|
await rewardLockerStore.init();
|
||||||
|
await memeBurnerStore.init();
|
||||||
|
|
||||||
app.use(router)
|
app.use(router)
|
||||||
app.component('font-awesome-icon', FontAwesomeIcon)
|
app.component('font-awesome-icon', FontAwesomeIcon)
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
|
|||||||
+1
-95
@@ -68,102 +68,8 @@ const router = createRouter({
|
|||||||
router.beforeEach(async (to, from) => {
|
router.beforeEach(async (to, from) => {
|
||||||
//init
|
//init
|
||||||
|
|
||||||
const showPanel = ref(false);
|
|
||||||
const eventWatch = ref(null);
|
|
||||||
const netWorkEvent = ref(null);
|
|
||||||
const memeSacrificedEvent = ref(null);
|
|
||||||
const clientClientEvent = ref(null);
|
|
||||||
console.log("beforeEach");
|
|
||||||
const tokenStore = useTokenStore();
|
|
||||||
const memeBurnerStore = useMemeburnerStore();
|
|
||||||
const rewardLockerStore = useRewardLockerStore();
|
|
||||||
const roundsStore = useRoundsStore();
|
|
||||||
const walletStore = useWalletStoreV2();
|
const walletStore = useWalletStoreV2();
|
||||||
console.log("walletStore.publicClient", walletStore.publicClient);
|
|
||||||
if (!walletStore.initialized) {
|
|
||||||
walletStore.initialized = true
|
|
||||||
console.log("hier");
|
|
||||||
await walletStore.init();
|
|
||||||
await tokenStore.initV2();
|
|
||||||
await memeBurnerStore.init();
|
|
||||||
await rewardLockerStore.init();
|
|
||||||
await memeBurnerStore.init();
|
|
||||||
console.log("init router");
|
|
||||||
console.log("roundsStore.currentRound", roundsStore.currentRound);
|
|
||||||
if (!roundsStore.currentRound) {
|
|
||||||
roundsStore.currentRound = parseInt(await memeBurnerStore.getCurrentRound());
|
|
||||||
console.log("roundsStore.currentRound", roundsStore.currentRound);
|
|
||||||
roundsStore.activeRound = roundsStore.currentRound;
|
|
||||||
}
|
|
||||||
|
|
||||||
//events
|
|
||||||
eventWatch.value = watchAccount(async (account) => {
|
|
||||||
console.log("account123", account);
|
|
||||||
const publicClient = getPublicClient();
|
|
||||||
console.log("publicClient", publicClient);
|
|
||||||
|
|
||||||
// {chainId: }
|
|
||||||
console.log("walletClient", walletClient);
|
|
||||||
if (account.address) {
|
|
||||||
walletStore.address = account.address;
|
|
||||||
walletStore.connected = true;
|
|
||||||
let chainObject = walletStore.chain;
|
|
||||||
if (!walletStore.chain) {
|
|
||||||
const { chain, chains } = getNetwork();
|
|
||||||
chainObject = chain;
|
|
||||||
}
|
|
||||||
var walletClient = await getWalletClient({
|
|
||||||
account: account.address,
|
|
||||||
chainId: chainObject.id,
|
|
||||||
});
|
|
||||||
walletStore.walletClient = walletClient;
|
|
||||||
|
|
||||||
// walletStore.getTokenBalances()
|
|
||||||
|
|
||||||
await memeBurnerStore.init();
|
|
||||||
console.log("hierabc");
|
|
||||||
await tokenStore.initV2();
|
|
||||||
} else {
|
|
||||||
walletStore.address = null;
|
|
||||||
walletStore.connected = false;
|
|
||||||
walletStore.walletClient = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
netWorkEvent.value = watchNetwork((network) => {
|
|
||||||
console.log("network123", network);
|
|
||||||
if (network.chain) {
|
|
||||||
walletStore.chain = network.chain;
|
|
||||||
|
|
||||||
clientClientEvent.value = watchWalletClient(
|
|
||||||
{
|
|
||||||
chainId: network.chain.id,
|
|
||||||
},
|
|
||||||
(walletClient) => {
|
|
||||||
walletStore.walletClient = walletClient;
|
|
||||||
console.log("wc123", walletClient);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
memeSacrificedEvent.value = watchContractEvent(
|
|
||||||
{
|
|
||||||
address: memeBurnerStore.config.contractAddress,
|
|
||||||
abi: memeBurnerStore.config.abi,
|
|
||||||
eventName: "MemeSacrificed",
|
|
||||||
},
|
|
||||||
async (log) => {
|
|
||||||
console.log("memeSacrificedEvent", log);
|
|
||||||
const token = log[0].args.sacrificedToken;
|
|
||||||
await roundsStore.updateCurrentRound(token);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
await roundsStore.fillRound(roundsStore.activeRound);
|
|
||||||
await walletStore.loadWalletData();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//middleware
|
//middleware
|
||||||
if (to.meta.middleware) {
|
if (to.meta.middleware) {
|
||||||
|
|||||||
@@ -79,9 +79,10 @@ export const useMemeburnerStore = defineStore("memeburner", {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
const amountDecimal = BigInt(amount * Math.pow(10, tokenStore.activeToken.decimals));
|
const amountDecimal = BigInt(amount * Math.pow(10, tokenStore.activeToken.decimals));
|
||||||
console.log("this.contract", this.contract);
|
console.log("this.contract", this.contract);
|
||||||
console.log("amountDecimal", amountDecimal);
|
console.log("amountDecimal", amountDecimal.toString());
|
||||||
|
console.log("tokenStore.activeToken.contractAddress", tokenStore.activeToken.contractAddress);
|
||||||
var hash = await this.contract.write
|
var hash = await this.contract.write
|
||||||
.sacrificeMeme([tokenStore.activeToken.contractAddress, amountDecimal])
|
.sacrificeMeme([tokenStore.activeToken.contractAddress, amountDecimal.toString()])
|
||||||
console.log("hash", hash);
|
console.log("hash", hash);
|
||||||
const data = await waitForTransaction({
|
const data = await waitForTransaction({
|
||||||
hash: hash,
|
hash: hash,
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ import { defineStore } from "pinia";
|
|||||||
import RewardLockerJson from "@/assets/contracts/RewardLocker.json";
|
import RewardLockerJson from "@/assets/contracts/RewardLocker.json";
|
||||||
import { useTokenStore } from "./tokens";
|
import { useTokenStore } from "./tokens";
|
||||||
import { useWalletStoreV2 } from "./walletV2";
|
import { useWalletStoreV2 } from "./walletV2";
|
||||||
import { multicall, getContract } from "@wagmi/core";
|
import { useRoundsStore } from "@/stores/rounds";
|
||||||
|
import { createPermitObject, getSignatureRSV } from "@/helper/blockchain.js";
|
||||||
|
import { multicall, getContract, signTypedData, getAccount, waitForTransaction } from "@wagmi/core";
|
||||||
|
|
||||||
|
|
||||||
export const useRewardLockerStore = defineStore("rewardlocker", {
|
export const useRewardLockerStore = defineStore("rewardlocker", {
|
||||||
@@ -49,7 +51,7 @@ export const useRewardLockerStore = defineStore("rewardlocker", {
|
|||||||
contracts,
|
contracts,
|
||||||
});
|
});
|
||||||
// const multicallStore = useMultiCallStore();
|
// const multicallStore = useMultiCallStore();
|
||||||
return data
|
return data;
|
||||||
},
|
},
|
||||||
async getSacrificedTokenCoefficient(roundNumber, sacrificedToken) {
|
async getSacrificedTokenCoefficient(roundNumber, sacrificedToken) {
|
||||||
return await this.contract.read.getSacrificedTokenCoefficient([roundNumber, sacrificedToken]);
|
return await this.contract.read.getSacrificedTokenCoefficient([roundNumber, sacrificedToken]);
|
||||||
@@ -65,11 +67,67 @@ export const useRewardLockerStore = defineStore("rewardlocker", {
|
|||||||
// return await this.contract.methods.claim(round).send({from: walletStore.address, to: this.contractAddress});
|
// return await this.contract.methods.claim(round).send({from: walletStore.address, to: this.contractAddress});
|
||||||
return await this.contract.write.claim([round]);
|
return await this.contract.write.claim([round]);
|
||||||
},
|
},
|
||||||
|
async claimAll() {
|
||||||
|
console.log("claimAll");
|
||||||
|
const roundsStore = useRoundsStore();
|
||||||
|
const account = getAccount();
|
||||||
|
console.log("acocunt", account);
|
||||||
|
|
||||||
|
const rounds = await roundsStore.getFinshedRoundNumbers();
|
||||||
|
return await this.contract.write.claim([[1, 2]]);
|
||||||
|
},
|
||||||
async getTotalRewardsOf(address, rounds) {
|
async getTotalRewardsOf(address, rounds) {
|
||||||
return await this.contract.read.getTotalRewardsOf([address, rounds]);
|
return await this.contract.read.getTotalRewardsOf([address, rounds]);
|
||||||
},
|
},
|
||||||
|
async getTotalRewards(address) {
|
||||||
|
console.log("this.contract", this.contract);
|
||||||
|
const roundsStore = useRoundsStore();
|
||||||
|
const rounds = await roundsStore.getFinshedRoundNumbers();
|
||||||
|
return await this.contract.read.getTotalRewardsOf([address, rounds]);
|
||||||
|
},
|
||||||
async getStaked(address) {
|
async getStaked(address) {
|
||||||
return await this.contract.read.staked([address]);
|
return await this.contract.read.staked([address]);
|
||||||
},
|
},
|
||||||
|
async orderUnstake() {
|
||||||
|
try {
|
||||||
|
return await this.contract.write.orderUnstake();
|
||||||
|
} catch (error) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async unstake(unstakeRound) {
|
||||||
|
return await this.contract.write.unstake([unstakeRound]);
|
||||||
|
},
|
||||||
|
async stakeBloodline(tokenNumber) {
|
||||||
|
console.log("tokenNumber", tokenNumber);
|
||||||
|
const walletStore = useWalletStoreV2();
|
||||||
|
const tokenStore = useTokenStore();
|
||||||
|
|
||||||
|
const fromAddress = walletStore.address;
|
||||||
|
const spender = this.config.contractAddress;
|
||||||
|
const deadline = Date.now() + 20 * 60;
|
||||||
|
const decimals = tokenStore.getToken(walletStore.memeToken.contractAddress).decimals;
|
||||||
|
const value = (tokenNumber * Math.pow(10, decimals)).toString();
|
||||||
|
const nonce = await tokenStore.memeToken.contract.read.nonces([fromAddress]);
|
||||||
|
console.log("nonce", nonce);
|
||||||
|
const { types, message, domain, primaryType } = createPermitObject(fromAddress, spender, nonce, deadline, value);
|
||||||
|
|
||||||
|
const signature = await signTypedData({
|
||||||
|
domain: domain,
|
||||||
|
message: message,
|
||||||
|
primaryType: primaryType,
|
||||||
|
types: types,
|
||||||
|
});
|
||||||
|
|
||||||
|
const { r, s, v } = getSignatureRSV(signature);
|
||||||
|
|
||||||
|
const hash = await this.contract.write.stakeToBeSecured([value, deadline, v, r, s]);
|
||||||
|
console.log("hash", hash);
|
||||||
|
|
||||||
|
const data = await waitForTransaction({
|
||||||
|
hash: hash,
|
||||||
|
});
|
||||||
|
console.log("data", data);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
+49
-20
@@ -8,15 +8,18 @@ import { multicall } from "@wagmi/core";
|
|||||||
|
|
||||||
export const useRoundsStore = defineStore("rounds", {
|
export const useRoundsStore = defineStore("rounds", {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
rounds: [
|
rounds: [],
|
||||||
],
|
|
||||||
activeRound: null,
|
activeRound: null,
|
||||||
currentRound: null
|
currentRound: null,
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
getRoundWinner() {
|
getRoundWinner() {
|
||||||
const goal = this.getCurrentRoundData?.goal;
|
const goal = this.getCurrentRoundData?.goal;
|
||||||
const winnerCoin = this.rounds[this.activeRound]?.token.find((token) => token.amount === goal)
|
console.log("goal", goal);
|
||||||
|
if (!goal) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const winnerCoin = this.rounds[this.activeRound]?.token.find((token) => token.amount === goal);
|
||||||
if (winnerCoin) {
|
if (winnerCoin) {
|
||||||
return winnerCoin;
|
return winnerCoin;
|
||||||
} else {
|
} else {
|
||||||
@@ -24,8 +27,9 @@ export const useRoundsStore = defineStore("rounds", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getCurrentRoundData() {
|
getCurrentRoundData() {
|
||||||
|
console.log("this.rounds", this.rounds);
|
||||||
return this.rounds[this.activeRound];
|
return this.rounds[this.activeRound];
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
async init() {
|
async init() {
|
||||||
@@ -36,7 +40,7 @@ export const useRoundsStore = defineStore("rounds", {
|
|||||||
const rewardLockerStore = useRewardLockerStore();
|
const rewardLockerStore = useRewardLockerStore();
|
||||||
|
|
||||||
console.log("this.currentRound", this.currentRound);
|
console.log("this.currentRound", this.currentRound);
|
||||||
const contracts = []
|
const contracts = [];
|
||||||
for (let index = 0; index < this.currentRound; index++) {
|
for (let index = 0; index < this.currentRound; index++) {
|
||||||
console.log("load round: " + index);
|
console.log("load round: " + index);
|
||||||
// await this.fillRound(index)
|
// await this.fillRound(index)
|
||||||
@@ -58,8 +62,8 @@ export const useRoundsStore = defineStore("rounds", {
|
|||||||
if (!this.rounds[index]) {
|
if (!this.rounds[index]) {
|
||||||
this.rounds[index] = {};
|
this.rounds[index] = {};
|
||||||
}
|
}
|
||||||
this.rounds[index].round = index + 1
|
this.rounds[index].round = index + 1;
|
||||||
this.rounds[index].rewards_total = element.result
|
this.rounds[index].rewards_total = element.result;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async updateCurrentRound(sacrificedToken) {
|
async updateCurrentRound(sacrificedToken) {
|
||||||
@@ -67,9 +71,10 @@ export const useRoundsStore = defineStore("rounds", {
|
|||||||
const memeBurnerStore = useMemeburnerStore();
|
const memeBurnerStore = useMemeburnerStore();
|
||||||
var data = await memeBurnerStore.getSacrificedRound(this.currentRound);
|
var data = await memeBurnerStore.getSacrificedRound(this.currentRound);
|
||||||
console.log("data123", data);
|
console.log("data123", data);
|
||||||
var tokenIndex = this.rounds[this.currentRound].token.findIndex((tokenData) => tokenData.contractAddress === sacrificedToken);
|
var tokenIndex = this.rounds[this.currentRound].token.findIndex(
|
||||||
|
(tokenData) => tokenData.contractAddress === sacrificedToken
|
||||||
|
);
|
||||||
this.rounds[this.currentRound].token[tokenIndex].amount = data[tokenIndex].result[1];
|
this.rounds[this.currentRound].token[tokenIndex].amount = data[tokenIndex].result[1];
|
||||||
|
|
||||||
},
|
},
|
||||||
async fillRound(roundNumber) {
|
async fillRound(roundNumber) {
|
||||||
console.log("fillRound");
|
console.log("fillRound");
|
||||||
@@ -84,24 +89,27 @@ export const useRoundsStore = defineStore("rounds", {
|
|||||||
if (!this.rounds[roundNumber]?.goal) {
|
if (!this.rounds[roundNumber]?.goal) {
|
||||||
console.log("round not filled --> fill round");
|
console.log("round not filled --> fill round");
|
||||||
console.log("vor error");
|
console.log("vor error");
|
||||||
var data = await memeBurnerStore.getSacrificedRound(roundNumber)
|
var data = await memeBurnerStore.getSacrificedRound(roundNumber);
|
||||||
let rewardData = null;
|
let rewardData = null;
|
||||||
if (walletStore.connected) {
|
if (walletStore.connected) {
|
||||||
|
console.log("hier1");
|
||||||
rewardData = await rewardLockerStore.getRewardsForAllToken(roundNumber);
|
rewardData = await rewardLockerStore.getRewardsForAllToken(roundNumber);
|
||||||
|
console.log("hier2", rewardData);
|
||||||
}
|
}
|
||||||
console.log("rewardData123", rewardData);
|
console.log("rewardData123", rewardData);
|
||||||
|
|
||||||
var goal = await memeBurnerStore.getGoal(roundNumber);
|
var goal = await memeBurnerStore.getGoal(roundNumber);
|
||||||
console.log("goal", goal);
|
console.log("goal", goal);
|
||||||
var tokenArray = []
|
var tokenArray = [];
|
||||||
var rewards_clan = 0
|
var rewards_clan = 0;
|
||||||
var rewards_sacrifice = 0
|
var rewards_sacrifice = 0;
|
||||||
for (let index = 0; index < data.length; index++) {
|
for (let index = 0; index < data.length; index++) {
|
||||||
var tokenData = {};
|
var tokenData = {};
|
||||||
const token = tokenStore.token[index];
|
const token = tokenStore.token[index];
|
||||||
var testcoef = await rewardLockerStore.getSacrificedTokenCoefficient(roundNumber, token.contractAddress);
|
var testcoef = await rewardLockerStore.getSacrificedTokenCoefficient(
|
||||||
|
roundNumber,
|
||||||
|
token.contractAddress
|
||||||
|
);
|
||||||
|
|
||||||
tokenData.name = token.name;
|
tokenData.name = token.name;
|
||||||
tokenData.contractAddress = token.contractAddress;
|
tokenData.contractAddress = token.contractAddress;
|
||||||
@@ -117,9 +125,8 @@ export const useRoundsStore = defineStore("rounds", {
|
|||||||
tokenData.rewards_clan = BigInt(clanwin);
|
tokenData.rewards_clan = BigInt(clanwin);
|
||||||
tokenData.rewards_sacrifice = BigInt(sacrificeRewards);
|
tokenData.rewards_sacrifice = BigInt(sacrificeRewards);
|
||||||
|
|
||||||
rewards_clan = rewards_clan + (clanwin / Math.pow(10, token.decimals));
|
rewards_clan = rewards_clan + clanwin / Math.pow(10, token.decimals);
|
||||||
rewards_sacrifice =
|
rewards_sacrifice = rewards_sacrifice + sacrificeRewards / Math.pow(10, token.decimals);
|
||||||
rewards_sacrifice + sacrificeRewards / Math.pow(10, token.decimals);
|
|
||||||
}
|
}
|
||||||
tokenArray.push(tokenData);
|
tokenArray.push(tokenData);
|
||||||
}
|
}
|
||||||
@@ -139,5 +146,27 @@ export const useRoundsStore = defineStore("rounds", {
|
|||||||
}
|
}
|
||||||
console.log("this.rounds123", this.rounds);
|
console.log("this.rounds123", this.rounds);
|
||||||
},
|
},
|
||||||
|
async getFinshedRoundNumbers() {
|
||||||
|
const array = [];
|
||||||
|
const rewardLockerStore = useRewardLockerStore();
|
||||||
|
const lastCompletedRound = await rewardLockerStore.lastCompletedRound();
|
||||||
|
for (let index = 1; index <= Number(lastCompletedRound) + 1; index++) {
|
||||||
|
array.push(index);
|
||||||
|
}
|
||||||
|
return array;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* function to get finished rounds, active round and the next round to check if there is a round the user called unstakeOrdered.
|
||||||
|
* with Backend it would be much easier because we could store the event data in the database
|
||||||
|
*/
|
||||||
|
async getRoundsNumberWithNext() {
|
||||||
|
const array = [];
|
||||||
|
const rewardLockerStore = useRewardLockerStore();
|
||||||
|
const lastCompletedRound = await rewardLockerStore.lastCompletedRound();
|
||||||
|
for (let index = 1; index <= Number(lastCompletedRound) + 1; index++) {
|
||||||
|
array.push(index);
|
||||||
|
}
|
||||||
|
return array;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ export const useTokenStore = defineStore("token", {
|
|||||||
},
|
},
|
||||||
async approveToken(amount) {
|
async approveToken(amount) {
|
||||||
try {
|
try {
|
||||||
|
console.log("amount", amount);
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const memeBurnerStore = useMemeburnerStore();
|
const memeBurnerStore = useMemeburnerStore();
|
||||||
// var approve = await this.contract.methods
|
// var approve = await this.contract.methods
|
||||||
@@ -168,12 +169,15 @@ export const useTokenStore = defineStore("token", {
|
|||||||
console.log("approve");
|
console.log("approve");
|
||||||
var approveHash = await this.activeToken.contract.write.approve([
|
var approveHash = await this.activeToken.contract.write.approve([
|
||||||
memeBurnerStore.config.contractAddress,
|
memeBurnerStore.config.contractAddress,
|
||||||
amount,
|
50000000000000000000,
|
||||||
]);
|
]);
|
||||||
|
console.log("approveHash", approveHash);
|
||||||
|
|
||||||
const data = await waitForTransaction({
|
const data = await waitForTransaction({
|
||||||
hash: approveHash,
|
hash: approveHash,
|
||||||
});
|
});
|
||||||
|
this.activeToken.allowance = await this.allowance();
|
||||||
|
console.log("data", data);
|
||||||
return data;
|
return data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|||||||
+13
-4
@@ -16,6 +16,7 @@ import {
|
|||||||
getWalletClient,
|
getWalletClient,
|
||||||
fetchBalance,
|
fetchBalance,
|
||||||
multicall,
|
multicall,
|
||||||
|
getNetwork,
|
||||||
} from "@wagmi/core";
|
} from "@wagmi/core";
|
||||||
|
|
||||||
import { WalletConnectConnector } from "@wagmi/core/connectors/walletConnect";
|
import { WalletConnectConnector } from "@wagmi/core/connectors/walletConnect";
|
||||||
@@ -40,7 +41,7 @@ export const useWalletStoreV2 = defineStore("walletV2", {
|
|||||||
config: null,
|
config: null,
|
||||||
chain: null,
|
chain: null,
|
||||||
token: [],
|
token: [],
|
||||||
initialized: false
|
initialized1: false,
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
sacrificeToken: (state) => state.token.filter((obj) => obj.contractAddress !== MemeToken.contractAddress),
|
sacrificeToken: (state) => state.token.filter((obj) => obj.contractAddress !== MemeToken.contractAddress),
|
||||||
@@ -59,6 +60,7 @@ export const useWalletStoreV2 = defineStore("walletV2", {
|
|||||||
this.address = account.address;
|
this.address = account.address;
|
||||||
this.connected = true;
|
this.connected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// await this.isConnected();
|
// await this.isConnected();
|
||||||
// const goerliKey = import.meta.env.VITE_GOERLI_KEY;
|
// const goerliKey = import.meta.env.VITE_GOERLI_KEY;
|
||||||
// if (this.connected) {
|
// if (this.connected) {
|
||||||
@@ -77,11 +79,9 @@ export const useWalletStoreV2 = defineStore("walletV2", {
|
|||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
console.log("this.config", this.config);
|
|
||||||
const walletClient = await getWalletClient();
|
|
||||||
console.log("walletClient", walletClient);
|
|
||||||
},
|
},
|
||||||
async connectWallet(connector) {
|
async connectWallet(connector) {
|
||||||
|
try {
|
||||||
console.log("connector.name", connector.name);
|
console.log("connector.name", connector.name);
|
||||||
// if (!account.isConnected) {
|
// if (!account.isConnected) {
|
||||||
const connection = await connect({
|
const connection = await connect({
|
||||||
@@ -90,6 +90,12 @@ export const useWalletStoreV2 = defineStore("walletV2", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
console.log("connection", connection);
|
console.log("connection", connection);
|
||||||
|
} catch (error) {
|
||||||
|
if (error.message.includes("Connector not found")) {
|
||||||
|
console.warn("Connector not found");
|
||||||
|
}
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
// this.address = connection.account;
|
// this.address = connection.account;
|
||||||
},
|
},
|
||||||
async getTokenBalance(token) {
|
async getTokenBalance(token) {
|
||||||
@@ -101,6 +107,7 @@ export const useWalletStoreV2 = defineStore("walletV2", {
|
|||||||
|
|
||||||
async getTokenBalances() {
|
async getTokenBalances() {
|
||||||
console.log("getTokenBalances");
|
console.log("getTokenBalances");
|
||||||
|
this.token = []
|
||||||
const tokenStore = useTokenStore();
|
const tokenStore = useTokenStore();
|
||||||
console.log("tokenStore.token.length", tokenStore.token.length);
|
console.log("tokenStore.token.length", tokenStore.token.length);
|
||||||
var contracts = [];
|
var contracts = [];
|
||||||
@@ -138,6 +145,8 @@ export const useWalletStoreV2 = defineStore("walletV2", {
|
|||||||
const staked = await rewardlockerStore.getStaked(this.address);
|
const staked = await rewardlockerStore.getStaked(this.address);
|
||||||
console.log("staked", staked);
|
console.log("staked", staked);
|
||||||
this.memeToken.staked = Number(staked / BigInt(Math.pow(10, tokenStore.memeToken.decimals)));
|
this.memeToken.staked = Number(staked / BigInt(Math.pow(10, tokenStore.memeToken.decimals)));
|
||||||
|
const unclaimedRewards = await rewardlockerStore.getTotalRewards(this.address);
|
||||||
|
this.memeToken.unclaimedRewards = Number(unclaimedRewards/ BigInt(Math.pow(10, tokenStore.memeToken.decimals)))
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
+27
-7
@@ -21,7 +21,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="cycle card bloodline-wrapper container">
|
<div class="cycle card bloodline-wrapper container">
|
||||||
<div class="bloodline-border">
|
<div class="bloodline-border" v-if="difference > 0 && roundsStore.currentRound === roundsStore.activeRound">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Sacrifice:</td>
|
<td>Sacrifice:</td>
|
||||||
@@ -103,7 +103,11 @@ import { inject, ref, onMounted, onBeforeUnmount } from "vue";
|
|||||||
|
|
||||||
import BloodChart from "@/components/BloodChart.vue";
|
import BloodChart from "@/components/BloodChart.vue";
|
||||||
import TokenClaim from "@/components/TokenClaim.vue";
|
import TokenClaim from "@/components/TokenClaim.vue";
|
||||||
|
import { useMemeburnerStore } from "@/stores/memeburner";
|
||||||
|
|
||||||
import { useRoundsStore } from "@/stores/rounds";
|
import { useRoundsStore } from "@/stores/rounds";
|
||||||
|
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||||
|
|
||||||
const roundsStore = useRoundsStore();
|
const roundsStore = useRoundsStore();
|
||||||
|
|
||||||
const days = ref(null);
|
const days = ref(null);
|
||||||
@@ -111,12 +115,25 @@ const hours = ref(null);
|
|||||||
const minutes = ref(null);
|
const minutes = ref(null);
|
||||||
const seconds = ref(null);
|
const seconds = ref(null);
|
||||||
const timer = ref(null);
|
const timer = ref(null);
|
||||||
|
const difference = ref(null);
|
||||||
|
const memeBurnerStore = useMemeburnerStore();
|
||||||
|
const rewardLockerStore = useRewardLockerStore();
|
||||||
|
|
||||||
const isMobile = inject("isMobile");
|
const isMobile = inject("isMobile");
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
console.log("onmounted", roundsStore.activeRound);
|
console.log("onmounted", roundsStore.activeRound);
|
||||||
console.log("blatest", roundsStore.getCurrentRoundData.expirationTimestamp);
|
console.log("roundsStore.activeRound123", roundsStore.activeRound);
|
||||||
|
// await memeBurnerStore.init();
|
||||||
|
// await rewardLockerStore.init();
|
||||||
|
|
||||||
|
if (!roundsStore.currentRound) {
|
||||||
|
console.log("test");
|
||||||
|
roundsStore.currentRound = parseInt(await memeBurnerStore.getCurrentRound());
|
||||||
|
console.log("roundsStore.currentRound", roundsStore.currentRound);
|
||||||
|
roundsStore.activeRound = roundsStore.currentRound;
|
||||||
|
}
|
||||||
|
await roundsStore.fillRound(roundsStore.activeRound);
|
||||||
const expirationTimestamp = roundsStore.getCurrentRoundData.expirationTimestamp;
|
const expirationTimestamp = roundsStore.getCurrentRoundData.expirationTimestamp;
|
||||||
timer.value = setInterval(function () {
|
timer.value = setInterval(function () {
|
||||||
timeBetweenDates(expirationTimestamp);
|
timeBetweenDates(expirationTimestamp);
|
||||||
@@ -146,12 +163,15 @@ function timeBetweenDates(expirationTimestamp) {
|
|||||||
const dateEntered = new Date(Number(expirationTimestamp) * 1000);
|
const dateEntered = new Date(Number(expirationTimestamp) * 1000);
|
||||||
if (dateEntered) {
|
if (dateEntered) {
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
var difference = dateEntered.getTime() - now.getTime();
|
difference.value = dateEntered.getTime() - now.getTime();
|
||||||
console.log("difference", difference);
|
console.log("difference.value", difference.value);
|
||||||
if (difference <= 0) {
|
if (difference.value <= 0) {
|
||||||
clearInterval(timer.value);
|
clearInterval(timer.value);
|
||||||
|
days.value = "0d";
|
||||||
|
hours.value = "0h";
|
||||||
|
minutes.value = "0m";
|
||||||
} else {
|
} else {
|
||||||
var _seconds = Math.floor(difference / 1000);
|
var _seconds = Math.floor(difference.value / 1000);
|
||||||
var _minutes = Math.floor(_seconds / 60);
|
var _minutes = Math.floor(_seconds / 60);
|
||||||
var _hours = Math.floor(_minutes / 60);
|
var _hours = Math.floor(_minutes / 60);
|
||||||
var _days = Math.floor(_hours / 24);
|
var _days = Math.floor(_hours / 24);
|
||||||
|
|||||||
+92
-44
@@ -1,33 +1,47 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="profile-page container">
|
||||||
<div class="profile-header">Profile</div>
|
<div class="profile-header">
|
||||||
|
<div class="profile-headline">Profile</div>
|
||||||
<div class="profile-subheader">
|
<div class="profile-subheader">
|
||||||
<div class="profile-subheader-logo"><img :src="getblocky(walletStore.address)" alt="" /></div>
|
<div class="profile-subheader-logo"><img :src="getblocky(walletStore.address)" alt="" /></div>
|
||||||
<div class="profile-subheader-address">0x12345...812d</div>
|
<div class="profile-subheader-address">{{ getAddressShortName(walletStore.address) }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="total-rewards-wrapper">
|
</div>
|
||||||
<div class="total-rewards-headline">Total Rewards</div>
|
<!-- <div class="total-rewards-wrapper">
|
||||||
|
<div class="total-rewards-headline mid-text text-center">Total Rewards</div>
|
||||||
<div class="total-rewards-inner">
|
<div class="total-rewards-inner">
|
||||||
<div class="claim-wrapper">
|
|
||||||
<div class="claim-inner">
|
|
||||||
<div class="claim-header">Claimed</div>
|
|
||||||
<div class="claim-body">TODO</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="claim-hr"></div>
|
|
||||||
<div class="claim-wrapper">
|
|
||||||
<div class="claim-inner">
|
|
||||||
<div class="claim-header">Unclaimed</div>
|
<div class="claim-header">Unclaimed</div>
|
||||||
<div class="claim-body">TODO</div>
|
<div class="claim-wrapper">
|
||||||
|
<div class="claim-inner">
|
||||||
|
<div class="claim-body">
|
||||||
|
<div class="claim-coin small-text">$Blood</div>
|
||||||
|
<div class="claim-amount number-mobile">
|
||||||
|
{{ walletStore.memeToken?.unclaimedRewards }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<img class="bloodline-token" src="/assets/img/vampir.png" alt="vampir" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="total-rewards-buttons">
|
<div class="total-rewards-buttons">
|
||||||
|
<div class="btn btn-immortal" @click="rewardLockerStore.claimAll">Claim</div>
|
||||||
<div class="btn btn-immortal">Stake</div>
|
<div class="btn btn-immortal">Stake</div>
|
||||||
<div class="btn btn-immortal">Unstake</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="text-center low-mid-text">You can claim, once the cycle is over.</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div> -->
|
||||||
|
<div class="total-rewards-wrapper">
|
||||||
|
<div class="total-rewards-headline mid-text text-center">Total Rewards</div>
|
||||||
|
<claim-component></claim-component>
|
||||||
|
</div>
|
||||||
|
<stake-component-v1></stake-component-v1>
|
||||||
|
<div class="profile-stake">
|
||||||
|
<!-- <stake-component>
|
||||||
|
<template v-slot:headline> Staked </template>
|
||||||
|
<template v-slot:subheadline>
|
||||||
|
Stake for a 25% bonus on your sacrifice. Upper limit is your stake.
|
||||||
|
</template>
|
||||||
|
</stake-component> -->
|
||||||
</div>
|
</div>
|
||||||
<stake-component></stake-component>
|
|
||||||
|
|
||||||
<div class="most-sacrificed-wrapper" v-if="false">
|
<div class="most-sacrificed-wrapper" v-if="false">
|
||||||
<div class="most-sacrificed-inner">
|
<div class="most-sacrificed-inner">
|
||||||
@@ -72,7 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="cycle-wrapper">
|
<!-- <div class="cycle-wrapper">
|
||||||
<div class="cycle-inner">
|
<div class="cycle-inner">
|
||||||
<div class="cycle-headline">Cycles</div>
|
<div class="cycle-headline">Cycles</div>
|
||||||
<div class="cycle-header">
|
<div class="cycle-header">
|
||||||
@@ -145,13 +159,13 @@
|
|||||||
<div class="sacrifice-reward-header-amount">+200 $BDL</div>
|
<div class="sacrifice-reward-header-amount">+200 $BDL</div>
|
||||||
</div>
|
</div>
|
||||||
<table class="sacrifice-coins">
|
<table class="sacrifice-coins">
|
||||||
<div class="sacrifice-coin">
|
<tr class="sacrifice-coin">
|
||||||
<div><img src="/assets/img/winner.png" alt="" /></div>
|
<td><img src="/assets/img/winner.png" alt="" /></td>
|
||||||
<div><img src="/assets/img/token/pepevamp.png" alt="" /></div>
|
<td><img src="/assets/img/token/pepevamp.png" alt="" /></td>
|
||||||
<div>$PEPE</div>
|
<td>$PEPE</td>
|
||||||
<div class="arrow"></div>
|
<td class="arrow"></td>
|
||||||
<div class="bloodline">1,000 $BDL</div>
|
<td class="bloodline">1,000 $BDL</td>
|
||||||
</div>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -161,7 +175,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -170,12 +184,18 @@ import { ref, onMounted, computed } from "vue";
|
|||||||
import { useRoundsStore } from "@/stores/rounds";
|
import { useRoundsStore } from "@/stores/rounds";
|
||||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||||
|
|
||||||
import { getblocky } from "@/helper/helper.js";
|
import { getblocky, getAddressShortName } from "@/helper/helper.js";
|
||||||
import StakeComponent from "@/components/StakeComponent.vue";
|
import StakeComponent from "@/components/StakeComponent.vue";
|
||||||
|
import StakeComponentV1 from "@/components/StakeComponentV1.vue";
|
||||||
|
import ClaimComponent from "@/components/ClaimComponent.vue";
|
||||||
|
|
||||||
|
import { useMemeburnerStore } from "@/stores/memeburner";
|
||||||
|
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||||
|
|
||||||
const roundsStore = useRoundsStore();
|
const roundsStore = useRoundsStore();
|
||||||
|
|
||||||
const walletStore = useWalletStoreV2();
|
const walletStore = useWalletStoreV2();
|
||||||
|
const rewardLockerStore = useRewardLockerStore();
|
||||||
|
const memeBurnerStore = useMemeburnerStore();
|
||||||
|
|
||||||
const activeRound = ref(null);
|
const activeRound = ref(null);
|
||||||
const openCycleElement = ref(false);
|
const openCycleElement = ref(false);
|
||||||
@@ -189,13 +209,22 @@ function openRound(index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
// await memeBurnerStore.init();
|
||||||
|
// await rewardLockerStore.init();
|
||||||
|
|
||||||
console.log("loadRounds");
|
console.log("loadRounds");
|
||||||
|
if (!roundsStore.currentRound) {
|
||||||
|
console.log("test");
|
||||||
|
roundsStore.currentRound = parseInt(await memeBurnerStore.getCurrentRound());
|
||||||
|
console.log("roundsStore.currentRound", roundsStore.currentRound);
|
||||||
|
roundsStore.activeRound = roundsStore.currentRound;
|
||||||
|
}
|
||||||
await roundsStore.loadRewardsRounds();
|
await roundsStore.loadRewardsRounds();
|
||||||
console.log("roundsStore.rounds", roundsStore.rounds);
|
console.log("roundsStore.rounds", roundsStore.rounds);
|
||||||
});
|
});
|
||||||
|
|
||||||
const rounds = computed(() =>
|
const rounds = computed(() => {
|
||||||
roundsStore.rounds
|
var tetst = roundsStore.rounds
|
||||||
.filter((round) => {
|
.filter((round) => {
|
||||||
if (round.round) {
|
if (round.round) {
|
||||||
return true;
|
return true;
|
||||||
@@ -203,22 +232,29 @@ const rounds = computed(() =>
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.reverse()
|
.reverse();
|
||||||
);
|
return tetst;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="sass">
|
<style lang="sass">
|
||||||
|
.profile-page
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
|
gap: 24px
|
||||||
.profile-header
|
.profile-header
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
|
gap: 8px
|
||||||
|
.profile-headline
|
||||||
color: #FFF
|
color: #FFF
|
||||||
text-align: center
|
text-align: center
|
||||||
font-size: 32px
|
font-size: 32px
|
||||||
margin-bottom: 12px
|
|
||||||
.profile-subheader
|
.profile-subheader
|
||||||
display: flex
|
display: flex
|
||||||
justify-content: center
|
justify-content: center
|
||||||
gap: 12px
|
gap: 12px
|
||||||
align-items: center
|
align-items: center
|
||||||
margin-bottom: 24px
|
|
||||||
.profile-subheader-logo
|
.profile-subheader-logo
|
||||||
img
|
img
|
||||||
width: 21px
|
width: 21px
|
||||||
@@ -228,27 +264,33 @@ const rounds = computed(() =>
|
|||||||
font-size: 12px
|
font-size: 12px
|
||||||
.total-rewards-wrapper
|
.total-rewards-wrapper
|
||||||
border-radius: 16px
|
border-radius: 16px
|
||||||
background: #202020
|
background: var(--darkgrey, #202020)
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
|
gap: 24px
|
||||||
padding: 8px
|
padding: 8px
|
||||||
.total-rewards-headline
|
|
||||||
color: #FFF
|
|
||||||
text-align: center
|
|
||||||
font-size: 24px
|
|
||||||
margin-bottom: 24px
|
|
||||||
.total-rewards-inner
|
.total-rewards-inner
|
||||||
border-radius: 16px
|
border-radius: 16px
|
||||||
border: 2px solid var(--grey, #858585)
|
border: 2px solid var(--grey, #858585)
|
||||||
background: var(--dark-grey, #202020)
|
background: var(--darkgrey, #202020)
|
||||||
padding: 8px 12px
|
padding: 8px 12px
|
||||||
|
gap: 16px
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
.claim-wrapper
|
.claim-wrapper
|
||||||
.claim-inner
|
.claim-inner
|
||||||
flex-direction: column
|
display: flex
|
||||||
margin-bottom: 16px
|
flex-direction: row
|
||||||
.claim-header
|
.claim-header
|
||||||
color: var(--white, #F9F9FA)
|
color: var(--white, #F9F9FA)
|
||||||
font-size: 18px
|
font-size: 18px
|
||||||
text-align: center
|
text-align: center
|
||||||
margin-bottom: 16px
|
.claim-body
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
|
gap: 4px
|
||||||
|
.bloodline-token
|
||||||
|
margin-left: auto
|
||||||
.claim-hr
|
.claim-hr
|
||||||
background-color: #858585
|
background-color: #858585
|
||||||
margin: 16px 0
|
margin: 16px 0
|
||||||
@@ -261,6 +303,8 @@ const rounds = computed(() =>
|
|||||||
div
|
div
|
||||||
flex: 1 1 auto
|
flex: 1 1 auto
|
||||||
font-size: 18px
|
font-size: 18px
|
||||||
|
.profile-stake
|
||||||
|
padding: 0 8px
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -383,6 +427,10 @@ const rounds = computed(() =>
|
|||||||
.sacrifice-coin
|
.sacrifice-coin
|
||||||
td
|
td
|
||||||
text-align: right
|
text-align: right
|
||||||
|
img
|
||||||
|
height: 40px
|
||||||
|
width: 40px
|
||||||
|
border-radius: 50%
|
||||||
.arrow
|
.arrow
|
||||||
width: 14px
|
width: 14px
|
||||||
padding: 0 16px
|
padding: 0 16px
|
||||||
|
|||||||
Reference in New Issue
Block a user