[internal] Black/whitelist rename (#3424)

* Rename white/black* to allow/deny*.

* White/black to allow/deny renames.

* Duplicate new allowlist.json/denylist.json files under the old names

* Fix allowed-files check

Co-authored-by: Catenocrypt <catenocrypt@users.noreply.github.com>
This commit is contained in:
Adam R 2020-08-18 08:50:32 +02:00 committed by GitHub
parent 1325c8c542
commit 4f487cd054
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
48 changed files with 10393 additions and 164 deletions

View File

@ -74,7 +74,7 @@ Smart contract address update procedure:
- File extension: `png`. Uppercase `PNG` is considered invalid.
- File name`logo.png`.
- Dimension: `256px by 256px` or `512px by 512px`.
- Background: preferably transparent (should fit dark mode as well; black logos need light border/background).
- Background: preferably transparent (should fit dark mode as well; dark logos need light border/background).
- File size: maximum 100KB. Tip: optimize image size, e.g. using simple drag-and-drop online service [tinypng](https://tinypng.com/).
## dApp image naming requirements
@ -113,7 +113,7 @@ To remain in validators list:
`validators` folder contains folders: `assets` same structure as above and `list.json` information about validators.
`blacklist.json` and `whitelist.json` files you may find in folders like `tron`, `ethereum` but not limited to, contain list of address approved based on many criterias (TODO add criterias) and disapproved based on factors such as scam, outdated, abandoned contracts etc ... .
`denylist.json` and `allowlist.json` files you may find in folders like `tron`, `ethereum` but not limited to, contain list of address approved based on many criterias (TODO add criterias) and disapproved based on factors such as scam, outdated, abandoned contracts etc ... .
```
@ -170,8 +170,8 @@ Uploading:
3. TRON TRC10, TRC20 token [token folder](https://github.com/trustwallet/assets/tree/master/blockchains/tron/assets)
4. Add Cosmos validator image [](https://github.com/trustwallet/assets/tree/master/blockchains/cosmos/validators)
5. Add Tezos validator info [](https://github.com/trustwallet/assets/tree/master/blockchains/tezos/validators/list.json)
6. Add Ethereum contract address to blacklist [](https://github.com/trustwallet/assets/tree/master/blockchains/ethereum/blacklist.json)
7. Add TRON TRC10 ID or TRC20 owner contract address to whitelist [](https://github.com/trustwallet/assets/tree/master/blockchains/tron/whitelist.json)
6. Add Ethereum contract address to denylist [](https://github.com/trustwallet/assets/tree/master/blockchains/ethereum/denylist.json)
7. Add TRON TRC10 ID or TRC20 owner contract address to allowlist [](https://github.com/trustwallet/assets/tree/master/blockchains/tron/allowlist.json)
## How To Add Asset
@ -220,7 +220,7 @@ After PR was merged, set of cron workers will update token status normally with
### What is smart contract deprication (removal)?
A process of removing smart contract information such as (token logo and info) from this repository.
Removed contract address will be added to the blacklist and, as a result, will no longer be present in token search results inside the TW app.
Removed contract address will be added to the denylist and, as a result, will no longer be present in token search results inside the TW app.
Why would you want to do this ?.
You are contract owner or just good samaritan who noticed contract to be no longer "active" and was an upgrade and abandoned by owning organization, involved in a scam, mimicking by its name or/and symbol a real contract. All facts must be supported with a link to any resource proving these statements.
@ -278,5 +278,5 @@ https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/tron/ass
## Disclaimer
Trust Wallet team allows anyone to submit new assets to this repository. However, this does not mean that we are in direct partnership with all of the projects.
Trust Wallet team will blacklist projects that are deemed as scams after careful review of the said assets.
Trust Wallet team will denylist projects that are deemed as scams after careful review of the said assets.
Trust Wallet team reserves the right to change the terms of asset submissions at any time due to changing market conditions, risk of fraud, or any other factors we deem relevant.

View File

@ -0,0 +1,156 @@
[
"ABCD-5D8",
"AERGO-46B",
"ALA-DCD",
"ANKR-E97",
"ARN-71B",
"ARPA-575",
"ART-3C9",
"ATP-38C",
"AVA-645",
"AWC-986",
"AXPR-777",
"BAW-DFB",
"BCH-1FD",
"BCPT-95A",
"BEAR-14C",
"BET-844",
"BETX-A0C",
"BGBP-CF3",
"BHC-3E8M",
"BHFT-BBE",
"BIDR-0E9",
"BKBT-3A6",
"BKRW-AB7",
"BLINK-9C6",
"BOLT-4C6",
"BST2-2F2",
"BTCB-1DE",
"BTTB-D31",
"BULL-BE4",
"BUSD-BD1",
"BZNT-464",
"CAN-677",
"CAS-167",
"CBIX-3C9",
"CBM-4B2",
"CHZ-ECD",
"CNNS-E16",
"COS-2E4",
"COTI-CBB",
"COVA-218",
"CRPT-8C9",
"CSM-734",
"DARC-24B",
"DEEP-9D3",
"DEFI-FA5",
"DOS-120",
"DREP-7D2",
"DUSK-45E",
"EBST-783",
"ECO-083",
"EET-45C",
"ENTRP-C8D",
"EOS-CDD",
"EOSBEAR-721",
"EOSBULL-F0D",
"EQL-586",
"ERD-D06",
"ETH-1C9",
"ETHBEAR-B2B",
"ETHBULL-D33",
"EVT-49B",
"FRM-DE7",
"FSN-E14",
"FTM-A64",
"GIV-94E",
"GMAT-FC8",
"GTEX-71B",
"GTO-908",
"HNST-3C9",
"HYN-F21",
"IDRTB-178",
"IRIS-D88",
"JDXU-706",
"KAT-7BB",
"KAVA-10C",
"LBA-340",
"LIT-099",
"LOKI-6A9",
"LTC-F07",
"LTO-BDF",
"LYFE-6AB",
"MATIC-84A",
"MCASH-869",
"MDAB-D42",
"MEDB-87E",
"MEETONE-031",
"MITH-C76",
"MITX-CAA",
"MTV-4C6",
"MTXLT-286",
"MVL-7B0",
"MZK-2C7",
"NEW-09E",
"NEXO-A84",
"NODE-F3A",
"NOIZB-878",
"NOW-E68",
"NPXB-1E8",
"NPXSXEM-89C",
"ONE-5F9",
"ONT-33D",
"OWTX-A6B",
"PCAT-4BB",
"PHB-2DF",
"PHV-4A1",
"PIBNB-43C",
"PLG-D8D",
"PVT-554",
"PYN-C37",
"QBX-38C",
"RAVEN-F66",
"RNO-14E",
"RUNE-B1A",
"SBC-5D4",
"SHR-DB6",
"SLV-986",
"SPNDB-916",
"STYL-65B",
"SWINGBY-888",
"SWIPE.B-DC0",
"SXP-CCC",
"TAUDB-888",
"TCADB-888",
"TGBPB-888",
"THKDB-888",
"TM2-0C4",
"TOMOB-4BC",
"TOP-491",
"TROY-9B8",
"TRUE-D84",
"TRXB-2E6",
"TUSDB-888",
"TWT-8C2",
"UGAS-B0C",
"UND-EBC",
"UPX-F3E",
"USDH-5B5",
"USDSB-1AC",
"VDX-A17",
"VIDT-F53",
"VNDC-DB9",
"VOTE-FD4",
"VRAB-B56",
"WICC-01D",
"WINB-41F",
"WISH-2D5",
"WRX-ED1",
"XBASE-CD2",
"XNS-760",
"XRP-BF2",
"XRPBEAR-00B",
"XRPBULL-E7C",
"XTZ-F7A",
"ZEBI-84F"
]

View File

@ -0,0 +1,8 @@
[
"AWC-8B2",
"BCPT-645",
"BNB",
"BOLT-762",
"USDS.B-c27",
"WITH-E50"
]

View File

@ -0,0 +1,85 @@
[
"0x0000000000b3F879cb30FE243b4Dfee438691c04",
"0x085B0FDf115aA9E16AE1Bddd396CE1F993c52220",
"0x0b6f824FAB88281ea8bd883bdfC1F586743F92FA",
"0x0DC554d2BBc8f4Cda0577CeD2CD86c54689Af3Db",
"0x0f54903F62Dc03DFBE1d99064B41a65D461F61b9",
"0x1178d40896cf784Db203eB40f159D78Ab6E99a29",
"0x15c56f9edE6a53AFaFF8505D88F47B03b57B52AB",
"0x169a4d7aB1244eB57433082B94d8ded5BB97483f",
"0x171040cd10f204F3b257e45b41ce65D36150558C",
"0x17CDb23E6151Dca9A75457d3d795CC5A63648949",
"0x1BE6D61B1103D91F7f86D47e6ca0429259A15ff0",
"0x1ce1b789E291FFA8812D03fa7E67e538f91f132d",
"0x1e797Ce986C3CFF4472F7D38d5C4aba55DfEFE40",
"0x1Fe3164dA6B47C52349E98c14440879A42852D71",
"0x22B3f1d789B189fDd2040d7d5B59568a291Ef611",
"0x24ccaAaE74041985e3D75712D5cce63b0bD9C4A3",
"0x2B682bd9d5c31E67a95cbdF0292017C02E51923C",
"0x2EB1D7785469FC5d478E59Ca09F66CBb9170C519",
"0x3398EB75EE22523fEfdA99574dBc62fD19F8c58B",
"0x33E89a9db4F5a44d80A3E9d2Bdff6c168cbbd15c",
"0x3a6979EAB0ad99549158c05F2635C3B85dCAf5e2",
"0x3E6eC3A0A995d3c58d3854AaE41C77C687C07E7f",
"0x4479B4e96252B829934bA0f8fb8f5c96883DA7E5",
"0x45e42D659D9f9466cD5DF622506033145a9b89Bc",
"0x477964C7B2CDFe2653b0D89469e40D8A5eeF9E52",
"0x4970515788ab15d4De4E9f8ed1E1079f6d25dC77",
"0x4a3a14d47634E0712B1Aa33f17EC31316a0D5BAB",
"0x4dF86FD5bf250D692C503592Bde3d3E9087F6232",
"0x4fab5005176F5E4c00988623c35107cCB40dC19D",
"0x5046E6b2C9D11458bC3718e0cF5Bc8557bCCf5dc",
"0x50fA6146E86deAd56bf9E8e4655DFc2b5235D355",
"0x51396a258BAe60D1fDE2a4Be900371f3B9C52c43",
"0x55b9a11c2e8351b4Ffc7b11561148bfaC9977855",
"0x5BEb463647b1Fd55D3F876E9b042c27Aa63F4bA8",
"0x5eB99507170F41bAA521cb71C9bCEa2a8A96827C",
"0x64fd6EeB4c86A66b0CfeEAFeC11FbC57A2993E67",
"0x651074850053b7FaCf7F7200068B29A2E3525B40",
"0x690D4d5e3722e140fCa16e25E7A579588D93eB75",
"0x6A37eC2C49E2FB35F9c029128e996f46928dDecC",
"0x6FD253A6D78df35f2D932aCf4bCEF4bB650a2263",
"0x76d0184CF511788032A74a1FB91146e63F43dd53",
"0x7b355c571FEde83F152E9585143306C0d2b53193",
"0x876A68D9efbc3CadaA886e9868D93737035F717C",
"0x88d60255F917e3eb94eaE199d827DAd837fac4cB",
"0x8900f34372f27Ebb5881D4eC6b35844A3655CCFc",
"0x8E100855e6647bd24F1A32999c4A6C91497C9f62",
"0x935E058102AFa0CC3c29Af024AF3208Ba521bcB0",
"0x9946C9C519638740EAc4Ee3Aa9f20eBe1Ce36c2c",
"0x9a145BABB0315F461eD40cB8Cd17523A039e0370",
"0x9aBcecb1CB8e174b4d158021c9C710c81a989487",
"0x9bd05bCd368BDB8050E85E35b8D38753e72b44BF",
"0x9c5D60F5D1493F3FA05cdE2403b4Bd4B9CF01057",
"0xAC55641Cbb734bdf6510d1bBd62E240c2409040f",
"0xAf4D36C8c744F345E060345b6eAf4E899eC7547c",
"0xb81BbB68D2C32398e628f5183D1cfe9f24dFb678",
"0xB932b16ccc42917dF3608bfC1519e948b42fdFD9",
"0xc2A4CE7835c7b6de4F3F15303E25b3eF0bB43bDF",
"0xC2E0bC52D1995dF11949425cfdf78D0B6D2cfE0a",
"0xc658E8372DaFFf26caa7439B95a1fF723baaef6E",
"0xC68dDd84fDC77506A5b7AB43B8E13DBA0AF74Ff4",
"0xC8671e3eAAd0793de26c4a7Ba5ca10a992a80c7A",
"0xc98333457471f82871B0193D0E4F03C6D7D7dFF8",
"0xca08DaeC07f11d9375cA64478e83a12fC35B09d2",
"0xCA68fE57A0E9987F940Ebcc65fe5F96E7bC30128",
"0xD1c10d433C888E6d1841fF924d0CE45157f0d5Cd",
"0xD1eBe08dAe15E604B043789cb140be646E0bd27b",
"0xD4729a47FFDBDd190a015BB0C29fC613c5aD3cFE",
"0xD507fAa6B65cF9E970d67cd108B224162495de30",
"0xd6dF0C579f2A65049a893fDaEC9fCE098CC19F87",
"0xdEb7ade9417f98AFbB60cd6b4a49d4B002AB79c9",
"0xDF23a076b82a08cEFe696346DB702BBDD86838Bf",
"0xDF9AaC76b722B08511A4C561607A9bf3AfA62E49",
"0xdfd0A6BeD91d7609a0d84389Dcb7AAb5877e6AfA",
"0xE0B7927c4aF23765Cb51314A0E0521A9645F0E2A",
"0xe37B29Ce789CFa51b72c64c93e0d7E2D7BA46681",
"0xe9506979c9FA6f34b93846792c2d4aad7974ea55",
"0xeceaDBB8441AA28b76D8c756EE873aC574068204",
"0xf03A967b0F6EedE6f73fd747a93006E9130525d4",
"0xf8af8f48ba1743ccb0001778070e4ce189225e90",
"0xf962Ce2544f9e22da3DAE54b2A3040db7867f029",
"0xFC07d3E0e36330a151c09384C3aD45e745227688",
"0xFF197d0558aa9CD8fF788c7f0d4A1A48E1c399D6",
"0xFf8596169865c7cc1458b1c0eCCAFd4092C7F10f"
]

View File

@ -0,0 +1,6 @@
[
"0x6ADa6F48C815689502C43eC1a59F1b5DD3C04E1F",
"0xAfe6851C1D9ee2E759ACDEE8cFC827E22a9eC5d7",
"0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413",
"0xC66eA802717bFb9833400264Dd12c2bCeAa34a6d"
]

View File

@ -0,0 +1,3 @@
[
"volentixgsys"
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
[
"0x064353B5C02A9F35979524Ebbfff4042151cF0c6",
"0x473A70391d961D1D81044f7e2b69eeCd59dc355c",
"0x53A6Bec3126BCE4e0dE349a9Ad3D9e4F997E76C4",
"0x721Cc970CB5A22915f7663a6833E605deDDb7B92",
"0xB881f9bB7EEa9499073c279D6eAC59B1A9010617"
]

View File

@ -0,0 +1,3 @@
[
"0x7F02B0b116A1399CE4bD5A9D506F7F1AE3CAC705"
]

View File

@ -0,0 +1,4 @@
[
"2efdb22c152896964665d0a8214dc7bd59232162",
"bac0d143a547dc66a1d6a2b7d66b06de42614971"
]

View File

@ -0,0 +1 @@
[]

View File

@ -0,0 +1,3 @@
[
"NULSd6HgyZkiqLnBzTaeSQfx1TNg2cqbzq51h"
]

View File

@ -0,0 +1 @@
[]

View File

@ -0,0 +1,3 @@
[
"ong"
]

View File

@ -0,0 +1 @@
[]

View File

@ -0,0 +1,5 @@
[
"0xA17ed5dFc62D0a3E74D69a0503AE9FdA65d9f212",
"0xADFE00d92e5A16e773891F59780e6e54f40B532e",
"0xC98a06220239818B086CD96756d4E3bC41EC848E"
]

View File

@ -0,0 +1 @@
[]

View File

@ -0,0 +1,7 @@
[
"ukrw",
"uluna",
"umnt",
"usdr",
"uusd"
]

View File

@ -0,0 +1 @@
[]

View File

@ -0,0 +1,3 @@
[
"tfuel"
]

View File

@ -0,0 +1 @@
[]

View File

@ -0,0 +1,11 @@
[
"0x050fe1046B546286e2467De8Cb04800479D1FDE3",
"0x0A733F90D223d47DEa79aBEfF536F10af1068cB0",
"0x2b31e3b88847f03c1335E99A0d1274A2c72059DE",
"0x4f3C8E20942461e2c3Bdd8311AC57B0c222f2b82",
"0x876e7D048c6151e3D0F93AaBfBf5B7Da605d416F",
"0x92B82d80A51D9b280b75C7a3596358B2A67e4859",
"0xa71A7659E5d1824Bc0F71B96332B06097C8D6287",
"0xDDf952D68ff6aBC03B6Dd06E98DaD8829a1d2bb3",
"0xeff6f1612d03205BA5E8d26cAc1397bf778ab1AC"
]

View File

@ -0,0 +1,4 @@
[
"0x8c844A7Eb92C45e3B542B8ce3Fe5F82d37640d7F",
"0xf3Cab28E25b64fcd361446CCD6418D3e51d9cB52"
]

View File

@ -0,0 +1,7 @@
[
"0x01F83cE6636179b54b0CC0C408f9a8bce40ae776",
"0x17B26400621695c2D8C2D8869f6259E82D7544c4",
"0x5e55D0c59287F5F8d540eF0766cA3F3810C71B84",
"0x936b1F7290c8CFC57e31D7e4a301D5F9fA5B0cd8",
"0xcE98172f4fC9Ad02da607843A2C211b7834431da"
]

View File

@ -0,0 +1 @@
[]

View File

@ -0,0 +1,180 @@
[
"1000001",
"1000010",
"1000017",
"1000018",
"1000131",
"1000161",
"1000226",
"1000231",
"1000251",
"1000307",
"1000317",
"1000318",
"1000324",
"1000375",
"1000391",
"1000430",
"1000451",
"1000475",
"1000554",
"1000566",
"1000577",
"1000641",
"1000709",
"1000811",
"1000814",
"1000822",
"1000824",
"1000848",
"1000849",
"1000854",
"1000865",
"1000891",
"1000897",
"1000898",
"1000900",
"1000907",
"1000930",
"1000932",
"1000933",
"1000935",
"1000943",
"1000945",
"1000981",
"1000985",
"1000999",
"1001013",
"1001030",
"1001046",
"1001047",
"1001050",
"1001090",
"1001091",
"1001092",
"1001107",
"1001136",
"1001137",
"1001142",
"1001164",
"1001186",
"1001203",
"1001217",
"1001268",
"1001302",
"1001305",
"1001313",
"1001351",
"1001353",
"1001359",
"1001361",
"1001363",
"1001367",
"1001385",
"1001411",
"1001414",
"1001427",
"1001438",
"1001457",
"1001466",
"1001500",
"1001546",
"1001559",
"1001581",
"1001584",
"1001596",
"1001617",
"1001645",
"1001652",
"1001698",
"1001699",
"1001757",
"1001778",
"1001801",
"1001803",
"1001825",
"1001834",
"1001837",
"1001845",
"1001865",
"1001893",
"1001909",
"1001920",
"1001943",
"1001949",
"1002000",
"1002021",
"1002023",
"1002028",
"1002043",
"1002058",
"1002093",
"1002116",
"1002226",
"1002234",
"1002270",
"1002357",
"1002413",
"1002469",
"1002483",
"1002517",
"1002570",
"1002573",
"1002575",
"1002578",
"1002605",
"1002633",
"1002671",
"1002672",
"1002683",
"1002762",
"1002795",
"1002831",
"1002963",
"1003093",
"1003095",
"1003097",
"1003123",
"1003152",
"TAVDwcRTUpfibh5rr6GoE19FArsaHBfcur",
"TAvQRWviGyfbjcbbDaLVrh7T3tfPK6N5He",
"TCFLL5dx5ZJdKnWuesXxi1VPwjLVmWZZy9",
"TCRhVHPv6efvXgogNMhiunAMXFKcMmv2pF",
"TDFRfJLThnLXgtEBBBmA2LGwz3Ex9dAMCE",
"TDh4z44NbqrCGVCCqBe753UqHW2CcDpurB",
"TFPAuuQym78giRve6iHTf4y7dZJxAkkrUa",
"TG37mUxRUaH1E8DWSrrmoQ79BnZn1yHztb",
"TGbhcodQ1jRWB3ZywmfwsRTh4rwbiL2mzh",
"THvZvKPLHKLJhEFYKiyqj6j8G8nGgfg7ur",
"TJ63TQ3fvibq9pgkiFysPgDWkim1tBjejC",
"TJM6YUK7PsyhncoZG3b28ZFrZFWZLuAT4n",
"TJoiXo9nPhqPFvYfuHjUzswdth9Lu7Vg2p",
"TJzcEaqgYk9g4jZLEsB2DksLGikM4dWwYJ",
"TKTcfBEKpp5ZRPwmiZ8SfLx8W7CDZ7PHCY",
"TLa2f6VPqDgRE67v1736s7bJ8Ray5wYjU7",
"TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
"TMhjbHzJCiMWqa5oqn2DF3mGw5yh9oQNf2",
"TMwFHYXLJaRUPeW6421aqXL4ZEzPRFGkGT",
"TNjt5fShPVJ4YpsLuU4THuBbg58g2bZoLk",
"TNZXVQUKQ8Gnjq2BqLvt2kC5WbeDQc1q3j",
"TPRuU2GbXPwvvSuggE4xKMRtzsfwYfvBWq",
"TQhfmGiZvRt3oe9vKv6W9WXRr4oErxc8RE",
"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"TSkG9SSKdWV5QBuTPN6udi48rym5iPpLof",
"TTYpHRvz826qA8ChsSvdJKfAY4wiY7p1NP",
"TUH63441fBWg2Jam4qTYC8aKX7Np3fHi1b",
"TUL5yxRKeSWvceLZ3BSU5iNJcQmNxkWayh",
"TV2UZpAzMPuMNpzQW8FJEHidDB1oht7Anb",
"TVthmvBhhmgVNnXZwCvCFoCUTC9Hj4eg6y",
"TW2BkFwvkoH9Cx2zwifTacwkGSGiyiZWmt",
"TWGGB35HUudizmcLheQN7kANDnD8KfgKkK",
"TWVVcRqRmpyAi9dASvTXrqnS7FrwvDezMn",
"TXfUT4K3z8tatGAk3rEw5qMuqrPXp28h4g",
"TYLrbh1pVcx95bop33XQ1iYdh7r3ogEQ8Q",
"TYM9eM22SCynRc5YaMxE2PX1kwv7H2rXAu",
"TYNgrZX2eLPZ8UUoZEWuiUZYn3bh8fHU8f",
"TYqgBctn2NjCQZLBbh1SMEAsH36mopnNqo",
"TYxoK7DAvfze7ByWA7LYnzcoLxdKQpjrD1",
"TZGQJY1QbZuXJmMgDgoZVeG4mD1Ef6SdWU",
"TZHTVehxLeoVQ5uuQLy3TDx4Uuw6EmHVNF"
]

View File

@ -0,0 +1,38 @@
[
"1000003",
"1000396",
"1000480",
"1000491",
"1000501",
"1000520",
"1000532",
"1000541",
"1000564",
"1000644",
"1000743",
"1000744",
"1000745",
"1000746",
"1001948",
"1001952",
"1001964",
"1002001",
"1002009",
"1002038",
"1002065",
"1002101",
"1002544",
"1002597",
"1002670",
"1002775",
"1002814",
"1002845",
"1002858",
"1002881",
"1002897",
"1002907",
"1002927",
"1002962",
"1002999",
"1003109"
]

View File

@ -0,0 +1,3 @@
[
"0x0000000000000000000000000000456E65726779"
]

View File

@ -0,0 +1 @@
[]

View File

@ -0,0 +1,8 @@
[
"0x0f2e7C0E904a525A24FF6f658053f6bA5Ce7A209",
"0x350bb91C9C8Ef4e8C0e19fbdc6A90A24bcb1eC2A",
"0x3BEB80170272f07aCA12987AF86A59888255A807",
"0x51316966907ef568689775066e97c46a4Ffde1a4",
"0xA13a41a2349D09C1E3a0dD4d9448Af4aD799fC4A",
"0xc6f4465a6A521124c8E3096b62575C157999d361"
]

View File

@ -0,0 +1 @@
[]

View File

@ -0,0 +1 @@
[]

View File

@ -12,8 +12,8 @@ import {
isPathExistsSync,
makeDirSync,
getChainAssetPath,
getChainBlacklist,
getChainWhitelist,
getChainDenylist,
getChainAllowlist,
} from "../../script-old/helpers";
import { TickerType, mapTiker, PlatformType } from "../../script-old/models";
@ -26,8 +26,8 @@ const CMC_PRO_API_KEY = `df781835-e5f4-4448-8b0a-fe31402ab3af` // Free Basic Pla
const CMC_LATEST_BASE_URL = `https://pro-api.coinmarketcap.com/v1/global-metrics/quotes/latest?`
const typeToken = TickerType.Token
const typeCoin = TickerType.Coin
const mappedChainsBlacklistAssets = {} // {ethereum: {<0x...>: ""},}
const mappedChainsWhitelistAssets = {} // {ethereum: {<0x...>: ""},}
const mappedChainsDenylistAssets = {} // {ethereum: {<0x...>: ""},}
const mappedChainsAllowlistAssets = {} // {ethereum: {<0x...>: ""},}
const custom: mapTiker[] = [
{"coin": 60, "type": typeToken, "token_id": "0x6758B7d441a9739b98552B373703d8d3d14f9e62", "id": 2548}, // POA ERC20 on Foundation (POA20)
@ -105,7 +105,7 @@ function buildCoinEntry(coin: any): any {
if (platform.token_address) {
try {
const checksum = toChecksum(platform.token_address)
if (!isAddressInBlackList("ethereum", checksum)) {
if (!isAddressInDenyList("ethereum", checksum)) {
return {
coin: 60,
type: typeToken,
@ -215,14 +215,14 @@ async function initState () {
async function mapChainsAssetsLists() {
ethForkChains.forEach(chain => {
Object.assign(mappedChainsWhitelistAssets, {[chain]: {}})
Object.assign(mappedChainsBlacklistAssets, {[chain]: {}})
Object.assign(mappedChainsAllowlistAssets, {[chain]: {}})
Object.assign(mappedChainsDenylistAssets, {[chain]: {}})
getChainWhitelist(chain).forEach(addr => {
Object.assign(mappedChainsWhitelistAssets[chain], {[addr]: ""})
getChainAllowlist(chain).forEach(addr => {
Object.assign(mappedChainsAllowlistAssets[chain], {[addr]: ""})
})
getChainBlacklist(chain).forEach(addr => {
Object.assign(mappedChainsBlacklistAssets[chain], {[addr]: ""})
getChainDenylist(chain).forEach(addr => {
Object.assign(mappedChainsDenylistAssets[chain], {[addr]: ""})
})
})
}
@ -280,7 +280,7 @@ const getImageURL = (id: string | number): string => `https://s2.coinmarketcap.c
async function getImageIfMissing(chain: string, address: string, id: string) {
try {
const logoPath = getChainAssetLogoPath(chain, String(address))
if (!isPathExistsSync(logoPath) && !isAddressInBlackList(chain, address)) {
if (!isPathExistsSync(logoPath) && !isAddressInDenyList(chain, address)) {
const imageStream = await fetchImage(getImageURL(id))
if (imageStream) {
@ -300,8 +300,8 @@ async function getImageIfMissing(chain: string, address: string, id: string) {
}
function isAddressInBlackList(chain: string, address: string): boolean {
return mappedChainsBlacklistAssets[chain].hasOwnProperty(address)
function isAddressInDenyList(chain: string, address: string): boolean {
return mappedChainsDenylistAssets[chain].hasOwnProperty(address)
}
async function fetchImage(url: string) {

View File

@ -9,8 +9,8 @@ export const infoName = `info`
export const logoExtension = "png"
export const jsonExtension = "json"
const whiteList = `whitelist.${jsonExtension}`
const blackList = `blacklist.${jsonExtension}`
const allowList = `allowlist.${jsonExtension}`
const denyList = `denylist.${jsonExtension}`
export const logo = `${logoName}.${logoExtension}`
export const info = `${infoName}.${jsonExtension}`
@ -25,17 +25,17 @@ export const getChainPath = (chain: string): string => `${chainsFolderPath}/${ch
export const getChainAssetPath = (chain: string, address: string) => `${getChainAssetsPath(chain)}/${address}`
export const getAllChainsList = (): string[] => readDirSync(chainsFolderPath)
export const getChainAssetLogoPath = (chain: string, address: string) => `${getChainAssetsPath(chain)}/${address}/${logo}`
export const getChainWhitelistPath = (chain: string): string => `${chainsFolderPath}/${chain}/${whiteList}`
export const getChainBlacklistPath = (chain: string): string => `${chainsFolderPath}/${chain}/${blackList}`
export const getChainWhitelist = (chain: string): string[] => {
if (isChainWhitelistExistSync(chain)) {
return JSON.parse(readFileSync(getChainWhitelistPath(chain)))
export const getChainAllowlistPath = (chain: string): string => `${chainsFolderPath}/${chain}/${allowList}`
export const getChainDenylistPath = (chain: string): string => `${chainsFolderPath}/${chain}/${denyList}`
export const getChainAllowlist = (chain: string): string[] => {
if (isChainAllowlistExistSync(chain)) {
return JSON.parse(readFileSync(getChainAllowlistPath(chain)))
}
return []
}
export const getChainBlacklist = (chain: string): string[] => {
if (isChainBlacklistExistSync(chain)) {
return JSON.parse(readFileSync(getChainBlacklistPath(chain)))
export const getChainDenylist = (chain: string): string[] => {
if (isChainDenylistExistSync(chain)) {
return JSON.parse(readFileSync(getChainDenylistPath(chain)))
}
return []
}
@ -45,8 +45,8 @@ export const readDirSync = (path: string): string[] => fs.readdirSync(path)
export const makeDirSync = (path: string) => fs.mkdirSync(path)
export const isPathExistsSync = (path: string): boolean => fs.existsSync(path)
export const isDirContainLogo = (path: string): boolean => fs.existsSync(`${path}/${logo}`)
export const isChainWhitelistExistSync = (chain: string): boolean => isPathExistsSync(getChainWhitelistPath(chain))
export const isChainBlacklistExistSync = (chain: string): boolean => isPathExistsSync(getChainBlacklistPath(chain))
export const isChainAllowlistExistSync = (chain: string): boolean => isPathExistsSync(getChainAllowlistPath(chain))
export const isChainDenylistExistSync = (chain: string): boolean => isPathExistsSync(getChainDenylistPath(chain))
export const isChainInfoExistSync = (chain: string): boolean => isPathExistsSync(getChainInfoPath(chain))
export const readFileSync = (path: string) => fs.readFileSync(path, 'utf8')

132
script/action/allowlists.ts Normal file
View File

@ -0,0 +1,132 @@
import { chainsWithDenylist } from "../common/blockchains";
import {
getChainAssetsList,
getChainAllowlistPath,
getChainDenylistPath,
getChainPath
} from "../common/repo-structure";
import { readFileSync, writeFileSync } from "../common/filesystem";
import {
arrayDiff,
arrayDiffNocase,
findCommonElementsOrDuplicates,
makeUnique
} from "../common/types";
import { ActionInterface, CheckStepInterface } from "./interface";
import { formatSortJson } from "../common/json";
import * as bluebird from "bluebird";
import { copyFile } from "fs";
async function checkUpdateAllowDenyList(chain: string, checkOnly: boolean ): Promise<[boolean, string]> {
let wrongMsg = "";
const assets = getChainAssetsList(chain);
const allowlistPath = getChainAllowlistPath(chain);
const denylistPath = getChainDenylistPath(chain);
const currentAllowlistText = readFileSync(allowlistPath);
const currentDenylistText = readFileSync(denylistPath);
const currentAllowlist = JSON.parse(currentAllowlistText);
const currentDenylist = JSON.parse(currentDenylistText);
const commonElementsOrDuplicates = findCommonElementsOrDuplicates(currentAllowlist, currentDenylist);
if (commonElementsOrDuplicates && commonElementsOrDuplicates.length > 0) {
wrongMsg += `Denylist and allowlist for chain ${chain} should have no common elements or duplicates, found ${commonElementsOrDuplicates.length} ${commonElementsOrDuplicates[0]}\n`;
}
const allowlistOrphan = arrayDiff(currentAllowlist, assets);
if (allowlistOrphan && allowlistOrphan.length > 0) {
wrongMsg += `Allowlist for chain ${chain} contains non-exitent assets, found ${allowlistOrphan.length}, ${allowlistOrphan[0]}\n`;
}
const newDeny = makeUnique(currentDenylist.concat(allowlistOrphan));
const newAllow = makeUnique(arrayDiffNocase(assets, newDeny));
//console.log(currentAllowlist.length, "vs.", newAllow.length);
//console.log(currentDenylist.length, "vs.", newDeny.length);
const wDiff1 = arrayDiffNocase(newAllow, currentAllowlist);
if (wDiff1.length > 0) {
wrongMsg += `Some elements are missing from allowlist for chain ${chain}: ${wDiff1.length} ${wDiff1[0]}\n`;
}
const wDiff2 = arrayDiffNocase(currentAllowlist, newAllow);
if (wDiff2.length > 0) {
wrongMsg += `Some elements should be removed from allowlist for chain ${chain}: ${wDiff2.length} ${wDiff2[0]}\n`;
}
const bDiff1 = arrayDiffNocase(newDeny, currentDenylist);
if (bDiff1.length > 0) {
wrongMsg += `Some elements are missing from denylist for chain ${chain}: ${bDiff1.length} ${bDiff1[0]}\n`;
}
const bDiff2 = arrayDiffNocase(currentDenylist, newDeny);
if (bDiff2.length > 0) {
wrongMsg += `Some elements should be removed from denylist for chain ${chain}: ${bDiff2.length} ${bDiff2[0]}\n`;
}
// additionally check for nice formatting, sorting:
const newAllowText = formatSortJson(newAllow);
const newDenyText = formatSortJson(newDeny);
if (newAllowText !== currentAllowlistText) {
wrongMsg += `Allowlist for chain ${chain}: not formatted nicely \n`;
}
if (newDenyText !== currentDenylistText) {
wrongMsg += `Denylist for chain ${chain}: not formatted nicely \n`;
}
if (wrongMsg.length > 0) {
// sg wrong, may need to fix
if (!checkOnly) {
// update
writeFileSync(allowlistPath, newAllowText);
writeFileSync(denylistPath, newDenyText);
console.log(`Updated allow and denylists for chain ${chain}`);
}
}
return [(wrongMsg.length == 0), wrongMsg];
}
async function copyAllowListsTemp() {
// clone allow/denylist.txt to white/blacklist.txt, for backward compatibility
chainsWithDenylist.forEach(chain => {
copyFile(`${getChainPath(chain)}/allowlist.json`, `${getChainPath(chain)}/whitelist.json`, (err) => {
if (err) throw err;
});
copyFile(`${getChainPath(chain)}/denylist.json`, `${getChainPath(chain)}/blacklist.json`, (err) => {
if (err) throw err;
});
});
console.log("allowlist/blakclist files duplicated for backwards compatibility.");
}
export class Allowlist implements ActionInterface {
getName(): string { return "Allowlists"; }
getSanityChecks = null;
getConsistencyChecks(): CheckStepInterface[] {
const steps: CheckStepInterface[] = [];
chainsWithDenylist.forEach(chain => {
steps.push(
{
getName: () => { return `Allowlist and denylist for ${chain} should be consistent with assets`},
check: async () => {
const [isOK, msg] = await checkUpdateAllowDenyList(chain, true);
if (!isOK) {
return msg;
}
return "";
}
}
);
});
return steps;
}
async sanityFix(): Promise<void> {
await copyAllowListsTemp();
}
async consistencyFix(): Promise<void> {
await bluebird.each(chainsWithDenylist, async (chain) => await checkUpdateAllowDenyList(chain, false));
}
update = null;
}

View File

@ -11,7 +11,7 @@ import { readDirSync } from "../common/filesystem";
import {
getChainAssetLogoPath,
getChainBlacklistPath
getChainDenylistPath
} from "../common/repo-structure";
const binanceChain = "binance"
@ -54,15 +54,15 @@ function fetchImage(url) {
}
/// Return: array with images to fetch; {asset, assetImg}
export function findImagesToFetch(assetInfoList: any, blacklist: string[]): any[] {
export function findImagesToFetch(assetInfoList: any, denylist: string[]): any[] {
let toFetch: any[] = [];
console.log(`Checking for asset images to be fetched`);
assetInfoList.forEach(({asset, assetImg}) => {
process.stdout.write(`.${asset} `);
if (assetImg) {
if (blacklist.indexOf(asset) != -1) {
if (denylist.indexOf(asset) != -1) {
console.log();
console.log(`${asset} is blacklisted`);
console.log(`${asset} is denylisted`);
} else {
const imagePath = getChainAssetLogoPath(binanceChain, asset);
if (!fs.existsSync(imagePath)) {
@ -130,9 +130,9 @@ export class BinanceAction implements ActionInterface {
async update(): Promise<void> {
// retrieve missing token images; BEP2 (bep8 not supported)
const bep2InfoList = await retrieveBep2AssetList();
const blacklist: string[] = require(getChainBlacklistPath(binanceChain));
const denylist: string[] = require(getChainDenylistPath(binanceChain));
const toFetch = findImagesToFetch(bep2InfoList, blacklist);
const toFetch = findImagesToFetch(bep2InfoList, denylist);
const fetchedAssets = await fetchMissingImages(toFetch);
if (fetchedAssets.length > 0) {

View File

@ -10,7 +10,7 @@ import { TezosAction } from "./tezos";
import { TronAction } from "./tron";
import { Validators } from "./validators";
import { WavesAction } from "./waves";
import { Whitelist } from "./whitelists";
import { Allowlist } from "./allowlists";
import { Coinmarketcap } from "../../pricing/coinmarketcap/cmc-action";
import { ActionInterface, CheckStepInterface } from "./interface";
import * as chalk from 'chalk';
@ -20,7 +20,7 @@ const actionList: ActionInterface[] = [
new FoldersFiles(),
new EthForks(),
new LogoSize(),
new Whitelist(),
new Allowlist(),
new Validators(),
new JsonAction(),
// chains:

View File

@ -1,111 +0,0 @@
import { chainsWithBlacklist } from "../common/blockchains";
import { getChainAssetsList, getChainWhitelistPath, getChainBlacklistPath } from "../common/repo-structure";
import { readFileSync, writeFileSync } from "../common/filesystem";
import {
arrayDiff,
arrayDiffNocase,
findCommonElementsOrDuplicates,
makeUnique
} from "../common/types";
import { ActionInterface, CheckStepInterface } from "./interface";
import { formatSortJson } from "../common/json";
import * as bluebird from "bluebird";
async function checkUpdateWhiteBlackList(chain: string, checkOnly: boolean ): Promise<[boolean, string]> {
let wrongMsg = "";
const assets = getChainAssetsList(chain);
const whitelistPath = getChainWhitelistPath(chain);
const blacklistPath = getChainBlacklistPath(chain);
const currentWhitelistText = readFileSync(whitelistPath);
const currentBlacklistText = readFileSync(blacklistPath);
const currentWhitelist = JSON.parse(currentWhitelistText);
const currentBlacklist = JSON.parse(currentBlacklistText);
const commonElementsOrDuplicates = findCommonElementsOrDuplicates(currentWhitelist, currentBlacklist);
if (commonElementsOrDuplicates && commonElementsOrDuplicates.length > 0) {
wrongMsg += `Blacklist and whitelist for chain ${chain} should have no common elements or duplicates, found ${commonElementsOrDuplicates.length} ${commonElementsOrDuplicates[0]}\n`;
}
const whitelistOrphan = arrayDiff(currentWhitelist, assets);
if (whitelistOrphan && whitelistOrphan.length > 0) {
wrongMsg += `Whitelist for chain ${chain} contains non-exitent assets, found ${whitelistOrphan.length}, ${whitelistOrphan[0]}\n`;
}
const newBlack = makeUnique(currentBlacklist.concat(whitelistOrphan));
const newWhite = makeUnique(arrayDiffNocase(assets, newBlack));
//console.log(currentWhitelist.length, "vs.", newWhite.length);
//console.log(currentBlacklist.length, "vs.", newBlack.length);
const wDiff1 = arrayDiffNocase(newWhite, currentWhitelist);
if (wDiff1.length > 0) {
wrongMsg += `Some elements are missing from whitelist for chain ${chain}: ${wDiff1.length} ${wDiff1[0]}\n`;
}
const wDiff2 = arrayDiffNocase(currentWhitelist, newWhite);
if (wDiff2.length > 0) {
wrongMsg += `Some elements should be removed from whitelist for chain ${chain}: ${wDiff2.length} ${wDiff2[0]}\n`;
}
const bDiff1 = arrayDiffNocase(newBlack, currentBlacklist);
if (bDiff1.length > 0) {
wrongMsg += `Some elements are missing from blacklist for chain ${chain}: ${bDiff1.length} ${bDiff1[0]}\n`;
}
const bDiff2 = arrayDiffNocase(currentBlacklist, newBlack);
if (bDiff2.length > 0) {
wrongMsg += `Some elements should be removed from blacklist for chain ${chain}: ${bDiff2.length} ${bDiff2[0]}\n`;
}
// additionally check for nice formatting, sorting:
const newWhiteText = formatSortJson(newWhite);
const newBlackText = formatSortJson(newBlack);
if (newWhiteText !== currentWhitelistText) {
wrongMsg += `Whitelist for chain ${chain}: not formatted nicely \n`;
}
if (newBlackText !== currentBlacklistText) {
wrongMsg += `Blacklist for chain ${chain}: not formatted nicely \n`;
}
if (wrongMsg.length > 0) {
// sg wrong, may need to fix
if (!checkOnly) {
// update
writeFileSync(whitelistPath, newWhiteText);
writeFileSync(blacklistPath, newBlackText);
console.log(`Updated white and blacklists for chain ${chain}`);
}
}
return [(wrongMsg.length == 0), wrongMsg];
}
export class Whitelist implements ActionInterface {
getName(): string { return "Whitelists"; }
getSanityChecks = null;
getConsistencyChecks(): CheckStepInterface[] {
const steps: CheckStepInterface[] = [];
chainsWithBlacklist.forEach(chain => {
steps.push(
{
getName: () => { return `Whitelist and blacklist for ${chain} should be consistent with assets`},
check: async () => {
const [isOK, msg] = await checkUpdateWhiteBlackList(chain, true);
if (!isOK) {
return msg;
}
return "";
}
}
);
});
return steps;
}
sanityFix = null;
async consistencyFix(): Promise<void> {
await bluebird.each(chainsWithBlacklist, async (chain) => await checkUpdateWhiteBlackList(chain, false));
}
update = null;
}

View File

@ -43,7 +43,7 @@ export const stakingChains = [
Kava,
Terra
];
export const chainsWithBlacklist = ethForkChains.concat(
export const chainsWithDenylist = ethForkChains.concat(
Binance,
Tron,
Terra,

View File

@ -12,17 +12,19 @@ export const logoExtension = "png";
export const jsonExtension = "json";
export const logoFullName = `${logoName}.${logoExtension}`;
export const infoFullName = `${infoName}.${jsonExtension}`;
const whiteList = `whitelist.${jsonExtension}`;
const blackList = `blacklist.${jsonExtension}`;
const allowList = `allowlist.${jsonExtension}`;
const denyList = `denylist.${jsonExtension}`;
export const validatorsList = `${listName}.${jsonExtension}`
export const assetFolderAllowedFiles = [logoFullName, infoFullName];
export const chainFolderAllowedFiles = [
"assets",
whiteList,
blackList,
allowList,
denyList,
"validators",
infoName
infoName,
"whitelist.json", // interim
"blacklist.json"
]
export const chainsPath: string = path.join(process.cwd(), '/blockchains');
export const getChainPath = (chain: string): string => `${chainsPath}/${chain}`;
@ -31,8 +33,8 @@ export const getChainAssetsPath = (chain: string): string => `${getChainPath(cha
export const getChainAssetPath = (chain: string, asset: string) => `${getChainAssetsPath(chain)}/${asset}`;
export const getChainAssetLogoPath = (chain: string, asset: string): string => `${getChainAssetPath(chain, asset)}/${logoFullName}`;
export const getChainAssetInfoPath = (chain: string, asset: string): string => `${getChainAssetPath(chain, asset)}/${infoFullName}`;
export const getChainWhitelistPath = (chain: string): string => `${getChainPath(chain)}/${whiteList}`;
export const getChainBlacklistPath = (chain: string): string => `${getChainPath(chain)}/${blackList}`;
export const getChainAllowlistPath = (chain: string): string => `${getChainPath(chain)}/${allowList}`;
export const getChainDenylistPath = (chain: string): string => `${getChainPath(chain)}/${denyList}`;
export const pricingFolderPath = path.join(process.cwd(), '/pricing');
export const getChainValidatorsPath = (chain: string): string => `${getChainPath(chain)}/validators`;

View File

@ -121,11 +121,11 @@ describe("Test action binance", () => {
test(`Test findImagesToFetch`, () => {
const assetsInfoListNonexisting: any[] = [{asset: "A1", assetImg: "imgurl1"}, {asset: "A2", assetImg: "imgurl2"}];
const assetsInfoListExisting: any[] = [{asset: "BUSD-BD1", assetImg: "imgurlBUSD"}, {asset: "ETH-1C9", assetImg: "imgurlETH"}];
const blackListEmpty: string[] = [];
const blackListA1: string[] = ["A1"];
expect(findImagesToFetch(assetsInfoListNonexisting, blackListEmpty), `2 nonexisting`).toEqual(assetsInfoListNonexisting);
expect(findImagesToFetch(assetsInfoListNonexisting, blackListA1), `2 nonexisting with 1 blacklisted`).toEqual([{asset: "A2", assetImg: "imgurl2"}]);
expect(findImagesToFetch(assetsInfoListExisting, blackListEmpty), `2 existing`).toEqual([]);
const denyListEmpty: string[] = [];
const denyListA1: string[] = ["A1"];
expect(findImagesToFetch(assetsInfoListNonexisting, denyListEmpty), `2 nonexisting`).toEqual(assetsInfoListNonexisting);
expect(findImagesToFetch(assetsInfoListNonexisting, denyListA1), `2 nonexisting with 1 denylisted`).toEqual([{asset: "A2", assetImg: "imgurl2"}]);
expect(findImagesToFetch(assetsInfoListExisting, denyListEmpty), `2 existing`).toEqual([]);
expect(findImagesToFetch([], []), `empty`).toEqual([]);
});
});