Commit 79706a9a authored by Maurelian's avatar Maurelian

feat(ctb): Wait for all MSD ownership transfers at once

parent df38d134
......@@ -78,16 +78,6 @@ const deployFn: DeployFunction = async (hre) => {
transferFunc: 'transferOwnership',
dictator: SystemDictator,
})
// Wait for the ownership transfer to complete.
await awaitCondition(
async () => {
const owner = await ProxyAdmin.owner()
return owner === SystemDictator.address
},
5000,
1000
)
}
// We don't need to transfer proxy addresses if we're already beyond the proxy transfer step.
......@@ -107,16 +97,6 @@ const deployFn: DeployFunction = async (hre) => {
transferFunc: 'transferOwnership',
dictator: SystemDictator,
})
// Wait for the ownership transfer to complete.
await awaitCondition(
async () => {
const owner = await AddressManager.owner()
return owner === SystemDictator.address
},
5000,
1000
)
} else {
console.log(`AddressManager already owned by the SystemDictator`)
}
......@@ -135,18 +115,6 @@ const deployFn: DeployFunction = async (hre) => {
transferFunc: 'setOwner',
dictator: SystemDictator,
})
// Wait for the ownership transfer to complete.
await awaitCondition(
async () => {
const owner = await L1StandardBridgeProxy.callStatic.getOwner({
from: ethers.constants.AddressZero,
})
return owner === SystemDictator.address
},
5000,
1000
)
} else {
console.log(`L1StandardBridge already owned by MSD`)
}
......@@ -165,22 +133,34 @@ const deployFn: DeployFunction = async (hre) => {
transferFunc: 'changeAdmin',
dictator: SystemDictator,
})
// Wait for the ownership transfer to complete.
await awaitCondition(
async () => {
const owner = await L1ERC721BridgeProxy.callStatic.admin({
from: ethers.constants.AddressZero,
})
return owner === SystemDictator.address
},
5000,
1000
)
} else {
console.log(`L1ERC721Bridge already owned by MSD`)
}
// Wait for the ownership transfers to complete before continuing.
await awaitCondition(
async (): Promise<boolean> => {
const proxyAdminOwner = await ProxyAdmin.owner()
const addressManagerOwner = await AddressManager.owner()
const l1StandardBridgeOwner =
await L1StandardBridgeProxy.callStatic.getOwner({
from: ethers.constants.AddressZero,
})
const l1Erc721BridgeOwner = await L1ERC721BridgeProxy.callStatic.admin({
from: ethers.constants.AddressZero,
})
return (
proxyAdminOwner === SystemDictator.address &&
addressManagerOwner === SystemDictator.address &&
l1StandardBridgeOwner === SystemDictator.address &&
l1Erc721BridgeOwner === SystemDictator.address
)
},
5000,
1000
)
await doPhase({
isLiveDeployer,
SystemDictator,
......
......@@ -338,6 +338,7 @@ export const doOwnershipTransfer = async (opts: {
dictator: ethers.Contract
}): Promise<void> => {
if (opts.isLiveDeployer) {
console.log(`Setting ${opts.name} owner to MSD`)
await opts.proxy[opts.transferFunc](opts.dictator.address)
} else {
const tx = await opts.proxy.populateTransaction[opts.transferFunc](
......
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