mirror of
https://github.com/Instadapp/trustwallet-assets.git
synced 2024-07-29 22:37:31 +00:00
Enforce decimals=8 for BEP2 tokens (#12727)
Co-authored-by: Catenocrypt <catenocrypt@users.noreply.github.com>
This commit is contained in:
parent
b71c7e27dd
commit
64b62f987e
|
@ -112,6 +112,14 @@ function isAssetInfoValid(info: unknown, path: string, address: string, chain: s
|
|||
}
|
||||
}
|
||||
|
||||
// extra checks on decimals
|
||||
if (info['decimals'] > 30 || info['decimals'] < 0) {
|
||||
return [`Incorrect value for decimals '${info['decimals']}' '${chain}' ${path}`, "", fixedInfo];
|
||||
}
|
||||
if (info['type'] === 'BEP2' && info['decimals'] != 8) {
|
||||
return [`Incorrect value for decimals, BEP2 tokens have 8 decimals. '${info['decimals']}' '${chain}' ${path}`, "", fixedInfo];
|
||||
}
|
||||
|
||||
// status
|
||||
if (!isValidStatusValue(info['status'])) {
|
||||
return [`Invalid value for status field, '${info['status']}'`, "", fixedInfo];
|
||||
|
|
Loading…
Reference in New Issue
Block a user