diff --git a/lib/src/screens/dashboard/edit_token_page.dart b/lib/src/screens/dashboard/edit_token_page.dart index 8429a63df..8cf4ff8e2 100644 --- a/lib/src/screens/dashboard/edit_token_page.dart +++ b/lib/src/screens/dashboard/edit_token_page.dart @@ -207,15 +207,15 @@ class _EditTokenPageBodyState extends State { onPressed: () async { if (_formKey.currentState!.validate() && (!_showDisclaimer || _disclaimerChecked)) { - final hasPotentialError = await widget.homeSettingsViewModel + final isWhitelisted = await widget.homeSettingsViewModel + .checkIfTokenIsWhitelisted(_contractAddressController.text); + + final hasPotentialError = !isWhitelisted && await widget.homeSettingsViewModel .checkIfERC20TokenContractAddressIsAPotentialScamAddress( _contractAddressController.text, ); - final isWhitelisted = await widget.homeSettingsViewModel - .checkIfTokenIsWhitelisted(_contractAddressController.text); - - bool isPotentialScam = hasPotentialError; + bool isPotentialScam = hasPotentialError && !isWhitelisted; final tokenSymbol = _tokenSymbolController.text.toUpperCase(); // check if the token symbol is the same as any of the base currencies symbols (ETH, SOL, POL, TRX, etc): @@ -258,7 +258,7 @@ class _EditTokenPageBodyState extends State { } }; - if (hasPotentialError) { + if (hasPotentialError && !isWhitelisted) { showPopUp( context: context, builder: (dialogContext) { diff --git a/lib/view_model/dashboard/home_settings_view_model.dart b/lib/view_model/dashboard/home_settings_view_model.dart index 381ae0614..7bba04b21 100644 --- a/lib/view_model/dashboard/home_settings_view_model.dart +++ b/lib/view_model/dashboard/home_settings_view_model.dart @@ -221,7 +221,8 @@ abstract class HomeSettingsViewModelBase with Store { } // check if the contractAddress is in the defaultTokenAddresses - bool isInWhitelist = defaultTokenAddresses.any((element) => element == contractAddress); + bool isInWhitelist = defaultTokenAddresses + .any((element) => element.toLowerCase() == contractAddress.toLowerCase()); return isInWhitelist; }