From 2b653b476268ba898aa7b898169c96a2e90a29f9 Mon Sep 17 00:00:00 2001 From: Austin Adams <36116882+aadams@users.noreply.github.com> Date: Thu, 22 Feb 2024 20:21:59 -0500 Subject: [PATCH] fix: add correct addresses for sepolia (#119) * fix: add correct addresses for sepolia * Fixed bug that returned an empty swap router 02 address for base chain (#120) * Updated code to correctly access addresses * add test to ensure no regression --------- Co-authored-by: jsy1218 <91580504+jsy1218@users.noreply.github.com> * Fix code style issues with Prettier * enhance testing coverage * Fix code style issues with Prettier --------- Co-authored-by: dallinlarsen <56076097+dallinlarsen@users.noreply.github.com> Co-authored-by: jsy1218 <91580504+jsy1218@users.noreply.github.com> Co-authored-by: Lint Action --- src/addresses.test.ts | 15 +++++++++++++++ src/addresses.ts | 9 ++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/addresses.test.ts b/src/addresses.test.ts index 7f387b63..d0fc0199 100644 --- a/src/addresses.test.ts +++ b/src/addresses.test.ts @@ -22,5 +22,20 @@ describe('addresses', () => { const address = SWAP_ROUTER_02_ADDRESSES(ChainId.BNB) expect(address).toEqual('0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2') }) + + it('should return the correct address for arbitrum goerli', () => { + const address = SWAP_ROUTER_02_ADDRESSES(ChainId.ARBITRUM_GOERLI) + expect(address).toEqual('0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45') + }) + + it('should return the correct address for optimism sepolia', () => { + const address = SWAP_ROUTER_02_ADDRESSES(ChainId.OPTIMISM_SEPOLIA) + expect(address).toEqual('0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4') + }) + + it('should return the correct address for sepolia', () => { + const address = SWAP_ROUTER_02_ADDRESSES(ChainId.SEPOLIA) + expect(address).toEqual('0x3bFA4769FB09eefC5a80d6E87c3B9C650f7Ae48E') + }) }) }) diff --git a/src/addresses.ts b/src/addresses.ts index fbf03c46..7c57b798 100644 --- a/src/addresses.ts +++ b/src/addresses.ts @@ -127,7 +127,8 @@ const OPTIMISM_SEPOLIA_ADDRESSES: ChainAddresses = { quoterAddress: '0x0FBEa6cf957d95ee9313490050F6A0DA68039404', v3MigratorAddress: '0xE7EcbAAaA54D007A00dbb6c1d2f150066D69dA07', nonfungiblePositionManagerAddress: '0xdA75cEf1C93078e8b736FCA5D5a30adb97C8957d', - tickLensAddress: '0xCb7f54747F58F8944973cea5b8f4ac2209BadDC5' + tickLensAddress: '0xCb7f54747F58F8944973cea5b8f4ac2209BadDC5', + swapRouter02Address: '0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4' } // arbitrum goerli v3 addresses @@ -147,7 +148,8 @@ const ARBITRUM_SEPOLIA_ADDRESSES: ChainAddresses = { quoterAddress: '0x2779a0CC1c3e0E44D2542EC3e79e3864Ae93Ef0B', v3MigratorAddress: '0x398f43ef2c67B941147157DA1c5a868E906E043D', nonfungiblePositionManagerAddress: '0x6b2937Bde17889EDCf8fbD8dE31C3C2a70Bc4d65', - tickLensAddress: '0x0fd18587734e5C2dcE2dccDcC7DD1EC89ba557d9' + tickLensAddress: '0x0fd18587734e5C2dcE2dccDcC7DD1EC89ba557d9', + swapRouter02Address: '0x101F443B4d1b059569D643917553c771E1b9663E' } // sepolia v3 addresses @@ -157,7 +159,8 @@ const SEPOLIA_ADDRESSES: ChainAddresses = { quoterAddress: '0xEd1f6473345F45b75F8179591dd5bA1888cf2FB3', v3MigratorAddress: '0x729004182cF005CEC8Bd85df140094b6aCbe8b15', nonfungiblePositionManagerAddress: '0x1238536071E1c677A632429e3655c799b22cDA52', - tickLensAddress: '0xd7f33bcdb21b359c8ee6f0251d30e94832baad07' + tickLensAddress: '0xd7f33bcdb21b359c8ee6f0251d30e94832baad07', + swapRouter02Address: '0x3bFA4769FB09eefC5a80d6E87c3B9C650f7Ae48E' } // Avalanche v3 addresses