diff --git a/cw_core/lib/crypto_currency.dart b/cw_core/lib/crypto_currency.dart index cb8485ec5..4b0f9521e 100644 --- a/cw_core/lib/crypto_currency.dart +++ b/cw_core/lib/crypto_currency.dart @@ -232,7 +232,7 @@ class CryptoCurrency extends EnumerableItem with Serializable implemen static const ton = CryptoCurrency(title: 'TON', fullName: 'Toncoin', raw: 95, name: 'ton', iconPath: 'assets/images/ton_icon.png', decimals: 8); static const zano = CryptoCurrency(title: 'ZANO', tag: 'ZANO', fullName: 'Zano', raw: 96, name: 'zano', iconPath: 'assets/images/zano_icon.png', decimals: 12); static const flip = CryptoCurrency(title: 'FLIP', tag: 'ETH', fullName: 'Chainflip', raw: 97, name: 'flip', iconPath: 'assets/images/flip_icon.png', decimals: 18); - static const deuro = CryptoCurrency(title: 'DEURO', tag: 'ETH', fullName: 'Digital Euro', raw: 98, name: 'deuro', iconPath: 'assets/images/deuro_icon.png', decimals: 18); + static const deuro = CryptoCurrency(title: 'DEURO', tag: 'ETH', fullName: 'Decentralized Euro', raw: 98, name: 'deuro', iconPath: 'assets/images/deuro_icon.png', decimals: 18); static final Map _rawCurrencyMap = [...all, ...havenCurrencies].fold>({}, (acc, item) { diff --git a/cw_ethereum/lib/default_ethereum_erc20_tokens.dart b/cw_ethereum/lib/default_ethereum_erc20_tokens.dart index 8381744d6..630424967 100644 --- a/cw_ethereum/lib/default_ethereum_erc20_tokens.dart +++ b/cw_ethereum/lib/default_ethereum_erc20_tokens.dart @@ -18,7 +18,7 @@ class DefaultEthereumErc20Tokens { enabled: true, ), Erc20Token( - name: "Digital Euro", + name: "Decentralized Euro", symbol: "DEURO", contractAddress: "0xbA3f535bbCcCcA2A154b573Ca6c5A49BAAE0a3ea", decimal: 18, diff --git a/cw_ethereum/lib/ethereum_wallet.dart b/cw_ethereum/lib/ethereum_wallet.dart index 7cc140c5a..c22be3cb2 100644 --- a/cw_ethereum/lib/ethereum_wallet.dart +++ b/cw_ethereum/lib/ethereum_wallet.dart @@ -31,11 +31,14 @@ class EthereumWallet extends EVMChainWallet { }) : super(nativeCurrency: CryptoCurrency.eth); @override - void addInitialTokens() { + void addInitialTokens([bool isMigration = false]) { final initialErc20Tokens = DefaultEthereumErc20Tokens().initialErc20Tokens; - for (var token in initialErc20Tokens) { - evmChainErc20TokensBox.put(token.contractAddress, token); + for (final token in initialErc20Tokens) { + if (!evmChainErc20TokensBox.containsKey(token.contractAddress)) { + if (isMigration) token.enabled = false; + evmChainErc20TokensBox.put(token.contractAddress, token); + } } } diff --git a/cw_ethereum/lib/ethereum_wallet_service.dart b/cw_ethereum/lib/ethereum_wallet_service.dart index 858416055..06ba07bfc 100644 --- a/cw_ethereum/lib/ethereum_wallet_service.dart +++ b/cw_ethereum/lib/ethereum_wallet_service.dart @@ -53,6 +53,7 @@ class EthereumWalletService extends EVMChainWalletService { ); await wallet.init(); + wallet.addInitialTokens(true); await wallet.save(); saveBackup(name); return wallet; diff --git a/cw_evm/lib/evm_chain_wallet.dart b/cw_evm/lib/evm_chain_wallet.dart index d640f8c14..a1b253dd8 100644 --- a/cw_evm/lib/evm_chain_wallet.dart +++ b/cw_evm/lib/evm_chain_wallet.dart @@ -136,7 +136,7 @@ abstract class EVMChainWalletBase //! Methods to be overridden by every child - void addInitialTokens(); + void addInitialTokens([bool isMigration]); // Future open({ // required String name, diff --git a/cw_polygon/lib/default_polygon_erc20_tokens.dart b/cw_polygon/lib/default_polygon_erc20_tokens.dart index deff285c0..2c739e8c5 100644 --- a/cw_polygon/lib/default_polygon_erc20_tokens.dart +++ b/cw_polygon/lib/default_polygon_erc20_tokens.dart @@ -31,6 +31,13 @@ class DefaultPolygonErc20Tokens { decimal: 6, enabled: true, ), + Erc20Token( + name: "Decentralized Euro", + symbol: "DEURO", + contractAddress: "0xC2ff25dD99e467d2589b2c26EDd270F220F14E47", + decimal: 18, + enabled: true, + ), Erc20Token( name: "Avalanche Token", symbol: "AVAX", diff --git a/cw_polygon/lib/polygon_wallet.dart b/cw_polygon/lib/polygon_wallet.dart index b2bf064b1..c1d36b9cb 100644 --- a/cw_polygon/lib/polygon_wallet.dart +++ b/cw_polygon/lib/polygon_wallet.dart @@ -41,11 +41,14 @@ class PolygonWallet extends EVMChainWallet { } @override - void addInitialTokens() { + void addInitialTokens([bool isMigration = false]) { final initialErc20Tokens = DefaultPolygonErc20Tokens().initialPolygonErc20Tokens; - for (var token in initialErc20Tokens) { - evmChainErc20TokensBox.put(token.contractAddress, token); + for (final token in initialErc20Tokens) { + if (!evmChainErc20TokensBox.containsKey(token.contractAddress)) { + if (isMigration) token.enabled = false; + evmChainErc20TokensBox.put(token.contractAddress, token); + } } } diff --git a/cw_polygon/lib/polygon_wallet_service.dart b/cw_polygon/lib/polygon_wallet_service.dart index 994912e8d..05af311e7 100644 --- a/cw_polygon/lib/polygon_wallet_service.dart +++ b/cw_polygon/lib/polygon_wallet_service.dart @@ -55,6 +55,7 @@ class PolygonWalletService extends EVMChainWalletService { ); await wallet.init(); + wallet.addInitialTokens(true); await wallet.save(); saveBackup(name); return wallet;