Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Metal L2 and Metal L2 testnet #932

Merged
merged 6 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ We currently accept tokens on the following chains:
- `lisk`
- `lisk-sepolia`
- `redstone`
- `metall2`
- `metall2-sepolia`

#### Non-bridgable tokens

Expand Down
32 changes: 32 additions & 0 deletions src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ export const NETWORK_DATA: Record<Chain, Network> = {
),
layer: 2
},
'metall2': {
id: 1750,
name: 'Metal L2',
provider: new ethers.providers.StaticJsonRpcProvider(
'https://rpc.metall2.com'
),
layer: 2
},
sepolia: {
id: 11155111,
name: 'Sepolia',
Expand Down Expand Up @@ -101,6 +109,14 @@ export const NETWORK_DATA: Record<Chain, Network> = {
),
layer: 2,
},
'metall2-sepolia': {
id: 1740,
name: 'Metal L2 Sepolia',
provider: new ethers.providers.StaticJsonRpcProvider(
'https://testnet.rpc.metall2.com'
),
layer: 2,
},
}

interface L2BridgeInformation {
Expand Down Expand Up @@ -134,6 +150,9 @@ export const L2_STANDARD_BRIDGE_INFORMATION: Record<
'redstone': {
l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010'
},
'metall2': {
l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010',
},
'optimism-sepolia': {
l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010',
},
Expand All @@ -146,6 +165,9 @@ export const L2_STANDARD_BRIDGE_INFORMATION: Record<
'lisk-sepolia': {
l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010',
},
'metall2-sepolia': {
l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010',
},
}

export const L2_TO_L1_PAIR: Partial<Record<L2Chain, L1Chain>> = {
Expand All @@ -155,10 +177,12 @@ export const L2_TO_L1_PAIR: Partial<Record<L2Chain, L1Chain>> = {
mode: 'ethereum',
lisk: 'ethereum',
redstone: 'ethereum',
metall2: 'ethereum',
'optimism-sepolia': 'sepolia',
'base-sepolia': 'sepolia',
'pgn-sepolia': 'sepolia',
'lisk-sepolia': 'sepolia',
'metall2-sepolia': 'sepolia',
}

export const L1_STANDARD_BRIDGE_INFORMATION: Record<
Expand Down Expand Up @@ -190,6 +214,10 @@ export const L1_STANDARD_BRIDGE_INFORMATION: Record<
l2Chain: 'redstone',
l1StandardBridgeAddress: '0xc473ca7E02af24c129c2eEf51F2aDf0411c1Df69',
},
{
l2Chain: 'metall2',
l1StandardBridgeAddress: '0x6d0f65D59b55B0FEC5d2d15365154DcADC140BF3',
},
],
sepolia: [
{
Expand All @@ -208,5 +236,9 @@ export const L1_STANDARD_BRIDGE_INFORMATION: Record<
l2Chain: 'lisk-sepolia',
l1StandardBridgeAddress: '0x1Fb30e446eA791cd1f011675E5F3f5311b70faF5',
},
{
l2Chain: 'metall2-sepolia',
l1StandardBridgeAddress: '0x21530aAdF4DCFb9c477171400E40d4ef615868BE',
},
],
}
4 changes: 4 additions & 0 deletions src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ export const TOKEN_DATA_SCHEMA = {
mode: TOKEN_SCHEMA,
pgn: TOKEN_SCHEMA,
redstone: TOKEN_SCHEMA,
metall2: TOKEN_SCHEMA,
sepolia: TOKEN_SCHEMA,
'base-sepolia': TOKEN_SCHEMA,
'optimism-sepolia': TOKEN_SCHEMA,
'lisk-sepolia': TOKEN_SCHEMA,
'metall2-sepolia': TOKEN_SCHEMA,
},
additionalProperties: false,
anyOf: [
Expand All @@ -80,10 +82,12 @@ export const TOKEN_DATA_SCHEMA = {
{ required: ['pgn'] },
{ required: ['lisk'] },
{ required: ['redstone'] },
{ required: ['metall2'] },
{ required: ['sepolia'] },
{ required: ['base-sepolia'] },
{ required: ['optimism-sepolia'] },
{ required: ['lisk-sepolia'] },
{ required: ['metall2-sepolia'] },
],
},
},
Expand Down
6 changes: 5 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export type Chain =
| 'lisk'
| 'lisk-sepolia'
| 'redstone'
| 'metall2'
| 'metall2-sepolia'

const l2Chains = [
'optimism',
Expand All @@ -43,7 +45,9 @@ const l2Chains = [
'mode',
'lisk',
'lisk-sepolia',
'redstone'
'redstone',
'metall2',
'metall2-sepolia'
] as const
export type L2Chain = typeof l2Chains[number]

Expand Down
Loading