Figment Stablecoin Staking clear signing descriptor - #2616
hesterbruikman merged 9 commits into
Conversation
🧪 Clear Signing Tests
This PR is from a fork. A maintainer needs to add the Once approved, the tests will run automatically and post screenshots here. |
53af434 to
5e50343
Compare
|
Hi! @hesterbruikman 👋 Just a friendly follow-up on this PR. Whenever you have a chance, I'd appreciate a review. Thanks! |
|
Hey there :)
Thank you! We will have a look at the PR afterwards. |
Clear Signing Tests
This PR is from a fork. A maintainer needs to add the 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.
d86d6d8 to
f12d13a
Compare
|
Hi @manuelwedler, thanks for the review and the pointer to the new format 😄 All items from your comment are done:
Ready for another look whenever you have time, happy to iterate if anything else needs adjusting. Thanks again! |
|
Hey @manuelwedler , whenever you have a chance, could you review this or point me to anything that's still missing? I appreciate it 🙏 |
|
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
left a comment
There was a problem hiding this comment.
LGTM, thanks for contributing and your patience updating the test files!
|
Thanks for the review @hesterbruikman! Really appreciate the help and guidance along the way 🙌 Happy to contribute! |
Context
Figment's
PoolDynamicyield vault. Covers customer-signeddepositandrequestRedeemfor mainnet and Sepolia; USDCapproveagainst the vault resolves via the existingercs/calldata-erc20-tokens.jsonwildcard once this descriptor's$idis registered.Summary
Three new files under
registry/figment/:common-figment-pool-dynamic.jsondepositandrequestRedeem, parameterized over the underlying token viametadata.constants.calldata-PoolDynamic-USDC.jsonunderlyingToken = USDC.calldata-PoolDynamic-MUSDC-sepolia.jsonunderlyingToken = MUSDC(a mock token deployed for testnet integration).On-device labels
$idStablecoin Staking Yield USDC$idStablecoin Staking Yield MUSDCdepositintentDeposit into Stablecoin VaultrequestRedeemintentRedeem from Stablecoin VaultAll within the 30-character device display limit.
Contracts covered
0xe1b1252652A2FF0CC3A4214eE73d9FeD1FEa5b4f0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB480xD1f0774ccff0CE4F36DeA57b6a28aB7FeB0a01B00xfd4f11A2aaE86165050688c85eC9ED6210C427A9Functions covered
deposit(uint256 assets, address lender)— renders the deposit amount (token-resolved) and the depositing walletrequestRedeem(uint256 shares)— renders the share amount being redeemedapproveon USDC with this vault as spender is already handled by the registry'sercs/calldata-erc20-tokens.jsonwildcard; this descriptor's$idlets Ledger Live render the spender asStablecoin Staking Yield USDCinstead of an unrecognized contract address.Mainnet/Sepolia split.
metadata.constantsis 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 samecommon-*.jsonfor display logic. This also produces a distinctStablecoin Staking Yield MUSDCdevice label so testnet transactions are visually distinguishable from mainnet — useful safety property for QA.Token resolution.
deposit.assetsresolves viametadata.constants.underlyingToken(asset is fixed per vault);requestRedeem.sharesusestokenPath: "@.to"because the share token IS the vault itself (PoolDynamicis ERC-20).Tests
v2-format test suites under
registry/figment/testsv2/(per #2586 Common Test Strategy). Each file carries real on-chain deposit +requestRedeemtransactions plus adataProviderblock with token metadata mocks, so the multi-implementation runners (Ledger, Sourcify, Rust) execute offline:calldata-PoolDynamic-USDC.tests.json— Mainnet deposit + redeemcalldata-PoolDynamic-MUSDC-sepolia.tests.json— Sepolia deposit + redeem