feat: add collection blocklist for ip infringement (#6022)

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
This commit is contained in:
Charles Bachmeier 2023-02-23 10:44:27 -08:00 committed by GitHub
parent f15e5725f1
commit 772416cc7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 11 deletions

@ -15,6 +15,7 @@ import { CollectionPageSkeleton } from 'nft/components/collection/CollectionPage
import { BagCloseIcon } from 'nft/components/icons'
import { useBag, useCollectionFilters, useFiltersExpanded, useIsMobile } from 'nft/hooks'
import * as styles from 'nft/pages/collection/index.css'
import { blocklistedCollections } from 'nft/utils'
import { Suspense, useEffect } from 'react'
import { useLocation, useNavigate, useParams } from 'react-router-dom'
import { animated, easings, useSpring } from 'react-spring'
@ -188,7 +189,7 @@ const Collection = () => {
width: CollectionContainerWidthChange.to((x) => `calc(100% - ${x as number}px)`),
}}
>
{contractAddress ? (
{contractAddress && !blocklistedCollections.includes(contractAddress) ? (
<>
<BannerWrapper>
<Banner

@ -1,4 +1,5 @@
import { isAddress } from '@ethersproject/address'
import { blocklistedCollections } from 'nft/utils'
import { GenieCollection } from '../../types'
@ -45,15 +46,17 @@ export const fetchSearchCollections = async (addressOrName: string, recursive =
if (isName) {
const data = await r.json()
const formattedData = data?.data
? data.data.map((collection: { stats: Record<string, unknown>; floorPrice: string }) => {
return {
...collection,
stats: {
...collection.stats,
floor_price: collection.floorPrice,
},
}
})
? data.data
.filter((collection: { address: string }) => !blocklistedCollections.includes(collection.address))
.map((collection: { stats: Record<string, unknown>; floorPrice: string }) => {
return {
...collection,
stats: {
...collection.stats,
floor_price: collection.floorPrice,
},
}
})
: []
return formattedData.slice(0, MAX_SEARCH_RESULTS)
}

@ -1,3 +1,5 @@
import { blocklistedCollections } from 'nft/utils'
import { TimePeriod, TrendingCollection } from '../../types'
const NFT_API_URL = process.env.REACT_APP_TEMP_API_URL
@ -18,5 +20,5 @@ export const fetchTrendingCollections = async (payload: {
const data = await r.json()
return data ?? []
return data.filter((collection: { address: string }) => !blocklistedCollections.includes(collection.address)) ?? []
}

@ -22,3 +22,8 @@ export const isInSameSudoSwapPool = (assetA: GenieAsset, assetB: GenieAsset): bo
export const isInSameMarketplaceCollection = (assetA: GenieAsset, assetB: GenieAsset): boolean => {
return assetA.address === assetB.address && assetA.marketplace === assetB.marketplace
}
export const blocklistedCollections = [
'0xd5eeac01b0d1d929d6cffaaf78020af137277293',
'0x85c08fffa9510f87019efdcf986301873cbb10d6',
]