update contracts+ desktop version
This commit is contained in:
+16
-8
@@ -66,14 +66,22 @@ export const useRoundsStore = defineStore("rounds", {
|
||||
// this.rounds[index].rewards_total = element.result;
|
||||
}
|
||||
},
|
||||
async updateCurrentRound(sacrificedToken) {
|
||||
async updateCurrentRound(sacrificedToken) {
|
||||
console.log("updateCurrentRound");
|
||||
const tokenStore = useTokenStore();
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
var data = await memeBurnerStore.getSacrificedRound(this.currentRound);
|
||||
var tokenIndex = this.rounds[this.currentRound].token.findIndex(
|
||||
(tokenData) => tokenData.contractAddress === sacrificedToken
|
||||
);
|
||||
this.rounds[this.currentRound].token[tokenIndex].amount = data[tokenIndex].result[1];
|
||||
);
|
||||
const token = tokenStore.getToken(sacrificedToken);
|
||||
// console.log(
|
||||
// "this.rounds[this.currentRound].token[tokenIndex].amount",
|
||||
// this.rounds[this.currentRound].token[tokenIndex].amount
|
||||
// );
|
||||
// console.log("Number(data[tokenIndex].result[1] / BigInt(Math.pow(10, token.decimals))", Number(data[tokenIndex].result[1] / BigInt(Math.pow(10, token.decimals))));
|
||||
this.rounds[this.currentRound].token[tokenIndex].amount =
|
||||
Number(data[tokenIndex].result[1] / BigInt(Math.pow(10, token.decimals)))
|
||||
},
|
||||
async fillRound(roundNumber) {
|
||||
console.log("fillRound");
|
||||
@@ -117,10 +125,10 @@ export const useRoundsStore = defineStore("rounds", {
|
||||
tokenData.vampname = token.vamp.name;
|
||||
// tokenData.amount = data[index].result[1];
|
||||
tokenData.amount = Number(data[index].result[1]) / Math.pow(10, token.decimals);
|
||||
tokenData.getAmountToReachGoal =
|
||||
Number(await memeBurnerStore.getAmountToReachGoal(token.contractAddress)) /
|
||||
Math.pow(10, token.decimals);
|
||||
if (this.currentRound !== roundNumber && walletStore.connected) {
|
||||
// tokenData.getAmountToReachGoal =
|
||||
// Number(await memeBurnerStore.getAmountToReachGoal(token.contractAddress)) /
|
||||
// Math.pow(10, token.decimals);
|
||||
if (this.currentRound !== roundNumber && walletStore.connected) {
|
||||
console.log("index", index);
|
||||
console.log("rewardData[index]", rewardData[index]);
|
||||
const stakeReward = Number(rewardData[index].result[0]);
|
||||
@@ -145,7 +153,7 @@ export const useRoundsStore = defineStore("rounds", {
|
||||
tokenArray.push(tokenData);
|
||||
}
|
||||
console.log("clanwin123", rewards_clan);
|
||||
const goalInBLD = await memeBurnerStore.getGoalInBLD(roundNumber);
|
||||
const goalInBLD = await memeBurnerStore.getGoalInBLOOD(roundNumber);
|
||||
this.rounds[roundNumber] = {
|
||||
goal: Number(goal[0]) / Math.pow(10, tokenStore.memeToken.decimals),
|
||||
goalInBLD: Number(goalInBLD / BigInt(Math.pow(10, tokenStore.memeToken.decimals))),
|
||||
|
||||
Reference in New Issue
Block a user