Skip to content

Commit

Permalink
chore: fix claim time
Browse files Browse the repository at this point in the history
  • Loading branch information
cinnabarhorse committed Dec 1, 2024
1 parent 38da38e commit 962f86c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/mappings/polter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1963,8 +1963,17 @@ export function handleTransfer(event: Transfer): void {
if (gotchi) {
gotchi = updateAavegotchiInfo(gotchi, event.params._tokenId, event);
gotchi = updateAavegotchiWearables(gotchi, event);
gotchi.claimedAt = event.block.number;
gotchi.claimedTime = event.block.timestamp;

let claimTime = contract.try_aavegotchiClaimTime(
BigInt.fromString(tokenId)
);

if (!claimTime.reverted) {
gotchi.claimedTime = claimTime.value;
//we do not have access to the block number here, so we use the claimed time
gotchi.claimedAt = claimTime.value;
}

gotchi.gotchiId = event.params._tokenId;

gotchi.save();
Expand Down

0 comments on commit 962f86c

Please sign in to comment.