mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
Fix Scam tokens handling and make it persistent (#2138)
* Fix Scam tokens handling and make it persistent * Add potential scam text next to scam tokens * change UI of potential scam text
This commit is contained in:
parent
cbca4c9c77
commit
23a47ed561
41 changed files with 121 additions and 45 deletions
|
@ -20,6 +20,8 @@ class Erc20Token extends CryptoCurrency with HiveObjectMixin {
|
|||
final String? iconPath;
|
||||
@HiveField(6)
|
||||
final String? tag;
|
||||
@HiveField(7, defaultValue: false)
|
||||
final bool isPotentialScam;
|
||||
|
||||
bool get enabled => _enabled;
|
||||
|
||||
|
@ -33,14 +35,17 @@ class Erc20Token extends CryptoCurrency with HiveObjectMixin {
|
|||
bool enabled = true,
|
||||
this.iconPath,
|
||||
this.tag,
|
||||
this.isPotentialScam = false,
|
||||
}) : _enabled = enabled,
|
||||
super(
|
||||
name: symbol.toLowerCase(),
|
||||
title: symbol.toUpperCase(),
|
||||
fullName: name,
|
||||
tag: tag,
|
||||
iconPath: iconPath,
|
||||
decimals: decimal);
|
||||
name: symbol.toLowerCase(),
|
||||
title: symbol.toUpperCase(),
|
||||
fullName: name,
|
||||
tag: tag,
|
||||
iconPath: iconPath,
|
||||
decimals: decimal,
|
||||
isPotentialScam: isPotentialScam,
|
||||
);
|
||||
|
||||
Erc20Token.copyWith(Erc20Token other, String? icon, String? tag)
|
||||
: this.name = other.name,
|
||||
|
@ -50,6 +55,7 @@ class Erc20Token extends CryptoCurrency with HiveObjectMixin {
|
|||
this._enabled = other.enabled,
|
||||
this.tag = tag,
|
||||
this.iconPath = icon,
|
||||
this.isPotentialScam = other.isPotentialScam,
|
||||
super(
|
||||
name: other.name,
|
||||
title: other.symbol.toUpperCase(),
|
||||
|
@ -57,6 +63,7 @@ class Erc20Token extends CryptoCurrency with HiveObjectMixin {
|
|||
tag: tag,
|
||||
iconPath: icon,
|
||||
decimals: other.decimal,
|
||||
isPotentialScam: other.isPotentialScam,
|
||||
);
|
||||
|
||||
static const typeId = ERC20_TOKEN_TYPE_ID;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue