toast rework + fix bugs
This commit is contained in:
@@ -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;
|
||||
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user