chore(clear_signing): delete inbuilt 1inch and uniswap definitions.
What changed, and why it matters
This commit removes built-in human-readable display definitions for 1inch and Uniswap swap transactions from Trezor's Ethereum clear-signing feature. Without these definitions, Trezor devices will likely fall back to showing raw contract call data for those transactions, making it harder for users to verify what they are signing. It is a feature-removal change, not a direct code vulnerability, but it weakens a security-relevant usability safeguard.
Verify whether this removal is paired with a Suite-side or external-definition delivery mechanism that restores the same labels; if not, ensure users are informed that 1inch/Uniswap clear signing is temporarily degraded. Treat this as a regression-test priority item and consider a changelog entry because the change affects user-visible security behavior.
Security signals we found
Removal of clear-signing definitions for decentralized exchange routers
Reduced transaction transparency for 1inch and Uniswap V3 interactions
Potential fallback to raw calldata display, increasing phishing/signature-misuse risk
No changelog entry despite security-relevant UI change
Commit message explicitly requests regression testing, indicating functional risk
Evidence from the diff
The change deletes inbuilt DisplayFormat bindings for 1inch AggregationRouterV6 and Uniswap V3 Router functions from core/src/apps/ethereum/clear_signing_definitions.py, along with their test fixtures and UI test data. The remaining code still yields APPROVE_DISPLAY_FORMAT, TRANSFER_DISPLAY_FORMAT, WETH wrap/unwrap formats, and debug-only test formats. The commit message frames this as a chore and notes that full regression testing with Suite 1inch swaps is needed. No replacement external-definition loading logic is added in this diff, so affected calls will no longer receive structured clear-signing labels from the firmware itself.
Changed components
core/src/apps/ethereum/clear_signing_definitions.pycommon/tests/fixtures/ethereum/sign_tx_clear_signing.jsoncommon/tests/fixtures/ethereum/sign_tx_external_definitions.jsoncore/tests/test_apps.ethereum.clear_signing_definitions.pytests/device_tests/ethereum/definitions/eth/chain-id/1/display-format/111111125421ca6dc452d289314280a0f8842a65-07ed2379.dattests/ui_tests/fixtures.jsonInspect captured patch +41 / −1683
### common/tests/fixtures/ethereum/sign_tx_clear_signing.json
@@ -4,106 +4,6 @@
"passphrase": ""
},
"tests": [
- {
- "name": "clear_sign_uniswap_exactInput",
- "parameters": {
- "comment": "https://etherscan.io/tx/0xea9c30c998b2d0764250b1bfbadbd59fbc3803c7356e14d193b4babafd55dc5b",
- "data": "b858183f0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000008000000000000000000000000054130c0f6d7c39e4129aedc56dd1a8a458918d8e000000000000000000000000000000000000000000000000000000002faf08000000000000000000000000000000000000000000000002d173e7149a0e4554a80000000000000000000000000000000000000000000000000000000000000042dac17f958d2ee523a2206206994597c13d831ec7000064a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000bb8031de51f3e8016514bd0963d0b2ab825a591db9a000000000000000000000000000000000000000000000000000000000000",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x0"
- },
- "result": {
- "sig_v": 38,
- "sig_r": "ac1f778e35442fdec00242e3644bf672ed9ae49845a6de938c1d82dd5d27bd44",
- "sig_s": "2090f86c5e7e79110ad0c10807b2daa18f8374fdefe4fb5c65a5555149f3e994"
- }
- },
- {
- "name": "clear_sign_uniswap_exactInputSingle",
- "parameters": {
- "comment": "https://etherscan.io/tx/0xebe95b6b3222b9eacbf40a02947ebbc83761ee526879d0ba99fd46f54217e5db",
- "data": "04e45aaf000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000bb800000000000000000000000051117eb63623aee74a39b63bd9efa3a728800dbb000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x0"
- },
- "result": {
- "sig_v": 38,
- "sig_r": "6890cae9fe4d5df40e6b55acccc83b5cd4f58ae95bf5d19f4b060919e6b98c2a",
- "sig_s": "41583d1eaf7c65a8aff0b0ea60ffd41682260c2fc9c71f1c4d7c2230807ac167"
- }
- },
- {
- "name": "clear_sign_uniswap_exactOutput",
- "parameters": {
- "comment": "https://etherscan.io/tx/0xdc411c8e5ef32627fd70da1aa7b53f28810cc2533edbc7221c630f3224d62bce",
- "data": "09b81346000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000800000000000000000000000002766be7d41479e8cf315f8bf27ca1511f515e13700000000000000000000000000000000000000000000002c54e880d24c32df5f00000000000000000000000000000000000000000000000000027d79cd00af38000000000000000000000000000000000000000000000000000000000000002bb5d730d442e1d5b119fb4e5c843c48a64202ef92000bb8c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x0"
- },
- "result": {
- "sig_v": 37,
- "sig_r": "ae12351baa02b3397af247cef0fe6cd29a9c9ed9dc6b9e7eb536861c29893dcc",
- "sig_s": "51e12c17b53c9896cee9c3bb873f28c446a2b87bd181f6e69cf6f73a87c63095"
- }
- },
- {
- "name": "clear_sign_uniswap_exactOutputSingle",
- "parameters": {
- "comment": "https://etherscan.io/tx/0x0402288e1aa5cfbc5cdab39bf717bc7e27861acc65205183a6019f963b3b7d46",
- "data": "5023b4df000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000007fc66500c84a76ad7e9c93437bfc5ac33e2ddae900000000000000000000000000000000000000000000000000000000000001f400000000000000000000000033e91500a1730570a3f67a72a3ab2025b5512c7b00000000000000000000000000000000000000000000000000032c2dc3c8d0000000000000000000000000000000000000000000000000000000307c7ec99baf0000000000000000000000000000000000000000000000000000000000000000",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x0"
- },
- "result": {
- "sig_v": 37,
- "sig_r": "a518034975324f9a2d901f17af3feeaa4ec634b23b85b91f75531f3803457cb9",
- "sig_s": "0cd9023955ba1984046222c39709b090458cbcff443e3b989914d12efb8f782d"
- }
- },
- {
- "name": "clear_sign_huge_data",
- "parameters": {
- "comment": "Same data as in 1inch_swap, but padded with zeroes until it exceeds 4kb",
- "data": "07ed2379000000000000000000000000990636ecb3ff04d33d92e970d3d588bf5cd8d086000000000000000000000000f0db65d17e30a966c2ae6a21f6bba71cea6e97540000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599000000000000000000000000990636ecb3ff04d33d92e970d3d588bf5cd8d086000000000000000000000000459e213d8b5e79d706ab22b945e3af983d51bc4c000000000000000000000000000000000000000000000071003fa9d87dc2000000000000000000000000000000000000000000000000000000000000002de7410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000009f90000000000000000000000000000000000000009db0009ad00096300004e00a0744c8c09f0db65d17e30a966c2ae6a21f6bba71cea6e975490cbe4bdd538d6e9b379bff5fe72c3d67a521de500000000000000000000000000000000000000000000000005c9205756dc400000a098aed105000000000000000000000000000000007d007d000000000000000000000000000000000000000000000000000008dd00055200a007e5c0d200000000000000000000000000000000000000000000000000052e0002105120111111125421ca6dc452d289314280a0f8842a65f0db65d17e30a966c2ae6a21f6bba71cea6e97540124cc713a04811642c03b93bb3fe7905266a4a3c300713f97460272be5479f22777c211dc84000000000000000000000000bee3211ab312a8d065c4fef0247448e17a8da0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000f0db65d17e30a966c2ae6a21f6bba71cea6e97540000000000000000000000000000000000000000000000000000000042b7e1d80000000000000000000000000000000000000000000000387d3b44c09372e00000000000000000000000000000000b2ddf0069ba7c5fe970d3d588bf5cd8d08600000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000414d00e9e0bed4d42074ef1786b2114d6a211ebe817c429c7da3c74105147d9a6b29dc0d7f1173a1fa5cb0460dc44b5b27946af164e156c5ec48d5d622d805a32b1c0000000000000000000000000000000000000000000000000000000000000000a098aed105000000000000000000000000000000001900e1000000000000000000000000000000000000000000000000000002e600028300a007e5c0d200000000000000000000000000000000000000000000000000025f0002105120111111125421ca6dc452d289314280a0f8842a65dac17f958d2ee523a2206206994597c13d831ec70124cc713a04688f385930a2a67070dc9b52a7b7ec4a955a110b038bd16cfe78e8806dfddd41000000000000000000000000bee3211ab312a8d065c4fef0247448e17a8da00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f984000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000de14077278f7ac8b1000000000000000000000000000000000000000000000000000000003c15454d00000000000000000000000000000b2ddd0069ba7c5fe970d3d588bf5cd8d0860000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041865a01e3afd96eb104a6d0017d9aa335a46fcc7a1f580b9155188c0176826a7a77c2be7695916dff5bf595519ee67a0966ab1769e792231b4482f5aa4dbd28b11b0000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000148da1ee63c1e5018f0cb37cdff37e004e0088f563e5fe39e05ccc5b1f9840a85d5af5bf1d1762f925bdaddc4201f9840ca0dac17f958d2ee523a2206206994597c13d831ec7d343d5dba2fba55eef58189619c05e33cab95ca1c028b46d03d343d5dba2fba55eef58189619c05e33cab95ca100000000000000000000000000000000000000000000000000000000000248ad00a007e5c0d20000000000000000000000000000000000000000000000000003670002105120111111125421ca6dc452d289314280a0f8842a65f0db65d17e30a966c2ae6a21f6bba71cea6e97540124cc713a04cfca011b8564e7bcc6a9792b8226a4d16ef853e2c19b5f691e66ca8a51a1a8d8000000000000000000000000bee3211ab312a8d065c4fef0247448e17a8da0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000f0db65d17e30a966c2ae6a21f6bba71cea6e975400000000000000000000000000000000000000000000000006ab4ca90f5ac5130000000000000000000000000000000000000000000000387d3b44c09372e00000000000000000000000000000000b2ddc0069ba7c5fe970d3d588bf5cd8d08600000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000411413c544e6473def8c4117d32d94db118aae69af01206f12c03f5d246770f41f3ab0cd7a076365d405e4cc96314b7d51522995909055ede938bb3e3db82fb82b1b0000000000000000000000000000000000000000000000000000000000000000a0c9e75c4800000000000000000000000000000000004d001700000000000000000000000000000000000000000000000000011f00004f02a000000000000000000000000000000000000000000000000000000000000540abee63c1e500e6ff8b9a37b0fab776134636d9981aa778c4e718c02aaa39b223fe8d0a0e5c4f27ead9083c756cc251207f86bf177dd4f3494b841a37e810a34dd56c829bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc20044394747c5000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011953a000000000000000000000000000000000000000000000000000000000000000000a0f2fa6b662260fac5e5542a773aa44fbcfedf7c193bc2c59900000000000000000000000000000000000000000000000000000000002e224f00000000000000000000000000001a6380a06c4eca272260fac5e5542a773aa44fbcfedf7c193bc2c599111111125421ca6dc452d289314280a0f8842a6500000000000000d1f115cb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x0"
- },
- "result": {
- "sig_v": 38,
- "sig_r": "5f5d821d9fa8ffaa8ae20660fef81b593cb459037ba350707ca5f8db0dc561b4",
- "sig_s": "30fb78a394aadfec03e1c23b1f0d0440cd7131ae22bd49e5cb94584f49b29e9f"
- }
- },
{
"name": "clear_sign_trezor_test_scalars",
"skip_models": ["t1b1"],
### common/tests/fixtures/ethereum/sign_tx_external_definitions.json
@@ -104,266 +104,6 @@
"sig_s": "37cbea03b1d70e95991f8f6c6015275cdf066f6eb063ec86b6d79ef4622d875b"
}
},
- {
- "name": "clear_sign_1inch_swap",
- "parameters": {
- "comment": "https://etherscan.io/tx/0x2c18175d5bf78e80892b21896b00eb27bf07ff5948b4be1e56038d8ba7266950",
- "data": "07ed2379000000000000000000000000990636ecb3ff04d33d92e970d3d588bf5cd8d086000000000000000000000000f0db65d17e30a966c2ae6a21f6bba71cea6e97540000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599000000000000000000000000990636ecb3ff04d33d92e970d3d588bf5cd8d086000000000000000000000000459e213d8b5e79d706ab22b945e3af983d51bc4c000000000000000000000000000000000000000000000071003fa9d87dc2000000000000000000000000000000000000000000000000000000000000002de7410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000009f90000000000000000000000000000000000000009db0009ad00096300004e00a0744c8c09f0db65d17e30a966c2ae6a21f6bba71cea6e975490cbe4bdd538d6e9b379bff5fe72c3d67a521de500000000000000000000000000000000000000000000000005c9205756dc400000a098aed105000000000000000000000000000000007d007d000000000000000000000000000000000000000000000000000008dd00055200a007e5c0d200000000000000000000000000000000000000000000000000052e0002105120111111125421ca6dc452d289314280a0f8842a65f0db65d17e30a966c2ae6a21f6bba71cea6e97540124cc713a04811642c03b93bb3fe7905266a4a3c300713f97460272be5479f22777c211dc84000000000000000000000000bee3211ab312a8d065c4fef0247448e17a8da0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000f0db65d17e30a966c2ae6a21f6bba71cea6e97540000000000000000000000000000000000000000000000000000000042b7e1d80000000000000000000000000000000000000000000000387d3b44c09372e00000000000000000000000000000000b2ddf0069ba7c5fe970d3d588bf5cd8d08600000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000414d00e9e0bed4d42074ef1786b2114d6a211ebe817c429c7da3c74105147d9a6b29dc0d7f1173a1fa5cb0460dc44b5b27946af164e156c5ec48d5d622d805a32b1c0000000000000000000000000000000000000000000000000000000000000000a098aed105000000000000000000000000000000001900e1000000000000000000000000000000000000000000000000000002e600028300a007e5c0d200000000000000000000000000000000000000000000000000025f0002105120111111125421ca6dc452d289314280a0f8842a65dac17f958d2ee523a2206206994597c13d831ec70124cc713a04688f385930a2a67070dc9b52a7b7ec4a955a110b038bd16cfe78e8806dfddd41000000000000000000000000bee3211ab312a8d065c4fef0247448e17a8da00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f984000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000de14077278f7ac8b1000000000000000000000000000000000000000000000000000000003c15454d00000000000000000000000000000b2ddd0069ba7c5fe970d3d588bf5cd8d0860000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041865a01e3afd96eb104a6d0017d9aa335a46fcc7a1f580b9155188c0176826a7a77c2be7695916dff5bf595519ee67a0966ab1769e792231b4482f5aa4dbd28b11b0000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000148da1ee63c1e5018f0cb37cdff37e004e0088f563e5fe39e05ccc5b1f9840a85d5af5bf1d1762f925bdaddc4201f9840ca0dac17f958d2ee523a2206206994597c13d831ec7d343d5dba2fba55eef58189619c05e33cab95ca1c028b46d03d343d5dba2fba55eef58189619c05e33cab95ca100000000000000000000000000000000000000000000000000000000000248ad00a007e5c0d20000000000000000000000000000000000000000000000000003670002105120111111125421ca6dc452d289314280a0f8842a65f0db65d17e30a966c2ae6a21f6bba71cea6e97540124cc713a04cfca011b8564e7bcc6a9792b8226a4d16ef853e2c19b5f691e66ca8a51a1a8d8000000000000000000000000bee3211ab312a8d065c4fef0247448e17a8da0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000f0db65d17e30a966c2ae6a21f6bba71cea6e975400000000000000000000000000000000000000000000000006ab4ca90f5ac5130000000000000000000000000000000000000000000000387d3b44c09372e00000000000000000000000000000000b2ddc0069ba7c5fe970d3d588bf5cd8d08600000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000411413c544e6473def8c4117d32d94db118aae69af01206f12c03f5d246770f41f3ab0cd7a076365d405e4cc96314b7d51522995909055ede938bb3e3db82fb82b1b0000000000000000000000000000000000000000000000000000000000000000a0c9e75c4800000000000000000000000000000000004d001700000000000000000000000000000000000000000000000000011f00004f02a000000000000000000000000000000000000000000000000000000000000540abee63c1e500e6ff8b9a37b0fab776134636d9981aa778c4e718c02aaa39b223fe8d0a0e5c4f27ead9083c756cc251207f86bf177dd4f3494b841a37e810a34dd56c829bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc20044394747c5000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011953a000000000000000000000000000000000000000000000000000000000000000000a0f2fa6b662260fac5e5542a773aa44fbcfedf7c193bc2c59900000000000000000000000000000000000000000000000000000000002e224f00000000000000000000000000001a6380a06c4eca272260fac5e5542a773aa44fbcfedf7c193bc2c599111111125421ca6dc452d289314280a0f8842a6500000000000000d1f115cb",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x0"
- },
- "result": {
- "sig_v": 38,
- "sig_r": "09a0efb1b7d948ec2be62ff43d9d9282df83d445060de95c44db5067cf9e81bd",
- "sig_s": "248ffd5f122ddb1eddd41331e28e86f171f2032bbe93ea5e75eaef2262c475d5"
- }
- },
- {
- "name": "clear_sign_1inch_unoswap",
- "parameters": {
- "comment": "https://etherscan.io/tx/0x772f2a3302ff43260dd22c69b740597c0de9434821ddcdce10e42c253815edf6",
- "data": "83800a8e000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000017cff16da2c808f348e280000000000000000000000d3e9895230e8fb1460852f6cda3c4b926fbc29d8fb39cfb5",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x0"
- },
- "result": {
- "sig_v": 38,
- "sig_r": "f39ecdd11c46c8743385f5a20051268b1a37a56e7a981a616b83264375a4bbf8",
- "sig_s": "35c18ed7ce660021551239b3b1746d1947acff335b89ee1c249835ebf732dc8f"
- }
- },
- {
- "name": "clear_sign_1inch_unoswapTo",
- "parameters": {
- "comment": "https://etherscan.io/tx/0xa3e7acb0c5702b9ae0ba93224ed9d51b4c827f3295c35c93b74e1d9b169dca6b",
- "data": "e2c95c82000000000000000000000000d862cdcfeb856c32b3c4f7563f4811d8ddfd42e2000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000188932d0c201ca000000000000000000000000000000000000000000000000000c7c88c3b9a9b6d08000000000000003b6d03405c6919b79fac1c3555675ae59a9ac2484f3972f51e6abebb",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x0"
- },
- "result": {
- "sig_v": 37,
- "sig_r": "d827ffec9e1ed6ee3c256b8e8ba1528d317f5f4005df46c7aae142862184f10c",
- "sig_s": "377c9b3df8b23f30e8e8fad1bd4fb12a0972b35da9ab9a3460873fa02afc7d7f"
- }
- },
- {
- "name": "clear_sign_1inch_unoswap2",
- "parameters": {
- "comment": "https://etherscan.io/tx/0x2d52823de04e02ed21d561935b4e7363a8cb4684410984e772718f5621e228c6",
- "data": "8770ba910000000000000000000000005f7827fdeb7c20b443265fc2f40845b715385ff20000000000000000000000000000000000000000000002757a49aba4f641520a0000000000000000000000000000000000000000000002e04c3685295104d6fe2880000000000000000000001f195908f2ee7a6fc15d33b30c82298f568e805c20000000000000000000000027848b0c260961826c4135e69e6cdd45cfba8257d1f115cb",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x0"
- },
- "result": {
- "sig_v": 38,
- "sig_r": "928ddf0625455c8319bc1b251eb9418a4719258f97058981746440299899f8a6",
- "sig_s": "4e143389f83ead9bc7276ec94e4d1e3bea457b2cc8b6f4cbc6167c52c1759bd7"
- }
- },
- {
- "name": "clear_sign_1inch_unoswapTo3",
- "parameters": {
- "comment": "https://etherscan.io/tx/0x897e8cae0b331eb72240af59387927dfa1791350b7ae51cf2d8766293a5bfc1d",
- "data": "f7a70056000000000000000000000000893ee5a10aec49aae0ae6e5a78ff79e2069f82e8000000000000000000000000320623b8e4ff03373931769a31fc52a4e78b5d70000000000000000000000000000000000000000000007ef4a40090a01ccc00000000000000000000000000000000000000000000000000000000000079e32bd54a1800020008020811000000db6925ea42897ca786a045b252d95aa7370f44b44010010001080008020000002c683fad51da2cd17793219cc86439c1875c353e208000000000000000000000c7bbec68d12a0d1830360f8ec58fa599ba1b0e9b",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x0"
- },
- "result": {
- "sig_v": 37,
- "sig_r": "dc94848dec0f020a4006112fe6e4ccc70791d74325b217d189768606130d2170",
- "sig_s": "1fcd7ae7236bfe0b21341dd5aafc0aebd5bff295cf59edf70885fe1353e980d5"
- }
- },
- {
- "name": "clear_sign_1inch_ethUnoswap",
- "parameters": {
- "comment": "https://etherscan.io/tx/0x2d8b8184e2c817839cbbe0de3d764e29283ec17e6ac6a0b841770e55d50da752",
- "data": "a76dfc3b00000000000000000000000000000000000000000000000000068ea41a18d0d020800000000000000000000004708077eca6bb527a5bbbd6358ffb043a9c1c14d1f115cb",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x71afd498d0000"
- },
- "result": {
- "sig_v": 38,
- "sig_r": "1b7192d0f6fd3e8de14a1b7267a968e0925a3cc8d9d7475ab2a756f11a6c3923",
- "sig_s": "76df266e99d40d4319e78624ad8b5287187c517be978c0fdffbf877dffa218a0"
- }
- },
- {
- "name": "clear_sign_1inch_ethUnoswap2",
- "parameters": {
- "comment": "https://etherscan.io/tx/0xe90d637d8c5cd2ccd7723b0c53cbae4a0b2e22335e30b834c65b79daf54249df",
- "data": "89af926a00000000000000000000000000000000000000000000000579736cd9bf730780208000000000000000000000c7bbec68d12a0d1830360f8ec58fa599ba1b0e9b2000000000000000000000007eb59373d63627be64b42406b108b602174b4cccd1f115cb",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x85a72265a39f07"
- },
- "result": {
- "sig_v": 37,
- "sig_r": "fe99b795d901752be910788cd79e1d6586e8f641d7529ae3e6a0c28e8f3bdd74",
- "sig_s": "070878c68eac4cc23217972dedcd362349ab6749060fff608ff420d87705dbb1"
- }
- },
- {
- "name": "clear_sign_1inch_unoswap3",
- "parameters": {
- "comment": "Fabricated tx (this variant is too rare to find on the router); calldata hand-assembled from real values of a real unoswap2 tx",
- "data": "193674720000000000000000000000005f7827fdeb7c20b443265fc2f40845b715385ff20000000000000000000000000000000000000000000002757a49aba4f641520a0000000000000000000000000000000000000000000002e04c3685295104d6fe2880000000000000000000001f195908f2ee7a6fc15d33b30c82298f568e805c20000000000000000000000027848b0c260961826c4135e69e6cdd45cfba825720000000000000000000000027848b0c260961826c4135e69e6cdd45cfba8257",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x0"
- },
- "result": {
- "sig_v": 37,
- "sig_r": "a3688dc3327cbdae1ceabb286bfd992601c6c32e8d25e97d5264631169c7207c",
- "sig_s": "15a5fb26cc77baae2a62f201529baad23b67a8b3428c4ad21537e933fb3e8783"
- }
- },
- {
- "name": "clear_sign_1inch_unoswapTo2",
- "parameters": {
- "comment": "Fabricated tx (this variant is too rare to find on the router); calldata hand-assembled from real values of a real unoswapTo3 tx",
- "data": "ea76dddf000000000000000000000000893ee5a10aec49aae0ae6e5a78ff79e2069f82e8000000000000000000000000320623b8e4ff03373931769a31fc52a4e78b5d70000000000000000000000000000000000000000000007ef4a40090a01ccc00000000000000000000000000000000000000000000000000000000000079e32bd54a1800020008020811000000db6925ea42897ca786a045b252d95aa7370f44b44010010001080008020000002c683fad51da2cd17793219cc86439c1875c353e",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x0"
- },
- "result": {
- "sig_v": 38,
- "sig_r": "68e1deea28b341a834eef7befbc7826ff498c59eca63489a2df8a3194ac13ce6",
- "sig_s": "7a6ca9f3cb5763555ac4afee0424d44ba984fd718d69062ae3aeb199a76d17e1"
- }
- },
- {
- "name": "clear_sign_1inch_ethUnoswap3",
- "parameters": {
- "comment": "Fabricated tx (this variant is too rare to find on the router); calldata hand-assembled from real values of a real ethUnoswap2 tx",
- "data": "188ac35d00000000000000000000000000000000000000000000000579736cd9bf730780208000000000000000000000c7bbec68d12a0d1830360f8ec58fa599ba1b0e9b2000000000000000000000007eb59373d63627be64b42406b108b602174b4ccc2000000000000000000000007eb59373d63627be64b42406b108b602174b4ccc",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x85a72265a39f07"
- },
- "result": {
- "sig_v": 38,
- "sig_r": "1690b9e30a51583b96e04a872791551c26699eab28167a3dc133274ccc273c0b",
- "sig_s": "30cf565361516de67cd3ed90717c487849fdf4af045e9ae2a1cbdfda747665c1"
- }
- },
- {
- "name": "clear_sign_1inch_ethUnoswapTo",
- "parameters": {
- "comment": "Fabricated tx (this variant is too rare to find on the router); calldata hand-assembled from real values of a real ethUnoswap tx + a real recipient",
- "data": "175accdc000000000000000000000000893ee5a10aec49aae0ae6e5a78ff79e2069f82e800000000000000000000000000000000000000000000000000068ea41a18d0d020800000000000000000000004708077eca6bb527a5bbbd6358ffb043a9c1c14",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x71afd498d0000"
- },
- "result": {
- "sig_v": 38,
- "sig_r": "a73846241c929e420b9d5a96815b0a5b45445c793cb1db708134f92292f13233",
- "sig_s": "2a91f7805ef68fd5cd1e04d183616195d69a08b1e420972ce20394f618c3442a"
- }
- },
- {
- "name": "clear_sign_1inch_ethUnoswapTo2",
- "parameters": {
- "comment": "Fabricated tx (this variant is too rare to find on the router); calldata hand-assembled from real values of a real ethUnoswap2 tx + a real recipient",
- "data": "0f449d71000000000000000000000000893ee5a10aec49aae0ae6e5a78ff79e2069f82e800000000000000000000000000000000000000000000000579736cd9bf730780208000000000000000000000c7bbec68d12a0d1830360f8ec58fa599ba1b0e9b2000000000000000000000007eb59373d63627be64b42406b108b602174b4ccc",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x85a72265a39f07"
- },
- "result": {
- "sig_v": 38,
- "sig_r": "c64fc355200bf014341e7f6370259c2fc52def64565a508c7bebd1e050630a51",
- "sig_s": "75c6e913f12991eabc460438f793b40118247abca525d8238cdec516515535a6"
- }
- },
- {
- "name": "clear_sign_1inch_ethUnoswapTo3",
- "parameters": {
- "comment": "Fabricated tx (this variant is too rare to find on the router); calldata hand-assembled from real values of a real ethUnoswap2 tx + a real recipient",
- "data": "493189f0000000000000000000000000893ee5a10aec49aae0ae6e5a78ff79e2069f82e800000000000000000000000000000000000000000000000579736cd9bf730780208000000000000000000000c7bbec68d12a0d1830360f8ec58fa599ba1b0e9b2000000000000000000000007eb59373d63627be64b42406b108b602174b4ccc2000000000000000000000007eb59373d63627be64b42406b108b602174b4ccc",
- "path": "m/44'/60'/0'/0/1",
- "to_address": "0x111111125421cA6dc452d289314280a0f8842A65",
- "chain_id": 1,
- "nonce": "0x0",
- "gas_price": "0x14",
- "gas_limit": "0x14",
- "tx_type": null,
- "value": "0x85a72265a39f07"
- },
- "result": {
- "sig_v": 38,
- "sig_r": "379c4e690e52425cf1b7002d56d66c2af3da0edb1a8298f508729d6b12d88b08",
- "sig_s": "2a4803e22ac943946d6f77cbad26e9ecbe703d1f6d6802ba31e218f7d6f48b31"
- }
- },
{
"name": "clear_sign_lifi_swapTokensMultipleV3ERC20ToERC20",
"parameters": {
### core/src/apps/ethereum/clear_signing_definitions.py
@@ -55,728 +55,11 @@
def all_display_formats() -> Generator[DisplayFormat, None, None]:
- from .clear_signing import (
- AmountFormatter,
- Array,
- BindingContext,
- DateFormatter,
- DynamicLeaf,
- RawFormatter,
- Tuple,
- UnitFormatter,
- make_fixed_bytes_parser,
- make_uint_parser,
- parse_bool,
- parse_bytes,
- parse_string,
- )
-
- parse_bytes32 = make_fixed_bytes_parser(32)
- parse_uint24 = make_uint_parser(24)
- parse_uint160 = make_uint_parser(160)
+ from .clear_signing import AmountFormatter, BindingContext
yield APPROVE_DISPLAY_FORMAT
yield TRANSFER_DISPLAY_FORMAT
- # https://github.com/ethereum/clear-signing-erc7730-registry/blob/master/registry/1inch/calldata-AggregationRouterV6.json#L9
- ONEINCH_ADDRESS = b"\x11\x11\x11\x12\x54\x21\xca\x6d\xc4\x52\xd2\x89\x31\x42\x80\xa0\xf8\x84\x2a\x65"
- ONEINCH_CHAINS = [
- 1,
- 10,
- 56,
- 100,
- 137,
- 146,
- 250,
- 8217,
- 8453,
- 42161,
- 43114,
- 59144,
- 1313161554,
- ]
-
- # $.metadata.constants.addressAsEth and addressAsNull from common-AggregationRouterV6.json
- ONEINCH_NATIVE_CURRENCY_ADDRESSES = [
- b"\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee",
- b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
- ]
-
- ONEINCH_CONTEXT = BindingContext(
- [(chain, ONEINCH_ADDRESS) for chain in ONEINCH_CHAINS],
- )
-
- # Rationale for the omitted "Minimum to Receive" (minReturn) field in the
- # unoswap / unoswapTo / ethUnoswap* definitions below:
- # Unlike `swap` (whose `desc` struct carries both srcToken and dstToken), these
- # functions encode only the source token; the destination token is implied by
- # the pool routing packed into the `dex` argument(s) and cannot be recovered
- # from the calldata. The ERC-7730 registry therefore gives their minReturn no
- # tokenPath, so we have no decimals/symbol to format it as a token amount and
- # omit the field rather than display a bare, tokenless integer. (`swap` keeps
- # its minReturnAmount because its dstToken is available.)
-
- _FUNC_SIG = b"\x07\xed\x23\x79"
- yield (
- DisplayFormat(
- binding_context=ONEINCH_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="1inch Aggregation Router V6",
- parameter_definitions=[
- Atomic(parse_address), # executor
- Tuple(
- (
- parse_address, # srcToken
- parse_address, # dstToken
- parse_address, # srcReceiver
- parse_address, # dstReceiver
- parse_uint256, # amount
- parse_uint256, # minReturnAmount
- parse_uint256, # flags
- ),
- is_dynamic=False,
- ), # desc
- DynamicLeaf(parse_bytes), # data
- ],
- field_definitions=[
- FieldDefinition(
- (1, 4), # desc.amount
- "Amount to Send",
- TokenAmountFormatter(
- token_path=(1, 0), # desc.srcToken
- native_currency_address=ONEINCH_NATIVE_CURRENCY_ADDRESSES,
- ),
- ),
- FieldDefinition(
- (1, 5), # desc.minReturnAmount
- "Minimum to Receive",
- TokenAmountFormatter(
- token_path=(1, 1), # desc.dstToken
- native_currency_address=ONEINCH_NATIVE_CURRENCY_ADDRESSES,
- ),
- ),
- FieldDefinition(
- (1, 3), "Beneficiary", AddressNameFormatter # desc.dstReceiver
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\x83\x80\x0a\x8e"
- yield (
- DisplayFormat(
- binding_context=ONEINCH_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="1inch Aggregation Router V6",
- parameter_definitions=[
- Atomic(parse_bytes32), # token
- Atomic(parse_uint256), # amount
- Atomic(parse_uint256), # minReturn
- Atomic(parse_bytes32), # dex
- ],
- field_definitions=[
- FieldDefinition(
- (1,), # amount
- "Amount to Send",
- TokenAmountFormatter(
- token_path=(0, (-20,)), # token.[-20:]
- native_currency_address=ONEINCH_NATIVE_CURRENCY_ADDRESSES,
- ),
- ),
- FieldDefinition(
- ContainerPath.From, # @.from
- "Beneficiary",
- AddressNameFormatter,
- ),
- FieldDefinition(
- (3, (-20,)), # dex.[-20:]
- "Last Pool",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\xe2\xc9\x5c\x82"
- yield (
- DisplayFormat(
- binding_context=ONEINCH_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="1inch Aggregation Router V6",
- parameter_definitions=[
- Atomic(parse_bytes32), # to
- Atomic(parse_bytes32), # token
- Atomic(parse_uint256), # amount
- Atomic(parse_uint256), # minReturn
- Atomic(parse_bytes32), # dex
- ],
- field_definitions=[
- FieldDefinition(
- (2,), # amount
- "Amount to Send",
- TokenAmountFormatter(
- token_path=(1, (-20,)), # token.[-20:]
- native_currency_address=ONEINCH_NATIVE_CURRENCY_ADDRESSES,
- ),
- ),
- FieldDefinition(
- (0, (-20,)), # to.[-20:]
- "Beneficiary",
- AddressNameFormatter,
- ),
- FieldDefinition(
- (4, (-20,)), # dex.[-20:]
- "Last Pool",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\x87\x70\xba\x91"
- yield (
- DisplayFormat(
- binding_context=ONEINCH_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="1inch Aggregation Router V6",
- parameter_definitions=[
- Atomic(parse_bytes32), # token
- Atomic(parse_uint256), # amount
- Atomic(parse_uint256), # minReturn
- Atomic(parse_uint256), # dex
- Atomic(parse_bytes32), # dex2
- ],
- field_definitions=[
- FieldDefinition(
- (1,), # amount
- "Amount to Send",
- TokenAmountFormatter(
- token_path=(0, (-20,)), # token.[-20:]
- native_currency_address=ONEINCH_NATIVE_CURRENCY_ADDRESSES,
- ),
- ),
- FieldDefinition(
- ContainerPath.From, # @.from
- "Beneficiary",
- AddressNameFormatter,
- ),
- FieldDefinition(
- (4, (-20,)), # dex2.[-20:]
- "Last Pool",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\x19\x36\x74\x72"
- yield (
- DisplayFormat(
- binding_context=ONEINCH_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="1inch Aggregation Router V6",
- parameter_definitions=[
- Atomic(parse_bytes32), # token
- Atomic(parse_uint256), # amount
- Atomic(parse_uint256), # minReturn
- Atomic(parse_uint256), # dex
- Atomic(parse_uint256), # dex2
- Atomic(parse_bytes32), # dex3
- ],
- field_definitions=[
- FieldDefinition(
- (1,), # amount
- "Amount to Send",
- TokenAmountFormatter(
- token_path=(0, (-20,)), # token.[-20:]
- native_currency_address=ONEINCH_NATIVE_CURRENCY_ADDRESSES,
- ),
- ),
- FieldDefinition(
- ContainerPath.From, # @.from
- "Beneficiary",
- AddressNameFormatter,
- ),
- FieldDefinition(
- (5, (-20,)), # dex3.[-20:]
- "Last Pool",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\xea\x76\xdd\xdf"
- yield (
- DisplayFormat(
- binding_context=ONEINCH_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="1inch Aggregation Router V6",
- parameter_definitions=[
- Atomic(parse_bytes32), # to
- Atomic(parse_bytes32), # token
- Atomic(parse_uint256), # amount
- Atomic(parse_uint256), # minReturn
- Atomic(parse_uint256), # dex
- Atomic(parse_bytes32), # dex2
- ],
- field_definitions=[
- FieldDefinition(
- (2,), # amount
- "Amount to Send",
- TokenAmountFormatter(
- token_path=(1, (-20,)), # token.[-20:]
- native_currency_address=ONEINCH_NATIVE_CURRENCY_ADDRESSES,
- ),
- ),
- FieldDefinition(
- (0, (-20,)), # to.[-20:]
- "Beneficiary",
- AddressNameFormatter,
- ),
- FieldDefinition(
- (5, (-20,)), # dex2.[-20:]
- "Last Pool",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\xf7\xa7\x00\x56"
- yield (
- DisplayFormat(
- binding_context=ONEINCH_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="1inch Aggregation Router V6",
- parameter_definitions=[
- Atomic(parse_bytes32), # to
- Atomic(parse_bytes32), # token
- Atomic(parse_uint256), # amount
- Atomic(parse_uint256), # minReturn
- Atomic(parse_uint256), # dex
- Atomic(parse_uint256), # dex2
- Atomic(parse_bytes32), # dex3
- ],
- field_definitions=[
- FieldDefinition(
- (2,), # amount
- "Amount to Send",
- TokenAmountFormatter(
- token_path=(1, (-20,)), # token.[-20:]
- native_currency_address=ONEINCH_NATIVE_CURRENCY_ADDRESSES,
- ),
- ),
- FieldDefinition(
- (0, (-20,)), # to.[-20:]
- "Beneficiary",
- AddressNameFormatter,
- ),
- FieldDefinition(
- (6, (-20,)), # dex3.[-20:]
- "Last Pool",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\xa7\x6d\xfc\x3b"
- yield (
- DisplayFormat(
- binding_context=ONEINCH_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="1inch Aggregation Router V6",
- parameter_definitions=[
- Atomic(parse_uint256), # minReturn
- Atomic(parse_bytes32), # dex
- ],
- field_definitions=[
- FieldDefinition(
- ContainerPath.Value, # @.value
- "Amount to Send",
- AmountFormatter,
- ),
- FieldDefinition(
- ContainerPath.From, # @.from
- "Beneficiary",
- AddressNameFormatter,
- ),
- FieldDefinition(
- (1, (-20,)), # dex.[-20:]
- "Last Pool",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\x89\xaf\x92\x6a"
- yield (
- DisplayFormat(
- binding_context=ONEINCH_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="1inch Aggregation Router V6",
- parameter_definitions=[
- Atomic(parse_uint256), # minReturn
- Atomic(parse_uint256), # dex
- Atomic(parse_bytes32), # dex2
- ],
- field_definitions=[
- FieldDefinition(
- ContainerPath.Value, # @.value
- "Amount to Send",
- AmountFormatter,
- ),
- FieldDefinition(
- ContainerPath.From, # @.from
- "Beneficiary",
- AddressNameFormatter,
- ),
- FieldDefinition(
- (2, (-20,)), # dex2.[-20:]
- "Last Pool",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\x18\x8a\xc3\x5d"
- yield (
- DisplayFormat(
- binding_context=ONEINCH_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="1inch Aggregation Router V6",
- parameter_definitions=[
- Atomic(parse_uint256), # minReturn
- Atomic(parse_uint256), # dex
- Atomic(parse_uint256), # dex2
- Atomic(parse_bytes32), # dex3
- ],
- field_definitions=[
- FieldDefinition(
- ContainerPath.Value, # @.value
- "Amount to Send",
- AmountFormatter,
- ),
- FieldDefinition(
- ContainerPath.From, # @.from
- "Beneficiary",
- AddressNameFormatter,
- ),
- FieldDefinition(
- (3, (-20,)), # dex3.[-20:]
- "Last Pool",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\x17\x5a\xcc\xdc"
- yield (
- DisplayFormat(
- binding_context=ONEINCH_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="1inch Aggregation Router V6",
- parameter_definitions=[
- Atomic(parse_bytes32), # to
- Atomic(parse_uint256), # minReturn
- Atomic(parse_bytes32), # dex
- ],
- field_definitions=[
- FieldDefinition(
- ContainerPath.Value, # @.value
- "Amount to Send",
- AmountFormatter,
- ),
- FieldDefinition(
- (0, (-20,)), # to.[-20:]
- "Beneficiary",
- AddressNameFormatter,
- ),
- FieldDefinition(
- (2, (-20,)), # dex.[-20:]
- "Last Pool",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\x0f\x44\x9d\x71"
- yield (
- DisplayFormat(
- binding_context=ONEINCH_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="1inch Aggregation Router V6",
- parameter_definitions=[
- Atomic(parse_bytes32), # to
- Atomic(parse_uint256), # minReturn
- Atomic(parse_uint256), # dex
- Atomic(parse_bytes32), # dex2
- ],
- field_definitions=[
- FieldDefinition(
- ContainerPath.Value, # @.value
- "Amount to Send",
- AmountFormatter,
- ),
- FieldDefinition(
- (0, (-20,)), # to.[-20:]
- "Beneficiary",
- AddressNameFormatter,
- ),
- FieldDefinition(
- (3, (-20,)), # dex2.[-20:]
- "Last Pool",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\x49\x31\x89\xf0"
- yield (
- DisplayFormat(
- binding_context=ONEINCH_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="1inch Aggregation Router V6",
- parameter_definitions=[
- Atomic(parse_bytes32), # to
- Atomic(parse_uint256), # minReturn
- Atomic(parse_uint256), # dex
- Atomic(parse_uint256), # dex2
- Atomic(parse_bytes32), # dex3
- ],
- field_definitions=[
- FieldDefinition(
- ContainerPath.Value, # @.value
- "Amount to Send",
- AmountFormatter,
- ),
- FieldDefinition(
- (0, (-20,)), # to.[-20:]
- "Beneficiary",
- AddressNameFormatter,
- ),
- FieldDefinition(
- (4, (-20,)), # dex3.[-20:]
- "Last Pool",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- # https://github.com/ethereum/clear-signing-erc7730-registry/blob/master/registry/uniswap/calldata-UniswapV3Router02.json#L6
- UNISWAP_V3_ROUTER_ADDRESS = b"\x68\xb3\x46\x58\x33\xfb\x72\xa7\x0e\xcd\xf4\x85\xe0\xe4\xc7\xbd\x86\x65\xfc\x45"
- UNISWAP_V3_ROUTER_CHAINS = [1]
-
- # https://github.com/ethereum/clear-signing-erc7730-registry/blob/master/registry/uniswap/calldata-UniswapV3Router02.json
-
- UNISWAP_CONTEXT = BindingContext(
- [(chain, UNISWAP_V3_ROUTER_ADDRESS) for chain in UNISWAP_V3_ROUTER_CHAINS],
- )
-
- _FUNC_SIG = b"\xb8\x58\x18\x3f"
- yield (
- DisplayFormat(
- binding_context=UNISWAP_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="Uniswap V3 Router",
- parameter_definitions=[
- Tuple(
- (
- parse_bytes, # path
- parse_address, # recipient
- parse_uint256, # amountIn
- parse_uint256, # amountOutMinimum
- ),
- is_dynamic=True,
- ), # params
- ],
- field_definitions=[
- FieldDefinition(
- (0, 2), # params.amountIn
- "Amount to Send",
- TokenAmountFormatter(
- token_path=(0, 0, (0, 20)), # params.path.[0:20]
- ),
- ),
- FieldDefinition(
- (0, 3), # params.amountOutMinimum
- "Minimum to Receive",
- TokenAmountFormatter(
- token_path=(0, 0, (-20,)), # params.path.[-20:]
- ),
- ),
- FieldDefinition(
- (0, 1), # params.recipient
- "Beneficiary",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\x04\xe4\x5a\xaf"
- yield (
- DisplayFormat(
- binding_context=UNISWAP_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="Uniswap V3 Router",
- parameter_definitions=[
- Tuple(
- (
- parse_address, # tokenIn
- parse_address, # tokenOut
- parse_uint24, # fee
- parse_address, # recipient
- parse_uint256, # amountIn
- parse_uint256, # amountOutMinimum
- parse_uint160, # sqrtPriceLimitX96
- ),
- is_dynamic=False,
- ), # params
- ],
- field_definitions=[
- FieldDefinition(
- (0, 4), # amountIn
- "Send",
- TokenAmountFormatter(
- token_path=(0, 0), # params.tokenIn
- ),
- ),
- FieldDefinition(
- (0, 5), # amountOutMinimum
- "Minimum to Receive",
- TokenAmountFormatter(
- token_path=(0, 1), # params.tokenOut
- ),
- ),
- FieldDefinition(
- (0, 2), # fee
- "Uniswap fee",
- UnitFormatter(decimals=4, base="%", prefix=False),
- ),
- FieldDefinition(
- (0, 3), # recipient
- "Beneficiary",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\x09\xb8\x13\x46"
- yield (
- DisplayFormat(
- binding_context=UNISWAP_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="Uniswap V3 Router",
- parameter_definitions=[
- Tuple(
- (
- parse_bytes, # path
- parse_address, # recipient
- parse_uint256, # amountOut
- parse_uint256, # amountInMaximum
- ),
- is_dynamic=True,
- ), # params
- ],
- field_definitions=[
- FieldDefinition(
- (0, 3), # params.amountInMaximum
- "Maximum Amount In",
- TokenAmountFormatter(
- token_path=(0, 0, (-20,)), # params.path.[-20:]
- ),
- ),
- FieldDefinition(
- (0, 2), # params.amountOut
- "Amount to Receive",
- TokenAmountFormatter(
- token_path=(0, 0, (0, 20)), # params.path.[0:20]
- ),
- ),
- FieldDefinition(
- (0, 1), # params.recipient
- "Beneficiary",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
- _FUNC_SIG = b"\x50\x23\xb4\xdf"
- yield (
- DisplayFormat(
- binding_context=UNISWAP_CONTEXT,
- func_sig=_FUNC_SIG,
- intent="Swap",
- provider_name="Uniswap V3 Router",
- parameter_definitions=[
- Tuple(
- (
- parse_address, # tokenIn
- parse_address, # tokenOut
- parse_uint24, # fee
- parse_address, # recipient
- parse_uint256, # amountOut
- parse_uint256, # amountInMaximum
- parse_uint160, # sqrtPriceLimitX96
- ),
- is_dynamic=False,
- ), # params
- ],
- field_definitions=[
- FieldDefinition(
- (0, 5), # amountInMaximum
- "Maximum Amount In",
- TokenAmountFormatter(
- token_path=(0, 0), # params.tokenIn
- ),
- ),
- FieldDefinition(
- (0, 4), # amountOut
- "Amount to Receive",
- TokenAmountFormatter(
- token_path=(0, 1), # params.tokenOut
- ),
- ),
- FieldDefinition(
- (0, 2), # fee
- "Uniswap fee",
- UnitFormatter(decimals=4, base="%", prefix=False),
- ),
- FieldDefinition(
- (0, 3), # recipient
- "Beneficiary",
- AddressNameFormatter,
- ),
- ],
- )
- )
-
# Canonical WETH (Wrapped Ether) contracts holding the chain's native currency.
# Wrapping is 1:1 and reversible, so the amounts are rendered with the native
# currency formatter: deposit() wraps the transaction value into WETH and
@@ -820,6 +103,22 @@ def all_display_formats() -> Generator[DisplayFormat, None, None]:
)
if __debug__:
+ from .clear_signing import (
+ Array,
+ DateFormatter,
+ DynamicLeaf,
+ RawFormatter,
+ Tuple,
+ UnitFormatter,
+ make_fixed_bytes_parser,
+ make_uint_parser,
+ parse_bool,
+ parse_bytes,
+ parse_string,
+ )
+
+ parse_bytes32 = make_fixed_bytes_parser(32)
+ parse_uint160 = make_uint_parser(160)
# One contract to test it all would have been easier. But Caesar has a paragraph limit.
# * TREZOR_TEST_SCALARS_DESCRIPTOR - scalar/atomic formatters
### core/tests/test_apps.ethereum.clear_signing_definitions.py
@@ -21,25 +21,6 @@
# ERC-20
b"approve(address,uint256)",
b"transfer(address,uint256)",
- # 1inch AggregationRouterV6
- b"swap(address,(address,address,address,address,uint256,uint256,uint256),bytes)",
- b"unoswap(uint256,uint256,uint256,uint256)",
- b"unoswapTo(uint256,uint256,uint256,uint256,uint256)",
- b"unoswap2(uint256,uint256,uint256,uint256,uint256)",
- b"unoswap3(uint256,uint256,uint256,uint256,uint256,uint256)",
- b"unoswapTo2(uint256,uint256,uint256,uint256,uint256,uint256)",
- b"unoswapTo3(uint256,uint256,uint256,uint256,uint256,uint256,uint256)",
- b"ethUnoswap(uint256,uint256)",
- b"ethUnoswap2(uint256,uint256,uint256)",
- b"ethUnoswap3(uint256,uint256,uint256,uint256)",
- b"ethUnoswapTo(uint256,uint256,uint256)",
- b"ethUnoswapTo2(uint256,uint256,uint256,uint256)",
- b"ethUnoswapTo3(uint256,uint256,uint256,uint256,uint256)",
- # Uniswap V3 Router 02
- b"exactInput((bytes,address,uint256,uint256))",
- b"exactInputSingle((address,address,uint24,address,uint256,uint256,uint160))",
- b"exactOutput((bytes,address,uint256,uint256))",
- b"exactOutputSingle((address,address,uint24,address,uint256,uint256,uint160))",
# ERC-4626 vaults + Merkl claim (apps.ethereum.yielding)
b"deposit(uint256,address)",
b"withdraw(uint256,address,address)",
### tests/device_tests/ethereum/definitions/eth/chain-id/1/display-format/111111125421ca6dc452d289314280a0f8842a65-07ed2379.dat
[binary or diff unavailable]
### tests/ui_tests/fixtures.json
[binary or diff unavailable]Why this scored 34/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.