HomePhabricator

[Cashtab] Remove tech debt around checking token names for scams

Description

[Cashtab] Remove tech debt around checking token names for scams

Summary:
Move token name and ticker blacklist items out of currency object (to be fully deprecated) and into a dedicated blacklist.

In the process of creating this diff, found some tech debt that made sense to clean up here.

  1. No need to have two functions for isProbablyNotAScam for ticker and name, esp since they are both checking each anyway
  2. Blacklist needs to condition data so that multi-word banned token names are correctly picked up, like 'Lido Staked Ether'
  3. Blacklist should be exported as a single pre-processed array. Validation function should compare against only one array.

Test Plan:
npm test

npm start and go to create an etoken. Try some scam names and some normal names. See validation error on scam names.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14333

Details

Provenance
bytesofmanAuthored on Aug 1 2023, 22:23
bytesofmanPushed on Aug 2 2023, 22:29
Reviewer
Restricted Project
Differential Revision
D14333: [Cashtab] Remove tech debt around checking token names for scams
Parents
rABC986fea30b59a: [chronik] Bump the RocksDb crate version to 0.21.0
Branches
Unknown
Tags
Unknown