From f5ac37971f61cf9b2d759977edf83b465b4e6e48 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Tue, 31 Oct 2023 16:36:42 +0100 Subject: [PATCH] Add option to provide rollup owner with env var --- .../deployCreatorAndCreateTokenBridge.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/local-deployment/deployCreatorAndCreateTokenBridge.ts b/scripts/local-deployment/deployCreatorAndCreateTokenBridge.ts index a79f0dd3cf..fd494ce801 100644 --- a/scripts/local-deployment/deployCreatorAndCreateTokenBridge.ts +++ b/scripts/local-deployment/deployCreatorAndCreateTokenBridge.ts @@ -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: @@ -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 @@ -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, @@ -117,7 +122,7 @@ export const setupTokenBridgeInLocalEnv = async () => { childDeployer.provider!, l1TokenBridgeCreator, coreL2Network.ethBridge.rollup, - orbitOwner + rollupOwner ) const l2Network: L2Network = {