Skip to content

Commit

Permalink
fix: change to the new Goerli Arb testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
pcarranzav committed Jul 28, 2022
1 parent 7648ea2 commit 500e86b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 65 deletions.
10 changes: 5 additions & 5 deletions arbitrum-addresses.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"source": "https://github.com/OffchainLabs/arbitrum/tree/f54baf10871ee86aedca4880796342ef9bd0b0ab/packages/",
"source": "https://developer.offchainlabs.com/docs/useful_addresses",
"1": {
"L1GatewayRouter": {
"address": "0x72Ce9c846789fdB6fC1f34aC4AD25Dd9ef7031ef"
Expand All @@ -18,10 +18,10 @@
},
"5": {
"L1GatewayRouter": {
"address": "0x8BDFa67ace22cE2BFb2fFebe72f0c91CDA694d4b"
"address": "0x4c7708168395aEa569453Fc36862D2ffcDaC588c"
},
"IInbox": {
"address": "0x1FdBBcC914e84aF593884bf8e8Dd6877c29035A2"
"address": "0x6BEbC4925716945D46F0Ec336D5C2564F419682C"
}
},
"42161": {
Expand All @@ -34,9 +34,9 @@
"address": "0x9413AD42910c1eA60c737dB5f58d1C504498a3cD"
}
},
"421612": {
"421613": {
"L2GatewayRouter": {
"address": "0xC502Ded1EE1d616B43F7f20Ebde83Be1A275ca3c"
"address": "0xE5B9d8d42d656d1DcB8065A6c012FE3780246041"
}
}
}
6 changes: 3 additions & 3 deletions cli/commands/bridge/to-l1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { loadEnv, CLIArgs, CLIEnvironment } from '../../env'
import { logger } from '../../logging'
import { getAddressBook } from '../../address-book'
import { getProvider, sendTransaction, toGRT } from '../../network'
import { chainIdIsL2, createNitroNetwork } from '../../utils'
import { chainIdIsL2 } from '../../utils'
import { loadAddressBookContract } from '../../contracts'
import {
L2TransactionReceipt,
Expand Down Expand Up @@ -67,7 +67,7 @@ export const startSendToL1 = async (cli: CLIEnvironment, cliArgs: CLIArgs): Prom
logger.info(`>>> Sending tokens to L1 <<<\n`)
const l2Provider = getProvider(cliArgs.l2ProviderUrl)
const l2ChainId = (await l2Provider.getNetwork()).chainId
createNitroNetwork(cliArgs.providerUrl)

if (chainIdIsL2(cli.chainId) || !chainIdIsL2(l2ChainId)) {
throw new Error(
'Please use an L1 provider in --provider-url, and an L2 provider in --l2-provider-url',
Expand Down Expand Up @@ -120,7 +120,7 @@ export const finishSendToL1 = async (
logger.info(`>>> Finishing transaction sending tokens to L1 <<<\n`)
const l2Provider = getProvider(cliArgs.l2ProviderUrl)
const l2ChainId = (await l2Provider.getNetwork()).chainId
createNitroNetwork(cliArgs.providerUrl)

if (chainIdIsL2(cli.chainId) || !chainIdIsL2(l2ChainId)) {
throw new Error(
'Please use an L1 provider in --provider-url, and an L2 provider in --l2-provider-url',
Expand Down
6 changes: 3 additions & 3 deletions cli/commands/bridge/to-l2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
L1ToL2MessageWriter,
L1ToL2MessageGasEstimator,
} from '@arbitrum/sdk'
import { chainIdIsL2, createNitroNetwork } from '../../utils'
import { chainIdIsL2 } from '../../utils'

const logAutoRedeemReason = (autoRedeemRec) => {
if (autoRedeemRec == null) {
Expand Down Expand Up @@ -43,7 +43,7 @@ export const sendToL2 = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<v
logger.info(`>>> Sending tokens to L2 <<<\n`)
const l2Provider = getProvider(cliArgs.l2ProviderUrl)
const l2ChainId = (await l2Provider.getNetwork()).chainId
createNitroNetwork(cliArgs.providerUrl)

if (chainIdIsL2(cli.chainId) || !chainIdIsL2(l2ChainId)) {
throw new Error(
'Please use an L1 provider in --provider-url, and an L2 provider in --l2-provider-url',
Expand Down Expand Up @@ -117,7 +117,7 @@ export const redeemSendToL2 = async (cli: CLIEnvironment, cliArgs: CLIArgs): Pro
logger.info(`>>> Redeeming pending tokens on L2 <<<\n`)
const l2Provider = getProvider(cliArgs.l2ProviderUrl)
const l2ChainId = (await l2Provider.getNetwork()).chainId
createNitroNetwork(cliArgs.providerUrl)

if (chainIdIsL2(cli.chainId) || !chainIdIsL2(l2ChainId)) {
throw new Error(
'Please use an L1 provider in --provider-url, and an L2 provider in --l2-provider-url',
Expand Down
52 changes: 1 addition & 51 deletions cli/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { loadArtifact } from './artifacts'
export const l1ToL2ChainIdMap = {
'1': '42161',
'4': '421611',
'5': '421612',
'5': '421613',
}

export const l2ChainIds = Object.values(l1ToL2ChainIdMap).map(Number)
Expand All @@ -28,53 +28,3 @@ export const getProvider = (providerUrl: string, network?: number): providers.Js
export const chainIdIsL2 = (chainId: number | string): boolean => {
return l2ChainIds.includes(Number(chainId))
}

export const createNitroNetwork = (l1ProviderUrl: string): void => {
addCustomNetwork({
customL1Network: {
blockTime: 15,
chainID: 5,
explorerUrl: 'https://goerli.etherscan.io/',
isCustom: true,
name: 'Goerli',
partnerChainIDs: [421612],
rpcURL: l1ProviderUrl,
},
customL2Network: {
chainID: 421612,
confirmPeriodBlocks: 960,
ethBridge: {
bridge: '0x9903a892da86c1e04522d63b08e5514a921e81df',
inbox: '0x1fdbbcc914e84af593884bf8e8dd6877c29035a2',
outboxes: {
'0xFDF2B11347dA17326BAF30bbcd3F4b09c4719584': 0,
},
rollup: '0x767CfF8D8de386d7cbe91DbD39675132ba2f5967',
sequencerInbox: '0xb32f4257e05c56c53d46bbec9e85770eb52425d6',
},
explorerUrl: 'https://nitro-devnet-explorer.arbitrum.io/',
isArbitrum: true,
isCustom: true,
name: 'ArbLocal',
partnerChainID: 5,
rpcURL: 'https://nitro-devnet.arbitrum.io/rpc',
tokenBridge: {
l1CustomGateway: '0x23D4e0D7Cb7AE7CF745E82262B17eb46535Ae819',
l1ERC20Gateway: '0x6336C4e811b2f7D17d45b6241Fd47F2E11621Ffb',
l1GatewayRouter: '0x8BDFa67ace22cE2BFb2fFebe72f0c91CDA694d4b',
l1MultiCall: '0x90863B80f274b6D2227b01f2c1de4fdCb04896E2',
l1ProxyAdmin: '0x678cC9702ebF79d741E4f815937475311A58404a',
l1Weth: '0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6',
l1WethGateway: '0x64bfF696bE6a087A81936b9a2489624015381be4',
l2CustomGateway: '0x7AC493f26EF26904E52fE46C8DaEE247b9A556B8',
l2ERC20Gateway: '0xf298434ffE691400b932f4b14B436f451F4CED76',
l2GatewayRouter: '0xC502Ded1EE1d616B43F7f20Ebde83Be1A275ca3c',
l2Multicall: '0x1068dbfcc13f3a22fcAe684943AFA43cc66fA689',
l2ProxyAdmin: '0x1F2715AaC7EeFb75ebCc478f3D9a361fa47A95DD',
l2Weth: '0x96CfA560e7332DebA750e330fb6f59E2269f40Dd',
l2WethGateway: '0xf10c7CAA33A3360f60053Bc1081980f62567505F',
},
retryableLifetimeSeconds: 608400,
},
})
}
6 changes: 3 additions & 3 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ const networkConfigs: NetworkConfig[] = [
{ network: 'arbitrum-rinkeby', chainId: 421611, url: 'https://rinkeby.arbitrum.io/rpc' },
{ network: 'arbitrum-one', chainId: 42161, url: 'https://arb1.arbitrum.io/rpc' },
{
network: 'arbitrum-nitro-devnet',
chainId: 421612,
url: 'https://nitro-devnet.arbitrum.io/rpc',
network: 'arbitrum-goerli',
chainId: 421613,
url: 'https://goerli-rollup.arbitrum.io/rpc',
},
]

Expand Down

0 comments on commit 500e86b

Please sign in to comment.