diff --git a/scripts/executeBoldUpgrade.ts b/scripts/executeBoldUpgrade.ts index 31a59744..7eb09efc 100644 --- a/scripts/executeBoldUpgrade.ts +++ b/scripts/executeBoldUpgrade.ts @@ -144,11 +144,6 @@ async function verifyPostUpgrade(params: VerificationParams) { l1Rpc ) - const expectedRollupAddress = await boldAction.expectedRollupAddress( - config.contracts.upgradeExecutor, - config.settings.chainId - ) - const rollupMigratedLogs = receipt.events!.filter( event => event.topics[0] === boldAction.interface.getEventTopic('RollupMigrated') @@ -160,11 +155,11 @@ async function verifyPostUpgrade(params: VerificationParams) { const rollupMigratedLog = boldAction.interface.parseLog(rollupMigratedLogs[0]) .args as RollupMigratedEvent['args'] - if (rollupMigratedLog.rollup !== expectedRollupAddress) { - throw new Error( - 'RollupMigratedEvent rollup address does not match expected' - ) - } + await boldAction.validateRollupDeployedAtAddress( + rollupMigratedLog.rollup, + config.contracts.upgradeExecutor, + config.settings.chainId + ) const boldRollup = RollupUserLogic__factory.connect( rollupMigratedLog.rollup, diff --git a/src/rollup/BOLDUpgradeAction.sol b/src/rollup/BOLDUpgradeAction.sol index 16a3f08a..fae6e3fa 100644 --- a/src/rollup/BOLDUpgradeAction.sol +++ b/src/rollup/BOLDUpgradeAction.sol @@ -487,13 +487,15 @@ contract BOLDUpgradeAction { ); } - function isRollupDeployedAtAddress( + function validateRollupDeployedAtAddress( address rollupAddress, address deployer, uint256 chainId - ) external view returns (bool) { - return rollupAddress.code.length > 0 - && expectedRollupAddress(deployer, chainId) == rollupAddress; + ) external view { + require(rollupAddress.code.length > 0, "ROLLUP_NOT_DEPLOYED"); + require( + expectedRollupAddress(deployer, chainId) == rollupAddress, "ROLLUP_ADDRESS_MISMATCH" + ); } function perform(