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:
David Adegoke 2025-06-24 03:47:21 +01:00 committed by GitHub
parent 4434ad7363
commit af89603b81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 127 additions and 5 deletions

View file

@ -913,6 +913,7 @@
"tip": "بقشيش:",
"to": "ل",
"today": "اليوم",
"token_already_exists": "رمز موجود بالفعل",
"token_contract_address": "عنوان عقد الرمز",
"token_decimal": "رمز عشري",
"token_name": "اسم الرمز ، على سبيل المثال: Tether",

View file

@ -913,6 +913,7 @@
"tip": "Tip:",
"to": "Да",
"today": "Днес",
"token_already_exists": "Токена вече съществува",
"token_contract_address": "Адрес на токен договор",
"token_decimal": "Токен десетичен",
"token_name": "Име на токена, напр.: Tether",

View file

@ -913,6 +913,7 @@
"tip": "Spropitné:",
"to": "Na",
"today": "Dnes",
"token_already_exists": "Token již existuje",
"token_contract_address": "Adresa tokenové smlouvy",
"token_decimal": "Token v desítkové soustavě",
"token_name": "Název tokenu např.: Tether",

View file

@ -914,6 +914,7 @@
"tip": "Hinweis:",
"to": "Zu",
"today": "Heute",
"token_already_exists": "Token existiert bereits",
"token_contract_address": "Token-Contract-Adresse",
"token_decimal": "Token-Dezimalzahl",
"token_name": "Token-Name, z. B.: Tether",

View file

@ -914,6 +914,7 @@
"tip": "Tip:",
"to": "To",
"today": "Today",
"token_already_exists": "Token already exists",
"token_contract_address": "Token contract address",
"token_decimal": "Token decimal",
"token_name": "Token name eg: Tether",

View file

@ -914,6 +914,7 @@
"tip": "Consejo:",
"to": "A",
"today": "Hoy",
"token_already_exists": "Token ya existe",
"token_contract_address": "Dirección de contrato de token",
"token_decimal": "Token decimal",
"token_name": "Nombre del token, por ejemplo: Tether",

View file

@ -913,6 +913,7 @@
"tip": "Pourboire:",
"to": "À",
"today": "Aujourd'hui",
"token_already_exists": "Le jeton existe déjà",
"token_contract_address": "Adresse du contrat de token",
"token_decimal": "Décimales de token",
"token_name": "Nom du token, par exemple : Tether",

View file

@ -915,6 +915,7 @@
"tip": "Tukwici:",
"to": "Zuwa",
"today": "Yau",
"token_already_exists": "Alama an riga an wanzu",
"token_contract_address": "Adireshin kwangilar Token",
"token_decimal": "Alamar ƙima",
"token_name": "Alamar sunan misali: Tether",

View file

@ -915,6 +915,7 @@
"tip": "टिप:",
"to": "को",
"today": "आज",
"token_already_exists": "टोकन पहले से मौजूद है",
"token_contract_address": "टोकन अनुबंध पता",
"token_decimal": "सांकेतिक दशमलव",
"token_name": "टोकन नाम जैसे: टीथर",

View file

@ -913,6 +913,7 @@
"tip": "Savjet:",
"to": "Do",
"today": "Danas",
"token_already_exists": "Token već postoji",
"token_contract_address": "Adresa ugovora tokena",
"token_decimal": "Token decimalni",
"token_name": "Naziv tokena npr.: Tether",

View file

@ -911,6 +911,7 @@
"tip": "Թեյավճար",
"to": "Դեպի",
"today": "Այսօր",
"token_already_exists": "Նշանն արդեն գոյություն ունի",
"token_contract_address": "Token-ի պայմանագրի հասցե",
"token_decimal": "Token-ի տասանիշ",
"token_name": "Token-ի անուն, օրինակ՝ Tether",

View file

@ -916,6 +916,7 @@
"tip": "Tip:",
"to": "Ke",
"today": "Hari ini",
"token_already_exists": "Token sudah ada",
"token_contract_address": "Alamat kontrak token",
"token_decimal": "Desimal token",
"token_name": "Nama token misalnya: Tether",

View file

@ -914,6 +914,7 @@
"tip": "Suggerimento:",
"to": "A",
"today": "Oggi",
"token_already_exists": "Il token esiste già",
"token_contract_address": "Indirizzo del contratto token",
"token_decimal": "Decimale del token",
"token_name": "Nome del token, ad esempio: Tether",

View file

@ -914,6 +914,7 @@
"tip": "ヒント: ",
"to": "に",
"today": "今日",
"token_already_exists": "トークンはすでに存在します",
"token_contract_address": "トークンコントラクトアドレス",
"token_decimal": "トークン10進数",
"token_name": "トークン名 例: Tether",

View file

