Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/L2/predeploys/L1GasPriceOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ contract L1GasPriceOracle is OwnableBase, IL1GasPriceOracle {
/// @notice Indicates whether the network has gone through the Feynman upgrade.
bool public isFeynman;

/// @dev Gap added to ensure that `isGalileo` is in the next storage slot.
uint248 private __gap;

/// @notice Indicates whether the network has gone through the Galileo upgrade.
bool public isGalileo;

Expand Down
15 changes: 15 additions & 0 deletions src/test/L1GasPriceOracle.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,19 @@ contract L1GasPriceOracleTest is DSTestPlus {

assertEq(oracle.getL1Fee(_data), (_baseTerm + _penaltyTerm) / PRECISION);
}

function testSetStorageDuringUpgrade() external {
assertFalse(oracle.isFeynman());
assertFalse(oracle.isGalileo());

// Feynman upgrade
hevm.store(address(oracle), bytes32(uint256(11)), bytes32(uint256(1)));
assertTrue(oracle.isFeynman());
assertFalse(oracle.isGalileo());

// GalileoV2 upgrade
hevm.store(address(oracle), bytes32(uint256(12)), bytes32(uint256(1)));
assertTrue(oracle.isFeynman());
assertTrue(oracle.isGalileo());
}
}
Loading