-
Notifications
You must be signed in to change notification settings - Fork 593
feat(token): emit Transfer event on public transfer #20198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
feat(token): emit Transfer event on public transfer #20198
Conversation
621d961 to
7886138
Compare
7886138 to
ea64007
Compare
| const events = await getDecodedPublicEvents<Transfer>( | ||
| t.node, | ||
| TokenContract.events.Transfer, | ||
| receipt.blockNumber!, | ||
| 1, | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, i wasn't aware of getDecodedPublicEvents method, isn't filtering by block number and limit quite fragile? at least on production seems like it would be inconvenient, why not use txHash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My motivating use case was around being able to scan blocks for these events, so I didn't want to assume I had access to the TxHash.
You're definitely right though that this would be fragile as written in prod, since the contents of the blocks would be subject to reorg until proven, so the polling code would need to be aware of that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding feature request related to this: #20332
ea64007 to
4264ed4
Compare
Compile (Noir contracts)TypeScript validationAction required: Please fix the docs examples or update them to match the current API. cc @AztecProtocol/devrel |
f7c5510 to
700c04b
Compare
Also accounts for private transfers (burn, mint, transfer_to_private, transfer_to_public). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
700c04b to
1a30c49
Compare
Summary
self.emit(Transfer { from, to, amount })to all balance changesCloses F-296