update loading cycle + potential staking rewards
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ import { useCycleStore } from "@/stores/cycles";
|
||||
import SlideoutPanel from "./components/SlideoutPanel.vue";
|
||||
import ConnectWallet from "./components/ConnectWallet.vue";
|
||||
|
||||
import { getNetwork } from "@wagmi/core";
|
||||
import { getNetwork, fetchTransaction } from "@wagmi/core";
|
||||
|
||||
const isMobile = ref(false);
|
||||
const showPanel = ref(false);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
]"
|
||||
v-for="token in props.data"
|
||||
:key="token.contractAddress"
|
||||
@click="tokenStore.changeActiveToken(token)"
|
||||
@click="changeActiveToken(token)"
|
||||
>
|
||||
<div class="sacrifice-token-logo">
|
||||
<img v-if="isMobile" :src="token.logoMobile" alt="token logo" />
|
||||
@@ -90,7 +90,7 @@
|
||||
>
|
||||
No Staking Bonus
|
||||
</div>
|
||||
<div class="mid-mid-text" v-else>+ TODO Staking Bonus</div>
|
||||
<div class="mid-mid-text" v-else>+ {{ stakingOutput }} Staking Bonus</div>
|
||||
<div class="icon">
|
||||
<font-awesome-icon icon="chevron-down" />
|
||||
</div>
|
||||
@@ -189,6 +189,7 @@ const props = defineProps({
|
||||
});
|
||||
|
||||
const output = ref(0);
|
||||
const stakingOutput = ref(null);
|
||||
const blockEvent = ref(null);
|
||||
const approveToast = ref(null);
|
||||
/**
|
||||
@@ -231,8 +232,9 @@ const stateComputed = computed(() => {
|
||||
return returnState;
|
||||
});
|
||||
const processChange = debounce(async (value) => {
|
||||
const returnValue = await sacrificeStore.getRewardsFor(value, activeToken.value);
|
||||
output.value = returnValue.output;
|
||||
const rewardValue = await sacrificeStore.getRewardsFor(value, activeToken.value);
|
||||
output.value = rewardValue.output;
|
||||
stakingOutput.value = rewardValue.staking;
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
@@ -244,6 +246,7 @@ onMounted(() => {
|
||||
console.log("blockNumber", blockNumber);
|
||||
var rewardValue = await sacrificeStore.getRewardsFor(sacrificeStore.sacrificeNumber, activeToken.value);
|
||||
output.value = rewardValue.output;
|
||||
stakingOutput.value = rewardValue.staking;
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -275,12 +278,16 @@ async function approveToken(amount) {
|
||||
|
||||
async function addTokens(value) {
|
||||
sacrificeStore.sacrificeNumber = Number(sacrificeStore.sacrificeNumber) + Number(value);
|
||||
output.value = await sacrificeStore.getRewardsFor(sacrificeStore.sacrificeNumber, activeToken.value).output;
|
||||
const rewardValue = await sacrificeStore.getRewardsFor(sacrificeStore.sacrificeNumber, activeToken.value);
|
||||
output.value = rewardValue.output;
|
||||
stakingOutput.value = rewardValue.staking;
|
||||
}
|
||||
|
||||
async function addMaxTokens() {
|
||||
sacrificeStore.sacrificeNumber = activeWalletToken.value.balanceOf;
|
||||
output.value = await sacrificeStore.getRewardsFor(sacrificeStore.sacrificeNumber, activeToken.value).output;
|
||||
const rewardValue = await sacrificeStore.getRewardsFor(sacrificeStore.sacrificeNumber, activeToken.value);
|
||||
output.value = rewardValue.output;
|
||||
stakingOutput.value = rewardValue.staking;
|
||||
}
|
||||
|
||||
function showApprovedToast(value, header, subheader, info) {
|
||||
@@ -310,11 +317,26 @@ function showApprovedToast(value, header, subheader, info) {
|
||||
toastClassName: "approve-toast toast-card",
|
||||
});
|
||||
}
|
||||
|
||||
//call function in the store and remove icon,
|
||||
async function sacrificeToken() {
|
||||
await sacrificeStore.sacrificeToken(sacrificeStore.sacrificeNumber, activeToken.value);
|
||||
toast.dismiss(approveToast.value);
|
||||
}
|
||||
|
||||
async function changeActiveToken(token) {
|
||||
console.log("changeActiveToken");
|
||||
tokenStore.activeToken = token;
|
||||
if (walletStore.connected) {
|
||||
//TODO, wenn connected, dann all diese Daten laden?
|
||||
tokenStore.activeToken.balance = await walletStore.getTokenBalance(token);
|
||||
tokenStore.activeToken.allowance = Number(await tokenStore.allowance());
|
||||
}
|
||||
var rewards = await sacrificeStore.getRewardsFor(sacrificeStore.sacrificeNumber, token);
|
||||
console.log("rewards", rewards);
|
||||
output.value = rewards.output;
|
||||
stakingOutput.value = rewards.staking;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
|
||||
@@ -77,8 +77,6 @@
|
||||
v-if="stakeMenu"
|
||||
>
|
||||
<template v-slot:body>
|
||||
{{ stateStakeClaimComp }}
|
||||
{{ stateStakeClaim }}
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateStakeClaimComp === 0">
|
||||
Enter Amount
|
||||
</div>
|
||||
@@ -150,11 +148,7 @@ async function stakeAndClaim() {
|
||||
console.log(tokenNumber.value);
|
||||
console.log(getCurrentCycleData.value.rewards_total);
|
||||
const coefficient = (10000 * tokenNumber.value) / getCurrentCycleData.value.rewards_total;
|
||||
console.log("hier");
|
||||
stateStakeClaim.value = 2;
|
||||
console.log("hier2");
|
||||
console.log("coefficient", coefficient);
|
||||
console.log("cycleStore.activeCycle", cycleStore.activeCycle);
|
||||
var hash = await rewardLockerStore.stakeAndClaimCycle(coefficient, cycleStore.activeCycle);
|
||||
console.log("hash");
|
||||
stateStakeClaim.value = 3;
|
||||
@@ -169,15 +163,26 @@ async function stakeAndClaim() {
|
||||
(topic) => topic === "0xd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba3"
|
||||
);
|
||||
});
|
||||
|
||||
var stakeData = data.logs.find((logObject) => {
|
||||
return logObject.topics.find(
|
||||
(topic) => topic === "0xf496bf2b14b1d178412b6f7a745900105b49b38b315cfdfbfabad31a6f995c6f"
|
||||
);
|
||||
});
|
||||
//
|
||||
console.log("rewardData", rewardData);
|
||||
const outputClaim = Number(rewardData?.topics[2]) / Math.pow(10, tokenStore.memeToken.decimals);
|
||||
const outputStaked = Number(stakeData?.topics[3]) / Math.pow(10, tokenStore.memeToken.decimals);
|
||||
showSuccessToast(
|
||||
formatNumber(outputClaim),
|
||||
formatNumber(outputClaim + outputStaked),
|
||||
"Success!",
|
||||
"You just claimed and staked",
|
||||
"Join the next cycle to increase your rewards and win with your clan."
|
||||
);
|
||||
tokenNumber.value = 0;
|
||||
stakeMenu.value = false;
|
||||
await cycleStore.fillCycle(activeCycle.value, true);
|
||||
await walletStore.loadWalletData();
|
||||
} catch (error) {
|
||||
console.error("stakeAndClaim", error);
|
||||
} finally {
|
||||
@@ -242,8 +247,8 @@ const stateClaimedComp = computed(() => {
|
||||
});
|
||||
|
||||
const stateStakeClaimComp = computed(() => {
|
||||
console.log("stateStakeClaimComp");
|
||||
let returnState = 0;
|
||||
console.log("tokenNumber.value", tokenNumber.value);
|
||||
if (
|
||||
tokenNumber.value === null ||
|
||||
tokenNumber.value === "" ||
|
||||
|
||||
@@ -64,10 +64,13 @@ export const useCycleStore = defineStore("cycles", {
|
||||
console.log("updateCurrentCycle");
|
||||
const tokenStore = useTokenStore();
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
var data = await memeBurnerStore.getSacrificedCycle(this.currentCycle);
|
||||
var data = await memeBurnerStore.getSacrificedCycle(this.currentCycle);
|
||||
console.log("this.currentCycle", this.currentCycle);
|
||||
console.log("this.cycles", this.cycles);
|
||||
var tokenIndex = this.cycles[this.currentCycle]?.token.findIndex(
|
||||
(tokenData) => tokenData.contractAddress === sacrificedToken
|
||||
);
|
||||
console.log("tokenIndex", tokenIndex);
|
||||
const token = tokenStore.getToken(sacrificedToken);
|
||||
this.cycles[this.currentCycle].token[tokenIndex].amount =
|
||||
Number(data[tokenIndex].result[1]) / Math.pow(10, token.decimals)
|
||||
|
||||
+59
-53
@@ -30,13 +30,12 @@ export const useRewardLockerStore = defineStore("rewardlocker", {
|
||||
* @param {*} tokenAddress
|
||||
* @returns Rewards for specific token and specific cycle
|
||||
*/
|
||||
async getRewards(walletAddress, cycleNumber, tokenAddress) {
|
||||
try {
|
||||
return await this.contract.read.rewards([walletAddress, cycleNumber, tokenAddress]);
|
||||
} catch (error) {
|
||||
async getRewards(walletAddress, cycleNumber, tokenAddress) {
|
||||
try {
|
||||
return await this.contract.read.rewards([walletAddress, cycleNumber, tokenAddress]);
|
||||
} catch (error) {
|
||||
console.error("getRewards", error);
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
async getRewardsForAllToken(cycleNumber) {
|
||||
console.log("getRewardsForAllToken");
|
||||
@@ -56,39 +55,47 @@ export const useRewardLockerStore = defineStore("rewardlocker", {
|
||||
contracts,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
async getTotalSacrificeRewardsForAllToken(cycleNumber) {
|
||||
try {
|
||||
const tokenStore = useTokenStore();
|
||||
const contracts = [];
|
||||
for (let index = 0; index < tokenStore.sacrificeToken.length; index++) {
|
||||
const token = tokenStore.sacrificeToken[index];
|
||||
// calls.push(this.contract.methods.rewards(walletStore.address, cycleNumber, token.contractAddress));
|
||||
contracts.push({
|
||||
...this.contract,
|
||||
functionName: "getTotalSacrificeRewardsForToken",
|
||||
args: [cycleNumber, token.contractAddress],
|
||||
},
|
||||
async getTotalSacrificeRewardsForAllToken(cycleNumber) {
|
||||
try {
|
||||
const tokenStore = useTokenStore();
|
||||
const contracts = [];
|
||||
for (let index = 0; index < tokenStore.sacrificeToken.length; index++) {
|
||||
const token = tokenStore.sacrificeToken[index];
|
||||
contracts.push({
|
||||
...this.contract,
|
||||
functionName: "getTotalSacrificeRewardsForToken",
|
||||
args: [cycleNumber, token.contractAddress],
|
||||
});
|
||||
}
|
||||
const data = await multicall({
|
||||
contracts,
|
||||
});
|
||||
}
|
||||
const data = await multicall({
|
||||
contracts,
|
||||
});
|
||||
// const multicallStore = useMultiCallStore();
|
||||
return data;
|
||||
|
||||
} catch (error) {
|
||||
throw new Error(error)
|
||||
}
|
||||
},
|
||||
async getSacrificedTokenCoefficient(cycleNumber, sacrificedToken) {
|
||||
// const multicallStore = useMultiCallStore();
|
||||
return data;
|
||||
} catch (error) {
|
||||
throw new Error(error);
|
||||
}
|
||||
},
|
||||
async getSacrificedTokenCoefficient(cycleNumber, sacrificedToken) {
|
||||
return await this.contract.read.getSacrificedTokenCoefficient([cycleNumber, sacrificedToken]);
|
||||
},
|
||||
async getStakeRewardForSacrificeReward(sacrificedToken, reward) {
|
||||
const walletStore = useWalletStoreV2();
|
||||
const cycleStore = useCycleStore();
|
||||
return await this.contract.read.getStakeRewardForSacrificeReward([
|
||||
walletStore.address,
|
||||
sacrificedToken,
|
||||
reward,
|
||||
]);
|
||||
|
||||
},
|
||||
async lastCompletedCycle() {
|
||||
return await this.contract.read.lastCompletedCycle();
|
||||
return await this.contract.read.lastCompletedCycle();
|
||||
},
|
||||
async claim(cycle) {
|
||||
console.log("claim");
|
||||
return await this.contract.write.claim([cycle]);
|
||||
console.log("claim");
|
||||
return await this.contract.write.claim([cycle]);
|
||||
},
|
||||
async claimAll() {
|
||||
console.log("claimAll");
|
||||
@@ -100,21 +107,21 @@ export const useRewardLockerStore = defineStore("rewardlocker", {
|
||||
return await this.contract.write.claim([cycles]);
|
||||
},
|
||||
async getTotalRewardsOf(address, cycles) {
|
||||
return await this.contract.read.getTotalRewardsOf([address, cycles]);
|
||||
return await this.contract.read.getTotalRewardsOf([address, cycles]);
|
||||
},
|
||||
async getTotalRewards(address) {
|
||||
const cycleStore = useCycleStore();
|
||||
const cycles = await cycleStore.getFinshedCycleNumbers();
|
||||
return await this.contract.read.getTotalRewardsOf([address, cycles]);
|
||||
const cycleStore = useCycleStore();
|
||||
const cycles = await cycleStore.getFinshedCycleNumbers();
|
||||
return await this.contract.read.getTotalRewardsOf([address, cycles]);
|
||||
},
|
||||
async getStaked(address) {
|
||||
return await this.contract.read.staked([address]);
|
||||
return await this.contract.read.staked([address]);
|
||||
},
|
||||
async orderUnstake() {
|
||||
return await this.contract.write.orderUnstake();
|
||||
return await this.contract.write.orderUnstake();
|
||||
},
|
||||
async unstake(unstakeCycle) {
|
||||
return await this.contract.write.unstake([unstakeCycle]);
|
||||
async unstake(unstakeCycle) {
|
||||
return await this.contract.write.unstake([unstakeCycle]);
|
||||
},
|
||||
async stakeBloodline(tokenNumber) {
|
||||
console.log("tokenNumber", tokenNumber);
|
||||
@@ -125,7 +132,7 @@ export const useRewardLockerStore = defineStore("rewardlocker", {
|
||||
const spender = this.config.contractAddress;
|
||||
const deadline = Date.now() + 20 * 60;
|
||||
const decimals = tokenStore.getToken(walletStore.memeToken.contractAddress).decimals;
|
||||
const value = BigInt(tokenNumber * Math.pow(10, decimals))
|
||||
const value = BigInt(tokenNumber * Math.pow(10, decimals));
|
||||
const nonce = await tokenStore.memeToken.contract.read.nonces([fromAddress]);
|
||||
console.log("nonce", nonce);
|
||||
const { types, message, domain, primaryType } = createPermitObject(
|
||||
@@ -144,10 +151,9 @@ export const useRewardLockerStore = defineStore("rewardlocker", {
|
||||
});
|
||||
|
||||
const { r, s, v } = getSignatureRSV(signature);
|
||||
console.log("value, deadline, v, r, s", value, deadline, v, r, s);
|
||||
console.log("value, deadline, v, r, s", value, deadline, v, r, s);
|
||||
const hash = await this.contract.write.stakeToBeSecured([value, deadline, v, r, s]);
|
||||
return hash;
|
||||
|
||||
return hash;
|
||||
},
|
||||
async stakeAndClaimCycle(stakeCoefficient, cycle) {
|
||||
// stakeCoefficient 25% = 2500, 50% = 5000
|
||||
@@ -156,18 +162,18 @@ export const useRewardLockerStore = defineStore("rewardlocker", {
|
||||
const hash = await this.contract.write.stakeAndClaim([stakeCoefficient, [cycle], addresses]);
|
||||
const data = await waitForTransaction({
|
||||
hash: hash,
|
||||
});
|
||||
return hash;
|
||||
});
|
||||
return hash;
|
||||
},
|
||||
async stakeAndClaimAllCycles(stakeCoefficient) {
|
||||
console.log("stakeAndClaimAllCycles");
|
||||
async stakeAndClaimAllCycles(stakeCoefficient) {
|
||||
console.log("stakeAndClaimAllCycles");
|
||||
const tokenStore = useTokenStore();
|
||||
const cycleStore = useCycleStore();
|
||||
const cycles = await cycleStore.getFinshedCycleNumbers();
|
||||
const addresses = tokenStore.sacrificeToken.map((obj) => obj.contractAddress);
|
||||
var stakeCoefficientInt = Math.round(stakeCoefficient);
|
||||
const hash = await this.contract.write.stakeAndClaim([stakeCoefficientInt, cycles, addresses]);
|
||||
return hash;
|
||||
const addresses = tokenStore.sacrificeToken.map((obj) => obj.contractAddress);
|
||||
var stakeCoefficientInt = Math.round(stakeCoefficient);
|
||||
const hash = await this.contract.write.stakeAndClaim([stakeCoefficientInt, cycles, addresses]);
|
||||
return hash;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
+32
-9
@@ -3,6 +3,8 @@ import { useMemeburnerStore } from "@/stores/memeburner";
|
||||
import { useUniswapStore } from "@/stores/uniswap";
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import { useCycleStore } from "@/stores/cycles";
|
||||
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||
|
||||
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import { waitForTransaction, readContract, watchBlockNumber, multicall } from "@wagmi/core";
|
||||
@@ -46,12 +48,23 @@ export const useSacrificeStore = defineStore("sacrifice", {
|
||||
});
|
||||
console.log("data", data);
|
||||
|
||||
var rewardData = data.logs.find((logObject) => {
|
||||
return logObject.topics.find(
|
||||
// var rewardData = data.logs.find((logObject) => {
|
||||
// return logObject.topics.find(
|
||||
// (topic) => topic === "0x5e60ccd3c81486143d815dce24867a494d7fee585a0a44282cf479b19a5186ee"
|
||||
// );
|
||||
// });
|
||||
|
||||
var rewardData = data.logs.filter((logObject) => {
|
||||
return logObject.topics.filter(
|
||||
(topic) => topic === "0x5e60ccd3c81486143d815dce24867a494d7fee585a0a44282cf479b19a5186ee"
|
||||
);
|
||||
});
|
||||
const outputSacrifice = Number(rewardData.data) / Math.pow(10, token.decimals);
|
||||
console.log("rewardData", rewardData);
|
||||
const outputSacrifice = rewardData.reduce((x, y) => {
|
||||
return x + Number(y.data) / Math.pow(10, token.decimals);
|
||||
}, 0);
|
||||
console.log("outputSacrifice", outputSacrifice);
|
||||
// const outputSacrifice = Number(rewardData.data) / Math.pow(10, token.decimals);
|
||||
token.allowance = await tokenStore.allowance();
|
||||
this.sacrificeState = 4;
|
||||
showSuccessToast(
|
||||
@@ -74,7 +87,9 @@ export const useSacrificeStore = defineStore("sacrifice", {
|
||||
console.log("getRewardsFor", {value, token});
|
||||
const memeburnerStore = useMemeburnerStore();
|
||||
const uniswapStore = useUniswapStore();
|
||||
const walletStore = useWalletStoreV2();
|
||||
const walletStore = useWalletStoreV2();
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
|
||||
|
||||
let output = 0;
|
||||
try {
|
||||
@@ -83,12 +98,11 @@ export const useSacrificeStore = defineStore("sacrifice", {
|
||||
return output;
|
||||
}
|
||||
const rewardsForResult = await memeburnerStore.getRewardFor(
|
||||
BigInt(value * Math.pow(10, token.decimals))
|
||||
);
|
||||
BigInt(value * Math.pow(10, token.decimals))
|
||||
);
|
||||
const rewardsForResultNumber = rewardsForResult.reduce((x, y) => {
|
||||
return x + Number(y) / Math.pow(10, token.decimals);
|
||||
}, 0);
|
||||
|
||||
var quoteRewards = await uniswapStore.quoteExactInputSingle(value * Math.pow(10, token.decimals));
|
||||
let variant = "sacrifice";
|
||||
if (quoteRewards.result) {
|
||||
@@ -162,8 +176,17 @@ export const useSacrificeStore = defineStore("sacrifice", {
|
||||
output = amountSacrificeNumber;
|
||||
console.log("use sacrifice after comparison sacrificeMemeAndBuyBLOOD and sacrificeMeme");
|
||||
}
|
||||
}
|
||||
return { output: output, variant: variant };
|
||||
}
|
||||
//potential staking rewards
|
||||
let stakingRewardsNumber = 0;
|
||||
if (output > 0) {
|
||||
const stakingReward = await rewardLockerStore.getStakeRewardForSacrificeReward(
|
||||
token.contractAddress,
|
||||
output * Math.pow(10, token.decimals)
|
||||
);
|
||||
stakingRewardsNumber = (Number(stakingReward) / Math.pow(10, token.decimals)).toFixed(2);
|
||||
}
|
||||
return { output: output, variant: variant, staking: stakingRewardsNumber };
|
||||
} catch (error) {
|
||||
console.error("getRewardsFor", error);
|
||||
}
|
||||
|
||||
@@ -134,16 +134,6 @@ export const useTokenStore = defineStore("token", {
|
||||
console.error("initV2", error);
|
||||
}
|
||||
},
|
||||
async changeActiveToken(token) {
|
||||
console.log("changeActiveToken");
|
||||
this.activeToken = token;
|
||||
const walletStore = useWalletStoreV2();
|
||||
if (walletStore.connected) {
|
||||
//TODO, wenn connected, dann all diese Daten laden?
|
||||
this.activeToken.balance = await walletStore.getTokenBalance(token);
|
||||
this.activeToken.allowance = Number(await this.allowance());
|
||||
}
|
||||
},
|
||||
async allowance() {
|
||||
console.log("allowance");
|
||||
const walletStore = useWalletStoreV2();
|
||||
|
||||
@@ -119,10 +119,10 @@ export const useWalletStoreV2 = defineStore("walletV2", {
|
||||
//MemeToken Staked
|
||||
const tokenStore = useTokenStore();
|
||||
const staked = await rewardlockerStore.getStaked(this.address);
|
||||
this.memeToken.staked = Number(staked / BigInt(Math.pow(10, tokenStore.memeToken.decimals)));
|
||||
this.memeToken.staked = Number(staked) / Math.pow(10, tokenStore.memeToken.decimals);
|
||||
const unclaimedRewardsArray = await rewardlockerStore.getTotalRewards(this.address);
|
||||
const unclaimedRewards = unclaimedRewardsArray[0] + unclaimedRewardsArray[1];
|
||||
this.memeToken.unclaimedRewards = Number(unclaimedRewards/ BigInt(Math.pow(10, tokenStore.memeToken.decimals)))
|
||||
this.memeToken.unclaimedRewards = Number(unclaimedRewards) / Math.pow(10, tokenStore.memeToken.decimals)
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
+29
-17
@@ -22,16 +22,18 @@
|
||||
<div class="cycle card card--glow container container--variant1 bloodline-wrapper">
|
||||
<div
|
||||
class="bloodline-border round-finish-info low-mid-text"
|
||||
v-if="difference > 0 && cycleStore.currentCycle === cycleStore.activeCycle"
|
||||
:class="{ loading: difference <= 0 }"
|
||||
v-if="cycleStore.currentCycle === cycleStore.activeCycle"
|
||||
>
|
||||
<!-- <div class="round-finish-info-element low-mid-text"> -->
|
||||
<div class="round-finish-info-key">Sacrifice Goal:</div>
|
||||
<div class="round-finish-info-value">{{ cycleStore.getCurrentCycleData?.goalInBLD }} $BDL</div>
|
||||
<!-- </div> -->
|
||||
<!-- <div class="round-finish-info-element low-mid-text"> -->
|
||||
<div class="round-finish-info-key">Time left:</div>
|
||||
<div class="round-finish-info-value">{{ days }} {{ hours }} {{ minutes }}</div>
|
||||
<!-- </div> -->
|
||||
<template v-if="difference > 0">
|
||||
<div class="round-finish-info-key">Sacrifice Goal:</div>
|
||||
<div class="round-finish-info-value">{{ cycleStore.getCurrentCycleData?.goalInBLD }} $BDL</div>
|
||||
<div class="round-finish-info-key">Time left:</div>
|
||||
<div class="round-finish-info-value">{{ days }} {{ hours }} {{ minutes }}</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<loading-component></loading-component>
|
||||
</template>
|
||||
</div>
|
||||
<template v-if="cycleStore.currentCycle !== cycleStore.activeCycle">
|
||||
<div class="bloodline-border bloodline-border purple cycle-winner" v-if="cycleStore.getCycleWinner">
|
||||
@@ -47,15 +49,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="bloodline-border bloodline-border__thin grey cycle-winner" v-else>
|
||||
<!-- <loading-component></loading-component> -->
|
||||
<div class="cycle-winner-left">
|
||||
<div class="cycle-winner-headline">No Clan Winner</div>
|
||||
<div class="cycle-winner-subheadline">time limit has been reached</div>
|
||||
</div>
|
||||
<div class="cycle-winner-right">
|
||||
<div class="cycle-winner-logo inactive">
|
||||
<img src="/assets/img/token/bloodline.png" alt="" />
|
||||
<template v-if="cycleStore.getCycleWinner">
|
||||
<div class="cycle-winner-left">
|
||||
<div class="cycle-winner-headline">No Clan Winner</div>
|
||||
<div class="cycle-winner-subheadline">time limit has been reached</div>
|
||||
</div>
|
||||
<div class="cycle-winner-right">
|
||||
<div class="cycle-winner-logo inactive">
|
||||
<img src="/assets/img/token/bloodline.png" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="cycle-winner-loading" v-else>
|
||||
<loading-component></loading-component>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -83,6 +89,7 @@ import { inject, ref, onMounted, onBeforeUnmount } from "vue";
|
||||
import BloodChart from "@/components/BloodChart.vue";
|
||||
import TokenClaim from "@/components/TokenClaim.vue";
|
||||
import { useMemeburnerStore } from "@/stores/memeburner";
|
||||
import LoadingComponent from "@/components/LoadingComponent.vue";
|
||||
|
||||
import { useCycleStore } from "@/stores/cycles";
|
||||
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||
@@ -278,6 +285,8 @@ function timeBetweenDates(expirationTimestamp) {
|
||||
opacity: 0.3
|
||||
.cycle-winner-name
|
||||
font-size: 16px
|
||||
.cycle-winner-loading
|
||||
width: 100%
|
||||
|
||||
|
||||
.bloodline-clan
|
||||
@@ -291,6 +300,9 @@ function timeBetweenDates(expirationTimestamp) {
|
||||
display: grid
|
||||
grid-template-columns: 1fr 1fr
|
||||
text-align: right
|
||||
&.loading
|
||||
grid-template-columns: 1fr
|
||||
|
||||
.round-finish-info-key
|
||||
text-align: right
|
||||
.round-finish-info-value
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<div>
|
||||
<button @click="mintToken">mint</button>
|
||||
<button @click="mintToken2">mint2</button>
|
||||
<button @click="mintToken3">mint3</button>
|
||||
<button @click="sacrificeMeme">sacrifice Meme</button>
|
||||
<button @click="approveMeme1">approve Meme1</button>
|
||||
<button @click="tokenStore.approveToken(MemeBurnerJson, 10)">wallet approve</button>
|
||||
@@ -163,6 +164,19 @@ async function mintToken2() {
|
||||
// var totalSupply = await contract.methods.totalSupply().call();
|
||||
// console.log("totalSupply", totalSupply);
|
||||
}
|
||||
async function mintToken3() {
|
||||
try {
|
||||
var mint = await tokenStore.token[2].contract.write.mint(["100000000000000000000000"]);
|
||||
// .send({ from: web3.value.eth.Contract.defaultAccount });
|
||||
console.log("mint", mint);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
// var balanceOf = await contract.methods.balanceOf("0x66422602B2f4885c57EE794174f98d9E4DDBBBC6").call();
|
||||
// console.log("balanceOf", balanceOf);
|
||||
// var totalSupply = await contract.methods.totalSupply().call();
|
||||
// console.log("totalSupply", totalSupply);
|
||||
}
|
||||
|
||||
async function fetchBalance() {
|
||||
var result = await walletV2Store.fetchBalance();
|
||||
|
||||
Reference in New Issue
Block a user