chore(core): inline `SC_FUNC_APPROVE_REVOKE_AMOUNT` constant definition
What changed, and why it matters
This commit is a minor code cleanup: it replaces a named constant with the literal number 0 in one place and removes the constant definition. There is no functional change, no bug fix, and no security relevance visible in the diff.
No security action needed; treat as routine refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change inlines SC_FUNC_APPROVE_REVOKE_AMOUNT (value 0) directly into the comparison in _handle_approve() and deletes the constant from clear_signing_definitions.py. The logic is_revoke = arg1_raw_value == 0 remains identical. No behavior, validation, or trust boundary changes.
Changed components
core/src/apps/ethereum/clear_signing.pycore/src/apps/ethereum/clear_signing_definitions.pyInspect captured patch +2 / −3
diff --git a/core/src/apps/ethereum/clear_signing.py b/core/src/apps/ethereum/clear_signing.py
index b4d6f32b..49500334 100644
--- a/core/src/apps/ethereum/clear_signing.py
+++ b/core/src/apps/ethereum/clear_signing.py
@@ -1067,7 +1067,6 @@ async def _handle_approve(
maximum_fee: str,
fee_items: Iterable[StrPropertyType],
) -> None:
- from .clear_signing_definitions import SC_FUNC_APPROVE_REVOKE_AMOUNT
from .layout import require_confirm_approve
from .sc_constants import KNOWN_ADDRESSES
from .yielding_vaults import UNKNOWN_VAULT, lookup_vault
@@ -1106,7 +1105,8 @@ async def _handle_approve(
if vault is not UNKNOWN_VAULT:
recipient_str = vault.name
- is_revoke = arg1_raw_value == SC_FUNC_APPROVE_REVOKE_AMOUNT
+ # In revocation, the approved amount is set to zero:
+ is_revoke = arg1_raw_value == 0
await require_confirm_approve(
recipient_addr,
diff --git a/core/src/apps/ethereum/clear_signing_definitions.py b/core/src/apps/ethereum/clear_signing_definitions.py
index 39964bbc..be946778 100644
--- a/core/src/apps/ethereum/clear_signing_definitions.py
+++ b/core/src/apps/ethereum/clear_signing_definitions.py
@@ -33,7 +33,6 @@ APPROVE_DISPLAY_FORMAT = DisplayFormat(
),
],
)
-SC_FUNC_APPROVE_REVOKE_AMOUNT = 0
TRANSFER_DISPLAY_FORMAT = DisplayFormat(
binding_context=None,
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.