CW-1228: Automatically Fetch All Tokens (#2869)

* feat: Automatically detect wallet tokens for EVM chains

* feat: Disable potential tg scam tokens by default

* feat: Add homoglyph normalization to detect spoofing attacks in token symbols

* refactor: Improve scam token detection and apply to automatically fetched EVM tokens

* refactor: Enhance scam detection for automatically detected tokens in evm wallets

* feat: Add fiat check to scam checks on automatically imported token and disable tokens that fail the check

* feat: Add fiat check to scam checks on automatically imported token and disable tokens that fail the check

* feat: Add fiat check to scam checks on automatically imported token and disable tokens that fail the check

* feat: Enable whitelisted tokens with balance when importing wallet tokens

* feat: Disable imported tokens with balance less than 0.1 usd

* feat: Disable imported tokens with balance less than 0.1 usd
- Update configure file
This commit is contained in:
David Adegoke
2026-02-05 23:52:24 +01:00
committed by GitHub
parent 8d71f004a2
commit 4ae94db3ee
4 changed files with 61 additions and 27 deletions
+3 -2
View File
@@ -1322,6 +1322,7 @@ abstract class DogeCoin {
Future<void> generateEVM(bool hasImplementation) async {
final outputFile = File(evmOutputPath);
const evmCommonHeaders = """
import 'dart:math' as math;
import 'package:cake_wallet/core/utilities.dart';
import 'package:cake_wallet/view_model/send/output.dart';
import 'package:cw_core/crypto_currency.dart';
@@ -1348,6 +1349,7 @@ import 'package:web3dart/web3dart.dart';
import 'package:cake_wallet/core/fiat_conversion_service.dart';
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/entities/fiat_api_mode.dart';
import 'package:cake_wallet/entities/fiat_currency.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cw_evm/utils/evm_chain_formatter.dart';
import 'package:cw_evm/evm_chain_mnemonics.dart';
@@ -1523,7 +1525,6 @@ abstract class EVM {
bool hasPriorityFee(int chainId);
Future<bool> checkTokenFiatPrice(WalletBase wallet, Erc20Token token);
Future<void> discoverAndAddWalletTokens(WalletBase wallet);
}
@@ -1792,7 +1793,7 @@ Future<void> generatePubspec({
output += '\n$flutterSecureStorage\n';
}
if (hasEthereum || hasPolygon || hasBase || hasArbitrum) {
if (hasEthereum || hasPolygon || hasBase || hasArbitrum || hasBsc) {
output += '\n$cwEVM';
}