Skip to content

Commit

Permalink
Add register gateway script draft
Browse files Browse the repository at this point in the history
  • Loading branch information
gvladika committed Jul 29, 2024
1 parent 4379de3 commit 6e59589
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/usdc-bridge-deployment/deployUsdcBridge.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { BigNumber, Wallet } from 'ethers'
import { Wallet } from 'ethers'
import { ethers } from 'hardhat'
import {
IERC20__factory,
IFiatToken__factory,
IFiatTokenProxy__factory,
L1GatewayRouter__factory,
L1USDCGateway,
L1USDCGateway__factory,
L2GatewayRouter__factory,
L2USDCGateway,
L2USDCGateway__factory,
ProxyAdmin,
Expand All @@ -16,8 +14,6 @@ import {
} from '../../build/types'
import { JsonRpcProvider } from '@ethersproject/providers'
import dotenv from 'dotenv'
import { L1ToL2MessageGasEstimator } from '@arbitrum/sdk'
import { getBaseFee } from '@arbitrum/sdk/dist/lib/utils/lib'
import {
abi as SigCheckerAbi,
bytecode as SigCheckerBytecode,
Expand Down Expand Up @@ -262,4 +258,6 @@ async function _initializeGateways(
ownerL2
)
).wait()

///// init logic
}
28 changes: 28 additions & 0 deletions scripts/usdc-bridge-deployment/registerUsdcGateway.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import dotenv from 'dotenv'
import { Wallet } from 'ethers'
import { ethers } from 'hardhat'
import { JsonRpcProvider } from '@ethersproject/providers'

dotenv.config()

main().then(() => console.log('Done.'))

async function main() {
const { deployerL1 } = await _loadWallet()
}

async function _loadWallet(): Promise<{
deployerL1: Wallet
}> {
const parentRpc = process.env['PARENT_RPC'] as string
const parentDeployerKey = process.env['PARENT_DEPLOYER_KEY'] as string

if (!parentRpc || !parentDeployerKey) {
throw new Error('Missing env vars')
}

const parentProvider = new JsonRpcProvider(parentRpc)
const deployerL1 = new ethers.Wallet(parentDeployerKey, parentProvider)

return { deployerL1 }
}

0 comments on commit 6e59589

Please sign in to comment.