From 59e6935b4d3fc5fa3c6b02f7029bc9603949f3b3 Mon Sep 17 00:00:00 2001 From: trizin <25263018+trizin@users.noreply.github.com> Date: Thu, 4 May 2023 13:59:21 +0300 Subject: [PATCH] Use event.params.ts --- src/mappings/veDelegation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mappings/veDelegation.ts b/src/mappings/veDelegation.ts index 80ab777..a551ddc 100644 --- a/src/mappings/veDelegation.ts +++ b/src/mappings/veDelegation.ts @@ -20,7 +20,7 @@ export function handleDelegation(event: DelegateBoost): void { getveOCEAN(_receiver) const delegator = getveOCEAN(_delegator) const veDelegation = getveDelegation(event.address, _tokenId.toHex()) - + const ts = event.params.ts const MAX_TIME = 4 * 365 * 86400 // max lock time veDelegation.delegator = _delegator @@ -31,7 +31,7 @@ export function handleDelegation(event: DelegateBoost): void { BigInt.fromI32(18).toI32() ) veDelegation.lockedAmount = delegator.lockedAmount - veDelegation.timeLeft = Datetime.now() - delegator.unlockTime + veDelegation.timeLeft = ts - delegator.unlockTime veDelegation.cancelTime = _cancelTime veDelegation.expireTime = _expireTime veDelegation.save()