Skip to content

Commit

Permalink
Add Form and Form Testnet chains
Browse files Browse the repository at this point in the history
  • Loading branch information
teimurjan committed Feb 21, 2025
1 parent c19ba8d commit 87b5336
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/cold-teachers-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

Added Form and Form Testnet chains.
57 changes: 57 additions & 0 deletions src/chains/definitions/form.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { chainConfig } from '../../op-stack/chainConfig.js'
import { defineChain } from '../../utils/chain/defineChain.js'

const sourceId = 1 // mainnet

export const form = /*#__PURE__*/ defineChain({
id: 478,
name: 'Form Network',
nativeCurrency: {
decimals: 18,
name: 'Ethereum',
symbol: 'ETH',
},
rpcUrls: {
public: { http: ['https://rpc.form.network/http'] },
default: { http: ['https://rpc.form.network/http'] },
},
blockExplorers: {
etherscan: {
name: 'Form Explorer',
url: 'https://explorer.form.network/',
},
default: {
name: 'Form Explorer',
url: 'https://explorer.form.network/',
},
},
contracts: {
...chainConfig.contracts,
addressManager: {
[sourceId]: {
address: '0x15c249E46A2F924C2dB3A1560CF86729bAD1f07B',
},
},
l1CrossDomainMessenger: {
[sourceId]: {
address: '0xF333158DCCad1dF6C3F0a3aEe8BC31fA94d9eD5c',
},
},
l2OutputOracle: {
[sourceId]: {
address: '0x4ccAAF69F41c5810cA875183648B577CaCf1F67E',
},
},
portal: {
[sourceId]: {
address: '0x4E259Ee5F4136408908160dD32295A5031Fa426F',
},
},
l1StandardBridge: {
[sourceId]: {
address: '0xdc20aA63D3DE59574E065957190D8f24e0F7B8Ba',
},
},
},
sourceId,
})
58 changes: 58 additions & 0 deletions src/chains/definitions/formTestnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { chainConfig } from '../../op-stack/chainConfig.js'
import { defineChain } from '../../utils/chain/defineChain.js'

const sourceId = 11_155_111 // sepolia

export const formTestnet = /*#__PURE__*/ defineChain({
id: 132_902,
name: 'Form Testnet Network',
nativeCurrency: {
decimals: 18,
name: 'Ethereum',
symbol: 'ETH',
},
rpcUrls: {
public: { http: ['https://sepolia-rpc.form.network/http'] },
default: { http: ['https://sepolia-rpc.form.network/http'] },
},
blockExplorers: {
etherscan: {
name: 'Form Testnet Explorer',
url: 'https://sepolia-explorer.form.network/',
},
default: {
name: 'Form Testnet Explorer',
url: 'https://sepolia-explorer.form.network/',
},
},
contracts: {
...chainConfig.contracts,
addressManager: {
[sourceId]: {
address: '0xd5C38fa934f7fd7477D4800F4f38a1c5BFdF1373',
},
},
l1CrossDomainMessenger: {
[sourceId]: {
address: '0x37A68565c4BE9700b3E3Ec60cC4416cAC3052FAa',
},
},
l2OutputOracle: {
[sourceId]: {
address: '0x9eA2239E65a59EC9C7F1ED4C116dD58Da71Fc1e2',
},
},
portal: {
[sourceId]: {
address: '0x60377e3cE15dF4CCA24c4beF076b60314240b032',
},
},
l1StandardBridge: {
[sourceId]: {
address: '0xD4531f633942b2725896F47cD2aFd260b44Ab1F7',
},
},
},
testnet: true,
sourceId,
})

0 comments on commit 87b5336

Please sign in to comment.