Commit c3db334f authored by Maurelian's avatar Maurelian Committed by Kelvin Fichter

fix(contracts): Always print dictator contract instructions

parent 7b5ccb36
......@@ -32,6 +32,45 @@ const deployFn: DeployFunction = async (hre) => {
const finalOwner = await AddressDictator.finalOwner()
const currentOwner = await Lib_AddressManager.owner()
console.log(`
The AddressDictator contract (glory to Arstotzka) has been deployed.
FOLLOW THESE INSTRUCTIONS CAREFULLY!
(1) Review the Contract Name / Contract Address pairs below and confirm that they match
the addresses found in the contract artifacts of your current deployment.
${namedAddresses
.map((namedAddress) => {
const padding = ' '.repeat(40 - namedAddress.name.length)
return `
${namedAddress.name}${padding} ${namedAddress.addr}
`
})
.join('\n')}
(2) Review the CURRENT and FINAL AddressManager owners and verify that these are the expected values:
Current AddressManager owner: (${currentOwner})
Final AddressManager owner: (${finalOwner})
[${
currentOwner === finalOwner
? 'THESE ARE THE SAME ADDRESSES'
: 'THESE ARE >>>NOT<<< THE SAME ADDRESSES'
}]
(3) Transfer ownership of the AddressManager located at (${
Lib_AddressManager.address
})
to the AddressDictator contract located at the following address:
TRANSFER OWNERSHIP TO THE FOLLOWING ADDRESS ONLY:
>>>>> (${AddressDictator.address}) <<<<<
(4) Wait for the deploy process to continue.
`)
// Check if the hardhat runtime environment has the owner of the AddressManager. This will only
// happen in CI. If this is the case, we can skip directly to transferring ownership over to the
// AddressDictator contract.
......@@ -39,52 +78,12 @@ const deployFn: DeployFunction = async (hre) => {
const hreHasOwner = hreSigners.some((signer) => {
return hexStringEquals(signer.address, currentOwner)
})
if (hreHasOwner) {
// Hardhat has the owner loaded into it, we can skip directly to transferOwnership.
const owner = await hre.ethers.getSigner(currentOwner)
await Lib_AddressManager.connect(owner).transferOwnership(
AddressDictator.address
)
} else {
console.log(`
The AddressDictator contract (glory to Arstotzka) has been deployed.
FOLLOW THESE INSTRUCTIONS CAREFULLY!
(1) Review the Contract Name / Contract Address pairs below and confirm that they match
the addresses found in the contract artifacts of your current deployment.
${namedAddresses
.map((namedAddress) => {
const padding = ' '.repeat(40 - namedAddress.name.length)
return `
${namedAddress.name}${padding} ${namedAddress.addr}
`
})
.join('\n')}
(2) Review the CURRENT and FINAL AddressManager owners and verify that these are the expected values:
Current AddressManager owner: (${currentOwner})
Final AddressManager owner: (${finalOwner})
[${
currentOwner === finalOwner
? 'THESE ARE THE SAME ADDRESSES'
: 'THESE ARE >>>NOT<<< THE SAME ADDRESSES'
}]
(3) Transfer ownership of the AddressManager located at (${
Lib_AddressManager.address
})
to the AddressDictator contract located at the following address:
TRANSFER OWNERSHIP TO THE FOLLOWING ADDRESS ONLY:
>>>>> (${AddressDictator.address}) <<<<<
(4) Wait for the deploy process to continue.
`)
}
// Wait for ownership to be transferred to the AddressDictator contract.
......
......@@ -45,6 +45,43 @@ const deployFn: DeployFunction = async (hre) => {
})
const finalOwner = await ChugSplashDictator.finalOwner()
const messengerSlotKey = await ChugSplashDictator.messengerSlotKey()
const messengerSlotVal = await ChugSplashDictator.messengerSlotVal()
const bridgeSlotKey = await ChugSplashDictator.bridgeSlotKey()
const bridgeSlotVal = await ChugSplashDictator.bridgeSlotVal()
console.log(`
The ChugSplashDictator contract (glory to Arstotzka) has been deployed.
FOLLOW THESE INSTRUCTIONS CAREFULLY!
(1) Review the storage key/value pairs below and make sure they match the expected values:
${messengerSlotKey}: ${messengerSlotVal}
${bridgeSlotKey}: ${bridgeSlotVal}
(2) Review the CURRENT and FINAL proxy owners and verify that these are the expected values:
Current proxy owner: (${currentOwner})
Final proxy owner: (${finalOwner})
[${
currentOwner === finalOwner
? 'THESE ARE THE SAME ADDRESSES'
: 'THESE ARE >>>NOT<<< THE SAME ADDRESSES'
}]
(3) Transfer ownership of the L1ChugSplashProxy located at (${
Proxy__OVM_L1StandardBridge.address
})
to the ChugSplashDictator contract located at the following address:
TRANSFER OWNERSHIP TO THE FOLLOWING ADDRESS ONLY:
>>>>> (${ChugSplashDictator.address}) <<<<<
(4) Wait for the deploy process to continue.
`)
// Check if the hardhat runtime environment has the owner of the proxy. This will only
// happen in CI. If this is the case, we can skip directly to transferring ownership over to the
// ChugSplashDictator contract.
......@@ -59,43 +96,6 @@ const deployFn: DeployFunction = async (hre) => {
await Proxy__OVM_L1StandardBridge.connect(owner).setOwner(
ChugSplashDictator.address
)
} else {
const messengerSlotKey = await ChugSplashDictator.messengerSlotKey()
const messengerSlotVal = await ChugSplashDictator.messengerSlotVal()
const bridgeSlotKey = await ChugSplashDictator.bridgeSlotKey()
const bridgeSlotVal = await ChugSplashDictator.bridgeSlotVal()
console.log(`
The ChugSplashDictator contract (glory to Arstotzka) has been deployed.
FOLLOW THESE INSTRUCTIONS CAREFULLY!
(1) Review the storage key/value pairs below and make sure they match the expected values:
${messengerSlotKey}: ${messengerSlotVal}
${bridgeSlotKey}: ${bridgeSlotVal}
(2) Review the CURRENT and FINAL proxy owners and verify that these are the expected values:
Current proxy owner: (${currentOwner})
Final proxy owner: (${finalOwner})
[${
currentOwner === finalOwner
? 'THESE ARE THE SAME ADDRESSES'
: 'THESE ARE >>>NOT<<< THE SAME ADDRESSES'
}]
(3) Transfer ownership of the L1ChugSplashProxy located at (${
Proxy__OVM_L1StandardBridge.address
})
to the ChugSplashDictator contract located at the following address:
TRANSFER OWNERSHIP TO THE FOLLOWING ADDRESS ONLY:
>>>>> (${ChugSplashDictator.address}) <<<<<
(4) Wait for the deploy process to continue.
`)
}
// Wait for ownership to be transferred to the AddressDictator contract.
......
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