Skip to content

Commit

Permalink
✨ Add: token owner before burn address (compound-finance#13)
Browse files Browse the repository at this point in the history
* ✨ Add: token burner address

* 🔨 PR Fix: rename prop of owner before burn
  • Loading branch information
jm42 authored Jun 29, 2022
1 parent e91b61e commit 5dec587
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ type Token @entity
transferCount: BigInt!
created: BigInt!
mintOrder: BigInt
# The last account to hold the token before being burned.
ownerBeforeBurn: Account
}

type Account @entity
Expand Down
3 changes: 3 additions & 0 deletions src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export function handleTransfer(ev: TransferEvent): void {
token.transferCount = BigInt.fromI32(0);
token.created = ev.block.timestamp
}
if (to.id == ZERO_ADDRESS) {
token.ownerBeforeBurn = from.id;
}
token.owner = to.id;
token.transferCount += BigInt.fromI32(1);
token.save();
Expand Down

0 comments on commit 5dec587

Please sign in to comment.