From 0e25d35fbd2f3499792f408f7c041b24219807f6 Mon Sep 17 00:00:00 2001 From: "Siyu Jiang (See-You John)" <91580504+jsy1218@users.noreply.github.com> Date: Tue, 1 Oct 2024 11:57:43 -0700 Subject: [PATCH] feat(universal-router-sdk): support worldchain on universal-router-sdk (#132) ## Description Support worldchain on universal router sdk ## How Has This Been Tested? Will test in routing ## Are there any breaking changes? No ## (Optional) Feedback Focus ## (Optional) Follow Ups --- sdks/universal-router-sdk/package.json | 8 +++--- .../src/utils/constants.ts | 13 ++++++++++ yarn.lock | 26 +++++++++---------- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/sdks/universal-router-sdk/package.json b/sdks/universal-router-sdk/package.json index 70dcd2228..0d8b9f039 100644 --- a/sdks/universal-router-sdk/package.json +++ b/sdks/universal-router-sdk/package.json @@ -31,13 +31,13 @@ "dependencies": { "@openzeppelin/contracts": "4.7.0", "@uniswap/permit2-sdk": "^1.3.0", - "@uniswap/router-sdk": "^1.12.1", - "@uniswap/sdk-core": "^5.3.1", + "@uniswap/router-sdk": "^1.13.0", + "@uniswap/sdk-core": "^5.6.0", "@uniswap/universal-router": "2.0.0-beta.1", "@uniswap/v2-core": "^1.0.1", - "@uniswap/v2-sdk": "^4.4.1", + "@uniswap/v2-sdk": "^4.5.0", "@uniswap/v3-core": "1.0.0", - "@uniswap/v3-sdk": "^3.13.1", + "@uniswap/v3-sdk": "^3.16.0", "@uniswap/v4-sdk": "^1.6.3", "bignumber.js": "^9.0.2", "ethers": "^5.7.0" diff --git a/sdks/universal-router-sdk/src/utils/constants.ts b/sdks/universal-router-sdk/src/utils/constants.ts index 87c562e87..1f3ef1775 100644 --- a/sdks/universal-router-sdk/src/utils/constants.ts +++ b/sdks/universal-router-sdk/src/utils/constants.ts @@ -268,6 +268,19 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { }, }, }, + [480]: { + weth: '0x4200000000000000000000000000000000000006', + routerConfigs: { + [UniversalRouterVersion.V1_2]: { + address: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D', + creationBlock: 4063979, + }, + [UniversalRouterVersion.V2_0]: { + address: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D', + creationBlock: 4063979, + }, + }, + }, } export const UNIVERSAL_ROUTER_ADDRESS = (version: UniversalRouterVersion, chainId: number): string => { diff --git a/yarn.lock b/yarn.lock index 1f5fd0add..52865cce5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4609,17 +4609,17 @@ __metadata: languageName: unknown linkType: soft -"@uniswap/router-sdk@npm:^1.12.1": - version: 1.12.1 - resolution: "@uniswap/router-sdk@npm:1.12.1" +"@uniswap/router-sdk@npm:^1.13.0": + version: 1.13.0 + resolution: "@uniswap/router-sdk@npm:1.13.0" dependencies: "@ethersproject/abi": ^5.5.0 - "@uniswap/sdk-core": ^5.3.1 + "@uniswap/sdk-core": ^5.6.0 "@uniswap/swap-router-contracts": ^1.3.0 - "@uniswap/v2-sdk": ^4.3.2 - "@uniswap/v3-sdk": ^3.11.2 + "@uniswap/v2-sdk": ^4.5.0 + "@uniswap/v3-sdk": ^3.16.0 "@uniswap/v4-sdk": ^1.6.0 - checksum: d97732822cdd062349a42762c9c4c458e156bdcf436fc9ba8ee3a7fb4e2ade803a6b6305b4a59e869073436dd510ad0d229ec58aa56dddff60a3f06d3670a84c + checksum: 0cda4642e1039363cb66959a7dadb530b6696b7038891befc47715cdad332c333666a4bf4c6bf48418a40c341c17f065509117c987fc05a8ed3f4d56490d7fc8 languageName: node linkType: hard @@ -4730,13 +4730,13 @@ __metadata: "@types/node": ^18.7.16 "@types/node-fetch": ^2.6.2 "@uniswap/permit2-sdk": ^1.3.0 - "@uniswap/router-sdk": ^1.12.1 - "@uniswap/sdk-core": ^5.3.1 + "@uniswap/router-sdk": ^1.13.0 + "@uniswap/sdk-core": ^5.6.0 "@uniswap/universal-router": 2.0.0-beta.1 "@uniswap/v2-core": ^1.0.1 - "@uniswap/v2-sdk": ^4.4.1 + "@uniswap/v2-sdk": ^4.5.0 "@uniswap/v3-core": 1.0.0 - "@uniswap/v3-sdk": ^3.13.1 + "@uniswap/v3-sdk": ^3.16.0 "@uniswap/v4-sdk": ^1.6.3 bignumber.js: ^9.0.2 chai: ^4.3.6 @@ -4771,7 +4771,7 @@ __metadata: languageName: node linkType: hard -"@uniswap/v2-sdk@npm:^4.3.2, @uniswap/v2-sdk@npm:^4.4.1, @uniswap/v2-sdk@npm:^4.5.0": +"@uniswap/v2-sdk@npm:^4.5.0": version: 4.5.0 resolution: "@uniswap/v2-sdk@npm:4.5.0" dependencies: @@ -4844,7 +4844,7 @@ __metadata: languageName: node linkType: hard -"@uniswap/v3-sdk@npm:^3.11.2, @uniswap/v3-sdk@npm:^3.13.1, @uniswap/v3-sdk@npm:^3.16.0": +"@uniswap/v3-sdk@npm:^3.16.0": version: 3.16.0 resolution: "@uniswap/v3-sdk@npm:3.16.0" dependencies: