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

fix(contracts): Always print dictator contract instructions

parent 7b5ccb36
...@@ -32,21 +32,6 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -32,21 +32,6 @@ const deployFn: DeployFunction = async (hre) => {
const finalOwner = await AddressDictator.finalOwner() const finalOwner = await AddressDictator.finalOwner()
const currentOwner = await Lib_AddressManager.owner() const currentOwner = await Lib_AddressManager.owner()
// 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.
const hreSigners = await hre.ethers.getSigners()
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(` console.log(`
The AddressDictator contract (glory to Arstotzka) has been deployed. The AddressDictator contract (glory to Arstotzka) has been deployed.
...@@ -85,6 +70,20 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -85,6 +70,20 @@ const deployFn: DeployFunction = async (hre) => {
(4) Wait for the deploy process to continue. (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.
const hreSigners = await hre.ethers.getSigners()
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
)
} }
// Wait for ownership to be transferred to the AddressDictator contract. // Wait for ownership to be transferred to the AddressDictator contract.
......
...@@ -45,21 +45,6 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -45,21 +45,6 @@ const deployFn: DeployFunction = async (hre) => {
}) })
const finalOwner = await ChugSplashDictator.finalOwner() const finalOwner = await ChugSplashDictator.finalOwner()
// 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.
const hreSigners = await hre.ethers.getSigners()
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 Proxy__OVM_L1StandardBridge.connect(owner).setOwner(
ChugSplashDictator.address
)
} else {
const messengerSlotKey = await ChugSplashDictator.messengerSlotKey() const messengerSlotKey = await ChugSplashDictator.messengerSlotKey()
const messengerSlotVal = await ChugSplashDictator.messengerSlotVal() const messengerSlotVal = await ChugSplashDictator.messengerSlotVal()
const bridgeSlotKey = await ChugSplashDictator.bridgeSlotKey() const bridgeSlotKey = await ChugSplashDictator.bridgeSlotKey()
...@@ -96,6 +81,21 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -96,6 +81,21 @@ const deployFn: DeployFunction = async (hre) => {
(4) Wait for the deploy process to continue. (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.
const hreSigners = await hre.ethers.getSigners()
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 Proxy__OVM_L1StandardBridge.connect(owner).setOwner(
ChugSplashDictator.address
)
} }
// Wait for ownership to be transferred to the AddressDictator contract. // 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