diff --git a/packages/contracts-bedrock/deploy/001-InitImplementations.deploy.ts b/packages/contracts-bedrock/deploy/001-InitImplementations.deploy.ts index 6260e3f012263..9d339f103e924 100644 --- a/packages/contracts-bedrock/deploy/001-InitImplementations.deploy.ts +++ b/packages/contracts-bedrock/deploy/001-InitImplementations.deploy.ts @@ -104,10 +104,8 @@ const deployFn: DeployFunction = async (hre) => { ] await Promise.all(implTxs) + let tx // Reset the nonce for the next set of transactions - nonce = await l1.getTransactionCount(deployer) - - const upgradeTxs: any[] = [] for (const [proxy, upgrader] of Object.entries(upgradeABIs)) { const upgraderOut = await upgrader(deployConfig) const implName = proxy.replace('Proxy', '') @@ -121,18 +119,17 @@ const deployFn: DeployFunction = async (hre) => { 'Proxy', proxyDeployment.address ) - upgradeTxs.push( - proxyContract.upgradeToAndCall( - implContract.address, - implContract.interface.encodeFunctionData( - upgraderOut[0] as string, - upgraderOut[1] as any[] - ), - { - nonce: ++nonce, - } + console.log(`Upgrading contract impl ${implName}.`) + tx = await proxyContract.upgradeToAndCall( + implContract.address, + implContract.interface.encodeFunctionData( + upgraderOut[0] as string, + upgraderOut[1] as any[] ) ) + console.log(`Awaiting TX hash ${tx.hash}.`) + await tx.wait() + console.log('Done.') } const bridge = await get('L1StandardBridge') @@ -140,11 +137,11 @@ const deployFn: DeployFunction = async (hre) => { 'Proxy', bridgeProxy.address ) - upgradeTxs.push( - bridgeProxyContract.upgradeTo(bridge.address, { - nonce: ++nonce, - }) - ) + console.log(`Upgrading L1StandardBridge at ${bridge.address}.`) + tx = await bridgeProxyContract.upgradeTo(bridge.address) + console.log(`Awaiting TX hash ${tx.hash}.`) + await tx.wait() + console.log('Done') const factory = await get('OptimismMintableERC20Factory') const factoryProxy = await get('OptimismMintableERC20FactoryProxy') @@ -152,13 +149,11 @@ const deployFn: DeployFunction = async (hre) => { 'Proxy', factoryProxy.address ) - upgradeTxs.push( - factoryProxyContract.upgradeTo(factory.address, { - nonce: ++nonce, - }) - ) - const rawTxs = await Promise.all(upgradeTxs) - await Promise.all(rawTxs.map((tx) => tx.wait())) + console.log(`Upgrading OptimismMintableERC20Factory at ${factory.address}.`) + tx = await factoryProxyContract.upgradeTo(factory.address) + console.log(`Awaiting TX hash ${tx.hash}.`) + await tx.wait() + console.log('Done') await validateOracle(hre, deployConfig, deployL2StartingTimestamp) await validatePortal(hre) diff --git a/packages/contracts-bedrock/deploy/002-ConfigureProxyAdmin.ts b/packages/contracts-bedrock/deploy/002-ConfigureProxyAdmin.ts index d7bc9e690cdaa..f6c0eb2446225 100644 --- a/packages/contracts-bedrock/deploy/002-ConfigureProxyAdmin.ts +++ b/packages/contracts-bedrock/deploy/002-ConfigureProxyAdmin.ts @@ -16,17 +16,12 @@ const deployFn: DeployFunction = async (hre) => { 'OptimismMintableERC20FactoryProxy', ] - const { deployer } = await hre.getNamedAccounts() - let nonce = await hre.ethers.provider.getTransactionCount(deployer) - // Subtract 1 from the nonce to simplify the loop below - nonce = nonce - 1 - // Wait on all the txs in parallel so that the deployment goes faster const txs = [] for (const proxy of proxies) { const deployment = await hre.deployments.get(proxy) const Proxy = await hre.ethers.getContractAt('Proxy', deployment.address) - const tx = await Proxy.changeAdmin(admin.address, { nonce: ++nonce }) + const tx = await Proxy.changeAdmin(admin.address) txs.push(tx) } await Promise.all(txs.map((tx) => tx.wait())) @@ -38,10 +33,8 @@ const deployFn: DeployFunction = async (hre) => { ) const postConfig = [ - await AddressManager.transferOwnership(admin.address, { nonce: ++nonce }), - await ProxyAdmin.setAddressManager(addressManager.address, { - nonce: ++nonce, - }), + await AddressManager.transferOwnership(admin.address), + await ProxyAdmin.setAddressManager(addressManager.address), ] await Promise.all(postConfig.map((tx) => tx.wait())) }