Skip to content

Commit

Permalink
chore: check deployment before register
Browse files Browse the repository at this point in the history
  • Loading branch information
gzeoneth committed Feb 5, 2024
1 parent 618849c commit 96dc0f0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/atomicTokenBridgeDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,15 @@ export const registerGateway = async (
tokens: string[],
gateways: string[]
) => {
const l2GatewayRouter = await L1GatewayRouter__factory.connect(gatewayRouter, l1Executor).counterpartGateway()
if (await l2Provider.getCode(l2GatewayRouter) == '0x') {
throw new Error('L2GatewayRouter not yet deployed')
}
const l1GatewayRouter = await L2GatewayRouter__factory.connect(l2GatewayRouter, l2Provider).counterpartGateway()
if (l1GatewayRouter != gatewayRouter) {
throw new Error('L2GatewayRouter not properly initialized')
}

const executorAddress = await l1Executor.getAddress()

const buildCall = (params: OmitTyped<L1ToL2MessageGasParams, 'deposit'>) => {
Expand Down

0 comments on commit 96dc0f0

Please sign in to comment.