What changed, and why it matters
This commit is a straightforward internal code cleanup. It renames a parameter from 'token_address' to 'extra_menu_items' and changes it from a single Ethereum token address string into a generic list of extra label/value pairs. The Ethereum app now passes the token contract address as one item in that list, while other cryptocurrency apps simply pass an empty list. There is no change to user-facing security behavior and no bug fix or vulnerability patch.
No security action needed. Treat as a normal maintainability refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The refactor decouples the trade-confirmation UI layouts from Ethereum-specific concepts. The confirm_payment_request helper and the underlying trade confirmation helpers in four UI themes (bolt, caesar, delizia, eckhart) replace the optional token_address: str | None parameter with extra_menu_items: list[tuple[str, str]] | None. Callers in apps/bitcoin/sign_tx/layout.py, cardano, ripple, solana, and stellar drop their trailing None argument; apps/ethereum/layout.py now passes [(TR.ethereum__token_contract, token_address)]. The displayed information remains identical: where a token address was previously shown, it is still shown with the same label.
Changed components
core/src/apps/bitcoin/sign_tx/layout.pycore/src/apps/cardano/layout.pycore/src/apps/ethereum/layout.pycore/src/apps/ripple/layout.pycore/src/apps/solana/layout.pycore/src/apps/stellar/layout.pycore/src/trezor/ui/layouts/bolt/__init__.pycore/src/trezor/ui/layouts/caesar/__init__.pycore/src/trezor/ui/layouts/delizia/__init__.pycore/src/trezor/ui/layouts/eckhart/__init__.pyInspect captured patch +21 / −32
diff --git a/core/src/apps/bitcoin/sign_tx/layout.py b/core/src/apps/bitcoin/sign_tx/layout.py
index 964a996f..663710df 100644
--- a/core/src/apps/bitcoin/sign_tx/layout.py
+++ b/core/src/apps/bitcoin/sign_tx/layout.py
@@ -221,7 +221,6 @@ async def show_payment_request_details(
account_items,
None,
None,
- None,
)
diff --git a/core/src/apps/cardano/layout.py b/core/src/apps/cardano/layout.py
index f53839ad..7a16936e 100644
--- a/core/src/apps/cardano/layout.py
+++ b/core/src/apps/cardano/layout.py
@@ -1262,5 +1262,4 @@ async def require_confirm_payment_request(
account_items,
None,
None,
- None,
)
diff --git a/core/src/apps/ethereum/layout.py b/core/src/apps/ethereum/layout.py
index d2fd0001..aa13d9ec 100644
--- a/core/src/apps/ethereum/layout.py
+++ b/core/src/apps/ethereum/layout.py
@@ -181,7 +181,7 @@ async def require_confirm_payment_request(
account_items,
maximum_fee,
fee_info_items,
- token_address,
+ [(TR.ethereum__token_contract, token_address)],
)
diff --git a/core/src/apps/ripple/layout.py b/core/src/apps/ripple/layout.py
index d34bc9d3..980993c1 100644
--- a/core/src/apps/ripple/layout.py
+++ b/core/src/apps/ripple/layout.py
@@ -97,5 +97,4 @@ async def require_confirm_payment_request(
account_items,
None,
None,
- None,
)
diff --git a/core/src/apps/solana/layout.py b/core/src/apps/solana/layout.py
index 12782e07..c1afd243 100644
--- a/core/src/apps/solana/layout.py
+++ b/core/src/apps/solana/layout.py
@@ -586,5 +586,4 @@ async def confirm_payment_request(
account_items,
fee_str,
fee_items,
- None,
)
diff --git a/core/src/apps/stellar/layout.py b/core/src/apps/stellar/layout.py
index 036ebd44..3cfc0893 100644
--- a/core/src/apps/stellar/layout.py
+++ b/core/src/apps/stellar/layout.py
@@ -109,7 +109,6 @@ async def require_confirm_payment_request(
account_items,
None,
None,
- None,
)
diff --git a/core/src/trezor/ui/layouts/bolt/__init__.py b/core/src/trezor/ui/layouts/bolt/__init__.py
index c1c8871f..38aba1ba 100644
--- a/core/src/trezor/ui/layouts/bolt/__init__.py
+++ b/core/src/trezor/ui/layouts/bolt/__init__.py
@@ -494,7 +494,7 @@ async def confirm_payment_request(
account_items: list[PropertyType] | None,
transaction_fee: str | None,
fee_info_items: Iterable[PropertyType] | None,
- token_address: str | None,
+ extra_menu_items: list[tuple[str, str]] | None = None,
) -> None:
is_swap = len(trades) != 0 and all(
sell_amount is not None for sell_amount, _, _, _, _ in trades
@@ -551,7 +551,7 @@ async def confirm_payment_request(
t_address,
t_account,
t_account_path,
- token_address,
+ extra_menu_items or [],
)
if transaction_fee is not None:
@@ -1177,7 +1177,7 @@ if not utils.BITCOIN_ONLY:
address: str,
account: str | None,
account_path: str | None,
- token_address: str | None,
+ extra_menu_items: list[tuple[str, str]],
) -> None:
menu_items: list[PropertyType] = [
(TR.address__title_receive_address, address, None)
@@ -1186,8 +1186,8 @@ if not utils.BITCOIN_ONLY:
menu_items.append((TR.words__account, account, None))
if account_path:
menu_items.append((TR.address_details__derivation_path, account_path, None))
- if token_address is not None:
- menu_items.append((TR.ethereum__token_contract, token_address, None))
+ for k, v in extra_menu_items:
+ menu_items.append((k, v, None))
items = []
if sell_amount is not None:
diff --git a/core/src/trezor/ui/layouts/caesar/__init__.py b/core/src/trezor/ui/layouts/caesar/__init__.py
index 2c98cfff..53e26fcb 100644
--- a/core/src/trezor/ui/layouts/caesar/__init__.py
+++ b/core/src/trezor/ui/layouts/caesar/__init__.py
@@ -559,7 +559,7 @@ async def confirm_payment_request(
account_items: list[PropertyType],
transaction_fee: str | None,
fee_info_items: Iterable[PropertyType] | None,
- token_address: str | None,
+ extra_menu_items: list[tuple[str, str]] | None = None,
) -> None:
from trezor.ui.layouts.menu import Menu, confirm_with_menu
@@ -612,7 +612,7 @@ async def confirm_payment_request(
t_address,
t_account,
t_account_path,
- token_address,
+ extra_menu_items or [],
)
if transaction_fee is not None:
@@ -1158,7 +1158,7 @@ if not utils.BITCOIN_ONLY:
address: str,
account: str | None,
account_path: str | None,
- token_address: str | None,
+ extra_menu_items: list[tuple[str, str]],
) -> None:
from trezor.ui.layouts.menu import Menu, confirm_with_menu
@@ -1181,10 +1181,8 @@ if not utils.BITCOIN_ONLY:
(TR.address_details__derivation_path, account_path, None)
)
menu_items = [create_details(TR.address__title_receive_address, account_items)]
- if token_address is not None:
- menu_items.append(
- create_details(TR.ethereum__token_contract, token_address)
- )
+ for k, v in extra_menu_items:
+ menu_items.append(create_details(k, v))
menu = Menu.root(menu_items)
await confirm_with_menu(trade_layout, menu, "confirm_trade")
diff --git a/core/src/trezor/ui/layouts/delizia/__init__.py b/core/src/trezor/ui/layouts/delizia/__init__.py
index b39d0d9e..56e4f076 100644
--- a/core/src/trezor/ui/layouts/delizia/__init__.py
+++ b/core/src/trezor/ui/layouts/delizia/__init__.py
@@ -492,7 +492,7 @@ async def confirm_payment_request(
account_items: list[PropertyType] | None,
transaction_fee: str | None,
fee_info_items: Iterable[PropertyType] | None,
- token_address: str | None,
+ extra_menu_items: list[tuple[str, str]] | None = None,
) -> None:
from trezor.ui.layouts.menu import Menu, confirm_with_menu
@@ -550,7 +550,7 @@ async def confirm_payment_request(
t_address,
t_account,
t_account_path,
- token_address,
+ extra_menu_items or [],
)
if transaction_fee is not None:
@@ -1120,7 +1120,7 @@ if not utils.BITCOIN_ONLY:
address: str,
account: str | None,
account_path: str | None,
- token_address: str | None,
+ extra_menu_items: list[tuple[str, str]],
) -> None:
from trezor.ui.layouts.menu import Menu, confirm_with_menu
@@ -1139,10 +1139,8 @@ if not utils.BITCOIN_ONLY:
(TR.address_details__derivation_path, account_path, None)
)
menu_items = [create_details(TR.address__title_receive_address, account_items)]
- if token_address is not None:
- menu_items.append(
- create_details(TR.ethereum__token_contract, token_address)
- )
+ for k, v in extra_menu_items:
+ menu_items.append(create_details(k, v))
menu = Menu.root(menu_items, TR.send__cancel_sign)
await confirm_with_menu(trade_layout, menu, "confirm_trade")
diff --git a/core/src/trezor/ui/layouts/eckhart/__init__.py b/core/src/trezor/ui/layouts/eckhart/__init__.py
index 5f70a3cb..0fcb5e86 100644
--- a/core/src/trezor/ui/layouts/eckhart/__init__.py
+++ b/core/src/trezor/ui/layouts/eckhart/__init__.py
@@ -453,7 +453,7 @@ async def confirm_payment_request(
account_items: list[PropertyType],
transaction_fee: str | None,
fee_info_items: Iterable[PropertyType] | None,
- token_address: str | None,
+ extra_menu_items: list[tuple[str, str]] | None = None,
) -> None:
from trezor.ui.layouts.menu import Menu, confirm_with_menu
@@ -528,7 +528,7 @@ async def confirm_payment_request(
t_address,
t_account,
t_account_path,
- token_address,
+ extra_menu_items or [],
can_go_back_from_trade,
)
if res is BACK:
@@ -1148,7 +1148,7 @@ if not utils.BITCOIN_ONLY:
address: str,
account: str | None,
account_path: str | None,
- token_address: str | None,
+ extra_menu_items: list[tuple[str, str]],
back_button: bool,
) -> Awaitable[ui.UiResult]:
from trezor.ui.layouts.menu import Menu, interact_with_menu
@@ -1169,10 +1169,8 @@ if not utils.BITCOIN_ONLY:
(TR.address_details__derivation_path, account_path, True)
)
menu_items = [create_details(TR.address__title_receive_address, account_info)]
- if token_address is not None:
- menu_items.append(
- create_details(TR.ethereum__token_contract, token_address)
- )
+ for k, v in extra_menu_items:
+ menu_items.append(create_details(k, v))
menu = Menu.root(menu_items, TR.send__cancel_sign)
return interact_with_menu(trade_layout, menu, "confirm_trade")
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.