Commit 3c7d3ace authored by Maurelian's avatar Maurelian Committed by Kelvin Fichter

refactor(contracts): Improve deploy script numbering scheme

Discrete deploy scripts are prefixed with multiples of 10, allowing for related scripts
to be place between them without renaming all subsquent scripts
parent 163f8bfc
......@@ -24,8 +24,6 @@ const deployFn: DeployFunction = async (hre) => {
'StateCommitmentChain',
'BondManager',
'OVM_L1CrossDomainMessenger',
'Proxy__L1CrossDomainMessenger',
'Proxy__L1StandardBridge',
]
const addresses = await Promise.all(
......@@ -34,17 +32,26 @@ const deployFn: DeployFunction = async (hre) => {
})
)
// Add non-deployed addresses to the arrays
// Add non-deployed addresses to the Address Setter argument arrays
// L2CrossDomainMessenger is the address of the predeploy on L2. We can refactor off-chain
// services such that we can remove the need to set this address, but for now it's easier
// to simply keep setting the address.
names.push('L2CrossDomainMessenger')
addresses.push(predeploys.L2CrossDomainMessenger)
// OVM_Sequencer is the address allowed to submit "Sequencer" blocks to the
// CanonicalTransactionChain.
names.push('OVM_Sequencer')
addresses.push((hre as any).deployConfig.ovmSequencerAddress)
// OVM_Proposer is the address allowed to submit state roots (transaction results) to the
// StateCommitmentChain.
names.push('OVM_Proposer')
addresses.push((hre as any).deployConfig.ovmProposerAddress)
await deployAndPostDeploy({
hre,
name: 'AddressSetter2',
name: 'AddressSetter1',
args: [
Lib_AddressManager.address,
(hre as any).deployConfig.ovmAddressManagerOwner,
......@@ -54,6 +61,6 @@ const deployFn: DeployFunction = async (hre) => {
})
}
deployFn.tags = ['AddressSetter2', 'upgrade']
deployFn.tags = ['AddressSetter1', 'upgrade']
export default deployFn
/* Imports: External */
import { DeployFunction } from 'hardhat-deploy/dist/types'
/* Imports: Internal */
import { getDeployedContract } from '../src/hardhat-deploy-ethers'
const deployFn: DeployFunction = async (hre) => {
// todo: add waitUntilTrue, detect when AddressSetter1 has ownership of the AddressManager
await (await getDeployedContract(hre, 'AddressSetter1')).setAddresses()
}
deployFn.tags = ['set-addresses', 'upgrade']
export default deployFn
/* Imports: External */
import { DeployFunction } from 'hardhat-deploy/dist/types'
/* Imports: Internal */
import {
deployAndPostDeploy,
getDeployedContract,
getReusableContract,
} from '../src/hardhat-deploy-ethers'
import { predeploys } from '../src/predeploys'
const deployFn: DeployFunction = async (hre) => {
const Lib_AddressManager = await getReusableContract(
hre,
'Lib_AddressManager'
)
const names = ['Proxy__L1CrossDomainMessenger', 'Proxy__L1StandardBridge']
const addresses = await Promise.all(
names.map(async (n) => {
return (await getDeployedContract(hre, n)).address
})
)
await deployAndPostDeploy({
hre,
name: 'AddressSetter2',
args: [
Lib_AddressManager.address,
(hre as any).deployConfig.ovmAddressManagerOwner,
names,
addresses,
],
})
}
deployFn.tags = ['AddressSetter2', 'upgrade']
export default deployFn
......@@ -12,28 +12,10 @@ const deployFn: DeployFunction = async (hre) => {
// L2CrossDomainMessenger is the address of the predeploy on L2. We can refactor off-chain
// services such that we can remove the need to set this address, but for now it's easier
// to simply keep setting the address.
await registerAddress({
hre,
name: 'L2CrossDomainMessenger',
address: predeploys.L2CrossDomainMessenger,
})
// OVM_Sequencer is the address allowed to submit "Sequencer" blocks to the
// CanonicalTransactionChain.
await registerAddress({
hre,
name: 'OVM_Sequencer',
address: (hre as any).deployConfig.ovmSequencerAddress,
})
// OVM_Proposer is the address allowed to submit state roots (transaction results) to the
// StateCommitmentChain.
await registerAddress({
hre,
name: 'OVM_Proposer',
address: (hre as any).deployConfig.ovmProposerAddress,
})
const names = [
'ChainStorageContainer-CTC-batches',
'ChainStorageContainer-SCC-batches',
......
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