@ -914,6 +914,7 @@
"tip": "팁:",
"to": "받는 통화",
"today": "오늘",
"token_already_exists": "토큰이 이미 존재합니다",
"token_contract_address": "토큰 계약 주소",
"token_decimal": "토큰 소수 자릿수",
"token_name": "토큰 이름 (예: Tether)",

View file

@ -913,6 +913,7 @@
"tip": "အကြံပြုချက်-",
"to": "သို့",
"today": "ဒီနေ့",
"token_already_exists": "တိုကင်ရှိပြီးသား",
"token_contract_address": "တိုကင်စာချုပ်လိပ်စာ",
"token_decimal": "တိုကင်ဒဿမ",
"token_name": "တိုကင်အမည် ဥပမာ- Tether",

View file

@ -913,6 +913,7 @@
"tip": "Tip:",
"to": "Naar",
"today": "Vandaag",
"token_already_exists": "Token bestaat al",
"token_contract_address": "Token contractadres",
"token_decimal": "Token decimaal",
"token_name": "Tokennaam bijv.: Tether",

View file

@ -913,6 +913,7 @@
"tip": "tip:",
"to": "Do",
"today": "Dzisiaj",
"token_already_exists": "Token już istnieje",
"token_contract_address": "Adres kontraktu tokena",
"token_decimal": "Token dziesiętny",
"token_name": "Nazwa tokena, np.: Tether",

View file

@ -915,6 +915,7 @@
"tip": "Dica:",
"to": "Para",
"today": "Hoje",
"token_already_exists": "Token já existe",
"token_contract_address": "Endereço do contrato de token",
"token_decimal": "Token decimal",
"token_name": "Nome do token, por exemplo: Tether",

View file

@ -914,6 +914,7 @@
"tip": "Совет:",
"to": "К",
"today": "Сегодня",
"token_already_exists": "Токен уже существует",
"token_contract_address": "Адрес контракта токена",
"token_decimal": "Десятичный токен",
"token_name": "Имя токена, например: Tether",

View file

@ -913,6 +913,7 @@
"tip": "เพิ่มค่าตอบแทน:",
"to": "ถึง",
"today": "วันนี้",
"token_already_exists": "โทเค็นมีอยู่แล้ว",
"token_contract_address": "ที่อยู่สัญญาโทเค็น",
"token_decimal": "โทเค็นทศนิยม",
"token_name": "ชื่อโทเค็น เช่น Tether",

View file

@ -913,6 +913,7 @@
"tip": "Tip:",
"to": "Sa",
"today": "Ngayon",
"token_already_exists": "Mayroon nang token",
"token_contract_address": "Address ng token contract",
"token_decimal": "Token decimal",
"token_name": "Pangalan ng token, halimbawa: Tether",

View file

@ -913,6 +913,7 @@
"tip": "Bahşiş:",
"to": "İle",
"today": "Bugün",
"token_already_exists": "Token zaten var",
"token_contract_address": "Token sözleşme adresi",
"token_decimal": "Belirteç ondalık",
"token_name": "Belirteç adı, örneğin: Tether",

View file

@ -914,6 +914,7 @@
"tip": "Порада:",
"to": "До",
"today": "Сьогодні",
"token_already_exists": "Маркер вже існує",
"token_contract_address": "Адреса договору маркера",
"token_decimal": "Токен десятковий",
"token_name": "Назва токена, наприклад: Tether",

View file

@ -915,6 +915,7 @@
"tip": "ٹپ:",
"to": "to",
"today": "آج",
"token_already_exists": "ٹوکن پہلے ہی موجود ہے",
"token_contract_address": "ٹوکن کنٹریکٹ ایڈریس",
"token_decimal": "ٹوکن اعشاریہ",
"token_name": "ٹوکن کا نام جیسے: Tether",

View file

@ -910,6 +910,7 @@
"tip": "Mẹo:",
"to": "ĐẾN",
"today": "Hôm nay",
"token_already_exists": "Mã thông báo đã tồn tại",
"token_contract_address": "Địa chỉ hợp đồng token",
"token_decimal": "Số thập phân của token",
"token_name": "Tên token ví dụ: Tether",

View file

@ -914,6 +914,7 @@
"tip": "Owó àfikún:",
"to": "Si",
"today": "Lénìí",
"token_already_exists": "Token tẹlẹ wa",
"token_contract_address": "Àmi guide adirẹsi",
"token_decimal": "Àmi eleemewa",
"token_name": "Orukọ àmi fun apẹẹrẹ: Tether",

View file

@ -913,6 +913,7 @@
"tip": "提示:",
"to": "到",
"today": "今天",
"token_already_exists": "令牌已经存在",
"token_contract_address": "代币合约地址",
"token_decimal": "令牌十进制",
"token_name": "代币名称例如Tether",