Skip to content

Commit 1ecc439

Browse files
committed
Self review clean up
1 parent 4a1f828 commit 1ecc439

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

packages/contracts-bedrock/test/L1/OPContractsManager.t.sol

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,16 @@ contract OPContractsManager_Upgrade_Harness is CommonTest, DisputeGames {
210210
address superchainPAO = IProxyAdmin(EIP1967Helper.getAdmin(address(superchainConfig))).owner();
211211

212212
// Execute the SuperchainConfig upgrade.
213-
// nosemgrep: sol-safety-trycatch-eip150)
214213
vm.prank(superchainPAO, true);
215-
(bool success, bytes memory returndata) =
214+
(bool success, bytes memory reason) =
216215
address(_opcm).delegatecall(abi.encodeCall(IOPContractsManager.upgradeSuperchainConfig, (superchainConfig)));
217216
if (success == false) {
218217
// Only acceptable revert reason is the SuperchainConfig already being up to date. This
219218
// try/catch is better than checking the version via the implementations struct because
220219
// the implementations struct interface can change between OPCM versions which would
221220
// cause the test to break and be a pain to resolve.
222221
assertTrue(
223-
bytes4(returndata)
222+
bytes4(reason)
224223
== IOPContractsManagerUpgrader.OPContractsManagerUpgrader_SuperchainConfigAlreadyUpToDate.selector,
225224
"Revert reason other than SuperchainConfigAlreadyUpToDate"
226225
);
@@ -231,6 +230,11 @@ contract OPContractsManager_Upgrade_Harness is CommonTest, DisputeGames {
231230
vm.expectRevert(_revertBytes);
232231
}
233232

233+
// Execute the chain upgrade.
234+
if (_delegateCaller.code.length > 0) {
235+
// Foundry fails with "cannot `prank` delegate call from an EOA" if empty
236+
vm.etch(_delegateCaller, hex"00");
237+
}
234238
vm.prank(_delegateCaller, true);
235239
(bool upgradeSuccess,) =
236240
address(_opcm).delegatecall(abi.encodeCall(IOPContractsManager.upgrade, (opChainConfigs)));
@@ -1057,7 +1061,7 @@ contract OPContractsManager_UpdatePrestate_Test is OPContractsManager_TestInit {
10571061
IOPContractsManager.UpdatePrestateInput[] memory inputs = new IOPContractsManager.UpdatePrestateInput[](1);
10581062
inputs[0] = _input;
10591063

1060-
// cache the proxy admin owner before the revert check
1064+
// make the call to cache the proxy admin owner before the revert check
10611065
address proxyAdminOwner = chainDeployOutput1.opChainProxyAdmin.owner();
10621066
if (_revertBytes.length > 0) {
10631067
vm.expectRevert(_revertBytes);

packages/contracts-bedrock/test/setup/ForkLive.s.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,10 @@ contract ForkLive is Deployer, StdAssertions, FeatureFlags {
216216
IProxyAdmin superchainProxyAdmin = IProxyAdmin(EIP1967Helper.getAdmin(address(superchainConfig)));
217217
address superchainPAO = superchainProxyAdmin.owner();
218218
vm.prank(superchainPAO, true);
219-
(bool success, bytes memory returndata) = address(_opcm).delegatecall(abi.encodeCall(IOPContractsManager.upgradeSuperchainConfig, (superchainConfig)));
219+
(bool success, bytes memory reason) = address(_opcm).delegatecall(abi.encodeCall(IOPContractsManager.upgradeSuperchainConfig, (superchainConfig)));
220220
if (success == false) {
221221
assertTrue(
222-
bytes4(returndata)
222+
bytes4(reason)
223223
== IOPContractsManagerUpgrader.OPContractsManagerUpgrader_SuperchainConfigAlreadyUpToDate.selector,
224224
"Revert reason other than SuperchainConfigAlreadyUpToDate"
225225
);

0 commit comments

Comments
 (0)