fix issues e + new contracts
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"contractName": "Bloodline",
|
"contractName": "Bloodline",
|
||||||
"contractAddress": "0x51bF3df58D123e8EA43fb2189f18027FD36a08Af",
|
"contractAddress": "0xfB97A4a863d75F72E6d3DCef4a47413E811c9D2E",
|
||||||
"abi": [
|
"abi": [
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"contractName": "LiquidityOwner",
|
"contractName": "LiquidityOwner",
|
||||||
"contractAddress": "0xF8bc4Ce13263DD4e12070e3192be50310eF7C95a",
|
"contractAddress": "0x0f18b2D23278E1f1d92cc2cE10a75604bDBE9Ad1",
|
||||||
"abi": [
|
"abi": [
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
@@ -132,6 +132,35 @@
|
|||||||
"stateMutability": "pure",
|
"stateMutability": "pure",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tick",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickLower",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickUpper",
|
||||||
|
"type": "int24"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "_liquidityCanBeProvided",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "bool",
|
||||||
|
"name": "",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
@@ -169,6 +198,54 @@
|
|||||||
"stateMutability": "view",
|
"stateMutability": "view",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickCycle",
|
||||||
|
"type": "int24"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "calculateTicksForRange1",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickLower",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickUpper",
|
||||||
|
"type": "int24"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "pure",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickCycle",
|
||||||
|
"type": "int24"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "calculateTicksForRange2",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickLower",
|
||||||
|
"type": "int24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "tickUpper",
|
||||||
|
"type": "int24"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "pure",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
@@ -211,6 +288,25 @@
|
|||||||
"stateMutability": "view",
|
"stateMutability": "view",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint256",
|
||||||
|
"name": "",
|
||||||
|
"type": "uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "cycleTicks",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "int24",
|
||||||
|
"name": "",
|
||||||
|
"type": "int24"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"inputs": [],
|
"inputs": [],
|
||||||
"name": "memeAltar",
|
"name": "memeAltar",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"contractName": "MemeAltar",
|
"contractName": "MemeAltar",
|
||||||
"contractAddress": "0xE4F42F3f8B0E57b1054D457fe3b49a1A10B1aCEa",
|
"contractAddress": "0x5368264F18DD0e09ea074a79F3F8B504e2363d84",
|
||||||
"abi": [
|
"abi": [
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
@@ -53,6 +53,11 @@
|
|||||||
"name": "CycleCompletedRegistrationFailed",
|
"name": "CycleCompletedRegistrationFailed",
|
||||||
"type": "error"
|
"type": "error"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "GoalCannotBeZero",
|
||||||
|
"type": "error"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"inputs": [],
|
"inputs": [],
|
||||||
"name": "InsufficientOutputAmount",
|
"name": "InsufficientOutputAmount",
|
||||||
@@ -215,42 +220,16 @@
|
|||||||
"anonymous": false,
|
"anonymous": false,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
"components": [
|
"indexed": true,
|
||||||
{
|
"internalType": "uint64",
|
||||||
"internalType": "uint40",
|
"name": "b",
|
||||||
"name": "b1",
|
"type": "uint64"
|
||||||
"type": "uint40"
|
},
|
||||||
},
|
{
|
||||||
{
|
"indexed": true,
|
||||||
"internalType": "uint40",
|
"internalType": "uint64",
|
||||||
"name": "m1",
|
"name": "m",
|
||||||
"type": "uint40"
|
"type": "uint64"
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint40",
|
|
||||||
"name": "b2",
|
|
||||||
"type": "uint40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint40",
|
|
||||||
"name": "m2",
|
|
||||||
"type": "uint40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint40",
|
|
||||||
"name": "b3",
|
|
||||||
"type": "uint40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint40",
|
|
||||||
"name": "m4",
|
|
||||||
"type": "uint40"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"indexed": false,
|
|
||||||
"internalType": "struct MemeAltar.BM",
|
|
||||||
"name": "_bm",
|
|
||||||
"type": "tuple"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "NewBM",
|
"name": "NewBM",
|
||||||
@@ -309,41 +288,14 @@
|
|||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
"components": [
|
"internalType": "uint64",
|
||||||
{
|
"name": "newB",
|
||||||
"internalType": "uint40",
|
"type": "uint64"
|
||||||
"name": "b1",
|
},
|
||||||
"type": "uint40"
|
{
|
||||||
},
|
"internalType": "uint64",
|
||||||
{
|
"name": "newM",
|
||||||
"internalType": "uint40",
|
"type": "uint64"
|
||||||
"name": "m1",
|
|
||||||
"type": "uint40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint40",
|
|
||||||
"name": "b2",
|
|
||||||
"type": "uint40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint40",
|
|
||||||
"name": "m2",
|
|
||||||
"type": "uint40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint40",
|
|
||||||
"name": "b3",
|
|
||||||
"type": "uint40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint40",
|
|
||||||
"name": "m4",
|
|
||||||
"type": "uint40"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"internalType": "struct MemeAltar.BM",
|
|
||||||
"name": "newBM",
|
|
||||||
"type": "tuple"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "adjustBM",
|
"name": "adjustBM",
|
||||||
@@ -410,12 +362,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [],
|
"inputs": [],
|
||||||
"name": "bloodline",
|
"name": "b",
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"internalType": "contract Bloodline",
|
"internalType": "uint64",
|
||||||
"name": "",
|
"name": "",
|
||||||
"type": "address"
|
"type": "uint64"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"stateMutability": "view",
|
"stateMutability": "view",
|
||||||
@@ -423,37 +375,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [],
|
"inputs": [],
|
||||||
"name": "bm",
|
"name": "bloodline",
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"internalType": "uint40",
|
"internalType": "contract Bloodline",
|
||||||
"name": "b1",
|
"name": "",
|
||||||
"type": "uint40"
|
"type": "address"
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint40",
|
|
||||||
"name": "m1",
|
|
||||||
"type": "uint40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint40",
|
|
||||||
"name": "b2",
|
|
||||||
"type": "uint40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint40",
|
|
||||||
"name": "m2",
|
|
||||||
"type": "uint40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint40",
|
|
||||||
"name": "b3",
|
|
||||||
"type": "uint40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint40",
|
|
||||||
"name": "m4",
|
|
||||||
"type": "uint40"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"stateMutability": "view",
|
"stateMutability": "view",
|
||||||
@@ -662,9 +589,9 @@
|
|||||||
"name": "issuancePrice",
|
"name": "issuancePrice",
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"internalType": "uint256",
|
"internalType": "uint128",
|
||||||
"name": "",
|
"name": "",
|
||||||
"type": "uint256"
|
"type": "uint128"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"stateMutability": "view",
|
"stateMutability": "view",
|
||||||
@@ -683,6 +610,19 @@
|
|||||||
"stateMutability": "view",
|
"stateMutability": "view",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "m",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"internalType": "uint64",
|
||||||
|
"name": "",
|
||||||
|
"type": "uint64"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"contractName": "RewardLocker",
|
"contractName": "RewardLocker",
|
||||||
"contractAddress": "0x2952253374973DE0ffbFe35269Ca13FaF28B935F",
|
"contractAddress": "0x3342B37A0c06FEf2c3dD9481e31CCCF970e7235B",
|
||||||
"abi": [
|
"abi": [
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -59,7 +59,7 @@
|
|||||||
<template v-slot:message-end v-if="activeWalletToken?.balanceOf >= 0">
|
<template v-slot:message-end v-if="activeWalletToken?.balanceOf >= 0">
|
||||||
<div class="input-balance tiny-text">
|
<div class="input-balance tiny-text">
|
||||||
Balance:
|
Balance:
|
||||||
{{ BigInt(activeWalletToken?.balanceOf) / 10n ** activeToken.decimals }}
|
{{ formatBigIntDivision(activeWalletToken?.balanceOf, 10n ** activeToken.decimals) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="input-max tiny-text" @click="addMaxTokens">Max</div>
|
<div class="input-max tiny-text" @click="addMaxTokens">Max</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -77,7 +77,10 @@
|
|||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div class="sacrifice-to-body">
|
<div class="sacrifice-to-body">
|
||||||
<token-name-price name="$BLOOD" :price="`≈${output}`"></token-name-price>
|
<token-name-price
|
||||||
|
name="$BLOOD"
|
||||||
|
:price="`≈${formatBigIntDivision(output, 10n ** activeToken.decimals)}`"
|
||||||
|
></token-name-price>
|
||||||
<token-logo :img="activeToken.vamp.logo" :size="64" :alt="activeToken.vamp.name"></token-logo>
|
<token-logo :img="activeToken.vamp.logo" :size="64" :alt="activeToken.vamp.name"></token-logo>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -97,7 +100,9 @@
|
|||||||
>
|
>
|
||||||
No Staking Bonus
|
No Staking Bonus
|
||||||
</div>
|
</div>
|
||||||
<div class="mid-mid-text" v-else>+ {{ stakingOutput }} Staking Bonus</div>
|
<div class="mid-mid-text" v-else>
|
||||||
|
+ {{ formatBigIntDivision(stakingOutput, 10n ** activeToken.decimals) }} Staking Bonus
|
||||||
|
</div>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<font-awesome-icon icon="chevron-down" />
|
<font-awesome-icon icon="chevron-down" />
|
||||||
</div>
|
</div>
|
||||||
@@ -181,7 +186,7 @@ const cycleStore = useCycleStore();
|
|||||||
const sacrificeStore = useSacrificeStore();
|
const sacrificeStore = useSacrificeStore();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
|
|
||||||
import { debounce } from "@/helper/helper.js";
|
import { debounce, formatBigIntDivision } from "@/helper/helper.js";
|
||||||
|
|
||||||
const isMobile = inject("isMobile");
|
const isMobile = inject("isMobile");
|
||||||
const showPanel = inject("showPanel");
|
const showPanel = inject("showPanel");
|
||||||
@@ -346,6 +351,7 @@ function showSplash() {
|
|||||||
|
|
||||||
//call function in the store and remove icon,
|
//call function in the store and remove icon,
|
||||||
async function sacrificeToken() {
|
async function sacrificeToken() {
|
||||||
|
console.log("activeToken.value", activeToken.value);
|
||||||
var result = await sacrificeStore.sacrificeToken(sacrificeStore.sacrificeNumber, activeToken.value);
|
var result = await sacrificeStore.sacrificeToken(sacrificeStore.sacrificeNumber, activeToken.value);
|
||||||
if (result) {
|
if (result) {
|
||||||
showSplash();
|
showSplash();
|
||||||
@@ -482,6 +488,7 @@ async function changeActiveToken(token) {
|
|||||||
.value-adder
|
.value-adder
|
||||||
display: flex
|
display: flex
|
||||||
gap: 6px
|
gap: 6px
|
||||||
|
flex-wrap: wrap
|
||||||
.sacrifice-adder-step
|
.sacrifice-adder-step
|
||||||
font-size: 12px
|
font-size: 12px
|
||||||
align-items: center
|
align-items: center
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
v-model="tokenNumber"
|
v-model="tokenNumber"
|
||||||
@close="stakeMenu = false"
|
@close="stakeMenu = false"
|
||||||
:stake="stake"
|
:stake="stake"
|
||||||
:amount="balanceOf"
|
:amount="walletStore.balanceOf"
|
||||||
v-if="stakeMenu & !unstakeMenu"
|
v-if="stakeMenu & !unstakeMenu"
|
||||||
>
|
>
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
@@ -109,7 +109,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:message-end>
|
<template v-slot:message-end>
|
||||||
<div class="input-balance">Balance: {{ balanceOf }}</div>
|
<div class="input-balance">
|
||||||
|
Balance:
|
||||||
|
{{ formatBigIntDivision(walletStore.balanceOf, 10n ** tokenStore.memeToken.decimals) }}
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</stake-menu>
|
</stake-menu>
|
||||||
<div class="unstake-menu" v-else-if="stakeMenu & unstakeMenu">
|
<div class="unstake-menu" v-else-if="stakeMenu & unstakeMenu">
|
||||||
@@ -144,9 +147,7 @@
|
|||||||
v-if="walletStore.orderedUnstakedAmount > 0n && !ableToUnstake"
|
v-if="walletStore.orderedUnstakedAmount > 0n && !ableToUnstake"
|
||||||
>
|
>
|
||||||
You can claim
|
You can claim
|
||||||
{{
|
{{ formatBigIntDivision(walletStore.orderedUnstakedAmount, 10n ** tokenStore.memeToken.decimals) }}
|
||||||
formatBigIntDivision(walletStore.orderedUnstakedAmount, 10n ** tokenStore.memeToken.decimals)
|
|
||||||
}}
|
|
||||||
$BLOOD next cycle.
|
$BLOOD next cycle.
|
||||||
</div>
|
</div>
|
||||||
</slot>
|
</slot>
|
||||||
@@ -320,14 +321,6 @@ const ableToUnstake = computed(() => {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
const balanceOf = computed(() => {
|
|
||||||
if (!walletStore.memeToken?.balanceOf) {
|
|
||||||
return 0n;
|
|
||||||
} else {
|
|
||||||
return formatBigIntDivision(walletStore.memeToken?.balanceOf, 10n ** tokenStore.memeToken.decimals);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const stateStake = computed(() => {
|
const stateStake = computed(() => {
|
||||||
let returnState = 0;
|
let returnState = 0;
|
||||||
if (state.value === 2) {
|
if (state.value === 2) {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import { useWalletStoreV2 } from "@/stores/walletV2";
|
|||||||
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||||
import { useTokenStore } from "@/stores/tokens";
|
import { useTokenStore } from "@/stores/tokens";
|
||||||
import { createPermitObject, getSignatureRSV } from "@/helper/blockchain.js";
|
import { createPermitObject, getSignatureRSV } from "@/helper/blockchain.js";
|
||||||
|
import { formatBigIntDivision } from "@/helper/helper.js";
|
||||||
|
|
||||||
import { signTypedData } from "@wagmi/core";
|
import { signTypedData } from "@wagmi/core";
|
||||||
|
|
||||||
@@ -54,19 +55,19 @@ const emit = defineEmits(["close", "update:modelValue"]);
|
|||||||
async function addTokensPercent(value) {
|
async function addTokensPercent(value) {
|
||||||
console.log("value", value);
|
console.log("value", value);
|
||||||
console.log("props.amount", props.amount);
|
console.log("props.amount", props.amount);
|
||||||
console.log("props.amount * 100)", props.amount * 1000);
|
|
||||||
let amount;
|
let amount;
|
||||||
if (props.amount !== undefined || props.amount !== null) {
|
if (props.amount !== undefined || props.amount !== null) {
|
||||||
console.log("props.amount", props.amount);
|
//todo function to calculate correct bigInt value (maybe use string and split)
|
||||||
console.log("value", value);
|
amount = (BigInt(props.amount) * value) / 100n;
|
||||||
amount = (BigInt(props.amount * 1000) * value) / 100000n;
|
|
||||||
} else if (props.stake) {
|
} else if (props.stake) {
|
||||||
amount = (walletStore.memeToken.balanceOf * value) / 100n;
|
amount = (walletStore.memeToken.balanceOf * value) / 100n;
|
||||||
} else {
|
} else {
|
||||||
amount = (walletStore.memeToken.staked * value) / 100n;
|
amount = (walletStore.memeToken.staked * value) / 100n;
|
||||||
}
|
}
|
||||||
|
console.log("amount123", amount);
|
||||||
|
amount = amount / 10n ** tokenStore.memeToken.decimals;
|
||||||
console.log("amount", amount);
|
console.log("amount", amount);
|
||||||
emit("update:modelValue", Number(amount));
|
emit("update:modelValue", amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function unstakeBloodline() {
|
async function unstakeBloodline() {
|
||||||
|
|||||||
+14
-14
@@ -35,21 +35,21 @@ export const useCycleStore = defineStore("cycles", {
|
|||||||
if (!this.cycles[this.activeCycle]?.rewards_sacrifice) {
|
if (!this.cycles[this.activeCycle]?.rewards_sacrifice) {
|
||||||
return 0n;
|
return 0n;
|
||||||
}
|
}
|
||||||
return this.cycles[this.activeCycle]?.rewards_sacrifice
|
return this.cycles[this.activeCycle]?.rewards_sacrifice;
|
||||||
},
|
},
|
||||||
rewardsSacrificeCurrentCycle() {
|
rewardsSacrificeCurrentCycle() {
|
||||||
const tokenStore = useTokenStore();
|
const tokenStore = useTokenStore();
|
||||||
if (!this.cycles[this.currentCycle]?.rewards_sacrifice) {
|
if (!this.cycles[this.currentCycle]?.rewards_sacrifice) {
|
||||||
return 0n;
|
return 0n;
|
||||||
}
|
}
|
||||||
return this.cycles[this.currentCycle]?.rewards_sacrifice
|
return this.cycles[this.currentCycle]?.rewards_sacrifice;
|
||||||
},
|
},
|
||||||
rewardsStaking() {
|
rewardsStaking() {
|
||||||
const tokenStore = useTokenStore();
|
const tokenStore = useTokenStore();
|
||||||
if (!this.cycles[this.activeCycle]?.rewards_staking) {
|
if (!this.cycles[this.activeCycle]?.rewards_staking) {
|
||||||
return 0n;
|
return 0n;
|
||||||
}
|
}
|
||||||
return this.cycles[this.activeCycle]?.rewards_staking
|
return this.cycles[this.activeCycle]?.rewards_staking;
|
||||||
|
|
||||||
},
|
},
|
||||||
rewardsClan() {
|
rewardsClan() {
|
||||||
@@ -57,14 +57,14 @@ export const useCycleStore = defineStore("cycles", {
|
|||||||
if (!this.cycles[this.activeCycle]?.rewards_clan) {
|
if (!this.cycles[this.activeCycle]?.rewards_clan) {
|
||||||
return 0n;
|
return 0n;
|
||||||
}
|
}
|
||||||
return this.cycles[this.activeCycle]?.rewards_clan, 10n ** tokenStore.memeToken.decimals
|
return this.cycles[this.activeCycle]?.rewards_clan;
|
||||||
},
|
},
|
||||||
rewardsTotal() {
|
rewardsTotal() {
|
||||||
const tokenStore = useTokenStore();
|
const tokenStore = useTokenStore();
|
||||||
if (!this.cycles[this.activeCycle]?.rewards_total) {
|
if (!this.cycles[this.activeCycle]?.rewards_total) {
|
||||||
return 0n;
|
return 0n;
|
||||||
}
|
}
|
||||||
return this.cycles[this.activeCycle]?.rewards_total
|
return this.cycles[this.activeCycle]?.rewards_total;
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -99,18 +99,18 @@ export const useCycleStore = defineStore("cycles", {
|
|||||||
//todo check if needed, or use fillcycle
|
//todo check if needed, or use fillcycle
|
||||||
async updateCurrentCycle(sacrificedToken) {
|
async updateCurrentCycle(sacrificedToken) {
|
||||||
console.log("updateCurrentCycle");
|
console.log("updateCurrentCycle");
|
||||||
const memeBurnerStore = useMemeburnerStore();
|
const memeBurnerStore = useMemeburnerStore();
|
||||||
const rewardLockerStore = useRewardLockerStore();
|
const rewardLockerStore = useRewardLockerStore();
|
||||||
var data = await memeBurnerStore.getSacrificedCycle(this.currentCycle);
|
var data = await memeBurnerStore.getSacrificedCycle(this.currentCycle);
|
||||||
var tokenTotalSacrificed = await rewardLockerStore.getTotalSacrificeRewardsForAllToken(this.currentCycle);
|
var tokenTotalSacrificed = await rewardLockerStore.getTotalSacrificeRewardsForAllToken(this.currentCycle);
|
||||||
console.log("this.currentCycle", this.currentCycle);
|
console.log("this.currentCycle", this.currentCycle);
|
||||||
console.log("this.cycles", this.cycles);
|
console.log("this.cycles", this.cycles);
|
||||||
if (this.cycles[this.currentCycle]) {
|
if (this.cycles[this.currentCycle]) {
|
||||||
var tokenIndex = this.cycles[this.currentCycle].token.findIndex(
|
var tokenIndex = this.cycles[this.currentCycle].token.findIndex(
|
||||||
(tokenData) => tokenData.contractAddress === sacrificedToken
|
(tokenData) => tokenData.contractAddress === sacrificedToken
|
||||||
);
|
);
|
||||||
this.cycles[this.currentCycle].token[tokenIndex].amount = data[tokenIndex].result[1];
|
this.cycles[this.currentCycle].token[tokenIndex].amount = data[tokenIndex].result[1];
|
||||||
this.cycles[this.currentCycle].token[tokenIndex].amountInBLD = tokenTotalSacrificed[tokenIndex].result;
|
this.cycles[this.currentCycle].token[tokenIndex].amountInBLD = tokenTotalSacrificed[tokenIndex].result;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -170,7 +170,7 @@ export const useCycleStore = defineStore("cycles", {
|
|||||||
const sacrificeClanReward = rewardData[index].result[1];
|
const sacrificeClanReward = rewardData[index].result[1];
|
||||||
let clanwin = 0n;
|
let clanwin = 0n;
|
||||||
if (cycleNumber !== this.currentCycle) {
|
if (cycleNumber !== this.currentCycle) {
|
||||||
clanwin = (sacrificeClanReward * coefficent) / 10000n - sacrificeClanReward;
|
clanwin = (sacrificeClanReward * coefficent) / 10000n - sacrificeClanReward;
|
||||||
console.log("clanwin", clanwin);
|
console.log("clanwin", clanwin);
|
||||||
}
|
}
|
||||||
const sacrificeRewards = sacrificeClanReward;
|
const sacrificeRewards = sacrificeClanReward;
|
||||||
@@ -222,8 +222,8 @@ export const useCycleStore = defineStore("cycles", {
|
|||||||
const lastCompletedCycle = await rewardLockerStore.lastCompletedCycle();
|
const lastCompletedCycle = await rewardLockerStore.lastCompletedCycle();
|
||||||
for (let index = 1; index <= Number(lastCompletedCycle); index++) {
|
for (let index = 1; index <= Number(lastCompletedCycle); index++) {
|
||||||
array.push(index);
|
array.push(index);
|
||||||
}
|
}
|
||||||
console.log("array123", array);
|
console.log("array123", array);
|
||||||
return array;
|
return array;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -97,11 +97,10 @@ export const useMemeburnerStore = defineStore("memeburner", {
|
|||||||
async sacrificeMemeAndBuyBLOOD(amount, minBLOOD) {
|
async sacrificeMemeAndBuyBLOOD(amount, minBLOOD) {
|
||||||
const tokenStore = useTokenStore();
|
const tokenStore = useTokenStore();
|
||||||
|
|
||||||
const amountDecimal = BigInt(amount) * 10n ** BigInt(tokenStore.activeToken.decimals);
|
|
||||||
var hash = await this.contract.write.sacrificeMemeAndBuyBLOOD([
|
var hash = await this.contract.write.sacrificeMemeAndBuyBLOOD([
|
||||||
tokenStore.activeToken.contractAddress,
|
tokenStore.activeToken.contractAddress,
|
||||||
amountDecimal.toString(),
|
amount,
|
||||||
minBLOOD.toString()
|
minBLOOD,
|
||||||
]);
|
]);
|
||||||
return hash;
|
return hash;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -29,9 +29,7 @@ export const useSacrificeStore = defineStore("sacrifice", {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
this.sacrificeState = 2;
|
this.sacrificeState = 2;
|
||||||
console.log("hier");
|
|
||||||
const getRewards = await this.getRewardsFor(amount, token);
|
const getRewards = await this.getRewardsFor(amount, token);
|
||||||
console.log("hier1");
|
|
||||||
console.log("getRewards", getRewards);
|
console.log("getRewards", getRewards);
|
||||||
let hash = null;
|
let hash = null;
|
||||||
if (getRewards.variant === "sacrifice") {
|
if (getRewards.variant === "sacrifice") {
|
||||||
@@ -198,11 +196,10 @@ export const useSacrificeStore = defineStore("sacrifice", {
|
|||||||
token.contractAddress,
|
token.contractAddress,
|
||||||
output
|
output
|
||||||
);
|
);
|
||||||
stakingRewardsNumber = stakingReward / 10n ** token.decimals
|
stakingRewardsNumber = stakingReward
|
||||||
}
|
}
|
||||||
const outputNumber = output / 10n ** BigInt(token.decimals);
|
|
||||||
return {
|
return {
|
||||||
output: outputNumber,
|
output: output,
|
||||||
variant: variant,
|
variant: variant,
|
||||||
minETH: minETH,
|
minETH: minETH,
|
||||||
minBLOOD: minBLOOD,
|
minBLOOD: minBLOOD,
|
||||||
|
|||||||
+17
-11
@@ -2,7 +2,7 @@ import { defineStore } from "pinia";
|
|||||||
import { markRaw } from "vue";
|
import { markRaw } from "vue";
|
||||||
import { useTokenStore } from "./tokens";
|
import { useTokenStore } from "./tokens";
|
||||||
import { useRewardLockerStore } from "./rewardlocker";
|
import { useRewardLockerStore } from "./rewardlocker";
|
||||||
import {formatBigIntDivision } from "@/helper/helper.js"
|
import { formatBigIntDivision } from "@/helper/helper.js";
|
||||||
import {
|
import {
|
||||||
createConfig,
|
createConfig,
|
||||||
configureChains,
|
configureChains,
|
||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
getWalletClient,
|
getWalletClient,
|
||||||
fetchBalance,
|
fetchBalance,
|
||||||
multicall,
|
multicall,
|
||||||
getNetwork,
|
getNetwork,
|
||||||
} from "@wagmi/core";
|
} from "@wagmi/core";
|
||||||
|
|
||||||
import { WalletConnectConnector } from "@wagmi/core/connectors/walletConnect";
|
import { WalletConnectConnector } from "@wagmi/core/connectors/walletConnect";
|
||||||
@@ -26,7 +26,6 @@ import { goerli, mainnet } from "@wagmi/core/chains";
|
|||||||
import { publicProvider } from "@wagmi/core/providers/public";
|
import { publicProvider } from "@wagmi/core/providers/public";
|
||||||
import { alchemyProvider } from "@wagmi/core/providers/alchemy";
|
import { alchemyProvider } from "@wagmi/core/providers/alchemy";
|
||||||
|
|
||||||
|
|
||||||
export const useWalletStoreV2 = defineStore("walletV2", {
|
export const useWalletStoreV2 = defineStore("walletV2", {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
alchemy: null,
|
alchemy: null,
|
||||||
@@ -59,18 +58,25 @@ export const useWalletStoreV2 = defineStore("walletV2", {
|
|||||||
}
|
}
|
||||||
return this.memeToken.unclaimedRewards;
|
return this.memeToken.unclaimedRewards;
|
||||||
},
|
},
|
||||||
orderedUnstakedAmount() {
|
orderedUnstakedAmount() {
|
||||||
if (!this.memeToken?.orderedUnstakedAmount) {
|
if (!this.memeToken?.orderedUnstakedAmount) {
|
||||||
return 0n
|
return 0n;
|
||||||
}
|
}
|
||||||
return this.memeToken?.orderedUnstakedAmount;
|
return this.memeToken?.orderedUnstakedAmount;
|
||||||
},
|
},
|
||||||
staked() {
|
staked() {
|
||||||
if (!this.memeToken?.staked) {
|
if (!this.memeToken?.staked) {
|
||||||
return 0n;
|
return 0n;
|
||||||
}
|
}
|
||||||
return this.memeToken?.staked;
|
return this.memeToken?.staked;
|
||||||
}
|
},
|
||||||
|
balanceOf() {
|
||||||
|
if (!this.memeToken?.balanceOf) {
|
||||||
|
return 0n;
|
||||||
|
} else {
|
||||||
|
return this.memeToken?.balanceOf;
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
async init() {
|
async init() {
|
||||||
|
|||||||
Reference in New Issue
Block a user