Skip to content

feat(statics): wire mainnet ERC-7984 wrapper-underlying metadata for Zama tokens (CHALO-2007) - #10091

Merged
0xPrabh merged 1 commit into
masterfrom
prabhsharansingh/chalo-2007-erc7984-mainnet-wrapper-metadata
Oct 29, 2026
Merged

0xPrabh merged 1 commit into
masterfrom
prabhsharansingh/chalo-2007-erc7984-mainnet-wrapper-metadata

Conversation

@0xPrabh

@0xPrabh 0xPrabh commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Registers underlyingErc20Address, rate, and requiresApprovalReset for all six mainnet Zama ERC-7984 confidential pairs in statics. This is the missing SDK-side prerequisite for shield/unshield on production: abstract-eth registers a shield pair only when underlyingErc20Address is set (abstractEthLikeNewCoins.ts:501), so until now every wrap/wrapApprove/unwrap intent on mainnet threw ``'...' is not a registered ERC-7984 shield pair''.

Metadata (verified on-chain via eth_call, 2026-10-29)

BitGo coin Wrapper underlying() Underlying (sym/dec) rate() requiresApprovalReset
eth:czama 0x80cb147f…98071 0xA12cC123…f4F3 ZAMA / 18 1000000000000 false
eth:cxaut 0x73cc9af9…eef1 0x68749665…82F38 XAUt (Tether Gold) / 6 1 false
eth:ctgbp 0xa873750c…edd9 0x27f6C828…5287 tGBP / 18 1000000000000 false
eth:cweth 0xda9396b8…4893 0xC02aaA39…6Cc2 WETH / 18 1000000000000 false
eth:cusdt 0xae0207c7…0c50 0xdAC17F95…1ec7 USDT / 6 1 true
eth:cusdc 0xe978f221…72b2 0xA0b86991…eb48 USDC / 6 1 false
  • Rate semantics match buildWrapCalldata (minted = floor(amount / rate)): 1e12 for 18dp→6dp pairs, 1 for 6dp→6dp pairs — all six internally consistent.
  • requiresApprovalReset = true only for eth:cusdt (real mainnet USDT reverts non-zero→non-zero approve; same guard as the Hoodi TUSDTMOCK mock, see CHALO-1815). Others are standard ERC-20.
  • Wrapper decimals()/symbol() confirmed on-chain (cZAMA, cXAUt, ctGBP, cWETH, cUSDT, cUSDC — all 6dp), matching the existing statics decimalPlaces.

Changes

  • modules/statics/src/coins/erc7984Tokens.ts — wrapper args for the six mainnet erc7984() entries; header comment updated
  • modules/statics/src/tokenConfig.ts — refreshed the "omitted on mainnet" doc comment
  • modules/statics/test/unit/erc7984Tokens.ts — replaced "leaves mainnet wrapper metadata unset" with exact assertions for all six mainnet pairs

Notes / out of scope

  • Passing undefined through the optional features/prefix/suffix/network/primaryKeyCurve positional params preserves current behavior exactly (defaults apply on undefined).
  • Served configs gain the three fields on mainnet — that is the point; the old comment/test existed specifically to block this until shield/unshield was ready.
  • AMS allowlisting/vetting of the mainnet wrappers remains the separate gate (CHALO-1145); AMS ungate of prod zama tokens is CHALO-1019.

Verification

  • mocha test/unit/erc7984Tokens.ts in modules/statics: 41522 passing, 0 failing (full registry validation suite included)
  • prettier --check clean on all touched files

Closes CHALO-2007

@0xPrabh
0xPrabh requested a review from a team as a code owner October 29, 2026 05:16

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@linear-code

linear-code Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

CHALO-2007

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Compatibility checks are failing on Node.js 27-nightly (experimental, non-blocking). This does not block merge, but it signals an incompatibility to fix before this release becomes supported.

View run

@0xPrabh
0xPrabh force-pushed the prabhsharansingh/chalo-2007-erc7984-mainnet-wrapper-metadata branch from 2c59454 to a198d17 Compare October 29, 2026 05:33
…Zama tokens (CHALO-2007)

Register underlyingErc20Address, rate, and requiresApprovalReset for all six mainnet
Zama confidential pairs (eth:czama, eth:cxaut, eth:ctgbp, eth:cweth, eth:cusdt,
eth:cusdc). Values verified on-chain via underlying()/rate().

abstract-eth registers an ERC-7984 shield pair only when underlyingErc20Address
is set, so this enables the shield/unshield (wrap/wrapApprove/unwrap/
finalizeUnwrap) journey for mainnet wallets. eth:cusdt sets
requiresApprovalReset=true (real USDT requires approve(0) before non-zero
approve); all other underlyings are standard ERC-20.

Also updates the sdk-coin-eth wrapper-registry scoping test, which asserted the
old no-metadata state (eth:cusdt underlyingErc20Address === undefined) and now
asserts the wired on-chain value - the three intent verifications it runs
resolve wrappers by network scope and are unchanged.

statics unit tests: 41522 passing. AMS allowlisting/vetting (CHALO-1145)
remains the separate gate.
@0xPrabh
0xPrabh force-pushed the prabhsharansingh/chalo-2007-erc7984-mainnet-wrapper-metadata branch from d70f28c to 61e3815 Compare October 29, 2026 06:52

@Venkat-Annavazzala Venkat-Annavazzala left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@0xPrabh
0xPrabh merged commit 5bd8445 into master Oct 29, 2026
27 checks passed
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.

2 participants