Skip to content

Commit 7fdcee0

Browse files
committed
chore: merge remote-tracking branch 'origin/main' into mmackz/utils/add-create-types
2 parents 1e2011b + ca69790 commit 7fdcee0

File tree

5 files changed

+33
-4
lines changed

5 files changed

+33
-4
lines changed

.changeset/wicked-deers-marry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@rabbitholegg/questdk-plugin-aerodrome": minor
3+
---
4+
5+
add universal router contract

packages/aerodrome/src/Aerodrome.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { swap } from './Aerodrome'
22
import { failingTestCases, passingTestCases } from './test-transactions'
3-
import { apply } from '@rabbitholegg/questdk/filter'
3+
import { apply } from '@rabbitholegg/questdk'
44
import { describe, expect, test } from 'vitest'
55

66
describe('Given the aerodrome plugin', () => {

packages/aerodrome/src/Aerodrome.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
EXECUTE_ABI_FRAGMENTS,
55
TOKENS_FOR_ETH_FRAGMENTS,
66
TOKENS_FOR_TOKENS_FRAGMENTS,
7-
UNIVERSAL_ROUTER,
7+
UNIVERSAL_ROUTERS,
88
V2_SWAP_EXACT_TYPES,
99
V3_SWAP_EXACT_TYPES,
1010
WETH_ADDRESS,
@@ -30,7 +30,10 @@ export const swap = async (
3030
chainId,
3131
value: tokenIn === zeroAddress ? amountIn : undefined,
3232
to: {
33-
$or: [AERODROME_ROUTER.toLowerCase(), UNIVERSAL_ROUTER.toLowerCase()],
33+
$or: [
34+
AERODROME_ROUTER.toLowerCase(),
35+
...UNIVERSAL_ROUTERS.map((r) => r.toLowerCase()),
36+
],
3437
},
3538
input: {
3639
$or: [

packages/aerodrome/src/constants.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
export const AERODROME_ROUTER = '0xcf77a3ba9a5ca399b7c97c74d54e5b1beb874e43'
2-
export const UNIVERSAL_ROUTER = '0xf07835bbf6eea0d05392fb4d3b9e5a333ca4da2a'
2+
export const UNIVERSAL_ROUTERS = [
3+
'0xf07835bbf6eea0d05392fb4d3b9e5a333ca4da2a',
4+
'0x6cb442acf35158d5eda88fe602221b67b400be3e',
5+
]
36
export const WETH_ADDRESS = '0x4200000000000000000000000000000000000006'
47

58
const ROUTER_ABI = [

packages/aerodrome/src/test-transactions.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,30 @@ export const SWAP_ERC20_V3: TestParams<SwapActionParams> = {
9797
},
9898
}
9999

100+
export const SWAP_V3_NEW_ROUTER: TestParams<SwapActionParams> = {
101+
transaction: {
102+
chainId: 8453,
103+
from: '0x1c37e98c0f9e36be11c50d803cd3069defe212b8',
104+
hash: '0xb02952ed6cfdba1cf0ab9f3a9f69edeed46b93f127ccb9ad9c8a34ae6fe1439b',
105+
input:
106+
'0x24856bc300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000108000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001800000000000000000000000001c37e98c0f9e36be11c50d803cd3069defe212b800000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000028af6a78bd7e60ad00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000004200000000000000000000000000000000000006000000000000000000000000dadc4f8e9d8d37294de0e02a2ce8cc0c90a4f6c20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dadc4f8e9d8d37294de0e02a2ce8cc0c90a4f6c2000000000000000000000000940181a94a35a4569e4529a3cdfb74e38fd986310000000000000000000000000000000000000000000000000000000000000000',
107+
to: '0x6cb442acf35158d5eda88fe602221b67b400be3e',
108+
value: '0',
109+
},
110+
params: {
111+
chainId: 8453,
112+
amountIn: GreaterThanOrEqual(1000000000000000n),
113+
tokenIn: '0x4200000000000000000000000000000000000006',
114+
},
115+
}
116+
100117
export const passingTestCases = [
101118
createTestCase(ETH_FOR_TOKENS, 'when using swapExactETHForTokens'),
102119
createTestCase(TOKENS_FOR_ETH, 'when using swapExactTokensForETH'),
103120
createTestCase(TOKENS_FOR_TOKENS, 'when using swapExactTokensForTokens'),
104121
createTestCase(SWAP_ETH_V3, 'when using ETH V3'),
105122
createTestCase(SWAP_ERC20_V3, 'when using ERC20 V3'),
123+
createTestCase(SWAP_V3_NEW_ROUTER, 'when using new router'),
106124
createTestCase(ETH_FOR_TOKENS, 'when using tokenIn is "Any"', {
107125
tokenIn: undefined,
108126
}),

0 commit comments

Comments
 (0)