feat(tempo): add TIP-1004 token permit/read actions#4638
Open
odupontt wants to merge 1 commit into
Open
Conversation
|
@odupontt is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR solving?
This PR adds missing
viem/tempotoken actions for TIP-1004 functions that already exist in thetip20ABI (from #4442):permit,nonces,DOMAIN_SEPARATOR, andoptedInSupply.Without these actions, users need to call
readContract/writeContractmanually.This change adds first-class action support and wires it into the Tempo decorator:
token.permittoken.permitSynctoken.getNoncetoken.getDomainSeparatortoken.getOptedInSupplyIt also includes JSDoc examples and action tests for the new behavior.
What alternatives have you explored?
permitSync.I chose full action coverage to match existing
tokenaction patterns and keep API ergonomics consistent.Are there any parts that require more attention from reviewers?
Please double-check:
permit.callargument ordering:[owner, spender, value, deadline, v, r, s]permitSynclog parsing viaApprovalevent extractiongetNonceaccount resolution (parameters.account ?? client.account) and missing-account behaviorTests
Added tests in
src/tempo/actions/token.test.tsfor:permitend-to-end flow (signature, allowance update, nonce increment)getDomainSeparatorgetNonce(default + explicit account)getOptedInSupply