toast rework + fix bugs

This commit is contained in:
EmberSpirit
2023-10-04 17:20:21 +02:00
parent 3d53d9e7c8
commit 64d46693ea
24 changed files with 713 additions and 1464 deletions
+8 -11
View File
@@ -123,14 +123,10 @@ export const useRewardLockerStore = defineStore("rewardlocker", {
});
const { r, s, v } = getSignatureRSV(signature);
console.log("value, deadline, v, r, s", value, deadline, v, r, s);
const hash = await this.contract.write.stakeToBeSecured([value, deadline, v, r, s]);
console.log("hash", hash);
const data = await waitForTransaction({
hash: hash,
});
console.log("data", data);
return hash;
},
async stakeAndClaimRound(stakeCoefficient, round) {
// stakeCoefficient 25% = 2500, 50% = 5000
@@ -151,10 +147,11 @@ export const useRewardLockerStore = defineStore("rewardlocker", {
const rounds = await roundsStore.getFinshedRoundNumbers();
const addresses = tokenStore.sacrificeToken.map((obj) => obj.contractAddress);
console.log({ stakeCoefficient, rounds, addresses });
const hash = await this.contract.write.stakeAndClaim([stakeCoefficient, rounds, addresses]);
// todo reload roundData and wallet data
const walletStore = useWalletStoreV2();
await walletStore.loadWalletData();
console.log("stakeCoefficient", stakeCoefficient);
var stakeCoefficientInt = Math.round(stakeCoefficient);
const hash = await this.contract.write.stakeAndClaim([stakeCoefficientInt, rounds, addresses]);
return hash;
},
},
});