dev
dart 74 lines 1.97 KB
Raw
1 import 'package:cw_core/crypto_currency.dart';
2 import 'package:cw_core/erc20_token.dart';
3
4 /// Default ERC20 tokens for Base
5 class BaseTokens {
6 static List<Erc20Token> get tokens {
7 final tokens = [
8 Erc20Token(
9 name: "USD Coin",
10 symbol: "USDC",
11 contractAddress: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
12 decimal: 6,
13 enabled: true,
14 ),
15 Erc20Token(
16 name: "USDe",
17 symbol: "USDe",
18 contractAddress: "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34",
19 decimal: 18,
20 enabled: true,
21 ),
22 Erc20Token(
23 name: "Dai",
24 symbol: "DAI",
25 contractAddress: "0x50c5725949a6f0c72e6c4a641f24049a917db0cb",
26 decimal: 18,
27 enabled: true,
28 ),
29 Erc20Token(
30 name: "Bridged Tether USD",
31 symbol: "USDT",
32 contractAddress: "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2",
33 decimal: 6,
34 enabled: true,
35 ),
36 Erc20Token(
37 name: "Wrapped Ether",
38 symbol: "WETH",
39 contractAddress: "0x4200000000000000000000000000000000000006",
40 decimal: 18,
41 enabled: false,
42 ),
43 Erc20Token(
44 name: "Wrapped BTC",
45 symbol: "WBTC",
46 contractAddress: "0x0555e30da8f98308edb960aa94c0db47230d2b9c",
47 decimal: 8,
48 enabled: false,
49 ),
50 Erc20Token(
51 name: "SPX6900",
52 symbol: "SPX",
53 contractAddress: "0x50da645f148798f68ef2d7db7c1cb22a6819bb2c",
54 decimal: 8,
55 enabled: false,
56 ),
57 ];
58
59 return tokens.map((token) {
60 String? iconPath;
61 if (token.iconPath?.isEmpty ?? true) {
62 try {
63 iconPath = CryptoCurrency.all
64 .firstWhere((element) => element.title.toUpperCase() == token.symbol.toUpperCase())
65 .iconPath;
66 } catch (_) {}
67 } else {
68 iconPath = token.iconPath;
69 }
70
71 return Erc20Token.copyWith(token, icon: iconPath, tag: 'BASE');
72 }).toList();
73 }
74 }