Skip to content

Commit 1cbd4ea

Browse files
committed
Add support for the Sepolia (L2) & Sepolia Arbitrum (L2) networks
1 parent eb602fc commit 1cbd4ea

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

packages/common-ts/src/contracts/chain.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const chainMap = new MapWithGetKey<number>([
1414
[1, 42161], // Ethereum Mainnet - Arbitrum One
1515
[4, 421611], // Ethereum Rinkeby - Arbitrum Rinkeby
1616
[5, 421613], // Ethereum Goerli - Arbitrum Goerli
17+
[11155111, 421614], // Ethereum Sepolia - Arbitrum Sepolia
1718
[1337, 412346], // Localhost - Arbitrum Localhost
1819
])
1920

packages/common-ts/src/contracts/index.test.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,18 @@ const mockSigner = jest.fn() as unknown as Signer
88

99
describe('Contracts', () => {
1010
// Test for each supported protocol network
11-
test.each([1, 5, 42161, 421613])('Connect contracts [chainId: %p]', chainId => {
12-
const contracts = connectContracts(mockSigner, chainId, DEPLOYED_CONTRACTS)
13-
expect(contracts).toBeDefined()
14-
})
11+
test.each([1, 5, 42161, 421613, 421614, 11155111])(
12+
'Connect contracts with explicit addressBook provided [chainId: %p]',
13+
chainId => {
14+
const contracts = connectContracts(mockSigner, chainId, DEPLOYED_CONTRACTS)
15+
expect(contracts).toBeDefined()
16+
},
17+
)
18+
test.each([1, 5, 42161, 421613, 421614, 11155111])(
19+
'Connect contracts without explicit addressBook provided [chainId: %p]',
20+
chainId => {
21+
const contracts = connectContracts(mockSigner, chainId, undefined)
22+
expect(contracts).toBeDefined()
23+
},
24+
)
1525
})

packages/common-ts/src/contracts/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ export const connectContracts = async (
7878
chainId: number,
7979
addressBook: AddressBook | undefined,
8080
): Promise<NetworkContracts> => {
81-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
82-
const deployedContracts = addressBook ? addressBook[`${chainId}`] : (DEPLOYED_CONTRACTS as any)[`${chainId}`]
81+
const deployedContracts = addressBook
82+
? addressBook[`${chainId}`]
83+
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
84+
(DEPLOYED_CONTRACTS as any)[`${chainId}`]
8385
if (!deployedContracts) {
8486
throw new Error(`chainId: '${chainId}' has no deployed contracts`)
8587
}

0 commit comments

Comments
 (0)