From a8d06379d60a88c3d29a96ae280b7ccd4f728455 Mon Sep 17 00:00:00 2001 From: Evgeny Gusarov Date: Thu, 19 Dec 2024 00:11:16 +0300 Subject: [PATCH] Fix claimed amount --- src/mappings/merkleDistributor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mappings/merkleDistributor.ts b/src/mappings/merkleDistributor.ts index ad21986..754124e 100644 --- a/src/mappings/merkleDistributor.ts +++ b/src/mappings/merkleDistributor.ts @@ -279,7 +279,7 @@ export function handleRewardsRootUpdated(event: RewardsRootUpdated): void { export function handleRewardsClaimed(event: RewardsClaimed): void { const user = event.params.account const tokens = event.params.tokens - const amounts = event.params.cumulativeAmounts + const cumulativeAmounts = event.params.cumulativeAmounts for (let i = 0; i < tokens.length; i++) { const claimedAmountId = `${tokens[i].toHex()}-${user.toHex()}` let claimedAmount = DistributorClaimedAmount.load(claimedAmountId) @@ -287,7 +287,7 @@ export function handleRewardsClaimed(event: RewardsClaimed): void { claimedAmount = new DistributorClaimedAmount(claimedAmountId) claimedAmount.cumulativeClaimedAmount = BigInt.zero() } - claimedAmount.cumulativeClaimedAmount = claimedAmount.cumulativeClaimedAmount.plus(amounts[i]) + claimedAmount.cumulativeClaimedAmount = cumulativeAmounts[i] claimedAmount.save() } store.remove('DistributorClaim', user.toHex())