Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes censorship from Analytics #440

Open
wants to merge 7 commits into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import AccountLookup from './pages/AccountLookup'
import LocalLoader from './components/LocalLoader'
import { useLatestBlocks } from './contexts/Application'
import GoogleAnalyticsReporter from './components/analytics/GoogleAnalyticsReporter'
import { PAIR_BLACKLIST, TOKEN_BLACKLIST } from './constants'

const AppWrapper = styled.div`
position: relative;
Expand Down Expand Up @@ -128,8 +127,7 @@ function App() {
path="/token/:tokenAddress"
render={({ match }) => {
if (
isAddress(match.params.tokenAddress.toLowerCase()) &&
!Object.keys(TOKEN_BLACKLIST).includes(match.params.tokenAddress.toLowerCase())
isAddress(match.params.tokenAddress.toLowerCase()) )
) {
return (
<LayoutWrapper savedOpen={savedOpen} setSavedOpen={setSavedOpen}>
Expand All @@ -147,8 +145,7 @@ function App() {
path="/pair/:pairAddress"
render={({ match }) => {
if (
isAddress(match.params.pairAddress.toLowerCase()) &&
!Object.keys(PAIR_BLACKLIST).includes(match.params.pairAddress.toLowerCase())
isAddress(match.params.pairAddress.toLowerCase()) )
) {
return (
<LayoutWrapper savedOpen={savedOpen} setSavedOpen={setSavedOpen}>
Expand Down
3 changes: 1 addition & 2 deletions src/components/PairList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import DoubleTokenLogo from '../DoubleLogo'
import FormattedName from '../FormattedName'
import QuestionHelper from '../QuestionHelper'
import { TYPE } from '../../Theme'
import { PAIR_BLACKLIST } from '../../constants'
import { AutoColumn } from '../Column'

dayjs.extend(utc)
Expand Down Expand Up @@ -236,7 +235,7 @@ function PairList({ pairs, color, disbaleLinks, maxItems = 10, useTracked = fals
pairs &&
Object.keys(pairs)
.filter(
(address) => !PAIR_BLACKLIST.includes(address) && (useTracked ? !!pairs[address].trackedReserveUSD : true)
(address) => (useTracked ? !!pairs[address].trackedReserveUSD : true)
)
.sort((addressA, addressB) => {
const pairA = pairs[addressA]
Expand Down
7 changes: 0 additions & 7 deletions src/components/Search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { useAllPairData, usePairData } from '../../contexts/PairData'
import DoubleTokenLogo from '../DoubleLogo'
import { useMedia } from 'react-use'
import { useAllPairsInUniswap, useAllTokensInUniswap } from '../../contexts/GlobalData'
import { TOKEN_BLACKLIST, PAIR_BLACKLIST } from '../../constants'

import { transparentize } from 'polished'
import { client } from '../../apollo/client'
Expand Down Expand Up @@ -287,9 +286,6 @@ export const Search = ({ small = false }) => {
return 1
})
.filter((token) => {
if (TOKEN_BLACKLIST.includes(token.id)) {
return false
}
const regexMatches = Object.keys(token).map((tokenEntryKey) => {
const isAddress = value.slice(0, 2) === '0x'
if (tokenEntryKey === 'id' && isAddress) {
Expand Down Expand Up @@ -326,9 +322,6 @@ export const Search = ({ small = false }) => {
return 0
})
.filter((pair) => {
if (PAIR_BLACKLIST.includes(pair.id)) {
return false
}
if (value && value.includes(' ')) {
const pairA = value.split(' ')[0]?.toUpperCase()
const pairB = value.split(' ')[1]?.toUpperCase()
Expand Down
11 changes: 1 addition & 10 deletions src/components/TokenList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { Divider } from '..'
import { formattedNum, formattedPercent } from '../../utils'
import { useMedia } from 'react-use'
import { withRouter } from 'react-router-dom'
import { TOKEN_BLACKLIST } from '../../constants'
import FormattedName from '../FormattedName'
import { TYPE } from '../../Theme'

Expand Down Expand Up @@ -140,15 +139,7 @@ function TopTokenList({ tokens, itemMax = 10, useTracked = false }) {
}, [tokens])

const formattedTokens = useMemo(() => {
return (
tokens &&
Object.keys(tokens)
.filter((key) => {
return !TOKEN_BLACKLIST.includes(key)
})
.map((key) => tokens[key])
)
}, [tokens])
return (tokens)}, [tokens])

useEffect(() => {
if (tokens && formattedTokens) {
Expand Down
25 changes: 0 additions & 25 deletions src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,6 @@ export const SUPPORTED_LIST_URLS__NO_ENS = [
'https://www.coingecko.com/tokens_list/uniswap/defi_100/v_0_0_0.json',
]

// hide from overview list
export const TOKEN_BLACKLIST = [
'0x495c7f3a713870f68f8b418b355c085dfdc412c3',
'0xc3761eb917cd790b30dad99f6cc5b4ff93c4f9ea',
'0xe31debd7abff90b06bca21010dd860d8701fd901',
'0xfc989fbb6b3024de5ca0144dc23c18a063942ac1',
'0xf4eda77f0b455a12f3eb44f8653835f377e36b76',
'0x93b2fff814fcaeffb01406e80b4ecd89ca6a021b',

// rebass tokens
'0x9ea3b5b4ec044b70375236a281986106457b20ef',
'0x05934eba98486693aaec2d00b0e9ce918e37dc3f',
'0x3d7e683fc9c86b4d653c9e47ca12517440fad14e',
'0xfae9c647ad7d89e738aba720acf09af93dc535f7',
'0x7296368fe9bcb25d3ecc19af13655b907818cc09',
]

// pair blacklist
export const PAIR_BLACKLIST = [
'0xb6a741f37d6e455ebcc9f17e2c16d0586c3f57a5',
'0x97cb8cbe91227ba87fc21aaf52c4212d245da3f8',
'0x1acba73121d5f63d8ea40bdc64edb594bd88ed09',
'0x7d7e813082ef6c143277c71786e5be626ec77b20',
]

// warnings to display if page contains info about blocked token
export const BLOCKED_WARNINGS = {
'0xf4eda77f0b455a12f3eb44f8653835f377e36b76':
Expand Down
18 changes: 0 additions & 18 deletions src/pages/PairPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import { Bookmark, PlusCircle, AlertCircle } from 'react-feather'
import FormattedName from '../components/FormattedName'
import { useListedTokens } from '../contexts/Application'
import HoverText from '../components/HoverText'
import { UNTRACKED_COPY, PAIR_BLACKLIST, BLOCKED_WARNINGS } from '../constants'

const DashboardWrapper = styled.div`
width: 100%;
Expand Down Expand Up @@ -195,23 +194,6 @@ function PairPage({ pairAddress, history }) {

const listedTokens = useListedTokens()

if (PAIR_BLACKLIST.includes(pairAddress)) {
return (
<BlockedWrapper>
<BlockedMessageWrapper>
<AutoColumn gap="1rem" justify="center">
<TYPE.light style={{ textAlign: 'center' }}>
{BLOCKED_WARNINGS[pairAddress] ?? `This pair is not supported.`}
</TYPE.light>
<Link external={true} href={'https://etherscan.io/address/' + pairAddress}>{`More about ${shortenAddress(
pairAddress
)}`}</Link>
</AutoColumn>
</BlockedMessageWrapper>
</BlockedWrapper>
)
}

return (
<PageWrapper>
<ThemedBackground backgroundColor={transparentize(0.6, backgroundColor)} />
Expand Down
18 changes: 0 additions & 18 deletions src/pages/TokenPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { PlusCircle, Bookmark, AlertCircle } from 'react-feather'
import FormattedName from '../components/FormattedName'
import { useListedTokens } from '../contexts/Application'
import HoverText from '../components/HoverText'
import { UNTRACKED_COPY, TOKEN_BLACKLIST, BLOCKED_WARNINGS } from '../constants'
import QuestionHelper from '../components/QuestionHelper'
import Checkbox from '../components/Checkbox'
import { shortenAddress } from '../utils'
Expand Down Expand Up @@ -171,23 +170,6 @@ function TokenPage({ address, history }) {

const [useTracked, setUseTracked] = useState(true)

if (TOKEN_BLACKLIST.includes(address)) {
return (
<BlockedWrapper>
<BlockedMessageWrapper>
<AutoColumn gap="1rem" justify="center">
<TYPE.light style={{ textAlign: 'center' }}>
{BLOCKED_WARNINGS[address] ?? `This token is not supported.`}
</TYPE.light>
<Link external={true} href={'https://etherscan.io/address/' + address}>{`More about ${shortenAddress(
address
)}`}</Link>
</AutoColumn>
</BlockedMessageWrapper>
</BlockedWrapper>
)
}

return (
<PageWrapper>
<ThemedBackground backgroundColor={transparentize(0.6, backgroundColor)} />
Expand Down