Skip to content

alpha: restore transformERC20 clear-signing with certified semantics #471

Description

@BitHighlander

Goal

Restore normal-mode 0x transformERC20 swaps on alpha without trusting an undisclosed transformations[] tail. The 7.14.2 release intentionally routes selector 0x415565b0 through AdvancedMode.

Required design

  • Parse the complete canonical ABI with overflow-safe bounds checks: the 0xa0 array offset, count, every tuple offset, uint32 nonce, bytes length/padding, and any explicitly supported attribution suffix.
  • Bind the complete calldata hash, chain ID, Exchange Proxy address, selector, decoded economic fields, and approved transformer policy/version to device-verifiable signed metadata. Missing, expired, mismatched, or unknown metadata must fall back to AdvancedMode.
  • Display protocol, exact input asset/amount, minimum receive asset/amount, signer-as-recipient, and attached native value.
  • Reject UINT256_MAX input, zero minimum receive, ERC-20 input with attached ETH, and native input where msg.value does not equal the displayed input.
  • Reject a second EthereumSignTx while calldata is pending, before any confirmation screen.
  • Keep standard ERC-20 transfer/approve and the separate sellToUniswap handler independent.

Acceptance tests

  • Valid certified quote clear-signs on every supported chain/address pair.
  • Same static head with different transformation tails has different calldata hashes and cannot reuse the same certificate.
  • Noncanonical offsets, overlap, dirty narrow values, truncation, oversized lengths, padding/trailing-data ambiguity, max input, zero minimum, and value mismatches fail closed.
  • Streamed calldata, cancellation, unexpected ACK, and second initialization leave no active signer state.
  • Vault and firmware version gates agree: stable 7.14.2 uses AdvancedMode; alpha enables normal review only when the certified path is available.

Contract tests against a pinned 0x source are supporting evidence, not the trust boundary: the 0x owner can change the trusted transformer deployer. The signed policy must make that external trust explicit and revocable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions