Skip to content

Decode uniswap ETH to token swaps#1864

Draft
jadzeidan wants to merge 1 commit into
BitBoxSwiss:masterfrom
jadzeidan:decode-uniswap
Draft

Decode uniswap ETH to token swaps#1864
jadzeidan wants to merge 1 commit into
BitBoxSwiss:masterfrom
jadzeidan:decode-uniswap

Conversation

@jadzeidan
Copy link
Copy Markdown
Contributor

Add decoding of Ethereum mainnet to ERC20 token swaps for
Uniswap V2/V3 so amounts are verifiable on device.

Note, decoding of ERC20 token amounts limited the
ones listed in the firmware.

Add decoding of Ethereum mainnet to ERC20 token swaps
for Uniswap V2/V3 so amounts are verifiable on device.

Note, decoding of ERC20 token amounts limited to
the ones listed in the firmware.
@jadzeidan
Copy link
Copy Markdown
Contributor Author

@Tomasvrba have a look if you would like to test :)

Note, only native ETH to ERC20 tokens (listed in firmware) are decoded. Did not manage to get ERC20 to ETH or ERC20 to ERC20 swaps to work (seems to be limited by the protocol since token “Swap from / Swap to min” amounts are not in the call data?)

@Tomasvrba
Copy link
Copy Markdown
Collaborator

will take a look

@benma
Copy link
Copy Markdown
Collaborator

benma commented Mar 22, 2026

Please report how many bytes the firmware binary is increased by this PR.

@Tomasvrba
Copy link
Copy Markdown
Collaborator

haven't tested yet, but code should definitely be moved out of ethereum/sign.rs, probably should have a separate file for each contract we would add for clear signing or the eth signing file will explode

@Tomasvrba Tomasvrba self-requested a review April 13, 2026 09:39
@Tomasvrba
Copy link
Copy Markdown
Collaborator

Can scrap this PR in favor of adopting ERC-7730 for clear signing

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.

3 participants