From 65b6f57d999639bc3dd6fbc715416b33c98bb8fe Mon Sep 17 00:00:00 2001 From: "jinyuan.jiang" Date: Mon, 27 Nov 2023 15:07:03 +0800 Subject: [PATCH] support coin ETH-LINEA. --- common/coin.go | 6 +++ common/crypto_test.go | 6 +++ docs/support_coins.md | 89 ++++++++++++++++++++++--------------------- 3 files changed, 57 insertions(+), 44 deletions(-) diff --git a/common/coin.go b/common/coin.go index a35d6a1..601825c 100644 --- a/common/coin.go +++ b/common/coin.go @@ -85,6 +85,7 @@ var ( "OKT": "ETH", "OKB": "ETH", "OPTIMISM": "ETH", + "ETH-LINEA": "ETH", // BETH "BETH": "BETH", @@ -156,6 +157,7 @@ var ( "OKB": EvmCoinTye, "OPTIMISM": EvmCoinTye, "FIL-EVM": EvmCoinTye, + "ETH-LINEA": EvmCoinTye, // BETH "BETH": BethCoinType, @@ -239,6 +241,7 @@ var ( "OKB": EthMessageSignatureHeader, "OPTIMISM": EthMessageSignatureHeader, "FIL-EVM": EthMessageSignatureHeader, + "ETH-LINEA": EthMessageSignatureHeader, // BETH "BETH": EthMessageSignatureHeader, @@ -337,6 +340,7 @@ var ( "OKT": "OKT", "OKB": "OKB", "OPTIMISM": "OPTIMISM", + "ETH-LINEA": "ETH", // BETH "BETH": "BETH", @@ -427,6 +431,7 @@ var ( "OKT": 18, "OKB": 18, "OPTIMISM": 18, + "ETH-LINEA": 18, // BETH "BETH": 18, @@ -483,6 +488,7 @@ var ( "USDT-ALGO": true, "FIL-EVM": true, + "ETH-LINEA": true, } VerifyAddressCoinBlackList = map[string]bool{ diff --git a/common/crypto_test.go b/common/crypto_test.go index 95e4c10..4b95175 100644 --- a/common/crypto_test.go +++ b/common/crypto_test.go @@ -157,6 +157,12 @@ func TestVerifyEvmCoinSignature(t *testing.T) { msg: "I am an OKX address", sign: "0x05168f6ede2213bebae69256ad78cfcf4f3a99d4b11bacd4a24ec2171becb34e2f690c515e3b1227a52e7e7c4dd99dd0f307c167f768b2201bd82b69af5a112b1c", }, + { + coin: "ETH-LINEA", + addr: "0xd3d7dbe73bbdd5a5c7a49ca322763c4d400fc240", + msg: "I am an OKX address", + sign: "0x75f1d8203bef472f4f5f2627b186eb6d700544633690f4f368ea3d6d069040ac378b84765bf4fecfc4d62d807158817a0d6f5d2ac13121aba578ff0f6880067b1c", + }, } for _, tt := range args { err := VerifyEvmCoin(tt.coin, tt.addr, tt.msg, tt.sign) diff --git a/docs/support_coins.md b/docs/support_coins.md index bbf43d3..0d4ad5f 100644 --- a/docs/support_coins.md +++ b/docs/support_coins.md @@ -39,50 +39,51 @@ ### VerifyAddress -| coin | network | -|---------|------------------| -| BTC | Bitcoin | -| ETH | Ethereum | -| ETH | Arbitrum | -| ETH | Optimism | -| USDT | Ethereum | -| USDT | Tron | -| USDT | Polygon | -| USDT | Avalanche | -| USDT | Arbitrum | -| USDT | Optimism | -| USDT | OKC | -| USDC | Ethereum | -| USDC | OKC | -| USDC | Tron | -| USDC | Polygon | -| USDC | Avalanche | -| USDC | Arbitrum | -| USDC | Optimism | -| OKB | Ethereum | -| OKB | OKC | -| OKT | OKC | -| FIL | Fil | -| FIL | OKC | -| DOT | Polkadot | -| DOT | OKC | -| ETC | Ethereum Classic | -| ETC | OKC | -| XRP | Ripple | -| XRP | OKC | -| UNI | Ethereum | -| UNI | OKC | -| ELF | Aelf | -| LINK | Ethereum | -| LINK | OKC | -| PEOPLE | Ethereum | -| TON | Toncoin | -| TRX | Tron | -| APT | Aptos | -| SOL | Solana | -| DASH | Dash | -| DOGE | Doge | -| FIL-EVM | FEVM | +| coin | network | +|-----------|------------------| +| BTC | Bitcoin | +| ETH | Ethereum | +| ETH | Arbitrum | +| ETH | Optimism | +| USDT | Ethereum | +| USDT | Tron | +| USDT | Polygon | +| USDT | Avalanche | +| USDT | Arbitrum | +| USDT | Optimism | +| USDT | OKC | +| USDC | Ethereum | +| USDC | OKC | +| USDC | Tron | +| USDC | Polygon | +| USDC | Avalanche | +| USDC | Arbitrum | +| USDC | Optimism | +| OKB | Ethereum | +| OKB | OKC | +| OKT | OKC | +| FIL | Fil | +| FIL | OKC | +| DOT | Polkadot | +| DOT | OKC | +| ETC | Ethereum Classic | +| ETC | OKC | +| XRP | Ripple | +| XRP | OKC | +| UNI | Ethereum | +| UNI | OKC | +| ELF | Aelf | +| LINK | Ethereum | +| LINK | OKC | +| PEOPLE | Ethereum | +| TON | Toncoin | +| TRX | Tron | +| APT | Aptos | +| SOL | Solana | +| DASH | Dash | +| DOGE | Doge | +| FIL-EVM | FEVM | +| ETH-LINEA | ETH_LINEA |