1111from apps .tron .serialize import serialize
1212
1313from . import ICON , PRIMARY_COLOR , layout , tokens
14- from .providers import provider_by_address
1514
1615
1716@auto_keychain (__name__ )
@@ -51,17 +50,10 @@ async def _require_confirm_by_type(ctx, transaction, owner_address):
5150 if contract .transfer_contract .amount is None :
5251 raise wire .DataError ("Invalid Tron transfer amount" )
5352 recipient = contract .transfer_contract .to_address
54- banner_text = None
55- if provider_by_address (recipient ) is not None :
56- from trezor .lvglui .i18n import gettext as _
57- from trezor .lvglui .i18n import keys as i18n_keys
58-
59- banner_text = _ (i18n_keys .BANNER_ENERGY_RENTAL )
6053 await layout .require_confirm_tx (
6154 ctx ,
6255 recipient ,
6356 contract .transfer_contract .amount ,
64- banner_text = banner_text ,
6557 )
6658 elif contract .trigger_smart_contract :
6759 # check if TRC20 transfer/approval
@@ -83,18 +75,17 @@ async def _require_confirm_by_type(ctx, transaction, owner_address):
8375 action = "Approve"
8476
8577 if action == "Transfer" :
86- token = tokens .token_by_address (
87- contract .trigger_smart_contract .contract_address
88- )
78+ token_addr = contract .trigger_smart_contract .contract_address
79+ token = tokens .token_by_address (token_addr )
8980 recipient = _address_base58 (b"\x41 " + data [16 :36 ])
9081 value = int .from_bytes (data [36 :68 ], "big" )
91- await layout .require_confirm_trigger_trc20 (
82+ if token is tokens .UNKNOWN_TOKEN :
83+ await layout .require_confirm_unknown_token (ctx , token_addr )
84+ await layout .require_confirm_tx (
9285 ctx ,
93- False if token is tokens .UNKNOWN_TOKEN else True ,
94- contract .trigger_smart_contract .contract_address ,
86+ recipient ,
9587 value ,
9688 token ,
97- recipient ,
9889 )
9990 if transaction .fee_limit :
10091 await layout .require_confirm_fee (
0 commit comments