Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
b93fd230
Unverified
Commit
b93fd230
authored
Dec 08, 2020
by
Noah Zinsmeister
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specially Designated Nationals and Blocked Persons Ethereum addresses
parent
e9a11bb6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
9 deletions
+32
-9
index.tsx
src/components/Blocklist/index.tsx
+12
-0
index.ts
src/constants/index.ts
+8
-0
index.tsx
src/index.tsx
+12
-9
No files found.
src/components/Blocklist/index.tsx
0 → 100644
View file @
b93fd230
import
React
,
{
ReactNode
,
useMemo
}
from
'
react
'
import
{
BLOCKED_ADDRESSES
}
from
'
../../constants
'
import
{
useActiveWeb3React
}
from
'
../../hooks
'
export
default
function
Blocklist
({
children
}:
{
children
:
ReactNode
})
{
const
{
account
}
=
useActiveWeb3React
()
const
blocked
:
boolean
=
useMemo
(()
=>
Boolean
(
account
&&
BLOCKED_ADDRESSES
.
indexOf
(
account
)
!==
-
1
),
[
account
])
if
(
blocked
)
{
return
<
div
>
Blocked address
</
div
>
}
return
<>
{
children
}
</>
}
src/constants/index.ts
View file @
b93fd230
...
@@ -199,3 +199,11 @@ export const BLOCKED_PRICE_IMPACT_NON_EXPERT: Percent = new Percent(JSBI.BigInt(
...
@@ -199,3 +199,11 @@ export const BLOCKED_PRICE_IMPACT_NON_EXPERT: Percent = new Percent(JSBI.BigInt(
// used to ensure the user doesn't send so much ETH so they end up with <.01
// used to ensure the user doesn't send so much ETH so they end up with <.01
export
const
MIN_ETH
:
JSBI
=
JSBI
.
exponentiate
(
JSBI
.
BigInt
(
10
),
JSBI
.
BigInt
(
16
))
// .01 ETH
export
const
MIN_ETH
:
JSBI
=
JSBI
.
exponentiate
(
JSBI
.
BigInt
(
10
),
JSBI
.
BigInt
(
16
))
// .01 ETH
export
const
BETTER_TRADE_LINK_THRESHOLD
=
new
Percent
(
JSBI
.
BigInt
(
75
),
JSBI
.
BigInt
(
10000
))
export
const
BETTER_TRADE_LINK_THRESHOLD
=
new
Percent
(
JSBI
.
BigInt
(
75
),
JSBI
.
BigInt
(
10000
))
// SDN OFAC addresses
export
const
BLOCKED_ADDRESSES
:
string
[]
=
[
'
0x7F367cC41522cE07553e823bf3be79A889DEbe1B
'
,
'
0xd882cFc20F52f2599D84b8e8D58C7FB62cfE344b
'
,
'
0x901bb9583b24D97e995513C6778dc6888AB6870e
'
,
'
0xA7e5d5A720f06526557c513402f2e6B5fA20b008
'
]
src/index.tsx
View file @
b93fd230
...
@@ -6,6 +6,7 @@ import ReactDOM from 'react-dom'
...
@@ -6,6 +6,7 @@ import ReactDOM from 'react-dom'
import
ReactGA
from
'
react-ga
'
import
ReactGA
from
'
react-ga
'
import
{
Provider
}
from
'
react-redux
'
import
{
Provider
}
from
'
react-redux
'
import
{
HashRouter
}
from
'
react-router-dom
'
import
{
HashRouter
}
from
'
react-router-dom
'
import
Blocklist
from
'
./components/Blocklist
'
import
{
NetworkContextName
}
from
'
./constants
'
import
{
NetworkContextName
}
from
'
./constants
'
import
'
./i18n
'
import
'
./i18n
'
import
App
from
'
./pages/App
'
import
App
from
'
./pages/App
'
...
@@ -58,6 +59,7 @@ ReactDOM.render(
...
@@ -58,6 +59,7 @@ ReactDOM.render(
<
FixedGlobalStyle
/>
<
FixedGlobalStyle
/>
<
Web3ReactProvider
getLibrary=
{
getLibrary
}
>
<
Web3ReactProvider
getLibrary=
{
getLibrary
}
>
<
Web3ProviderNetwork
getLibrary=
{
getLibrary
}
>
<
Web3ProviderNetwork
getLibrary=
{
getLibrary
}
>
<
Blocklist
>
<
Provider
store=
{
store
}
>
<
Provider
store=
{
store
}
>
<
Updaters
/>
<
Updaters
/>
<
ThemeProvider
>
<
ThemeProvider
>
...
@@ -67,6 +69,7 @@ ReactDOM.render(
...
@@ -67,6 +69,7 @@ ReactDOM.render(
</
HashRouter
>
</
HashRouter
>
</
ThemeProvider
>
</
ThemeProvider
>
</
Provider
>
</
Provider
>
</
Blocklist
>
</
Web3ProviderNetwork
>
</
Web3ProviderNetwork
>
</
Web3ReactProvider
>
</
Web3ReactProvider
>
</
StrictMode
>,
</
StrictMode
>,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment