Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@
"@ethersproject/address": "^5.0.8",
"@ethersproject/bignumber": "^5.1.1",
"@ethersproject/bytes": "^5.0.8",
"@typechain/ethers-v5": "9.0.0",
"@types/prompts": "^2.0.14",
"@types/yargs": "^17.0.9",
"dotenv": "^10.0.0",
"ethers": "^5.1.0",
"ts-node": "^10.2.1",
"typechain": "7.0.0"
"ethers": "^5.1.0"
},
"devDependencies": {
"ts-node": "^10.2.1",
"dotenv": "^10.0.0",
"@typechain/ethers-v5": "9.0.0",
"@types/yargs": "^17.0.9",
"typechain": "7.0.0",
"@arbitrum/nitro-contracts": "1.0.0-beta.5",
"arb-bridge-peripherals": "1.0.6",
"@nomiclabs/hardhat-ethers": "^2.0.4",
Expand Down
22 changes: 14 additions & 8 deletions scripts/instantiate_bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,20 @@ export const instantiateBridge = (
)
}

if (!l1Network.rpcURL) {
throw new Error('L1 rpc url not set (see .env.sample or networks.ts)')
}
if (!l2Network.rpcURL) {
throw new Error('L2 rpc url not set (see .env.sample or utils/networks.ts)')
}
const ethProvider = new JsonRpcProvider(l1Network.rpcURL)
const arbProvider = new JsonRpcProvider(l2Network.rpcURL)
const l1Rpc = (() => {
if (networkID === 42161) return process.env['MAINNET_RPC'] as string
Comment thread
fredlacs marked this conversation as resolved.
Outdated
if (networkID === 421611) return process.env['RINKEBY_RPC'] as string
if (networkID === 1338) return 'http://127.0.0.1:8545/'
Comment thread
fredlacs marked this conversation as resolved.
Outdated
throw new Error('L1 rpc url not set (see .env.sample or networks.ts) or chain id not supported')
})()
const l2Rpc = (() => {
if (networkID === 42161) return process.env['ARB_ONE_RPC'] || 'https://arb1.arbitrum.io/rpc'
if (networkID === 421611) return process.env['RINKARBY_RPC'] || 'https://rinkeby.arbitrum.io/rpc'
throw new Error('L2 rpc url not set (see .env.sample or networks.ts) or chain id not supported')
})()

const ethProvider = new JsonRpcProvider(l1Rpc)
const arbProvider = new JsonRpcProvider(l2Rpc)

const l1Signer = (() => {
if (l1PkParam) {
Expand Down
9 changes: 0 additions & 9 deletions src/lib/dataEntities/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@
/* eslint-env node */
'use strict'

import dotenv from 'dotenv'
import { SignerOrProvider, SignerProviderUtils } from './signerOrProvider'
import { ArbSdkError } from '../dataEntities/errors'
import { SEVEN_DAYS_IN_SECONDS } from './constants'

dotenv.config()

export interface L1Network extends Network {
partnerChainIDs: number[]
blockTime: number //seconds
Expand All @@ -40,7 +37,6 @@ export interface Network {
chainID: number
name: string
explorerUrl: string
rpcURL: string
gif?: string
isCustom: boolean
}
Expand Down Expand Up @@ -135,7 +131,6 @@ export const l1Networks: L1Networks = {
explorerUrl: 'https://etherscan.io',
partnerChainIDs: [42161],
blockTime: 14,
rpcURL: process.env['MAINNET_RPC'] as string,
Comment thread
fredlacs marked this conversation as resolved.
isCustom: false,
},
1338: {
Expand All @@ -144,7 +139,6 @@ export const l1Networks: L1Networks = {
explorerUrl: 'https://etherscan.io',
partnerChainIDs: [42161],
blockTime: 1,
rpcURL: 'http://127.0.0.1:8545/',
isCustom: false,
},
4: {
Expand All @@ -153,7 +147,6 @@ export const l1Networks: L1Networks = {
explorerUrl: 'https://rinkeby.etherscan.io',
partnerChainIDs: [421611],
blockTime: 15,
rpcURL: process.env['RINKEBY_RPC'] as string,
isCustom: false,
},
}
Expand All @@ -168,7 +161,6 @@ export const l2Networks: L2Networks = {
tokenBridge: mainnetTokenBridge,
ethBridge: mainnetETHBridge,
confirmPeriodBlocks: 45818,
rpcURL: process.env['ARB_ONE_RPC'] || 'https://arb1.arbitrum.io/rpc',
isCustom: false,
retryableLifetimeSeconds: SEVEN_DAYS_IN_SECONDS,
},
Expand All @@ -181,7 +173,6 @@ export const l2Networks: L2Networks = {
tokenBridge: rinkebyTokenBridge,
ethBridge: rinkebyETHBridge,
confirmPeriodBlocks: 6545, // TODO
rpcURL: process.env['RINKARBY_RPC'] || 'https://rinkeby.arbitrum.io/rpc',
isCustom: false,
retryableLifetimeSeconds: SEVEN_DAYS_IN_SECONDS,
},
Expand Down