From cbb27c5fd6de1a3e8070b4b923c6d104b32a09ed Mon Sep 17 00:00:00 2001 From: Ritchie Date: Fri, 6 Sep 2024 16:50:06 +0800 Subject: [PATCH] fix(core): update ethereum chains data and add erc-20 toekn `POL` support --- common/defs/ethereum/chains | 2 +- common/defs/evm_tokens/1.json | 26 +++++++++++++++++++++++ common/defs/support.json | 18 ++++++++-------- common/tools/coin_info.py | 1 + core/src/apps/ethereum/networks.py | 34 +++++++++++++++--------------- core/src/apps/ethereum/tokens.py | 6 ++++++ 6 files changed, 60 insertions(+), 27 deletions(-) diff --git a/common/defs/ethereum/chains b/common/defs/ethereum/chains index 3fb1fb982..ddf2efa5b 160000 --- a/common/defs/ethereum/chains +++ b/common/defs/ethereum/chains @@ -1 +1 @@ -Subproject commit 3fb1fb982c09a310163d0b0953e73a121ab61401 +Subproject commit ddf2efa5b91823383a4219a6bd7376748f2139e7 diff --git a/common/defs/evm_tokens/1.json b/common/defs/evm_tokens/1.json index 2e3351c51..e188274eb 100644 --- a/common/defs/evm_tokens/1.json +++ b/common/defs/evm_tokens/1.json @@ -157,6 +157,32 @@ "__v": 0, "marketCap": "6126893790.915463" }, + { + "_id": "62e8a3d28edb7c3c91a5586b", + "name": "Polygon", + "symbol": "POL", + "address": "0x455e53CBB86018Ac2B8092FdCd39d8444aFFC3F6", + "decimals": 18, + "logoURI": "https://common.onekey-asset.com/token/evm-1/0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0.jpg", + "impl": "evm", + "status": "LISTED", + "verified": true, + "security": false, + "addToIndex": false, + "chainId": "1", + "source": [ + "sushi", + "Uniswap Labs Default", + "Coingecko" + ], + "checked": true, + "coingeckoId": "matic-network", + "swftId": "MATIC", + "createdAt": "2022-08-02T04:10:58.228Z", + "updatedAt": "2022-11-16T13:02:51.357Z", + "__v": 0, + "marketCap": "6126893790.915463" + }, { "_id": "62e8a3d28edb7c3c91a5585f", "name": "Wrapped BTC", diff --git a/common/defs/support.json b/common/defs/support.json index b84b19669..925930ade 100644 --- a/common/defs/support.json +++ b/common/defs/support.json @@ -4744,7 +4744,7 @@ "eth:EWT": "2.3.5", "eth:EXP": "2.0.7", "eth:FETH": "2.4.2", - "eth:FIL": "4.3.0", + "eth:FIL:314": "4.3.0", "eth:FIN": "2.3.5", "eth:FLR": "2.3.7", "eth:FSN": "2.4.2", @@ -4758,7 +4758,7 @@ "eth:GT": "2.4.2", "eth:GooD": "2.4.2", "eth:HAIC": "2.4.2", - "eth:HO": "2.4.4", + "eth:HO:1280": "2.4.4", "eth:HOP": "2.4.4", "eth:HPB": "2.1.1", "eth:HT": "2.3.7", @@ -4772,12 +4772,12 @@ "eth:KCS": "2.4.2", "eth:KLAY": "2.3.7", "eth:KTO:2559": "2.4.2", - "eth:L1": "2.4.4", + "eth:L1:29": "2.4.4", "eth:L99": "2.4.3", "eth:LA": "2.4.4", "eth:LISINSKI": "2.3.5", "eth:MATH": "2.3.7", - "eth:MATIC": "2.3.5", + "eth:POL": "2.3.5", "eth:META": "2.1.1", "eth:METIS": "2.4.4", "eth:MINTME": "2.4.2", @@ -4803,7 +4803,7 @@ "eth:ONE:1666600003": "2.3.7", "eth:ONG": "2.4.2", "eth:OY": "2.4.4", - "eth:PALM": "2.4.3", + "eth:PALM:11297108109": "2.4.3", "eth:PETH": "2.4.2", "eth:PHT": "2.3.5", "eth:PHX": "2.4.4", @@ -4812,7 +4812,7 @@ "eth:PLS": "2.4.3", "eth:POA": "2.3.5", "eth:POLIS": "2.4.4", - "eth:POP": "2.4.3", + "eth:POP:1213": "2.4.3", "eth:PRB": "2.4.4", "eth:QKC:100000": "2.4.2", "eth:QKC:100001": "2.4.2", @@ -4843,7 +4843,7 @@ "eth:SPOA": "2.4.4", "eth:SRN": "2.4.3", "eth:Seele": "2.4.4", - "eth:TAO": "2.3.5", + "eth:TAO:558": "2.3.5", "eth:TBG": "2.3.7", "eth:TCH": "2.3.5", "eth:TCLO": "2.3.5", @@ -4851,7 +4851,7 @@ "eth:TETC": "2.3.5", "eth:TFI": "2.3.7", "eth:TLOS:40": "2.4.2", - "eth:TOMO:88": "2.4.4", + "eth:VIC": "2.4.4", "eth:TOYS": "2.3.7", "eth:TPEP": "2.3.5", "eth:TSF": "2.3.5", @@ -4901,7 +4901,7 @@ "eth:tKOT": "2.3.5", "eth:tKOV": "2.0.7", "eth:tMATH": "2.3.7", - "eth:tMATIC": "2.3.5", + "eth:tMATIC:80001": "2.3.5", "eth:tMETC": "2.3.5", "eth:tNEW": "2.3.7", "eth:tNRG": "2.3.5", diff --git a/common/tools/coin_info.py b/common/tools/coin_info.py index d427c2e06..ff53dc38a 100755 --- a/common/tools/coin_info.py +++ b/common/tools/coin_info.py @@ -397,6 +397,7 @@ def _load_btc_coins() -> Coins: } EVM_ICON_NAME_OVERRIDE = { 10: "oeth", + 137: "matic", 288: "boba", 314: "filecoin", 324: "zksync-era", diff --git a/core/src/apps/ethereum/networks.py b/core/src/apps/ethereum/networks.py index f1b597c82..174378c43 100644 --- a/core/src/apps/ethereum/networks.py +++ b/core/src/apps/ethereum/networks.py @@ -120,7 +120,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: 6, # chain_id 1, # slip44 "tKOT", # symbol - "Ethereum Classic Testnet Kotti", # name + "Kotti Testnet", # name "evm-tkot.png", # name 0x969696, # primary_color ) @@ -200,7 +200,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: 16, # chain_id 1, # slip44 "tCFLR", # symbol - "Flare Testnet Coston", # name + "Songbird Testnet Coston", # name "evm-tcflr.png", # name 0x969696, # primary_color ) @@ -264,7 +264,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: 30, # chain_id 137, # slip44 "RBTC", # symbol - "RSK", # name + "Rootstock", # name "evm-rbtc.png", # name 0xD2D2D2, # primary_color ) @@ -272,7 +272,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: 31, # chain_id 1, # slip44 "tRBTC", # symbol - "RSK Testnet", # name + "Rootstock Testnet", # name "evm-trbtc.png", # name 0x969696, # primary_color ) @@ -312,7 +312,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: 44, # chain_id 60, # slip44 "CRAB", # symbol - "Darwinia Crab Network", # name + "Crab Network", # name "evm-crab.png", # name 0xD2D2D2, # primary_color ) @@ -320,7 +320,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: 50, # chain_id 60, # slip44 "XDC", # symbol - "XinFin XDC Network", # name + "XDC Network", # name "evm-xdc.png", # name 0xD2D2D2, # primary_color ) @@ -384,7 +384,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: 62, # chain_id 1, # slip44 "TETC", # symbol - "Ethereum Classic Testnet Morden", # name + "Morden Testnet", # name "evm-tetc.png", # name 0x969696, # primary_color ) @@ -392,7 +392,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: 63, # chain_id 1, # slip44 "tMETC", # symbol - "Ethereum Classic Testnet Mordor", # name + "Mordor Testnet", # name "evm-tmetc.png", # name 0x969696, # primary_color ) @@ -479,9 +479,9 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: yield ( 88, # chain_id 889, # slip44 - "TOMO", # symbol - "TomoChain", # name - "evm-tomo.png", # name + "VIC", # symbol + "Viction", # name + "evm-vic.png", # name 0xD2D2D2, # primary_color ) yield ( @@ -607,7 +607,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: yield ( 137, # chain_id 966, # slip44 - "MATIC", # symbol + "POL", # symbol "Polygon", # name "evm-matic.png", # name 0x8247E5, # primary_color @@ -760,7 +760,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: 324, # chain_id 60, # slip44 "ETH", # symbol - "zkSync Era", # name + "zkSync", # name "evm-zksync-era.png", # name 0xFFFFFF, # primary_color ) @@ -920,7 +920,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: 1001, # chain_id 1, # slip44 "tKLAY", # symbol - "Klaytn Testnet Baobab", # name + "Kaia Testnet Kairos", # name "evm-tklay.png", # name 0x969696, # primary_color ) @@ -1054,7 +1054,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: ) yield ( 1287, # chain_id - 60, # slip44 + 1, # slip44 "DEV", # symbol "Moonbase Alpha", # name "evm-dev.png", # name @@ -1216,7 +1216,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: 8217, # chain_id 8217, # slip44 "KLAY", # symbol - "Klaytn", # name + "Kaia", # name "evm-klay.png", # name 0xD2D2D2, # primary_color ) @@ -1470,7 +1470,7 @@ def _networks_iterator() -> Iterator[NetworkInfoTuple]: ) yield ( 78110, # chain_id - 60, # slip44 + 1, # slip44 "FIN", # symbol "Firenze test network", # name "evm-fin.png", # name diff --git a/core/src/apps/ethereum/tokens.py b/core/src/apps/ethereum/tokens.py index 71a70294b..11dcdba84 100644 --- a/core/src/apps/ethereum/tokens.py +++ b/core/src/apps/ethereum/tokens.py @@ -252,6 +252,12 @@ def _token_iterator(chain_id: int) -> Iterator[tuple[bytes, str, int, str]]: 18, "OMGToken", ) + yield ( # address, symbol, decimals, name + b"\x45\x5e\x53\xcb\xb8\x60\x18\xac\x2b\x80\x92\xfd\xcd\x39\xd8\x44\x4a\xff\xc3\xf6", + "POL", + 18, + "Polygon", + ) yield ( # address, symbol, decimals, name b"\x95\xad\x61\xb0\xa1\x50\xd7\x92\x19\xdc\xf6\x4e\x1e\x6c\xc0\x1f\x0b\x64\xc4\xce", "SHIB",