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
d06451cb
Unverified
Commit
d06451cb
authored
Mar 10, 2023
by
Vignesh Mohankumar
Committed by
GitHub
Mar 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: remove universal-router logic in pay with any token flag (#6127)
parent
c1297b2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
14 deletions
+1
-14
payWithAnyToken.ts
src/featureFlags/flags/payWithAnyToken.ts
+1
-14
No files found.
src/featureFlags/flags/payWithAnyToken.ts
View file @
d06451cb
import
{
UNIVERSAL_ROUTER_ADDRESS
}
from
'
@uniswap/universal-router-sdk
'
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
BaseVariant
,
FeatureFlag
,
useBaseFlag
}
from
'
../index
'
export
function
usePayWithAnyTokenFlag
():
BaseVariant
{
...
...
@@ -8,17 +5,7 @@ export function usePayWithAnyTokenFlag(): BaseVariant {
}
export
function
usePayWithAnyTokenEnabled
():
boolean
{
const
flagEnabled
=
usePayWithAnyTokenFlag
()
===
BaseVariant
.
Enabled
const
{
chainId
}
=
useWeb3React
()
try
{
// Detect if the Universal Router is not yet deployed to chainId.
// This is necessary so that we can fallback correctly on chains without a Universal Router deployment.
// It will be removed once Universal Router is deployed on all supported chains.
chainId
&&
UNIVERSAL_ROUTER_ADDRESS
(
chainId
)
return
flagEnabled
}
catch
{
return
false
}
return
usePayWithAnyTokenFlag
()
===
BaseVariant
.
Enabled
}
export
{
BaseVariant
as
PayWithAnyTokenVariant
}
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