Skip to content

Figment Stablecoin Staking clear signing descriptor - #2616

Merged
hesterbruikman merged 9 commits into
ethereum:masterfrom
betocattani:feat/figment-pool-dynamic-clear-signing
Aug 19, 2026
Merged

hesterbruikman merged 9 commits into
ethereum:masterfrom
betocattani:feat/figment-pool-dynamic-clear-signing

Conversation

@betocattani

@betocattani betocattani commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Context

Figment's PoolDynamic yield vault. Covers customer-signed deposit and requestRedeem for mainnet and Sepolia; USDC approve against the vault resolves via the existing ercs/calldata-erc20-tokens.json wildcard once this descriptor's $id is registered.

Summary

Three new files under registry/figment/:

File Purpose
common-figment-pool-dynamic.json Shared display formats for deposit and requestRedeem, parameterized over the underlying token via metadata.constants.
calldata-PoolDynamic-USDC.json Pins to the mainnet vault. underlyingToken = USDC.
calldata-PoolDynamic-MUSDC-sepolia.json Pins to the Sepolia vault. underlyingToken = MUSDC (a mock token deployed for testnet integration).

On-device labels

Element String Length
Mainnet $id Stablecoin Staking Yield USDC 29
Sepolia $id Stablecoin Staking Yield MUSDC 30
deposit intent Deposit into Stablecoin Vault 29
requestRedeem intent Redeem from Stablecoin Vault 28

All within the 30-character device display limit.

Contracts covered

Network Chain ID Vault address (proxy) Underlying token
Mainnet 1 0xe1b1252652A2FF0CC3A4214eE73d9FeD1FEa5b4f USDC 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Sepolia 11155111 0xD1f0774ccff0CE4F36DeA57b6a28aB7FeB0a01B0 MUSDC 0xfd4f11A2aaE86165050688c85eC9ED6210C427A9

Functions covered

  • deposit(uint256 assets, address lender) — renders the deposit amount (token-resolved) and the depositing wallet
  • requestRedeem(uint256 shares) — renders the share amount being redeemed

approve on USDC with this vault as spender is already handled by the registry's ercs/calldata-erc20-tokens.json wildcard; this descriptor's $id lets Ledger Live render the spender as Stablecoin Staking Yield USDC instead of an unrecognized contract address.

Mainnet/Sepolia split. metadata.constants is flat per descriptor, and the underlying tokens differ across chains (USDC vs MUSDC at different addresses), so each chain has its own descriptor file. Both reference the same common-*.json for display logic. This also produces a distinct Stablecoin Staking Yield MUSDC device label so testnet transactions are visually distinguishable from mainnet — useful safety property for QA.

Token resolution. deposit.assets resolves via metadata.constants.underlyingToken (asset is fixed per vault); requestRedeem.shares uses tokenPath: "@.to" because the share token IS the vault itself (PoolDynamic is ERC-20).

Tests

v2-format test suites under registry/figment/testsv2/ (per #2586 Common Test Strategy). Each file carries real on-chain deposit + requestRedeem transactions plus a dataProvider block with token metadata mocks, so the multi-implementation runners (Ledger, Sourcify, Rust) execute offline:

  • calldata-PoolDynamic-USDC.tests.json — Mainnet deposit + redeem
  • calldata-PoolDynamic-MUSDC-sepolia.tests.json — Sepolia deposit + redeem

@github-actions github-actions Bot added the descriptors Changes to clear signing descriptors label Jun 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🧪 Clear Signing Tests

⏳ Waiting for maintainer approval to run tests.

This PR is from a fork. A maintainer needs to add the run-tests label to trigger the clear signing tests.

Once approved, the tests will run automatically and post screenshots here.

@betocattani
betocattani force-pushed the feat/figment-pool-dynamic-clear-signing branch 2 times, most recently from 53af434 to 5e50343 Compare June 19, 2026 19:45
@betocattani betocattani changed the title feat: add Figment PoolDynamic USDC yield pool clear signing descriptor Figment Stablecoin Staking clear signing descriptor Jun 19, 2026
@betocattani
betocattani marked this pull request as ready for review June 19, 2026 19:53
@hesterbruikman
hesterbruikman self-requested a review June 24, 2026 10:41
@betocattani

Copy link
Copy Markdown
Contributor Author

Hi! @hesterbruikman 👋

Just a friendly follow-up on this PR. Whenever you have a chance, I'd appreciate a review.
Happy to provide any additional context or make any changes needed to help move it forward.

Thanks!

@manuelwedler

Copy link
Copy Markdown
Collaborator

Hey there :)
We've been recently adapting the testing CI to run tests against the TypeScript and Rust libraries at the same time. For this, we needed to change the test file format. Could you please do the following:

  • Rebase this PR on latest master
  • Have a look at the updated README for documentation on the new test format
  • Add test files in the v2 format
  • Remove the test files in the old format

