diff --git a/hardhat.config.ts b/hardhat.config.ts index f17daecc..6aeb72ba 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -53,6 +53,16 @@ const solidity = { evmVersion: 'cancun', }, }, + 'src/mocks/ArbOS11To32UpgradeTest.sol': { + version: '0.8.24', + settings: { + optimizer: { + enabled: true, + runs: 100, + }, + evmVersion: 'cancun', + }, + }, }, } @@ -89,6 +99,16 @@ if (process.env['INTERFACE_TESTER_SOLC_VERSION']) { evmVersion: 'cancun', }, }, + 'src/mocks/ArbOS11To32UpgradeTest.sol': { + version: '0.8.24', + settings: { + optimizer: { + enabled: true, + runs: 100, + }, + evmVersion: 'cancun', + }, + }, } } diff --git a/src/mocks/ArbOS11To32UpgradeTest.sol b/src/mocks/ArbOS11To32UpgradeTest.sol new file mode 100644 index 00000000..6e8f3e55 --- /dev/null +++ b/src/mocks/ArbOS11To32UpgradeTest.sol @@ -0,0 +1,18 @@ +// Copyright 2024, Offchain Labs, Inc. +// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE +// SPDX-License-Identifier: BUSL-1.1 + +pragma solidity ^0.8.24; + +import "../precompiles/ArbSys.sol"; + +contract ArbOS11To32UpgradeTest { + function mcopy() external returns (bytes32 x) { + assembly { + mstore(0x20, 0x9) // Store 0x9 at word 1 in memory + mcopy(0, 0x20, 0x20) // Copies 0x9 to word 0 in memory + x := mload(0) // Returns 32 bytes "0x9" + } + require(ArbSys(address(0x64)).arbOSVersion() == 55 + 32, "EXPECTED_ARBOS_32"); + } +}