Commit 7ac556ad authored by Mark Tyneway's avatar Mark Tyneway

contracts-bedrock: check l2 log loud

parent 748f5e02
...@@ -14,6 +14,10 @@ const adminSlot = ...@@ -14,6 +14,10 @@ const adminSlot =
'0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103' '0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103'
const prefix = '0x420000000000000000000000000000000000' const prefix = '0x420000000000000000000000000000000000'
const logLoud = () => {
console.log(' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
}
// checkPredeploys will ensure that all of the predeploys are set // checkPredeploys will ensure that all of the predeploys are set
const checkPredeploys = async (hre: HardhatRuntimeEnvironment) => { const checkPredeploys = async (hre: HardhatRuntimeEnvironment) => {
console.log('Checking predeploys are configured correctly') console.log('Checking predeploys are configured correctly')
...@@ -162,7 +166,9 @@ const check = { ...@@ -162,7 +166,9 @@ const check = {
if (otherMessenger === hre.ethers.constants.AddressZero) { if (otherMessenger === hre.ethers.constants.AddressZero) {
throw new Error('otherMessenger misconfigured') throw new Error('otherMessenger misconfigured')
} }
console.log(` - otherMessenger: ${otherMessenger}`) logLoud()
console.log(` - OTHER_MESSENGER: ${otherMessenger}`)
logLoud()
const l1CrossDomainMessenger = const l1CrossDomainMessenger =
await L2CrossDomainMessenger.l1CrossDomainMessenger() await L2CrossDomainMessenger.l1CrossDomainMessenger()
...@@ -175,7 +181,9 @@ const check = { ...@@ -175,7 +181,9 @@ const check = {
if (owner === hre.ethers.constants.AddressZero) { if (owner === hre.ethers.constants.AddressZero) {
throw new Error('owner misconfigured') throw new Error('owner misconfigured')
} }
logLoud()
console.log(` - owner: ${owner}`) console.log(` - owner: ${owner}`)
logLoud()
const MESSAGE_VERSION = await L2CrossDomainMessenger.MESSAGE_VERSION() const MESSAGE_VERSION = await L2CrossDomainMessenger.MESSAGE_VERSION()
console.log(` - MESSAGE_VERSION: ${MESSAGE_VERSION}`) console.log(` - MESSAGE_VERSION: ${MESSAGE_VERSION}`)
...@@ -246,7 +254,9 @@ const check = { ...@@ -246,7 +254,9 @@ const check = {
if (OTHER_BRIDGE === hre.ethers.constants.AddressZero) { if (OTHER_BRIDGE === hre.ethers.constants.AddressZero) {
throw new Error('invalid OTHER_BRIDGE') throw new Error('invalid OTHER_BRIDGE')
} }
logLoud()
console.log(` - OTHER_BRIDGE: ${OTHER_BRIDGE}`) console.log(` - OTHER_BRIDGE: ${OTHER_BRIDGE}`)
logLoud()
const MESSENGER = await L2StandardBridge.MESSENGER() const MESSENGER = await L2StandardBridge.MESSENGER()
if (MESSENGER !== predeploys.L2CrossDomainMessenger) { if (MESSENGER !== predeploys.L2CrossDomainMessenger) {
...@@ -273,7 +283,9 @@ const check = { ...@@ -273,7 +283,9 @@ const check = {
if (RECIPIENT === hre.ethers.constants.AddressZero) { if (RECIPIENT === hre.ethers.constants.AddressZero) {
throw new Error('undefined RECIPIENT') throw new Error('undefined RECIPIENT')
} }
logLoud()
console.log(` - RECIPIENT: ${RECIPIENT}`) console.log(` - RECIPIENT: ${RECIPIENT}`)
logLoud()
const l1FeeWallet = await SequencerFeeVault.l1FeeWallet() const l1FeeWallet = await SequencerFeeVault.l1FeeWallet()
if (l1FeeWallet === hre.ethers.constants.AddressZero) { if (l1FeeWallet === hre.ethers.constants.AddressZero) {
...@@ -438,7 +450,9 @@ const check = { ...@@ -438,7 +450,9 @@ const check = {
console.log(` - symbol: ${symbol}`) console.log(` - symbol: ${symbol}`)
const owner = await GovernanceToken.owner() const owner = await GovernanceToken.owner()
logLoud()
console.log(` - owner: ${owner}`) console.log(` - owner: ${owner}`)
logLoud()
const totalSupply = await GovernanceToken.totalSupply() const totalSupply = await GovernanceToken.totalSupply()
console.log(` - totalSupply: ${totalSupply}`) console.log(` - totalSupply: ${totalSupply}`)
...@@ -461,11 +475,18 @@ const check = { ...@@ -461,11 +475,18 @@ const check = {
if (MESSENGER === hre.ethers.constants.AddressZero) { if (MESSENGER === hre.ethers.constants.AddressZero) {
throw new Error('MESSENGER misconfigured') throw new Error('MESSENGER misconfigured')
} }
console.log(` - MESSENGER: ${MESSENGER}`)
const OTHER_BRIDGE = await L2ERC721Bridge.OTHER_BRIDGE() const OTHER_BRIDGE = await L2ERC721Bridge.OTHER_BRIDGE()
if (OTHER_BRIDGE === hre.ethers.constants.AddressZero) { if (OTHER_BRIDGE === hre.ethers.constants.AddressZero) {
throw new Error('OTHER_BRIDGE misconfigured') throw new Error('OTHER_BRIDGE misconfigured')
} }
logLoud()
console.log(` - OTHER_BRIDGE: ${OTHER_BRIDGE}`)
logLoud()
await checkProxy(hre, 'L2ERC721Bridge')
await assertProxy(hre, 'L2ERC721Bridge')
}, },
// OptimismMintableERC721Factory // OptimismMintableERC721Factory
// - check version // - check version
...@@ -500,7 +521,9 @@ const check = { ...@@ -500,7 +521,9 @@ const check = {
if (owner === hre.ethers.constants.AddressZero) { if (owner === hre.ethers.constants.AddressZero) {
throw new Error('misconfigured owner') throw new Error('misconfigured owner')
} }
logLoud()
console.log(` - owner: ${owner}`) console.log(` - owner: ${owner}`)
logLoud()
const addressManager = await ProxyAdmin.addressManager() const addressManager = await ProxyAdmin.addressManager()
console.log(` - addressManager: ${addressManager}`) console.log(` - addressManager: ${addressManager}`)
...@@ -525,7 +548,9 @@ const check = { ...@@ -525,7 +548,9 @@ const check = {
if (RECIPIENT === hre.ethers.constants.AddressZero) { if (RECIPIENT === hre.ethers.constants.AddressZero) {
throw new Error(`RECIPIENT misconfigured`) throw new Error(`RECIPIENT misconfigured`)
} }
logLoud()
console.log(` - RECIPIENT: ${RECIPIENT}`) console.log(` - RECIPIENT: ${RECIPIENT}`)
logLoud()
assertSemver(version, 'BaseFeeVault') assertSemver(version, 'BaseFeeVault')
await checkProxy(hre, 'BaseFeeVault') await checkProxy(hre, 'BaseFeeVault')
...@@ -551,7 +576,9 @@ const check = { ...@@ -551,7 +576,9 @@ const check = {
if (RECIPIENT === hre.ethers.constants.AddressZero) { if (RECIPIENT === hre.ethers.constants.AddressZero) {
throw new Error(`RECIPIENT misconfigured`) throw new Error(`RECIPIENT misconfigured`)
} }
logLoud()
console.log(` - RECIPIENT: ${RECIPIENT}`) console.log(` - RECIPIENT: ${RECIPIENT}`)
logLoud()
assertSemver(version, 'L1FeeVault') assertSemver(version, 'L1FeeVault')
await checkProxy(hre, 'L1FeeVault') await checkProxy(hre, 'L1FeeVault')
...@@ -583,9 +610,15 @@ task( ...@@ -583,9 +610,15 @@ task(
'check-l2', 'check-l2',
'Checks a freshly migrated L2 system for correct migration' 'Checks a freshly migrated L2 system for correct migration'
).setAction(async (_, hre: HardhatRuntimeEnvironment) => { ).setAction(async (_, hre: HardhatRuntimeEnvironment) => {
logLoud()
console.log('Manually check values wrapped in !!!!')
logLoud()
console.log()
// Ensure that all the predeploys exist, including the not // Ensure that all the predeploys exist, including the not
// currently configured ones // currently configured ones
await checkPredeploys(hre) await checkPredeploys(hre)
console.log()
// Check the currently configured predeploys // Check the currently configured predeploys
for (const [name, fn] of Object.entries(check)) { for (const [name, fn] of Object.entries(check)) {
const address = predeploys[name] const address = predeploys[name]
......
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