Skip to content

Commit

Permalink
fix: bnb and zora hardcoded gas estimate (#945)
Browse files Browse the repository at this point in the history
forgot to hardcode the gas estimate for BNB and ZORA, when I move both to tenderly not supported chains in Uniswap/smart-order-router#782
  • Loading branch information
jsy1218 authored Dec 10, 2024
1 parent 8318f1a commit 9d0fc74
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/util/gasLimit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ export const CELO_UPPER_SWAP_GAS_LIMIT = BigNumber.from(5000000)
export const WORLDCHAIN_UPPER_SWAP_GAS_LIMIT = BigNumber.from(300000)
// https://github.com/Uniswap/routing-api/blob/fe410751985995cb2904837e24f22da7dca1f518/lib/util/onChainQuoteProviderConfigs.ts#L344 divivde by 10
export const ASTROCHAIN_SEPOLIA_UPPER_SWAP_GAS_LIMIT = BigNumber.from(300000)
// https://github.com/Uniswap/smart-order-router/blob/c77d04d334cc1c6694bd74d88287cc5b6e3a7425/src/util/onchainQuoteProviderConfigs.ts#L83 divide by 10
export const BNB_UPPER_SWAP_GAS_LIMIT = BigNumber.from(200000)
// https://github.com/Uniswap/smart-order-router/blob/c77d04d334cc1c6694bd74d88287cc5b6e3a7425/src/util/onchainQuoteProviderConfigs.ts#L83 divide by 10
export const ZORA_UPPER_SWAP_GAS_LIMIT = BigNumber.from(200000)

export const CHAIN_TO_GAS_LIMIT_MAP: { [chainId: number]: BigNumber } = {
[ChainId.ZKSYNC]: ZKSYNC_UPPER_SWAP_GAS_LIMIT,
[ChainId.CELO]: CELO_UPPER_SWAP_GAS_LIMIT,
[ChainId.CELO_ALFAJORES]: CELO_UPPER_SWAP_GAS_LIMIT,
[ChainId.ASTROCHAIN_SEPOLIA]: ASTROCHAIN_SEPOLIA_UPPER_SWAP_GAS_LIMIT,
[ChainId.BNB]: BNB_UPPER_SWAP_GAS_LIMIT,
[ChainId.ZORA]: ZORA_UPPER_SWAP_GAS_LIMIT,
}

0 comments on commit 9d0fc74

Please sign in to comment.