What changed, and why it matters
This commit is a simple code cleanup: it moves a small list of known Ethereum contract addresses and their human-readable names from one file to a new dedicated file. The actual addresses and names remain exactly the same, and no security behavior changes.
No security action needed; treat as routine maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change extracts the KNOWN_ADDRESSES dictionary (mapping contract addresses to display labels such as ‘1inch Aggregation Router V6’, ‘LiFI Diamond’, and ‘Uniswap V3 Router’) from clear_signing_definitions.py into a new module sc_constants.py. Import statements in clear_signing.py are updated accordingly. Values, keys, and usage are unchanged; this is a pure refactor.
Changed components
core/src/apps/ethereum/clear_signing.pycore/src/apps/ethereum/clear_signing_definitions.pycore/src/apps/ethereum/sc_constants.pycore/embed/upymod/qstrdefsport.hInspect captured patch +18 / −19
diff --git a/core/embed/upymod/qstrdefsport.h b/core/embed/upymod/qstrdefsport.h
index 16ccf556..9b3ca666 100644
--- a/core/embed/upymod/qstrdefsport.h
+++ b/core/embed/upymod/qstrdefsport.h
@@ -553,6 +553,7 @@ Q(apps.ethereum.helpers)
Q(apps.ethereum.keychain)
Q(apps.ethereum.layout)
Q(apps.ethereum.networks)
+Q(apps.ethereum.sc_constants)
Q(apps.ethereum.sign_message)
Q(apps.ethereum.sign_tx)
Q(apps.ethereum.sign_tx_eip1559)
diff --git a/core/src/apps/ethereum/clear_signing.py b/core/src/apps/ethereum/clear_signing.py
index 765e4330..aa595df9 100644
--- a/core/src/apps/ethereum/clear_signing.py
+++ b/core/src/apps/ethereum/clear_signing.py
@@ -672,11 +672,9 @@ async def _handle_approve(
maximum_fee: str,
fee_items: Iterable[StrPropertyType],
) -> None:
- from .clear_signing_definitions import (
- KNOWN_ADDRESSES,
- SC_FUNC_APPROVE_REVOKE_AMOUNT,
- )
+ from .clear_signing_definitions import SC_FUNC_APPROVE_REVOKE_AMOUNT
from .layout import require_confirm_approve
+ from .sc_constants import KNOWN_ADDRESSES
args, fields = display_format.parse(
calldata, msg.address_n, msg.value, definitions, token
@@ -787,9 +785,9 @@ async def _handle_generic_ui(
maximum_fee: str,
) -> None:
from . import tokens
- from .clear_signing_definitions import KNOWN_ADDRESSES
from .helpers import bytes_from_address
from .layout import require_confirm_clear_signing
+ from .sc_constants import KNOWN_ADDRESSES
_, fields = display_format.parse(
calldata, msg.address_n, msg.value, definitions, token
diff --git a/core/src/apps/ethereum/clear_signing_definitions.py b/core/src/apps/ethereum/clear_signing_definitions.py
index 1ee6336b..3abb8b78 100644
--- a/core/src/apps/ethereum/clear_signing_definitions.py
+++ b/core/src/apps/ethereum/clear_signing_definitions.py
@@ -82,7 +82,6 @@ ONEINCH_CHAINS = [
59144,
1313161554,
]
-ONEINCH_OWNER = "1inch Aggregation Router V6"
# https://github.com/LedgerHQ/clear-signing-erc7730-registry/blob/master/registry/lifi/calldata-LIFIDiamond.json
LIFI_ADDRESS = unhexlify("1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE")
@@ -118,7 +117,6 @@ LIFI_CHAINS = [
1313161554,
1666600000,
]
-LIFI_OWNER = "LiFI Diamond"
LIFI_CONTEXT = BindingContext(
[(chain, LIFI_ADDRESS) for chain in LIFI_CHAINS],
@@ -470,11 +468,6 @@ ALL_DISPLAY_FORMATS.extend(
# https://github.com/LedgerHQ/clear-signing-erc7730-registry/blob/master/registry/uniswap/calldata-UniswapV3Router02.json#L6
UNISWAP_V3_ROUTER_ADDRESS = unhexlify("68b3465833fb72A70ecDF485E0e4C7bD8665Fc45")
UNISWAP_V3_ROUTER_CHAINS = [1]
-UNISWAP_OWNER = "Uniswap V3 Router"
-
-UNISWAP_V3_OLD_DEPLOYER = unhexlify(
- "e592427a0aece92de3edee1f18e0157c05861564"
-) # https://etherscan.io/address/0xe592427a0aece92de3edee1f18e0157c05861564
# https://github.com/LedgerHQ/clear-signing-erc7730-registry/blob/master/registry/uniswap/calldata-UniswapV3Router02.json
@@ -650,10 +643,3 @@ ALL_DISPLAY_FORMATS.extend(
),
]
)
-
-KNOWN_ADDRESSES = {
- ONEINCH_ADDRESS: ONEINCH_OWNER,
- LIFI_ADDRESS: LIFI_OWNER,
- UNISWAP_V3_ROUTER_ADDRESS: UNISWAP_OWNER,
- UNISWAP_V3_OLD_DEPLOYER: UNISWAP_OWNER,
-}
diff --git a/core/src/apps/ethereum/sc_constants.py b/core/src/apps/ethereum/sc_constants.py
new file mode 100644
index 00000000..bb8c3c6b
--- /dev/null
+++ b/core/src/apps/ethereum/sc_constants.py
@@ -0,0 +1,14 @@
+from ubinascii import unhexlify
+
+KNOWN_ADDRESSES = {
+ # https://github.com/LedgerHQ/clear-signing-erc7730-registry/blob/master/registry/1inch/calldata-AggregationRouterV6.json#L9
+ unhexlify(
+ "111111125421cA6dc452d289314280a0f8842A65"
+ ): "1inch Aggregation Router V6",
+ # https://github.com/LedgerHQ/clear-signing-erc7730-registry/blob/master/registry/lifi/calldata-LIFIDiamond.json
+ unhexlify("1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE"): "LiFI Diamond",
+ # https://github.com/LedgerHQ/clear-signing-erc7730-registry/blob/master/registry/uniswap/calldata-UniswapV3Router02.json#L6
+ unhexlify("68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"): "Uniswap V3 Router",
+ # https://etherscan.io/address/0xe592427a0aece92de3edee1f18e0157c05861564
+ unhexlify("e592427a0aece92de3edee1f18e0157c05861564"): "Uniswap V3 Router",
+}
Why this scored 15/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.