Skip to content

feat(tempo): add TIP-1004 token permit/read actions#4638

Open
odupontt wants to merge 1 commit into
wevm:mainfrom
odupontt:tempo-token-tip1004-permit-actions
Open

feat(tempo): add TIP-1004 token permit/read actions#4638
odupontt wants to merge 1 commit into
wevm:mainfrom
odupontt:tempo-token-tip1004-permit-actions

Conversation

@odupontt
Copy link
Copy Markdown

What is this PR solving?

This PR adds missing viem/tempo token actions for TIP-1004 functions that already exist in the tip20 ABI (from #4442): permit, nonces, DOMAIN_SEPARATOR, and optedInSupply.

Without these actions, users need to call readContract/writeContract manually.
This change adds first-class action support and wires it into the Tempo decorator:

  • token.permit
  • token.permitSync
  • token.getNonce
  • token.getDomainSeparator
  • token.getOptedInSupply

It also includes JSDoc examples and action tests for the new behavior.

What alternatives have you explored?

  • Keep ABI-only support and rely on manual contract calls in userland.
  • Add read actions only and skip permitSync.

I chose full action coverage to match existing token action patterns and keep API ergonomics consistent.

Are there any parts that require more attention from reviewers?

Please double-check:

  • permit.call argument ordering: [owner, spender, value, deadline, v, r, s]
  • permitSync log parsing via Approval event extraction
  • getNonce account resolution (parameters.account ?? client.account) and missing-account behavior

Tests

Added tests in src/tempo/actions/token.test.ts for:

  • permit end-to-end flow (signature, allowance update, nonce increment)
  • getDomainSeparator
  • getNonce (default + explicit account)
  • getOptedInSupply

@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

@odupontt is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant