Skip to content

Commit

Permalink
feat: filter addresses and name for phishing
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNumlock committed Apr 2, 2024
1 parent 7809ca5 commit 83ff0a2
Show file tree
Hide file tree
Showing 3 changed files with 138,406 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { addressEqual, getChainConstant } from '@nftx/utils';
import { RESERVOIR_URL } from '@nftx/constants';
import fetchUserCollectionsReservoir from './reservoir';
import fetchSubgraphVaults from '../../vaults/fetchSubgraphVaults';
import { Collection } from '@nftx/types';
import Addresses from '../utils/phishing/json/Addresses.json';
import Domains from '../utils/phishing/json/Domains.json';

type FetchUserCollectionsReservoir = typeof fetchUserCollectionsReservoir;

Expand Down Expand Up @@ -31,12 +34,17 @@ export const makeFetchUserCollections =
return [];
}

const allCollections = await fetchUserCollectionsReservoir({
const unfilteredCollections = await fetchUserCollectionsReservoir({
network,
offset: 0,
userAddress,
});

// Filter out phishing addresses and names as per: https://github.com/scamsniffer/scam-database/
const allCollections = unfilteredCollections.filter((c: Collection) =>
!Addresses.includes(c.address) &&
!Domains.includes(c.name))

if (mintable) {
const vaults =
givenVaults ?? (await fetchSubgraphVaults({ network })).vaults;
Expand Down
Loading

0 comments on commit 83ff0a2

Please sign in to comment.