Commit d02c33f9 authored by Mark Tyneway's avatar Mark Tyneway

contracts-bedrock: more strict deploy checks

Specifically strictly check the `SystemConfig` proxy
so that the correct storage is set.
parent fb498ecf
...@@ -93,7 +93,7 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -93,7 +93,7 @@ const deployFn: DeployFunction = async (hre) => {
systemConfigConfig: { systemConfigConfig: {
owner: hre.deployConfig.finalSystemOwner, owner: hre.deployConfig.finalSystemOwner,
overhead: hre.deployConfig.gasPriceOracleOverhead, overhead: hre.deployConfig.gasPriceOracleOverhead,
scalar: hre.deployConfig.gasPriceOracleDecimals, scalar: hre.deployConfig.gasPriceOracleScalar,
batcherHash: hre.ethers.utils.hexZeroPad( batcherHash: hre.ethers.utils.hexZeroPad(
hre.deployConfig.batchSenderAddress, hre.deployConfig.batchSenderAddress,
32 32
......
...@@ -31,6 +31,7 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -31,6 +31,7 @@ const deployFn: DeployFunction = async (hre) => {
L1ERC721BridgeProxy, L1ERC721BridgeProxy,
L1ERC721BridgeProxyWithSigner, L1ERC721BridgeProxyWithSigner,
L1ERC721Bridge, L1ERC721Bridge,
SystemConfigProxy,
] = await getContractsFromArtifacts(hre, [ ] = await getContractsFromArtifacts(hre, [
{ {
name: 'SystemDictatorProxy', name: 'SystemDictatorProxy',
...@@ -89,6 +90,11 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -89,6 +90,11 @@ const deployFn: DeployFunction = async (hre) => {
iface: 'L1ERC721Bridge', iface: 'L1ERC721Bridge',
signerOrProvider: deployer, signerOrProvider: deployer,
}, },
{
name: 'SystemConfigProxy',
iface: 'SystemConfig',
signerOrProvider: deployer,
},
]) ])
// If we have the key for the controller then we don't need to wait for external txns. // If we have the key for the controller then we don't need to wait for external txns.
...@@ -138,7 +144,7 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -138,7 +144,7 @@ const deployFn: DeployFunction = async (hre) => {
if ( if (
needsProxyTransfer && needsProxyTransfer &&
(await AddressManager.getAddress('OVM_L1CrossDomainMessenger')) !== (await AddressManager.getAddress('OVM_L1CrossDomainMessenger')) !==
ethers.constants.AddressZero && ethers.constants.AddressZero &&
(await L1CrossDomainMessenger.owner()) !== SystemDictator.address (await L1CrossDomainMessenger.owner()) !== SystemDictator.address
) { ) {
if (isLiveDeployer) { if (isLiveDeployer) {
...@@ -317,7 +323,7 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -317,7 +323,7 @@ const deployFn: DeployFunction = async (hre) => {
checks: async () => { checks: async () => {
assert( assert(
(await AddressManager.getAddress('OVM_L1CrossDomainMessenger')) === (await AddressManager.getAddress('OVM_L1CrossDomainMessenger')) ===
ethers.constants.AddressZero ethers.constants.AddressZero
) )
}, },
}) })
...@@ -353,7 +359,7 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -353,7 +359,7 @@ const deployFn: DeployFunction = async (hre) => {
for (const dead of deads) { for (const dead of deads) {
assert( assert(
(await AddressManager.getAddress(dead)) === (await AddressManager.getAddress(dead)) ===
ethers.constants.AddressZero ethers.constants.AddressZero
) )
} }
}, },
...@@ -498,6 +504,37 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -498,6 +504,37 @@ const deployFn: DeployFunction = async (hre) => {
'messenger', 'messenger',
L1CrossDomainMessenger.address L1CrossDomainMessenger.address
) )
// Check the SystemConfig was initialized properly.
await assertContractVariable(
SystemConfigProxy,
'owner',
hre.deployConfig.finalSystemOwner
)
await assertContractVariable(
SystemConfigProxy,
'overhead',
hre.deployConfig.gasPriceOracleOverhead
)
await assertContractVariable(
SystemConfigProxy,
'scalar',
hre.deployConfig.gasPriceOracleScalar
)
await assertContractVariable(
SystemConfigProxy,
'batcherHash',
ethers.utils.hexZeroPad(hre.deployConfig.batchSenderAddress, 32)
)
await assertContractVariable(
SystemConfigProxy,
'gasLimit',
hre.deployConfig.l2GenesisBlockGasLimit
)
}, },
}) })
......
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