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: bump sor to 4.14.3 - fix: tenderly doesn't support monad testnet #969

Merged
merged 3 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions lib/util/gasLimit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const UNICHAIN_SEPOLIA_UPPER_SWAP_GAS_LIMIT = BigNumber.from(300000)
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 MONAD_UPPER_SWAP_GAS_LIMIT = BigNumber.from(4000000)

export const CHAIN_TO_GAS_LIMIT_MAP: { [chainId: number]: BigNumber } = {
[ChainId.ZKSYNC]: ZKSYNC_UPPER_SWAP_GAS_LIMIT,
Expand All @@ -20,4 +21,5 @@ export const CHAIN_TO_GAS_LIMIT_MAP: { [chainId: number]: BigNumber } = {
[ChainId.UNICHAIN_SEPOLIA]: UNICHAIN_SEPOLIA_UPPER_SWAP_GAS_LIMIT,
[ChainId.BNB]: BNB_UPPER_SWAP_GAS_LIMIT,
[ChainId.ZORA]: ZORA_UPPER_SWAP_GAS_LIMIT,
[ChainId.MONAD_TESTNET]: MONAD_UPPER_SWAP_GAS_LIMIT,
}
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@uniswap/permit2-sdk": "^1.3.0",
"@uniswap/router-sdk": "^1.18.0",
"@uniswap/sdk-core": "^7.1.0",
"@uniswap/smart-order-router": "4.14.2",
"@uniswap/smart-order-router": "4.14.3",
"@uniswap/token-lists": "^1.0.0-beta.33",
"@uniswap/universal-router-sdk": "^4.10.0",
"@uniswap/v2-sdk": "^4.9.0",
Expand Down
11 changes: 10 additions & 1 deletion test/jest/unit/handlers/util/estimateGasUsed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { describe, it, expect } from '@jest/globals'
import { ChainId } from '@uniswap/sdk-core'
import { adhocCorrectGasUsed } from '../../../../../lib/util/estimateGasUsed'
import { BigNumber } from '@ethersproject/bignumber'
import { CELO_UPPER_SWAP_GAS_LIMIT, ZKSYNC_UPPER_SWAP_GAS_LIMIT } from '../../../../../lib/util/gasLimit'
import {
CELO_UPPER_SWAP_GAS_LIMIT,
MONAD_UPPER_SWAP_GAS_LIMIT,
ZKSYNC_UPPER_SWAP_GAS_LIMIT,
} from '../../../../../lib/util/gasLimit'

describe('estimateGasUsed', () => {
it('returns normal gas for mainnet', () => {
Expand Down Expand Up @@ -49,4 +53,9 @@ describe('estimateGasUsed', () => {
const estimatedGasUsed = CELO_UPPER_SWAP_GAS_LIMIT.add(1)
expect(adhocCorrectGasUsed(estimatedGasUsed, ChainId.CELO)).toBe(estimatedGasUsed)
})

it('returns upper limit gas for monad', () => {
const estimatedGasUsed = MONAD_UPPER_SWAP_GAS_LIMIT.sub(1)
expect(adhocCorrectGasUsed(estimatedGasUsed, ChainId.MONAD_TESTNET)).toBe(MONAD_UPPER_SWAP_GAS_LIMIT)
})
})
Loading