Skip to content

Commit

Permalink
Add option to provide rollup owner with env var
Browse files Browse the repository at this point in the history
  • Loading branch information
gvladika committed Oct 31, 2023
1 parent 1da55c1 commit f5ac379
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/local-deployment/deployCreatorAndCreateTokenBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { l2Networks } from '@arbitrum/sdk/dist/lib/dataEntities/networks'

const LOCALHOST_L2_RPC = 'http://localhost:8547'
const LOCALHOST_L3_RPC = 'http://localhost:3347'
const LOCALHOST_L3_OWNER = '0x863c904166E801527125D8672442D736194A3362'

/**
* Steps:
Expand Down Expand Up @@ -48,6 +49,12 @@ export const setupTokenBridgeInLocalEnv = async () => {
)
}

// set rollup owner either from env vars or use defaults
let rollupOwner = process.env['ROLLUP_OWNER'] as string
if (rollupOwner === undefined) {
rollupOwner = LOCALHOST_L3_OWNER
}

// if no ROLLUP_ADDRESS is defined, it will be pulled from local container
const rollupAddress = process.env['ROLLUP_ADDRESS'] as string

Expand All @@ -60,8 +67,6 @@ export const setupTokenBridgeInLocalEnv = async () => {
childDeployerKey,
new ethers.providers.JsonRpcProvider(childRpc)
)
// docker-compose run scripts print-address --account l3owner | tail -n 1 | tr -d '\r\n'
const orbitOwner = '0x863c904166E801527125D8672442D736194A3362'

const { l1Network, l2Network: coreL2Network } = await getLocalNetworks(
parentRpc,
Expand Down Expand Up @@ -117,7 +122,7 @@ export const setupTokenBridgeInLocalEnv = async () => {
childDeployer.provider!,
l1TokenBridgeCreator,
coreL2Network.ethBridge.rollup,
orbitOwner
rollupOwner
)

const l2Network: L2Network = {
Expand Down

0 comments on commit f5ac379

Please sign in to comment.