Skip to content

Commit

Permalink
fix: uniswap v3 on arbitrum (DimensionDev#4372)
Browse files Browse the repository at this point in the history
  • Loading branch information
guanbinrui authored Sep 16, 2021
1 parent fc824ee commit f5a5fa9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ async function handleNonce(account: string, error: Error | null, response: JsonR
const error_ = (error ?? response?.error) as { message: string } | undefined
const message = error_?.message ?? ''
if (!EthereumAddress.isValid(account)) return
if (/\bnonce\b/im.test(message) && /\b(low|high)\b/im.test(message)) resetNonce(account)
// nonce too low
// nonce too high
// transaction too old
if (/\bnonce|transaction\b/im.test(message) && /\b(low|high|old)\b/im.test(message)) resetNonce(account)
else commitNonce(account)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export function useTradeCallback(trade: TradeComputed<Trade> | null, allowedSlip
from: account,
to: address,
data: calldata,
...(!value || /^0x0*$/.test(value) ? {} : { value }),
...(!value || /^0x0*$/.test(value)
? {}
: { value: `0x${Number.parseInt(value, 16).toString(16)}` }),
}

return Services.Ethereum.estimateGas(config)
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-constants/data/token.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"BSCT": "",
"Matic": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
"Mumbai": "",
"Arbitrum": "",
"Arbitrum": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
"Arbitrum_Rinkeby": "",
"xDai": "0x4ECaBa5870353805a9F068101A40E0f32ed605C6"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-shared/src/assets/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
"explorers": [
{
"name": "arbitrum",
"url": "https://explorer.arbitrum.io",
"url": "https://arbiscan.io",
"standard": "EIP3091"
}
],
Expand Down

0 comments on commit f5a5fa9

Please sign in to comment.