contracts update

This commit is contained in:
Michel Fromme
2023-07-27 15:34:07 +02:00
parent 5157308745
commit 650df134d2
12 changed files with 14369 additions and 16715 deletions
+12 -10
View File
@@ -3,6 +3,7 @@ import { useMemeburnerStore } from "./memeburner";
import { useTokenStore } from "./tokens";
import { useRewardLockerStore } from "./rewardlocker";
import { useWalletStore } from "./wallet";
import { useWalletStoreV2 } from "./walletV2";
export const useRoundsStore = defineStore("rounds", {
@@ -34,7 +35,7 @@ export const useRoundsStore = defineStore("rounds", {
console.log("fillRound");
const memeBurnerStore = useMemeburnerStore();
const tokenStore = useTokenStore();
const walletStore = useWalletStore();
const walletStore = useWalletStoreV2();
const rewardLockerStore = useRewardLockerStore();
// if (this.activeRound === this.currentRound) {
@@ -51,7 +52,7 @@ export const useRoundsStore = defineStore("rounds", {
console.log("rewardData123", rewardData);
var goal = await memeBurnerStore.getGoal(this.activeRound);
console.log("goal", goal);
var tokenArray = []
var rewards_clan = BigInt(0);
var rewards_sacrifice = BigInt(0);
@@ -66,9 +67,10 @@ export const useRoundsStore = defineStore("rounds", {
tokenData.contractAddress = token.contractAddress;
tokenData.vamplogo = token.vamp.logo;
tokenData.vampname = token.vamp.name;
tokenData.amount = data[index][1];
tokenData.amount = data[index].result[1];
tokenData.getAmountToReachGoal= await memeBurnerStore.getAmountToReachGoal(token.contractAddress);
if (this.currentRound !== this.activeRound && await walletStore.isConnected()) {
if (this.currentRound !== this.activeRound && walletStore.connected) {
console.log("rewarddata", rewardData);
const clanwin = BigInt((testcoef / 10000 - 1) * rewardData[index]);
const sacrificeRewards = BigInt(rewardData[index]) - clanwin;
tokenData.rewards_ges = rewardData[index];
@@ -80,17 +82,17 @@ export const useRoundsStore = defineStore("rounds", {
}
tokenArray.push(tokenData);
}
const goalInBLD = await memeBurnerStore.getGoalInBLD(this.activeRound);
this.rounds[this.activeRound] = {
goal: goal.goal,
goalInBLD: goalInBLD /Math.pow(10, tokenStore.memeToken.decimals),
expirationTimestamp: goal.expirationTimestamp,
goal: goal[0],
goalInBLD: goalInBLD / BigInt(Math.pow(10, tokenStore.memeToken.decimals)),
expirationTimestamp: goal[1],
rewards_clan: rewards_clan,
rewards_sacrifice: rewards_sacrifice,
rewards_total: rewards_clan + rewards_sacrifice,
rewards_sacrifice: rewards_sacrifice,
rewards_total: rewards_clan + rewards_sacrifice,
token: tokenArray,
};
console.log("this.rounds[this.activeRound]", this.rounds[this.activeRound]);
} else {
console.log("round already filled");
}