diff --git a/packages/common-ts/src/contracts/chain.ts b/packages/common-ts/src/contracts/chain.ts index f5ee8c3..235e2af 100644 --- a/packages/common-ts/src/contracts/chain.ts +++ b/packages/common-ts/src/contracts/chain.ts @@ -14,6 +14,7 @@ const chainMap = new MapWithGetKey([ [1, 42161], // Ethereum Mainnet - Arbitrum One [4, 421611], // Ethereum Rinkeby - Arbitrum Rinkeby [5, 421613], // Ethereum Goerli - Arbitrum Goerli + [11155111, 421614], // Ethereum Sepolia - Arbitrum Sepolia [1337, 412346], // Localhost - Arbitrum Localhost ]) diff --git a/packages/common-ts/src/contracts/index.test.ts b/packages/common-ts/src/contracts/index.test.ts index e6cfde1..26a3f8e 100644 --- a/packages/common-ts/src/contracts/index.test.ts +++ b/packages/common-ts/src/contracts/index.test.ts @@ -8,8 +8,18 @@ const mockSigner = jest.fn() as unknown as Signer describe('Contracts', () => { // Test for each supported protocol network - test.each([1, 5, 42161, 421613])('Connect contracts [chainId: %p]', chainId => { - const contracts = connectContracts(mockSigner, chainId, DEPLOYED_CONTRACTS) - expect(contracts).toBeDefined() - }) + test.each([1, 5, 42161, 421613, 421614, 11155111])( + 'Connect contracts with explicit addressBook provided [chainId: %p]', + chainId => { + const contracts = connectContracts(mockSigner, chainId, DEPLOYED_CONTRACTS) + expect(contracts).toBeDefined() + }, + ) + test.each([1, 5, 42161, 421613, 421614, 11155111])( + 'Connect contracts without explicit addressBook provided [chainId: %p]', + chainId => { + const contracts = connectContracts(mockSigner, chainId, undefined) + expect(contracts).toBeDefined() + }, + ) }) diff --git a/packages/common-ts/src/contracts/index.ts b/packages/common-ts/src/contracts/index.ts index acfce23..b136ce3 100644 --- a/packages/common-ts/src/contracts/index.ts +++ b/packages/common-ts/src/contracts/index.ts @@ -78,8 +78,10 @@ export const connectContracts = async ( chainId: number, addressBook: AddressBook | undefined, ): Promise => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const deployedContracts = addressBook ? addressBook[`${chainId}`] : (DEPLOYED_CONTRACTS as any)[`${chainId}`] + const deployedContracts = addressBook + ? addressBook[`${chainId}`] + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (DEPLOYED_CONTRACTS as any)[`${chainId}`] if (!deployedContracts) { throw new Error(`chainId: '${chainId}' has no deployed contracts`) }