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
9e2dc9a4
Unverified
Commit
9e2dc9a4
authored
Mar 21, 2022
by
Zach Pomerantz
Committed by
GitHub
Mar 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: rm approval invariant (#3569)
parent
6567f18b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
5 deletions
+0
-5
useSwapApproval.ts
src/lib/hooks/swap/useSwapApproval.ts
+0
-5
No files found.
src/lib/hooks/swap/useSwapApproval.ts
View file @
9e2dc9a4
...
@@ -7,7 +7,6 @@ import useActiveWeb3React from 'hooks/useActiveWeb3React'
...
@@ -7,7 +7,6 @@ import useActiveWeb3React from 'hooks/useActiveWeb3React'
import
{
useERC20PermitFromTrade
,
UseERC20PermitState
}
from
'
hooks/useERC20Permit
'
import
{
useERC20PermitFromTrade
,
UseERC20PermitState
}
from
'
hooks/useERC20Permit
'
import
useTransactionDeadline
from
'
lib/hooks/useTransactionDeadline
'
import
useTransactionDeadline
from
'
lib/hooks/useTransactionDeadline
'
import
{
useCallback
,
useMemo
,
useState
}
from
'
react
'
import
{
useCallback
,
useMemo
,
useState
}
from
'
react
'
import
invariant
from
'
tiny-invariant
'
import
{
getTxOptimizedSwapRouter
,
SwapRouterVersion
}
from
'
utils/getTxOptimizedSwapRouter
'
import
{
getTxOptimizedSwapRouter
,
SwapRouterVersion
}
from
'
utils/getTxOptimizedSwapRouter
'
import
{
ApprovalState
,
useApproval
,
useApprovalStateForSpender
}
from
'
../useApproval
'
import
{
ApprovalState
,
useApproval
,
useApprovalStateForSpender
}
from
'
../useApproval
'
...
@@ -75,10 +74,6 @@ export default function useSwapApproval(
...
@@ -75,10 +74,6 @@ export default function useSwapApproval(
const
spender
=
useSwapRouterAddress
(
trade
)
const
spender
=
useSwapRouterAddress
(
trade
)
const
approval
=
useApproval
(
amountToApprove
,
spender
,
useIsPendingApproval
)
const
approval
=
useApproval
(
amountToApprove
,
spender
,
useIsPendingApproval
)
if
(
trade
instanceof
V2Trade
||
trade
instanceof
V3Trade
)
{
const
approvalState
=
approval
[
0
]
invariant
(
approvalState
===
ApprovalState
.
APPROVED
,
'
Trying to approve legacy router
'
)
}
return
approval
return
approval
}
}
...
...
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