Skip to content

Commit 4984821

Browse files
committed
Do on-chain check to see if previous upgrade took place
1 parent 3f0a7f9 commit 4984821

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

contracts/parent-chain/contract-upgrades/NitroContracts2Point0Point0UpgradeAction.sol

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ interface IRollupUpgrade {
1717
function anyTrustFastConfirmer() external returns (address);
1818
}
1919

20+
interface ISequencerInbox_v1_2_1 {
21+
function isUsingFeeToken() external returns (bool);
22+
}
23+
2024
/**
2125
* @title DeployNitroContracts2Point0Point0UpgradeActionScript
2226
* @notice Set wasm module root and upgrade challenge manager for stylus ArbOS upgrade.
@@ -77,6 +81,14 @@ contract NitroContracts2Point0Point0UpgradeAction {
7781
}
7882

7983
function perform(IRollupCore rollup, ProxyAdmin proxyAdmin) external {
84+
/// check if previous upgrade v1.2.1 was performed by polling function which was introduced in that version
85+
ISequencerInbox_v1_2_1 sequencerInbox = ISequencerInbox_v1_2_1(address(rollup.sequencerInbox()));
86+
try sequencerInbox.isUsingFeeToken() returns (bool) {}
87+
catch {
88+
revert("NitroContracts2Point0Point0UpgradeAction: sequencer inbox needs to be at version >= 1.2.1");
89+
}
90+
91+
/// do the upgrade
8092
_upgradeChallengerManager(rollup, proxyAdmin);
8193
_upgradeRollup(address(rollup));
8294
}

0 commit comments

Comments
 (0)