diff --git a/scripts/proposals/ArbOS50AIP/data.json b/scripts/proposals/ArbOS50AIP/data.json new file mode 100644 index 000000000..075992d3c --- /dev/null +++ b/scripts/proposals/ArbOS50AIP/data.json @@ -0,0 +1,22 @@ +{ + "actionChainIds": [ + 1, + 1, + 42161, + 42170, + 42161, + 42170 + ], + "actionAddresses": [ + "0x653e31e11769a9c6feE825E4BC822753DE2286B7", + "0xd3f7381fD955dD9C019A9775c8DbF7c390F4cE3d", + "0x12A132e2341aE7D24cF77Ada0b5503E11A15a447", + "0x114637D5cB4BaE22c94F822c984F5cA6013284Da", + "0x08aA1648fC9d862a28Aad015EEAa1Ee2C2483838", + "0xd3f7381fD955dD9C019A9775c8DbF7c390F4cE3d" + ], + "arbSysSendTxToL1Args": { + "l1Timelock": "0xE6841D92B0C345144506576eC13ECf5103aC7f49", + "calldata": "0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000000002077333cfae015cc520076eba7142c5cb29dc69d0e16c026dac7aae7b7b2cc1d000000000000000000000000000000000000000000000000000000000003f48000000000000000000000000000000000000000000000000000000000000000060000000000000000000000003fffbadaf827559da092217e474760e2b2c3cedd0000000000000000000000003fffbadaf827559da092217e474760e2b2c3cedd000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c0000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000003e00000000000000000000000000000000000000000000000000000000000000580000000000000000000000000000000000000000000000000000000000000072000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000653e31e11769a9c6fee825e4bc822753de2286b700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000d3f7381fd955dd9c019a9775c8dbf7c390f4ce3d00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001800000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f000000000000000000000000cf57572261c7c2bcf21ffd220ea7d1a27d40a82700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd00000000000000000000000012a132e2341ae7d24cf77ada0b5503e11a15a44700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000c4448b71118c9071bcb9734a0eac55d18a15394900000000000000000000000086a02dd71363c440b21f4c0e5b2ad01ffe1a748200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000114637d5cb4bae22c94f822c984f5ca6013284da00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001800000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f000000000000000000000000cf57572261c7c2bcf21ffd220ea7d1a27d40a82700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd00000000000000000000000008aa1648fc9d862a28aad015eeaa1ee2c248383800000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000c4448b71118c9071bcb9734a0eac55d18a15394900000000000000000000000086a02dd71363c440b21f4c0e5b2ad01ffe1a748200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000d3f7381fd955dd9c019a9775c8dbf7c390f4ce3d00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } +} \ No newline at end of file diff --git a/src/gov-action-contracts/AIPs/ArbOS50/ArbOS50SettingsAction.sol b/src/gov-action-contracts/AIPs/ArbOS50/ArbOS50SettingsAction.sol new file mode 100644 index 000000000..4559792e3 --- /dev/null +++ b/src/gov-action-contracts/AIPs/ArbOS50/ArbOS50SettingsAction.sol @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.16; + +import "@openzeppelin/contracts/utils/Address.sol"; + +// Interfaces +interface IArbOwner { + function setMinimumL2BaseFee(uint256 minBaseFeeWei) external; + function setParentGasFloorPerToken(uint64 floorPerToken) external; + function addChainOwner(address newOwner) external; +} + +interface IArbSys { + function arbOSVersion() external view returns (uint256); +} + +/// @notice Settings to be applied on Arbitrum One are Arbitrum Nova after the ArbOS 50 upgrade +/// These settings include: +/// - Setting a new minimum L2 base fee in wei +/// - Setting the new gas floor per token +/// - Adding the ResourceConstraintManager as a chain owner +/// @dev Identical copies of this contract will be deployed on Arbitrum One and Arbitrum Nova +/// @dev This contract is to be used after the chain has been successfully upgraded to ArbOS 50, +/// otherwise the call to setParentGasFloorPerToken will fail and the transaction will revert. +contract ArbOS50SettingsAction { + uint256 public constant NEW_MIN_BASE_FEE = 0.02 gwei; + uint64 public constant NEW_FLOOR_PER_TOKEN = 10; + address public immutable resourceConstraintManagerAddress; + + // Precompile addresses + address public constant ARB_OWNER_ADDRESS = 0x0000000000000000000000000000000000000070; + address public constant ARBSYS_ADDRESS = 0x0000000000000000000000000000000000000064; + + constructor(address _resourceConstraintManagerAddress) { + require( + Address.isContract(address(_resourceConstraintManagerAddress)), + "ArbOS50SettingsAction: _resourceConstraintManagerAddress is not a contract" + ); + resourceConstraintManagerAddress = _resourceConstraintManagerAddress; + } + + /// @notice Gets the current ArbOS version + /// @dev The ArbOS version returned by ArbSys includes an offset of 55 + /// (https://github.com/OffchainLabs/nitro/blob/v3.8.0/precompiles/ArbSys.go#L65-L69) + function getArbOSVersion() public view returns (uint256) { + IArbSys arbSys = IArbSys(ARBSYS_ADDRESS); + return arbSys.arbOSVersion() - 55; + } + + function perform() public { + // Verify that the chain is running ArbOS 50 + require(getArbOSVersion() >= 50, "ArbOS50SettingsAction: ArbOS version is less than 50"); + + // Create ArbOwner precompile interface + IArbOwner arbOwner = IArbOwner(ARB_OWNER_ADDRESS); + + // Set the minimum L2 base fee + arbOwner.setMinimumL2BaseFee(NEW_MIN_BASE_FEE); + + // Set the new gas floor per token + arbOwner.setParentGasFloorPerToken(NEW_FLOOR_PER_TOKEN); + + // Add the ResourceConstraintManager as a chain owner + arbOwner.addChainOwner(resourceConstraintManagerAddress); + } +} diff --git a/test/signatures/ArbOS50SettingsAction b/test/signatures/ArbOS50SettingsAction new file mode 100644 index 000000000..07a9c5d13 --- /dev/null +++ b/test/signatures/ArbOS50SettingsAction @@ -0,0 +1,19 @@ + +╭------------------------------------+------------╮ +| Method | Identifier | ++=================================================+ +| ARBSYS_ADDRESS() | 71811f7b | +|------------------------------------+------------| +| ARB_OWNER_ADDRESS() | c696d9c1 | +|------------------------------------+------------| +| NEW_FLOOR_PER_TOKEN() | cc1278a6 | +|------------------------------------+------------| +| NEW_MIN_BASE_FEE() | a59faf8e | +|------------------------------------+------------| +| getArbOSVersion() | 17628539 | +|------------------------------------+------------| +| perform() | b147f40c | +|------------------------------------+------------| +| resourceConstraintManagerAddress() | fa49b3a2 | +╰------------------------------------+------------╯ + diff --git a/test/storage/ArbOS50SettingsAction b/test/storage/ArbOS50SettingsAction new file mode 100644 index 000000000..1ec5dc079 --- /dev/null +++ b/test/storage/ArbOS50SettingsAction @@ -0,0 +1,6 @@ + +╭------+------+------+--------+-------+----------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++================================================+ +╰------+------+------+--------+-------+----------╯ +