Thank you! We will have a look at the PR afterwards.

@github-actions

github-actions Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Clear Signing Tests

⏳ Waiting for maintainer approval to run tests.

This PR is from a fork. A maintainer needs to add the run-tests label to trigger the clear signing tests.

Once approved, the tests will run automatically and post their results here.

Adds ERC-7730 descriptors so wallets supporting the ERC-7730 standard render Figment's Stablecoin Staking Yield product transactions with human-readable intents instead of opaque calldata.

Three descriptor files under registry/figment/ using the includes + metadata.constants convention:

- common-figment-pool-dynamic.json — shared display formats for deposit and requestRedeem, parameterized over the underlying token

- calldata-PoolDynamic-USDC.json — mainnet USDC vault (0xe1b1252652A2FF0CC3A4214eE73d9FeD1FEa5b4f)

- calldata-PoolDynamic-MUSDC-sepolia.json — Sepolia vault (0xD1f0774ccff0CE4F36DeA57b6a28aB7FeB0a01B0); underlying is a Mock USDC (MUSDC) at 0xfd4f11A2aaE86165050688c85eC9ED6210C427A9

Two test files under registry/figment/tests/ with real on-chain deposit + requestRedeem transactions for both mainnet and Sepolia.

On-device labels (all within the 30-char display limit):

- Mainnet $id: "Stablecoin Staking Yield USDC" (29)

- Sepolia $id: "Stablecoin Staking Yield MUSDC" (30)

- deposit intent: "Deposit into Stablecoin Vault" (29)

- requestRedeem intent: "Redeem from Stablecoin Vault" (28)

Scope is customer-only: deposit + requestRedeem. Operator functions (acceptRedemption, repayRedemption, setExchangeRate, depositOffChain, changeRedemptionDestination, etc.) are signed by Figment's settlement infrastructure (HSM/MPC), never by end users. Mainnet and Sepolia are separate descriptors because metadata.constants is flat per descriptor and the underlying tokens differ across chains (USDC vs MUSDC at different addresses); both reference the same common-*.json so display logic stays single-sourced.
Adopts the new test format introduced in ethereum#2586 (Common Test Strategy). The v2 shape lets the CI run the same fixture against multiple test runners (Ledger cs-tester, Sourcify's TypeScript runner, and the upcoming Rust runner) by declaring the rendered output structurally rather than as a loose list of expected strings.

Changes per test file:

- Moved from registry/figment/tests/ to registry/figment/testsv2/

- Points at specs/erc7730-tests-v2.schema.json

- Adds a top-level descriptor field pointing at the .json under test

- Adds a dataProvider block with token metadata (USDC/MUSDC as underlyings; xSOLY/xFIGSOL as vault share tokens) so runners execute without hitting a live RPC

- Converts rawTx from the signed form to the unsigned EIP-1559 form required by v2

- Replaces the flat expectedTexts array with a structured expected block (intent, owner, fields[]) matching the descriptor's own field order

Old-format tests under registry/figment/tests/ removed to avoid duplicate coverage; the pre-existing calldata-figment-batch-deposit.tests.json is untouched and remains under the old path since it belongs to a separate descriptor.
@betocattani
betocattani force-pushed the feat/figment-pool-dynamic-clear-signing branch from d86d6d8 to f12d13a Compare July 6, 2026 15:48
@betocattani

Copy link
Copy Markdown
Contributor Author

Hi @manuelwedler, thanks for the review and the pointer to the new format 😄

All items from your comment are done:

  • Rebased on latest master
  • Added v2 test files under registry/figment/testsv2/ (structured expected block + dataProvider token mocks so the runners execute offline)
  • Removed the old-format files

Ready for another look whenever you have time, happy to iterate if anything else needs adjusting. Thanks again!

@betocattani

Copy link
Copy Markdown
Contributor Author

Hey @manuelwedler , whenever you have a chance, could you review this or point me to anything that's still missing? I appreciate it 🙏

@betocattani

Copy link
Copy Markdown
Contributor Author

Hi! @hesterbruikman and @manuelwedler 👋

Just a friendly follow-up on this PR. When someone has a chance, I’d really appreciate a review. Thank you

@hesterbruikman hesterbruikman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks for contributing and your patience updating the test files!

@hesterbruikman
hesterbruikman merged commit af94170 into ethereum:master Aug 19, 2026
11 checks passed
@betocattani

Copy link
Copy Markdown
Contributor Author

Thanks for the review @hesterbruikman! Really appreciate the help and guidance along the way 🙌 Happy to contribute!

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

Labels

descriptors Changes to clear signing descriptors run-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants