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
79e74e1d
Unverified
Commit
79e74e1d
authored
Nov 15, 2023
by
Tina
Committed by
GitHub
Nov 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: disable showing approve cost for arbitrum (#7594)
disable showing approve cost for arbitrum
parent
52dc441e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
gas.ts
src/state/routing/gas.ts
+7
-1
No files found.
src/state/routing/gas.ts
View file @
79e74e1d
import
{
MaxUint256
,
PERMIT2_ADDRESS
}
from
'
@uniswap/permit2-sdk
'
import
{
MaxUint256
,
PERMIT2_ADDRESS
}
from
'
@uniswap/permit2-sdk
'
import
{
Currency
}
from
'
@uniswap/sdk-core
'
import
{
C
hainId
,
C
urrency
}
from
'
@uniswap/sdk-core
'
import
ERC20_ABI
from
'
abis/erc20.json
'
import
ERC20_ABI
from
'
abis/erc20.json
'
import
{
Erc20
,
Weth
}
from
'
abis/types
'
import
{
Erc20
,
Weth
}
from
'
abis/types
'
import
WETH_ABI
from
'
abis/weth.json
'
import
WETH_ABI
from
'
abis/weth.json
'
...
@@ -26,6 +26,12 @@ export async function getApproveInfo(
...
@@ -26,6 +26,12 @@ export async function getApproveInfo(
// If any of these arguments aren't provided, then we cannot generate approval cost info
// If any of these arguments aren't provided, then we cannot generate approval cost info
if
(
!
account
||
!
usdCostPerGas
)
return
{
needsApprove
:
false
}
if
(
!
account
||
!
usdCostPerGas
)
return
{
needsApprove
:
false
}
// routing-api under estimates gas for Arbitrum swaps so it inflates cost per gas by a lot
// so disable showing approves for Arbitrum until routing-api gives more accurate gas estimates
if
(
currency
.
chainId
===
ChainId
.
ARBITRUM_ONE
||
currency
.
chainId
===
ChainId
.
ARBITRUM_GOERLI
)
{
return
{
needsApprove
:
false
}
}
const
provider
=
DEPRECATED_RPC_PROVIDERS
[
currency
.
chainId
as
SupportedInterfaceChain
]
const
provider
=
DEPRECATED_RPC_PROVIDERS
[
currency
.
chainId
as
SupportedInterfaceChain
]
const
tokenContract
=
getContract
(
currency
.
address
,
ERC20_ABI
,
provider
)
as
Erc20
const
tokenContract
=
getContract
(
currency
.
address
,
ERC20_ABI
,
provider
)
as
Erc20
...
...
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