From ebb515d86f6c6687b7283ff6946e2c62e8407af8 Mon Sep 17 00:00:00 2001
From: alexstone <alex.stone@coinbase.com>
Date: Tue, 5 Nov 2024 14:28:51 -0800
Subject: [PATCH] feat(sdk-core): Add Base Sepolia constants

This adds the Chain ID, Addresses, and WETH token configuration for
the Base Sepolia network (84532).

This uses the addresses referenced in the Base Deployments doc:
https://docs.uniswap.org/contracts/v3/reference/deployments/base-deployments

This also uses this as the source for the WETH token on base sepolia:
https://sepolia.basescan.org/token/0x4200000000000000000000000000000000000006

This is following up on the changes that were being made on the old
SDK repos:
https://github.com/Uniswap/sdk-core/pull/110
https://github.com/Uniswap/smart-order-router/pull/494
---
 sdks/sdk-core/src/addresses.ts      | 12 ++++++++++++
 sdks/sdk-core/src/chains.ts         |  2 ++
 sdks/sdk-core/src/entities/weth9.ts |  1 +
 3 files changed, 15 insertions(+)

diff --git a/sdks/sdk-core/src/addresses.ts b/sdks/sdk-core/src/addresses.ts
index b0badf04a..be6f70e24 100644
--- a/sdks/sdk-core/src/addresses.ts
+++ b/sdks/sdk-core/src/addresses.ts
@@ -218,6 +218,17 @@ const BASE_GOERLI_ADDRESSES: ChainAddresses = {
   swapRouter02Address: '0x8357227D4eDc78991Db6FDB9bD6ADE250536dE1d',
 }
 
+// Base Sepolia v3 addresses
+const BASE_SEPOLIA_ADDRESSES: ChainAddresses = {
+  v3CoreFactoryAddress: '0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24',
+  multicallAddress: '0xd867e273eAbD6c853fCd0Ca0bFB6a3aE6491d2C1',
+  quoterAddress: '0xC5290058841028F1614F3A6F0F5816cAd0df5E27',
+  v3MigratorAddress: '0xCbf8b7f80800bd4888Fbc7bf1713B80FE4E23E10',
+  nonfungiblePositionManagerAddress: '0x27F971cb582BF9E50F397e4d29a5C7A34f11faA2',
+  tickLensAddress: '0xedf6066a2b290C185783862C7F4776A2C8077AD1',
+  swapRouter02Address: '0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4',
+}
+
 const ZORA_ADDRESSES: ChainAddresses = {
   v3CoreFactoryAddress: '0x7145F8aeef1f6510E92164038E1B6F8cB2c42Cbb',
   multicallAddress: '0xA51c76bEE6746cB487a7e9312E43e2b8f4A37C15',
@@ -310,6 +321,7 @@ export const CHAIN_TO_ADDRESSES_MAP: Record<SupportedChainsType, ChainAddresses>
   [ChainId.AVALANCHE]: AVALANCHE_ADDRESSES,
   [ChainId.BASE]: BASE_ADDRESSES,
   [ChainId.BASE_GOERLI]: BASE_GOERLI_ADDRESSES,
+  [ChainId.BASE_SEPOLIA]: BASE_SEPOLIA_ADDRESSES,
   [ChainId.ZORA]: ZORA_ADDRESSES,
   [ChainId.ZORA_SEPOLIA]: ZORA_SEPOLIA_ADDRESSES,
   [ChainId.ROOTSTOCK]: ROOTSTOCK_ADDRESSES,
diff --git a/sdks/sdk-core/src/chains.ts b/sdks/sdk-core/src/chains.ts
index f4f4f5f77..98887f533 100644
--- a/sdks/sdk-core/src/chains.ts
+++ b/sdks/sdk-core/src/chains.ts
@@ -17,6 +17,7 @@ export enum ChainId {
   BNB = 56,
   AVALANCHE = 43114,
   BASE_GOERLI = 84531,
+  BASE_SEPOLIA = 84532,
   BASE = 8453,
   ZORA = 7777777,
   ZORA_SEPOLIA = 999999999,
@@ -45,6 +46,7 @@ export const SUPPORTED_CHAINS = [
   ChainId.AVALANCHE,
   ChainId.BASE,
   ChainId.BASE_GOERLI,
+  ChainId.BASE_SEPOLIA,
   ChainId.ZORA,
   ChainId.ZORA_SEPOLIA,
   ChainId.ROOTSTOCK,
diff --git a/sdks/sdk-core/src/entities/weth9.ts b/sdks/sdk-core/src/entities/weth9.ts
index 6a6d01e39..61532c63f 100644
--- a/sdks/sdk-core/src/entities/weth9.ts
+++ b/sdks/sdk-core/src/entities/weth9.ts
@@ -20,6 +20,7 @@ export const WETH9: { [chainId: number]: Token } = {
   421614: new Token(421614, '0x980B62Da83eFf3D4576C647993b0c1D7faf17c73', 18, 'WETH', 'Wrapped Ether'),
 
   8453: new Token(8453, '0x4200000000000000000000000000000000000006', 18, 'WETH', 'Wrapped Ether'),
+  84532: new Token(84532, '0x4200000000000000000000000000000000000006', 18, 'WETH', 'Wrapped Ether'),
 
   56: new Token(56, '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c', 18, 'WBNB', 'Wrapped BNB'),
   137: new Token(137, '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270', 18, 'WMATIC', 'Wrapped MATIC'),