mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
CW-1103:Token Validation Issues (#2327)
* feat(token_validation): Improve flow for adding new tokens across wallets This change: - Implements check to see if a token is already added, preventing duplicates - Triggers dialog warning if its a duplicate token - Takes EVM Chains contract adddress case-insensitivity when making checks for potential scams. * refactor(token_validation): Modify token management flow This change: - Removes duplicate token check during token addition in EVMChainWalletBase. - Introduces a flag to indicate if a token is being edited - Adjusts token addition validation to bypass checks when editing an existing token. * Update lib/src/screens/dashboard/edit_token_page.dart --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
co-authored by
Omar Hatem
parent
4434ad7363
commit
af89603b81
@@ -760,6 +760,7 @@ abstract class Ethereum {
|
||||
void setLedgerConnection(WalletBase wallet, ledger.LedgerConnection connection);
|
||||
Future<List<HardwareAccountData>> getHardwareWalletAccounts(LedgerViewModel ledgerVM, {int index = 0, int limit = 5});
|
||||
List<String> getDefaultTokenContractAddresses();
|
||||
bool isTokenAlreadyAdded(WalletBase wallet, String contractAddress);
|
||||
}
|
||||
""";
|
||||
|
||||
@@ -870,6 +871,7 @@ abstract class Polygon {
|
||||
void setLedgerConnection(WalletBase wallet, ledger.LedgerConnection connection);
|
||||
Future<List<HardwareAccountData>> getHardwareWalletAccounts(LedgerViewModel ledgerVM, {int index = 0, int limit = 5});
|
||||
List<String> getDefaultTokenContractAddresses();
|
||||
bool isTokenAlreadyAdded(WalletBase wallet, String contractAddress);
|
||||
}
|
||||
""";
|
||||
|
||||
@@ -1156,6 +1158,7 @@ abstract class Solana {
|
||||
List<int>? getValidationLength(CryptoCurrency type);
|
||||
double? getEstimateFees(WalletBase wallet);
|
||||
List<String> getDefaultTokenContractAddresses();
|
||||
bool isTokenAlreadyAdded(WalletBase wallet, String contractAddress);
|
||||
}
|
||||
|
||||
""";
|
||||
@@ -1234,6 +1237,7 @@ abstract class Tron {
|
||||
|
||||
void updateTronGridUsageState(WalletBase wallet, bool isEnabled);
|
||||
List<String> getDefaultTokenContractAddresses();
|
||||
bool isTokenAlreadyAdded(WalletBase wallet, String contractAddress);
|
||||
}
|
||||
""";
|
||||
|
||||
@@ -1308,6 +1312,7 @@ abstract class Zano {
|
||||
String getAddress(WalletBase wallet);
|
||||
bool validateAddress(String address);
|
||||
Map<String, List<int>> debugCallLength();
|
||||
bool isTokenAlreadyAdded(WalletBase wallet, String contractAddress);
|
||||
}
|
||||
""";
|
||||
const zanoEmptyDefinition = 'Zano? zano;\n';
|
||||
|
||||
Reference in New Issue
Block a user