images + update wagmi
This commit is contained in:
+18
-17
@@ -22,13 +22,13 @@ export const useRoundsStore = defineStore("rounds", {
|
||||
async init() {
|
||||
//fill initial round
|
||||
},
|
||||
async updateCurrentRound(sacrificedToken, sacrificedAmount) {
|
||||
async updateCurrentRound(sacrificedToken) {
|
||||
const tokenStore = useTokenStore();
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
var data = await memeBurnerStore.getSacrificedRound(this.currentRound)
|
||||
var data = await memeBurnerStore.getSacrificedRound(this.currentRound);
|
||||
console.log("data123", data);
|
||||
var tokenIndex = this.rounds[this.currentRound].token.findIndex((tokenData) => tokenData.contractAddress === sacrificedToken);
|
||||
this.rounds[this.currentRound].token[tokenIndex].amount = data[tokenIndex][1];
|
||||
this.rounds[this.currentRound].token[tokenIndex].amount = data[tokenIndex].result[1];
|
||||
|
||||
},
|
||||
async fillRound() {
|
||||
@@ -46,7 +46,7 @@ export const useRoundsStore = defineStore("rounds", {
|
||||
console.log("vor error");
|
||||
var data = await memeBurnerStore.getSacrificedRound(this.activeRound)
|
||||
let rewardData = null;
|
||||
if (await walletStore.isConnected()) {
|
||||
if (walletStore.connected) {
|
||||
rewardData = await rewardLockerStore.getRewardsForAllToken(this.activeRound);
|
||||
}
|
||||
console.log("rewardData123", rewardData);
|
||||
@@ -54,8 +54,8 @@ export const useRoundsStore = defineStore("rounds", {
|
||||
var goal = await memeBurnerStore.getGoal(this.activeRound);
|
||||
console.log("goal", goal);
|
||||
var tokenArray = []
|
||||
var rewards_clan = BigInt(0);
|
||||
var rewards_sacrifice = BigInt(0);
|
||||
var rewards_clan = 0
|
||||
var rewards_sacrifice = 0
|
||||
for (let index = 0; index < data.length; index++) {
|
||||
var tokenData = {};
|
||||
const token = tokenStore.token[index];
|
||||
@@ -70,15 +70,16 @@ export const useRoundsStore = defineStore("rounds", {
|
||||
tokenData.amount = data[index].result[1];
|
||||
tokenData.getAmountToReachGoal= await memeBurnerStore.getAmountToReachGoal(token.contractAddress);
|
||||
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];
|
||||
tokenData.rewards_clan = clanwin;
|
||||
tokenData.rewards_sacrifice = sacrificeRewards;
|
||||
rewards_clan = rewards_clan + BigInt(clanwin / BigInt(Math.pow(10, token.decimals)));
|
||||
const clanwin = (Number(testcoef) / 10000 - 1) * Number(rewardData[index].result);
|
||||
const sacrificeRewards = Number(rewardData[index].result) - clanwin;
|
||||
|
||||
tokenData.rewards_ges = BigInt(rewardData[index].result);
|
||||
tokenData.rewards_clan = BigInt(clanwin);
|
||||
tokenData.rewards_sacrifice = BigInt(sacrificeRewards);
|
||||
|
||||
rewards_clan = rewards_clan + (clanwin / Math.pow(10, token.decimals));
|
||||
rewards_sacrifice =
|
||||
rewards_sacrifice + BigInt(sacrificeRewards / BigInt(Math.pow(10, token.decimals)));
|
||||
rewards_sacrifice + sacrificeRewards / Math.pow(10, token.decimals);
|
||||
}
|
||||
tokenArray.push(tokenData);
|
||||
}
|
||||
@@ -87,9 +88,9 @@ export const useRoundsStore = defineStore("rounds", {
|
||||
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_clan: BigInt(rewards_clan),
|
||||
rewards_sacrifice: BigInt(rewards_sacrifice),
|
||||
rewards_total: BigInt(rewards_clan + rewards_sacrifice),
|
||||
token: tokenArray,
|
||||
};
|
||||
console.log("this.rounds[this.activeRound]", this.rounds[this.activeRound]);
|
||||
|
||||
Reference in New Issue
Block a user