Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bnb and zora hardcoded gas estimate #945

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
}
Loading