| 1 | import 'package:cw_core/crypto_currency.dart'; |
| 2 | import 'package:cw_core/erc20_token.dart'; |
| 3 | |
| 4 | /// Default ERC20 tokens for Polygon |
| 5 | class PolygonTokens { |
| 6 | static List<Erc20Token> get tokens { |
| 7 | final tokens = [ |
| 8 | Erc20Token( |
| 9 | name: "Wrapped Ether", |
| 10 | symbol: "WETH", |
| 11 | contractAddress: "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619", |
| 12 | decimal: 18, |
| 13 | enabled: false, |
| 14 | ), |
| 15 | Erc20Token( |
| 16 | name: "Tether USD (PoS)", |
| 17 | symbol: "USDT", |
| 18 | contractAddress: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", |
| 19 | decimal: 6, |
| 20 | enabled: true, |
| 21 | ), |
| 22 | Erc20Token( |
| 23 | name: "USD Coin", |
| 24 | symbol: "USDC", |
| 25 | contractAddress: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", |
| 26 | decimal: 6, |
| 27 | enabled: true, |
| 28 | ), |
| 29 | Erc20Token( |
| 30 | name: "USD Coin (POS)", |
| 31 | symbol: "USDC.e", |
| 32 | contractAddress: "0x2791bca1f2de4661ed88a30c99a7a9449aa84174", |
| 33 | decimal: 6, |
| 34 | enabled: true, |
| 35 | ), |
| 36 | Erc20Token( |
| 37 | name: "Decentralized Euro", |
| 38 | symbol: "DEURO", |
| 39 | contractAddress: "0xc2ff25dd99e467d2589b2c26edd270f220f14e47", |
| 40 | decimal: 18, |
| 41 | enabled: true, |
| 42 | ), |
| 43 | Erc20Token( |
| 44 | name: "Avalanche Token", |
| 45 | symbol: "AVAX", |
| 46 | contractAddress: "0x2c89bbc92bd86f8075d1decc58c7f4e0107f286b", |
| 47 | decimal: 18, |
| 48 | enabled: false, |
| 49 | ), |
| 50 | Erc20Token( |
| 51 | name: "Wrapped BTC (PoS)", |
| 52 | symbol: "WBTC", |
| 53 | contractAddress: "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6", |
| 54 | decimal: 8, |
| 55 | enabled: false, |
| 56 | ), |
| 57 | Erc20Token( |
| 58 | name: "Dai (PoS)", |
| 59 | symbol: "DAI", |
| 60 | contractAddress: "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063", |
| 61 | decimal: 18, |
| 62 | enabled: true, |
| 63 | ), |
| 64 | Erc20Token( |
| 65 | name: "SHIBA INU (PoS)", |
| 66 | symbol: "SHIB", |
| 67 | contractAddress: "0x6f8a06447ff6fcf75d803135a7de15ce88c1d4ec", |
| 68 | decimal: 18, |
| 69 | enabled: false, |
| 70 | ), |
| 71 | ]; |
| 72 | |
| 73 | return tokens.map((token) { |
| 74 | String? iconPath; |
| 75 | if (token.iconPath?.isEmpty ?? true) { |
| 76 | try { |
| 77 | iconPath = CryptoCurrency.all |
| 78 | .firstWhere((element) => element.title.toUpperCase() == token.symbol.toUpperCase()) |
| 79 | .iconPath; |
| 80 | } catch (_) {} |
| 81 | } else { |
| 82 | iconPath = token.iconPath; |
| 83 | } |
| 84 | |
| 85 | return Erc20Token.copyWith(token, icon: iconPath, tag: 'POL'); |
| 86 | }).toList(); |
| 87 | } |
| 88 | } |