Commit 75b1e727 authored by Maurelian's avatar Maurelian Committed by Kelvin Fichter

refactor(contracts): move Proxy__L1CrossDomainMessenger init to end

parent bba041d5
......@@ -24,20 +24,6 @@ const deployFn: DeployFunction = async (hre) => {
contract: 'Lib_ResolvedDelegateProxy',
iface: 'L1CrossDomainMessenger',
args: [Lib_AddressManager.address, 'OVM_L1CrossDomainMessenger'],
// This reverts on a fresh deploy, because the implementation is not yet added to the AddressManager.
// I think the best option is to do the initialization atomically from within the AddressSetter.
// postDeployAction: async (contract) => {
// console.log(`Initializing Proxy__OVM_L1CrossDomainMessenger...`)
// await contract.initialize(Lib_AddressManager.address)
// console.log(`Checking that contract was correctly initialized...`)
// await waitUntilTrue(async () => {
// return hexStringEquals(
// await contract.libAddressManager(),
// Lib_AddressManager.address
// )
// })
// },
})
}
......
/* Imports: External */
import { DeployFunction } from 'hardhat-deploy/dist/types'
import { hexStringEquals } from '@eth-optimism/core-utils'
/* Imports: Internal */
import {
getLiveContract,
waitUntilTrue,
} from '../src/hardhat-deploy-ethers'
const deployFn: DeployFunction = async (hre) => {
// There is a risk that on a fresh deployment we could get front-run,
// and the Proxy would be bricked. But that feels unlikely, and we can recover from it.
console.log(`Initializing Proxy__L1CrossDomainMessenger...`)
const proxy = getLiveContract('Proxy__L1CrossDomainMessenger')
await proxy.initialize(Lib_AddressManager.address)
console.log(`Checking that contract was correctly initialized...`)
await waitUntilTrue(async () => {
return hexStringEquals(
await proxy.libAddressManager(),
Lib_AddressManager.address
)
})
}
deployFn.tags = ['fresh', 'finalize']
export default deployFn
......@@ -4,13 +4,13 @@ import { hexStringEquals } from '@eth-optimism/core-utils'
/* Imports: Internal */
import {
getDeployedContract,
getLiveContract,
waitUntilTrue,
} from '../src/hardhat-deploy-ethers'
const deployFn: DeployFunction = async (hre) => {
const { deployer } = await hre.getNamedAccounts()
const Lib_AddressManager = await getDeployedContract(
const Lib_AddressManager = await getLiveContract(
hre,
'Lib_AddressManager',
{
......
......@@ -8,7 +8,7 @@ import {
import { normalizeHardhatNetworkAccountsConfig } from 'hardhat/internal/core/providers/util'
/* Imports: Internal */
import { getDeployedContract } from '../src/hardhat-deploy-ethers'
import { getLiveContract } from '../src/hardhat-deploy-ethers'
// This is a TEMPORARY way to fund the default hardhat accounts on L2. The better way to do this is
// to make a modification to hardhat-ovm. However, I don't have the time right now to figure the
......@@ -17,7 +17,7 @@ const deployFn: DeployFunction = async (hre) => {
// Only execute this step if we're on the hardhat chain ID.
const { chainId } = await hre.ethers.provider.getNetwork()
if (chainId === defaultHardhatNetworkParams.chainId) {
const L1StandardBridge = await getDeployedContract(
const L1StandardBridge = await getLiveContract(
hre,
'Proxy__OVM_L1StandardBridge',
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment