From 55e52cf9dede23178a6f26bf56b2c3b52dd0bea7 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Fri, 27 Sep 2024 18:34:49 +0200 Subject: [PATCH 001/108] Added first pass of self rotation --- .../SecurityCouncilManager.sol | 70 ++++++++++++++++--- .../SecurityCouncilMemberElectionGovernor.sol | 2 +- ...SecurityCouncilNomineeElectionGovernor.sol | 4 +- .../governors/modules/ElectionGovernor.sol | 10 +-- .../interfaces/IElectionGovernor.sol | 15 ++++ .../interfaces/ISecurityCouncilManager.sol | 33 +++++---- ...ISecurityCouncilMemberElectionGovernor.sol | 4 ++ ...SecurityCouncilNomineeElectionGovernor.sol | 11 ++- 8 files changed, 118 insertions(+), 31 deletions(-) create mode 100644 src/security-council-mgmt/interfaces/IElectionGovernor.sol diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index fb03bf742..9449a6b5b 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -11,7 +11,10 @@ import "../UpgradeExecRouteBuilder.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/governance/IGovernorUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol"; import "./Common.sol"; +import "./interfaces/ISecurityCouncilMemberElectionGovernor.sol"; /// @title The Security Council Manager /// @notice The source of truth for an array of Security Councils that are under management. @@ -28,7 +31,8 @@ import "./Common.sol"; contract SecurityCouncilManager is Initializable, AccessControlUpgradeable, - ISecurityCouncilManager + ISecurityCouncilManager, + EIP712Upgradeable { event CohortReplaced(address[] newCohort, Cohort indexed cohort); event MemberAdded(address indexed newMember, Cohort indexed cohort); @@ -76,6 +80,13 @@ contract SecurityCouncilManager is /// @notice Size of cohort under ordinary circumstances uint256 public cohortSize; + /// @notice The timestamp at which the address was last rotated + mapping(address => uint256) lastRotated; + + /// @notice There is a minimum period between when an address can be rotated + /// This is to ensure a single member cannot do many rotations in a row + uint256 public minRotationPeriod; + /// @notice Magic value used by the L1 timelock to indicate that a retryable ticket should be created /// Value is defined in L1ArbitrumTimelock contract https://etherscan.io/address/0xE6841D92B0C345144506576eC13ECf5103aC7f49#readProxyContract#F5 address public constant RETRYABLE_TICKET_MAGIC = 0xa723C008e76E379c55599D2E4d93879BeaFDa79C; @@ -122,6 +133,8 @@ contract SecurityCouncilManager is for (uint256 i = 0; i < _securityCouncils.length; i++) { _addSecurityCouncil(_securityCouncils[i]); } + + __EIP712_init_unchained("SecurityCouncilManager", "1"); } /// @inheritdoc ISecurityCouncilManager @@ -207,14 +220,55 @@ contract SecurityCouncilManager is } /// @inheritdoc ISecurityCouncilManager - function rotateMember(address _currentAddress, address _newAddress) - external - onlyRole(MEMBER_ROTATOR_ROLE) - { - Cohort cohort = _swapMembers(_currentAddress, _newAddress); + function recoverAddMemberMessage(uint256 nonce, bytes calldata signature) public view returns (address) { + bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( + keccak256("addMember(uint256 nonce)"), + nonce + ))); + return ECDSAUpgradeable.recover(digest, signature); + } + + /// @inheritdoc ISecurityCouncilManager + function rotateMember(address memberElectionGovernor, bytes calldata signature) external { + uint256 lastRotatedTimestamp = lastRotated[msg.sender]; + if(block.timestamp < lastRotatedTimestamp + minRotationPeriod) { + revert RotationTooSoon(msg.sender, lastRotatedTimestamp + minRotationPeriod); + } + + // we enforce that a the new address is an eoa in the same way do + // in NomineeGovernor.addContender + address newAddress = recoverAddMemberMessage(updateNonce, signature); + + // the cohort replacer should be the member election governor + // we don't explicitly store the member election governor in this manager + // so we pass it in here and verify it as having the correct role + // since cohort replacing can change any member it's already a trusted entity + if(!hasRole(COHORT_REPLACER_ROLE, memberElectionGovernor)) { + revert GovernorNotReplacer(); + } + // use the member election governor to get the nominee governor + ISecurityCouncilNomineeElectionGovernor nomineeGovernor = ISecurityCouncilMemberElectionGovernor(memberElectionGovernor).nomineeElectionGovernor(); + // election count is increment after proposal, so the current election is electionCount - 1 + // we use this to form the proposal id for that election, and then check isContender + uint256 currentElectionIndex = nomineeGovernor.electionCount() - 1; + ( + address[] memory targets, + uint256[] memory values, + bytes[] memory callDatas, + string memory description + ) = nomineeGovernor.getProposeArgs(currentElectionIndex); + uint256 proposalId = IGovernorUpgradeable(address(nomineeGovernor)).hashProposal(targets, values, callDatas, keccak256(bytes(description))); + // CHRIS: TODO: we could also check what cohort will be replaced by that election, + // : since do allow clashes in the same cohort + if(nomineeGovernor.isContender(proposalId, newAddress)) { + revert NewAddressIsContender(proposalId); + } + + lastRotated[newAddress] = block.timestamp; + Cohort cohort = _swapMembers(msg.sender, newAddress); emit MemberRotated({ - replacedAddress: _currentAddress, - newAddress: _newAddress, + replacedAddress: msg.sender, + newAddress: newAddress, cohort: cohort }); } diff --git a/src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol index 768792d3c..4a4c50850 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol @@ -24,7 +24,7 @@ contract SecurityCouncilMemberElectionGovernor is ElectionGovernor, ISecurityCouncilMemberElectionGovernor { - /// @notice The SecurityCouncilNomineeElectionGovernor that creates proposals for this governor and contains the list of compliant nominees + /// @inheritdoc ISecurityCouncilMemberElectionGovernor ISecurityCouncilNomineeElectionGovernor public nomineeElectionGovernor; /// @notice The SecurityCouncilManager that will execute the election result diff --git a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol index e1eba1a96..a8de757a3 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol @@ -67,7 +67,7 @@ contract SecurityCouncilNomineeElectionGovernor is /// @notice Security council member election governor contract ISecurityCouncilMemberElectionGovernor public securityCouncilMemberElectionGovernor; - /// @notice Number of elections created + /// @inheritdoc ISecurityCouncilNomineeElectionGovernor uint256 public electionCount; /// @notice Maps proposalId to ElectionInfo @@ -422,7 +422,7 @@ contract SecurityCouncilNomineeElectionGovernor is public view virtual - override + override(ISecurityCouncilNomineeElectionGovernor, SecurityCouncilNomineeElectionGovernorCountingUpgradeable) returns (bool) { return _elections[proposalId].isContender[possibleContender]; diff --git a/src/security-council-mgmt/governors/modules/ElectionGovernor.sol b/src/security-council-mgmt/governors/modules/ElectionGovernor.sol index 291ee2228..a174c7ba1 100644 --- a/src/security-council-mgmt/governors/modules/ElectionGovernor.sol +++ b/src/security-council-mgmt/governors/modules/ElectionGovernor.sol @@ -5,9 +5,10 @@ pragma solidity 0.8.16; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/governance/GovernorUpgradeable.sol"; import "../../Common.sol"; +import "../../interfaces/IElectionGovernor.sol"; /// @notice Common functionality used by nominee and member election governors -abstract contract ElectionGovernor is GovernorUpgradeable { +abstract contract ElectionGovernor is GovernorUpgradeable, IElectionGovernor { /// @notice When a vote is cast using a signature we store a hash of the vote data /// so that the signature cannot be replayed mapping(bytes32 => bool) public usedNonces; @@ -54,12 +55,7 @@ abstract contract ElectionGovernor is GovernorUpgradeable { return _castVote(proposalId, voter, support, reason, params); } - /// @notice Generate arguments to be passed to the governor propose function - /// @param electionIndex The index of the election to create a proposal for - /// @return Targets - /// @return Values - /// @return Calldatas - /// @return Description + /// @inheritdoc IElectionGovernor function getProposeArgs(uint256 electionIndex) public pure diff --git a/src/security-council-mgmt/interfaces/IElectionGovernor.sol b/src/security-council-mgmt/interfaces/IElectionGovernor.sol new file mode 100644 index 000000000..ea5f08040 --- /dev/null +++ b/src/security-council-mgmt/interfaces/IElectionGovernor.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.16; + +interface IElectionGovernor { + /// @notice Generate arguments to be passed to the governor propose function + /// @param electionIndex The index of the election to create a proposal for + /// @return Targets + /// @return Values + /// @return Calldatas + /// @return Description + function getProposeArgs(uint256 electionIndex) + external + pure + returns (address[] memory, uint256[] memory, bytes[] memory, string memory); +} \ No newline at end of file diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index 076eadfa8..547613cbf 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -40,6 +40,11 @@ interface ISecurityCouncilManager { error SecurityCouncilNotInManager(SecurityCouncilData securiyCouncilData); error SecurityCouncilAlreadyInRouter(SecurityCouncilData securiyCouncilData); + // rotation errors + error RotationTooSoon(address rotator, uint256 rotatableWhen); + error GovernorNotReplacer(); + error NewAddressIsContender(uint256 proposalId); + /// @notice initialize SecurityCouncilManager. /// @param _firstCohort addresses of first cohort /// @param _secondCohort addresses of second cohort @@ -56,39 +61,43 @@ interface ISecurityCouncilManager { UpgradeExecRouteBuilder _router ) external; /// @notice Replaces a whole cohort. - /// @dev Initiaties cross chain messages to update the individual Security Councils. + /// @dev Initiates cross chain messages to update the individual Security Councils. /// @param _newCohort New cohort members to replace existing cohort. Must have 6 members. /// @param _cohort Cohort to replace. function replaceCohort(address[] memory _newCohort, Cohort _cohort) external; /// @notice Add a member to the specified cohort. /// Cohorts cannot have more than 6 members, so the cohort must have less than 6 in order to call this. /// New member cannot already be a member of either cohort. - /// @dev Initiaties cross chain messages to update the individual Security Councils. + /// @dev Initiates cross chain messages to update the individual Security Councils. /// When adding a member, make sure that the key does not conflict with any contenders/nominees of ongoing elections. /// @param _newMember New member to add /// @param _cohort Cohort to add member to function addMember(address _newMember, Cohort _cohort) external; /// @notice Remove a member. /// @dev Searches both cohorts for the member. - /// Initiaties cross chain messages to update the individual Security Councils + /// Initiates cross chain messages to update the individual Security Councils /// @param _member Member to remove function removeMember(address _member) external; /// @notice Replace a member in a council - equivalent to removing a member, then adding another in its place. - /// Idendities of members should be different. + /// Identities of members should be different. /// Functionality is equivalent to replaceMember, /// though emits a different event to distinguish the security council's intent (different identities). - /// @dev Initiaties cross chain messages to update the individual Security Councils. + /// @dev Initiates cross chain messages to update the individual Security Councils. /// When replacing a member, make sure that the key does not conflict with any contenders/nominees of ongoing electoins. /// @param _memberToReplace Security Council member to remove /// @param _newMember Security Council member to add in their place function replaceMember(address _memberToReplace, address _newMember) external; - /// @notice Security council member can rotate out their address for a new one; _currentAddress and _newAddress should be of the same identity. Functionality is equivalent to replaceMember, tho emits a different event to distinguish the security council's intent (same identity). - /// Rotation must be initiated by the security council. - /// @dev Initiaties cross chain messages to update the individual Security Councils. - /// When rotating a member, make sure that the key does not conflict with any contenders/nominees of ongoing elections. - /// @param _currentAddress Address to rotate out - /// @param _newAddress Address to rotate in - function rotateMember(address _currentAddress, address _newAddress) external; + /// @notice Recover a address from an addMember signed message + /// Used when rotating a member for the new address to be added + /// @param nonce The nonce that was signed + /// @param signature The signature over the addMember(nonce) message + function recoverAddMemberMessage(uint256 nonce, bytes calldata signature) external view returns (address); + /// @notice Security council member can rotate out their address for a new one + /// @dev Initiates cross chain messages to update the individual Security Councils. + /// Cannot rotate to a contender in an ongoing election, as this could cause a clash that would stop the election result executing + /// @param memberElectionGovernor The current member election governor - must have the COHORT_REPLACER_ROLE role + /// @param signature A signature from the new member address over the 712 addMember hash + function rotateMember(address memberElectionGovernor, bytes calldata signature) external; /// @notice Is the account a member of the first cohort function firstCohortIncludes(address account) external view returns (bool); /// @notice Is the account a member of the second cohort diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilMemberElectionGovernor.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilMemberElectionGovernor.sol index c52959502..c1eaf1ca9 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilMemberElectionGovernor.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilMemberElectionGovernor.sol @@ -1,7 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.16; +import "./ISecurityCouncilNomineeElectionGovernor.sol"; + interface ISecurityCouncilMemberElectionGovernor { /// @notice Creates a new member election proposal from the most recent nominee election. function proposeFromNomineeElectionGovernor(uint256 electionIndex) external returns (uint256); + /// @notice The SecurityCouncilNomineeElectionGovernor that creates proposals for this governor and contains the list of compliant nominees + function nomineeElectionGovernor() external returns (ISecurityCouncilNomineeElectionGovernor); } diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol index aadaf74ad..b3bf2127e 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol @@ -1,8 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.16; +import "./IElectionGovernor.sol"; + /// @notice Minimal interface of nominee election governor required by other contracts -interface ISecurityCouncilNomineeElectionGovernor { +interface ISecurityCouncilNomineeElectionGovernor is IElectionGovernor { /// @notice Whether the account a compliant nominee for a given proposal /// A compliant nominee is one who is a nominee, and has not been excluded /// @param proposalId The id of the proposal @@ -11,4 +13,11 @@ interface ISecurityCouncilNomineeElectionGovernor { /// @notice All compliant nominees of a given proposal /// A compliant nominee is one who is a nominee, and has not been excluded function compliantNominees(uint256 proposalId) external view returns (address[] memory); + /// @notice Number of elections created + function electionCount() external returns(uint256); + /// @notice Whether the account is a contender for the proposal + function isContender(uint256 proposalId, address possibleContender) + external + view + returns (bool); } From 168579156459769e082d912a93a107ebe652cbf3 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Fri, 27 Sep 2024 18:39:55 +0200 Subject: [PATCH 002/108] Commented out old rotation test --- .../SecurityCouncilManager.t.sol | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/test/security-council-mgmt/SecurityCouncilManager.t.sol b/test/security-council-mgmt/SecurityCouncilManager.t.sol index c68be6ce6..42e29ffc1 100644 --- a/test/security-council-mgmt/SecurityCouncilManager.t.sol +++ b/test/security-council-mgmt/SecurityCouncilManager.t.sol @@ -338,27 +338,28 @@ contract SecurityCouncilManagerTest is Test { vm.stopPrank(); } - function testRotateMember() public { - vm.startPrank(roles.memberRotator); - vm.recordLogs(); - scm.rotateMember(firstCohort[0], memberToAdd); - checkScheduleWasCalled(); - - address[] memory newFirstCohortArray = new address[](6); - newFirstCohortArray[0] = memberToAdd; - for (uint256 i = 1; i < firstCohort.length; i++) { - newFirstCohortArray[i] = firstCohort[i]; - } - assertTrue( - TestUtil.areUniqueAddressArraysEqual(newFirstCohortArray, scm.getFirstCohort()), - "first cohort rotated" - ); - assertTrue( - TestUtil.areUniqueAddressArraysEqual(secondCohort, scm.getSecondCohort()), - "second cohort untouched" - ); - vm.stopPrank(); - } + // CHRIS: TODO: add tests for new function + // function testRotateMember() public { + // vm.startPrank(roles.memberRotator); + // vm.recordLogs(); + // scm.rotateMember(firstCohort[0], memberToAdd); + // checkScheduleWasCalled(); + + // address[] memory newFirstCohortArray = new address[](6); + // newFirstCohortArray[0] = memberToAdd; + // for (uint256 i = 1; i < firstCohort.length; i++) { + // newFirstCohortArray[i] = firstCohort[i]; + // } + // assertTrue( + // TestUtil.areUniqueAddressArraysEqual(newFirstCohortArray, scm.getFirstCohort()), + // "first cohort rotated" + // ); + // assertTrue( + // TestUtil.areUniqueAddressArraysEqual(secondCohort, scm.getSecondCohort()), + // "second cohort untouched" + // ); + // vm.stopPrank(); + // } function testAddSCAffordances() public { vm.prank(rando); From 68a5a52fd74b079289b4d65cec7b5c722c447fe7 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Wed, 2 Oct 2024 13:16:00 +0200 Subject: [PATCH 003/108] Added tests and min rotation setter --- .../SecurityCouncilManager.sol | 108 +++++-- .../L2SecurityCouncilMgmtFactory.sol | 8 +- .../interfaces/ISecurityCouncilManager.sol | 27 +- ...SecurityCouncilNomineeElectionGovernor.sol | 2 + test/security-council-mgmt/E2E.t.sol | 6 +- .../L2SecurityCouncilMgmtFactory.t.sol | 16 +- .../SecurityCouncilManager.t.sol | 272 ++++++++++++++++-- 7 files changed, 374 insertions(+), 65 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 9449a6b5b..f747c002d 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -16,6 +16,18 @@ import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgra import "./Common.sol"; import "./interfaces/ISecurityCouncilMemberElectionGovernor.sol"; +library ProxyUtil { + function getProxyAdmin() internal view returns (address admin) { + // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0/contracts/proxy/TransparentUpgradeableProxy.sol#L48 + // Storage slot with the admin of the proxy contract. + // This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is + bytes32 slot = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; + assembly { + admin := sload(slot) + } + } +} + /// @title The Security Council Manager /// @notice The source of truth for an array of Security Councils that are under management. /// Can be used to change members, and replace whole cohorts, ensuring that all managed @@ -50,6 +62,7 @@ contract SecurityCouncilManager is uint256 securityCouncilsLength ); event UpgradeExecRouteBuilderSet(address indexed UpgradeExecRouteBuilder); + event MinRotationPeriodSet(uint256 minRotationPeriod); // The Security Council members are separated into two cohorts, allowing a whole cohort to be replaced, as // specified by the Arbitrum Constitution. @@ -81,7 +94,7 @@ contract SecurityCouncilManager is uint256 public cohortSize; /// @notice The timestamp at which the address was last rotated - mapping(address => uint256) lastRotated; + mapping(address => uint256) public lastRotated; /// @notice There is a minimum period between when an address can be rotated /// This is to ensure a single member cannot do many rotations in a row @@ -96,6 +109,7 @@ contract SecurityCouncilManager is bytes32 public constant MEMBER_REPLACER_ROLE = keccak256("MEMBER_REPLACER"); bytes32 public constant MEMBER_ROTATOR_ROLE = keccak256("MEMBER_ROTATOR"); bytes32 public constant MEMBER_REMOVER_ROLE = keccak256("MEMBER_REMOVER"); + bytes32 public constant MIN_ROTATION_PERIOD_SETTER_ROLE = keccak256("MIN_ROATATION_PERIOD_SETTER"); constructor() { _disableInitializers(); @@ -107,7 +121,8 @@ contract SecurityCouncilManager is SecurityCouncilData[] memory _securityCouncils, SecurityCouncilManagerRoles memory _roles, address payable _l2CoreGovTimelock, - UpgradeExecRouteBuilder _router + UpgradeExecRouteBuilder _router, + uint256 _minRotationPeriod ) external initializer { if (_firstCohort.length != _secondCohort.length) { revert CohortLengthMismatch(_firstCohort, _secondCohort); @@ -123,6 +138,7 @@ contract SecurityCouncilManager is } _grantRole(MEMBER_ROTATOR_ROLE, _roles.memberRotator); _grantRole(MEMBER_REPLACER_ROLE, _roles.memberReplacer); + _grantRole(MIN_ROTATION_PERIOD_SETTER_ROLE, _roles.minRotationPeriodSetter); if (!Address.isContract(_l2CoreGovTimelock)) { revert NotAContract({account: _l2CoreGovTimelock}); @@ -134,9 +150,29 @@ contract SecurityCouncilManager is _addSecurityCouncil(_securityCouncils[i]); } + setMinRotationPeriodImpl(_minRotationPeriod); + __EIP712_init_unchained("SecurityCouncilManager", "1"); } + function postUpgradeInit(uint256 _minRotationPeriod, address minRotationPeriodSetter) external { + address proxyAdmin = ProxyUtil.getProxyAdmin(); + require(msg.sender == proxyAdmin, "NOT_FROM_ADMIN"); + + _grantRole(MIN_ROTATION_PERIOD_SETTER_ROLE, minRotationPeriodSetter); + setMinRotationPeriodImpl(_minRotationPeriod); + } + + /// @inheritdoc ISecurityCouncilManager + function setMinRotationPeriod(uint256 _minRotationPeriod) external onlyRole(MIN_ROTATION_PERIOD_SETTER_ROLE) { + setMinRotationPeriodImpl(_minRotationPeriod); + } + + function setMinRotationPeriodImpl(uint256 _minRotationPeriod) internal { + minRotationPeriod = _minRotationPeriod; + emit MinRotationPeriodSet(_minRotationPeriod); + } + /// @inheritdoc ISecurityCouncilManager function replaceCohort(address[] memory _newCohort, Cohort _cohort) external @@ -220,24 +256,30 @@ contract SecurityCouncilManager is } /// @inheritdoc ISecurityCouncilManager - function recoverAddMemberMessage(uint256 nonce, bytes calldata signature) public view returns (address) { - bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( - keccak256("addMember(uint256 nonce)"), + function getRotateMemberHash(address from, uint256 nonce) public view returns(bytes32) { + return _hashTypedDataV4(keccak256(abi.encode( + keccak256("rotateMember(address from, uint256 nonce)"), + from, nonce ))); - return ECDSAUpgradeable.recover(digest, signature); } /// @inheritdoc ISecurityCouncilManager - function rotateMember(address memberElectionGovernor, bytes calldata signature) external { + function rotateMember(address newMemberAddress, address memberElectionGovernor, bytes calldata signature) external { uint256 lastRotatedTimestamp = lastRotated[msg.sender]; - if(block.timestamp < lastRotatedTimestamp + minRotationPeriod) { + if(lastRotatedTimestamp != 0 && block.timestamp < lastRotatedTimestamp + minRotationPeriod) { revert RotationTooSoon(msg.sender, lastRotatedTimestamp + minRotationPeriod); } // we enforce that a the new address is an eoa in the same way do - // in NomineeGovernor.addContender - address newAddress = recoverAddMemberMessage(updateNonce, signature); + // in NomineeGovernor.addContender by requiring a signature + bytes32 digest = getRotateMemberHash(msg.sender, updateNonce); + address newAddress = ECDSAUpgradeable.recover(digest, signature); + // we safety check the new member address is the one that we expect to replace here + // this isn't strictly necessary but it guards agains the case where the wrong sig is accidentally used + if(newAddress != newMemberAddress) { + revert InvalidNewAddress(newAddress); + } // the cohort replacer should be the member election governor // we don't explicitly store the member election governor in this manager @@ -247,21 +289,41 @@ contract SecurityCouncilManager is revert GovernorNotReplacer(); } // use the member election governor to get the nominee governor + // we we'll use that to check if there is a clash between the rotation and an ongoing election ISecurityCouncilNomineeElectionGovernor nomineeGovernor = ISecurityCouncilMemberElectionGovernor(memberElectionGovernor).nomineeElectionGovernor(); - // election count is increment after proposal, so the current election is electionCount - 1 + // election count is incremented after proposal, so the current election is electionCount - 1 // we use this to form the proposal id for that election, and then check isContender - uint256 currentElectionIndex = nomineeGovernor.electionCount() - 1; - ( - address[] memory targets, - uint256[] memory values, - bytes[] memory callDatas, - string memory description - ) = nomineeGovernor.getProposeArgs(currentElectionIndex); - uint256 proposalId = IGovernorUpgradeable(address(nomineeGovernor)).hashProposal(targets, values, callDatas, keccak256(bytes(description))); - // CHRIS: TODO: we could also check what cohort will be replaced by that election, - // : since do allow clashes in the same cohort - if(nomineeGovernor.isContender(proposalId, newAddress)) { - revert NewAddressIsContender(proposalId); + uint256 electionCount = nomineeGovernor.electionCount(); + // if the election count is still zero then no elections have started or taken place + // in that case it is always valid to rotate a member as there can be non clash with contenders + if(electionCount != 0) { + uint256 currentElectionIndex = electionCount - 1; + ( + address[] memory targets, + uint256[] memory values, + bytes[] memory callDatas, + string memory description + ) = nomineeGovernor.getProposeArgs(currentElectionIndex); + uint256 proposalId = IGovernorUpgradeable(address(nomineeGovernor)).hashProposal(targets, values, callDatas, keccak256(bytes(description))); + + // there can only be a clash with an incoming member if there is + // a. an ongoing election + // b. the election is for the other cohort than the member being rotated + // c. the address is a contender in that ongoing election + IGovernorUpgradeable.ProposalState nomineePropState = IGovernorUpgradeable(address(nomineeGovernor)).state(proposalId); + if( + nomineePropState != IGovernorUpgradeable.ProposalState.Executed || (// the proposal is ongoing in nomination phase + nomineePropState == IGovernorUpgradeable.ProposalState.Executed // the proposal has passed nomination phase but is still in member selection phase + && IGovernorUpgradeable(memberElectionGovernor).state(proposalId) != IGovernorUpgradeable.ProposalState.Executed + ) + ) { + Cohort otherCohort = nomineeGovernor.otherCohort(); + if(cohortIncludes(otherCohort, msg.sender)) { + if(nomineeGovernor.isContender(proposalId, newAddress)) { + revert NewMemberIsContender(proposalId, newAddress); + } + } + } } lastRotated[newAddress] = block.timestamp; diff --git a/src/security-council-mgmt/factories/L2SecurityCouncilMgmtFactory.sol b/src/security-council-mgmt/factories/L2SecurityCouncilMgmtFactory.sol index 026158f0c..fd7eaadfb 100644 --- a/src/security-council-mgmt/factories/L2SecurityCouncilMgmtFactory.sol +++ b/src/security-council-mgmt/factories/L2SecurityCouncilMgmtFactory.sol @@ -41,6 +41,8 @@ struct DeployParams { uint256 nomineeVotingPeriod; uint256 memberVotingPeriod; uint256 fullWeightDuration; + uint256 minRotationPeriod; + address minRotationPeriodSetter; } struct ContractImplementations { @@ -152,7 +154,8 @@ contract L2SecurityCouncilMgmtFactory is Ownable { memberAdder: dp.govChainEmergencySecurityCouncil, memberRemovers: memberRemovers, memberRotator: dp.govChainEmergencySecurityCouncil, - memberReplacer: dp.govChainEmergencySecurityCouncil + memberReplacer: dp.govChainEmergencySecurityCouncil, + minRotationPeriodSetter: dp.minRotationPeriodSetter }); deployedContracts.upgradeExecRouteBuilder = new UpgradeExecRouteBuilder({ @@ -175,7 +178,8 @@ contract L2SecurityCouncilMgmtFactory is Ownable { _securityCouncils: dp.securityCouncils, _roles: roles, _l2CoreGovTimelock: payable(dp.l2CoreGovTimelock), - _router: deployedContracts.upgradeExecRouteBuilder + _router: deployedContracts.upgradeExecRouteBuilder, + _minRotationPeriod: dp.minRotationPeriod }); _initRemovalGov( diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index 547613cbf..48770a01e 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -12,6 +12,7 @@ struct SecurityCouncilManagerRoles { address[] memberRemovers; address memberRotator; address memberReplacer; + address minRotationPeriodSetter; } /// @notice Data for a Security Council to be managed @@ -43,7 +44,8 @@ interface ISecurityCouncilManager { // rotation errors error RotationTooSoon(address rotator, uint256 rotatableWhen); error GovernorNotReplacer(); - error NewAddressIsContender(uint256 proposalId); + error NewMemberIsContender(uint256 proposalId, address newMember); + error InvalidNewAddress(address newAddress); /// @notice initialize SecurityCouncilManager. /// @param _firstCohort addresses of first cohort @@ -52,14 +54,20 @@ interface ISecurityCouncilManager { /// @param _roles permissions for triggering modifications to security councils /// @param _l2CoreGovTimelock timelock for core governance / constitutional proposal /// @param _router UpgradeExecRouteBuilder address + /// @param _minRotationPeriod The minimum amount of time that must happen between address rotations by the same council member function initialize( address[] memory _firstCohort, address[] memory _secondCohort, SecurityCouncilData[] memory _securityCouncils, SecurityCouncilManagerRoles memory _roles, address payable _l2CoreGovTimelock, - UpgradeExecRouteBuilder _router + UpgradeExecRouteBuilder _router, + uint256 _minRotationPeriod ) external; + /// @notice Set the min rotation period. This is the minimum period that must occur + /// between two consecutive rotations by the same member + /// @param _minRotationPeriod The new minimum rotation period to be set + function setMinRotationPeriod(uint256 _minRotationPeriod) external; /// @notice Replaces a whole cohort. /// @dev Initiates cross chain messages to update the individual Security Councils. /// @param _newCohort New cohort members to replace existing cohort. Must have 6 members. @@ -87,17 +95,20 @@ interface ISecurityCouncilManager { /// @param _memberToReplace Security Council member to remove /// @param _newMember Security Council member to add in their place function replaceMember(address _memberToReplace, address _newMember) external; - /// @notice Recover a address from an addMember signed message - /// Used when rotating a member for the new address to be added - /// @param nonce The nonce that was signed - /// @param signature The signature over the addMember(nonce) message - function recoverAddMemberMessage(uint256 nonce, bytes calldata signature) external view returns (address); + /// @notice Get the hash to be signed for member rotation + /// @param from The address that will be rotated out. Included in the hash so that other members cant use this message to rotate their address + /// @param nonce The message nonce. Must be equal to the update nonce in the contract at the time of execution + function getRotateMemberHash(address from, uint256 nonce) external view returns(bytes32); /// @notice Security council member can rotate out their address for a new one /// @dev Initiates cross chain messages to update the individual Security Councils. /// Cannot rotate to a contender in an ongoing election, as this could cause a clash that would stop the election result executing + /// Since the signature is over the update nonce, it is understood that other updates can invalidate the signed message, however since + /// other updates are either from the council itself (trusted), the election (infrequent) or another member rotation (also infrequent due + /// to the minRotationPeriod) the invalidation cannot occur often and in those cases the member should sign a new rotation message + /// @param newMemberAddress The new member address to be rotated to /// @param memberElectionGovernor The current member election governor - must have the COHORT_REPLACER_ROLE role /// @param signature A signature from the new member address over the 712 addMember hash - function rotateMember(address memberElectionGovernor, bytes calldata signature) external; + function rotateMember(address newMemberAddress, address memberElectionGovernor, bytes calldata signature) external; /// @notice Is the account a member of the first cohort function firstCohortIncludes(address account) external view returns (bool); /// @notice Is the account a member of the second cohort diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol index b3bf2127e..f2a5fa506 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.16; import "./IElectionGovernor.sol"; +import { Cohort } from "../Common.sol"; /// @notice Minimal interface of nominee election governor required by other contracts interface ISecurityCouncilNomineeElectionGovernor is IElectionGovernor { @@ -20,4 +21,5 @@ interface ISecurityCouncilNomineeElectionGovernor is IElectionGovernor { external view returns (bool); + function otherCohort() external view returns (Cohort); } diff --git a/test/security-council-mgmt/E2E.t.sol b/test/security-council-mgmt/E2E.t.sol index d53809430..9a19231e5 100644 --- a/test/security-council-mgmt/E2E.t.sol +++ b/test/security-council-mgmt/E2E.t.sol @@ -194,7 +194,9 @@ contract E2E is Test, DeployGnosisWithModule { uint256 nomineeVotingPeriod = 51; uint256 memberVotingPeriod = 53; uint256 fullWeightDuration = 39; + uint256 minRotationPeriod = 1 weeks; Date nominationStart = Date(1988, 1, 1, 1); + address minRotationPeriodSetter = address(7766); uint256 chain1Id = 937; uint256 chain2Id = 837; @@ -387,7 +389,9 @@ contract E2E is Test, DeployGnosisWithModule { nomineeQuorumNumerator: nomineeQuorumNumerator, nomineeVotingPeriod: nomineeVotingPeriod, memberVotingPeriod: memberVotingPeriod, - fullWeightDuration: fullWeightDuration + fullWeightDuration: fullWeightDuration, + minRotationPeriod: minRotationPeriod, + minRotationPeriodSetter: minRotationPeriodSetter }); ContractImplementations memory contractImpls = ContractImplementations({ diff --git a/test/security-council-mgmt/L2SecurityCouncilMgmtFactory.t.sol b/test/security-council-mgmt/L2SecurityCouncilMgmtFactory.t.sol index 9aa26e803..25fc8cfae 100644 --- a/test/security-council-mgmt/L2SecurityCouncilMgmtFactory.t.sol +++ b/test/security-council-mgmt/L2SecurityCouncilMgmtFactory.t.sol @@ -52,8 +52,11 @@ contract L2SecurityCouncilMgmtFactoryTest is Test, DeployGnosisWithModule { address firstCohortMember = address(3456); address secondCohortMember = address(7654); + uint256 minRotationPeriod = 1 weeks; + address minRotationPeriodSetter = address(7655); + function getDeployParams() public returns (DeployParams memory deployParams) { - ChainAndUpExecLocation[] memory upgradeExecutors; + ChainAndUpExecLocation[] memory _upgradeExecutors; address[] memory scOwners = new address[](2); scOwners[0] = firstCohortMember; @@ -71,7 +74,7 @@ contract L2SecurityCouncilMgmtFactoryTest is Test, DeployGnosisWithModule { vm.prank(owner); fac = new L2SecurityCouncilMgmtFactory(); return DeployParams({ - upgradeExecutors: upgradeExecutors, + upgradeExecutors: _upgradeExecutors, govChainEmergencySecurityCouncil: govChainEmergencySecurityCouncil, l1ArbitrumTimelock: l1ArbitrumTimelock, l2CoreGovTimelock: l2CoreGovTimelock, @@ -95,7 +98,9 @@ contract L2SecurityCouncilMgmtFactoryTest is Test, DeployGnosisWithModule { nomineeQuorumNumerator: nomineeQuorumNumerator, nomineeVotingPeriod: nomineeVotingPeriod, memberVotingPeriod: memberVotingPeriod, - fullWeightDuration: fullWeightDuration + fullWeightDuration: fullWeightDuration, + minRotationPeriod: minRotationPeriod, + minRotationPeriodSetter: minRotationPeriodSetter }); } @@ -158,6 +163,11 @@ contract L2SecurityCouncilMgmtFactoryTest is Test, DeployGnosisWithModule { ), "memberElectionGovernor has replacer role" ); + assertEq( + securityCouncilManager.minRotationPeriod(), + minRotationPeriod, + "Min rotation period" + ); assertTrue( TestUtil.areUniqueAddressArraysEqual( diff --git a/test/security-council-mgmt/SecurityCouncilManager.t.sol b/test/security-council-mgmt/SecurityCouncilManager.t.sol index 42e29ffc1..b3b41b4da 100644 --- a/test/security-council-mgmt/SecurityCouncilManager.t.sol +++ b/test/security-council-mgmt/SecurityCouncilManager.t.sol @@ -4,10 +4,14 @@ pragma solidity 0.8.16; import "forge-std/Test.sol"; import "../../src/security-council-mgmt/SecurityCouncilManager.sol"; import "../../src/UpgradeExecRouteBuilder.sol"; +import "../../src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol"; +import "../../src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol"; +import "../../src/L2ArbitrumToken.sol"; import "../util/TestUtil.sol"; import "../util/MockArbSys.sol"; import "../../src/security-council-mgmt/Common.sol"; +import "./governors/SecurityCouncilNomineeElectionGovernor.t.sol"; contract MockArbitrumTimelock { event CallScheduled( @@ -20,7 +24,7 @@ contract MockArbitrumTimelock { uint256 delay ); - function getMinDelay() external view returns (uint256) { + function getMinDelay() external pure returns (uint256) { return uint256(123); } @@ -59,6 +63,8 @@ contract SecurityCouncilManagerTest is Test { address[] memberRemovers = new address[](2); address memberRemover1 = address(4444); address memberRemover2 = address(4445); + uint256 minRotationPeriod = 1 weeks; + address minRotationPeriodSetter = address(4450); SecurityCouncilManagerRoles roles = SecurityCouncilManagerRoles({ admin: address(4441), @@ -66,12 +72,17 @@ contract SecurityCouncilManagerTest is Test { memberAdder: address(4443), memberRemovers: memberRemovers, memberRotator: address(4446), - memberReplacer: address(4447) + memberReplacer: address(4447), + minRotationPeriodSetter: minRotationPeriodSetter }); address rando = address(6661); address memberToAdd = address(7771); + uint256 pk1 = 7772; + address memberToRotate1 = vm.addr(pk1); + uint256 pk2 = 7773; + address memberToRotate2 = vm.addr(pk2); address l1ArbitrumTimelock = address(8881); @@ -105,6 +116,10 @@ contract SecurityCouncilManagerTest is Test { address[] bothCohorts; + address memberElectionGovernor; + address nomineeElectionGovernor; + L2ArbitrumToken token; + function setUp() public { chainAndUpExecLocation.push(firstChainAndUpExecLocation); chainAndUpExecLocation.push(secondChainAndUpExecLocation); @@ -125,13 +140,48 @@ contract SecurityCouncilManagerTest is Test { scm = SecurityCouncilManager(payable(prox)); l2CoreGovTimelock = payable(address(new MockArbitrumTimelock())); + token = L2ArbitrumToken(payable(TestUtil.deployProxy(address(new L2ArbitrumToken())))); + token.initialize( + address(137), + 10000000000, + address(this) + ); + + SecurityCouncilMemberElectionGovernor memGov = SecurityCouncilMemberElectionGovernor(payable(TestUtil.deployProxy(address(new SecurityCouncilMemberElectionGovernor())))); + SecurityCouncilNomineeElectionGovernor nomGov = SecurityCouncilNomineeElectionGovernor(payable(TestUtil.deployProxy(address(new SecurityCouncilNomineeElectionGovernor())))); + + SecurityCouncilNomineeElectionGovernor.InitParams memory initParams = SecurityCouncilNomineeElectionGovernor.InitParams( + Date(2000, 1, 1, 1), + 0, + address(0), + scm, + memGov, + token, + address(0), + 20, + 20 + ); + nomGov.initialize(initParams); + memGov.initialize( + nomGov, + scm, + token, + address(10), + 10, + 5 + ); + + roles.cohortUpdator = address(memGov); + memberElectionGovernor = address(memGov); + nomineeElectionGovernor = address(nomGov); + securityCouncils.push(firstSC); - scm.initialize(firstCohort, secondCohort, securityCouncils, roles, l2CoreGovTimelock, uerb); + scm.initialize(firstCohort, secondCohort, securityCouncils, roles, l2CoreGovTimelock, uerb, minRotationPeriod); } function testInitialization() public { vm.expectRevert("Initializable: contract is already initialized"); - scm.initialize(firstCohort, secondCohort, securityCouncils, roles, l2CoreGovTimelock, uerb); + scm.initialize(firstCohort, secondCohort, securityCouncils, roles, l2CoreGovTimelock, uerb, minRotationPeriod); assertTrue( TestUtil.areUniqueAddressArraysEqual(firstCohort, scm.getFirstCohort()), @@ -161,6 +211,7 @@ contract SecurityCouncilManagerTest is Test { "member memberRotator role set" ); assertEq(l2CoreGovTimelock, scm.l2CoreGovTimelock(), "l2CoreGovTimelock set"); + assertEq(minRotationPeriod, scm.minRotationPeriod(), "minRotationPeriod set"); assertEq(address(uerb), address(scm.router()), "exec router set"); } @@ -338,28 +389,193 @@ contract SecurityCouncilManagerTest is Test { vm.stopPrank(); } - // CHRIS: TODO: add tests for new function - // function testRotateMember() public { - // vm.startPrank(roles.memberRotator); - // vm.recordLogs(); - // scm.rotateMember(firstCohort[0], memberToAdd); - // checkScheduleWasCalled(); - - // address[] memory newFirstCohortArray = new address[](6); - // newFirstCohortArray[0] = memberToAdd; - // for (uint256 i = 1; i < firstCohort.length; i++) { - // newFirstCohortArray[i] = firstCohort[i]; - // } - // assertTrue( - // TestUtil.areUniqueAddressArraysEqual(newFirstCohortArray, scm.getFirstCohort()), - // "first cohort rotated" - // ); - // assertTrue( - // TestUtil.areUniqueAddressArraysEqual(secondCohort, scm.getSecondCohort()), - // "second cohort untouched" - // ); - // vm.stopPrank(); - // } + function sign(uint256 privKey, bytes32 h) internal pure returns (bytes memory) { + (uint8 v, bytes32 r, bytes32 s) = vm.sign(privKey, h); + return abi.encodePacked(r, s, v); + } + + function checkCohortChange(address newMember, uint256 index, address[] memory cohort, Cohort c) public { + address[] memory newSecondCohortArray = new address[](6); + for (uint256 i = 0; i < cohort.length; i++) { + newSecondCohortArray[i] = cohort[i]; + } + newSecondCohortArray[index] = newMember; + assertTrue( + TestUtil.areUniqueAddressArraysEqual(newSecondCohortArray, c == Cohort.FIRST ? scm.getFirstCohort() : scm.getSecondCohort() ), + "cohort updated" + ); + } + + function testRotateMember() public { + address originalMember = secondCohort[1]; + uint256 startTime = 5678; + vm.warp(startTime); + + bytes32 digest = scm.getRotateMemberHash(originalMember, scm.updateNonce()); + bytes memory signature = sign(pk1, digest); + uint256 startNonce = scm.updateNonce(); + + vm.expectRevert(abi.encodeWithSelector(ISecurityCouncilManager.InvalidNewAddress.selector, 0x00e6008973a133b0e603275498f18321534c3721f3)); + vm.prank(secondCohort[2]); + scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); + + vm.expectRevert(abi.encodeWithSelector(ISecurityCouncilManager.GovernorNotReplacer.selector)); + vm.prank(originalMember); + scm.rotateMember(memberToRotate1, address(137), signature); + + vm.recordLogs(); + vm.prank(originalMember); + scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); + assertEq(startNonce + 1, scm.updateNonce(), "nonce 1"); + checkScheduleWasCalled(); + checkCohortChange(memberToRotate1, 1, secondCohort, Cohort.SECOND); + assertTrue( + TestUtil.areUniqueAddressArraysEqual(firstCohort, scm.getFirstCohort()), + "first cohort untouched" + ); + assertEq(scm.lastRotated(memberToRotate1), startTime, "Member 1 last rotated"); + + bytes32 digest1 = scm.getRotateMemberHash(memberToRotate1, scm.updateNonce()); + bytes memory signature1 = sign(pk2, digest1); + + vm.expectRevert(abi.encodeWithSelector(ISecurityCouncilManager.RotationTooSoon.selector, memberToRotate1, startTime + minRotationPeriod)); + vm.prank(memberToRotate1); + scm.rotateMember(memberToRotate1, memberElectionGovernor, signature1); + + vm.warp(startTime + minRotationPeriod - 1); + + vm.expectRevert(abi.encodeWithSelector(ISecurityCouncilManager.RotationTooSoon.selector, memberToRotate1, startTime + minRotationPeriod)); + vm.prank(memberToRotate1); + scm.rotateMember(memberToRotate1, memberElectionGovernor, signature1); + + vm.warp(startTime + minRotationPeriod); + + vm.recordLogs(); + vm.prank(memberToRotate1); + scm.rotateMember(memberToRotate2, memberElectionGovernor, signature1); + assertEq(startNonce + 2, scm.updateNonce(), "nonce 2"); + checkScheduleWasCalled(); + checkCohortChange(memberToRotate2, 1, secondCohort, Cohort.SECOND); + assertTrue( + TestUtil.areUniqueAddressArraysEqual(firstCohort, scm.getFirstCohort()), + "first cohort untouched 2" + ); + assertEq(scm.lastRotated(memberToRotate2), startTime + minRotationPeriod, "Member 2 last rotated"); + } + + function addAllContendersVoteAndExecute(uint256 proposalId) public { + SecurityCouncilNomineeElectionGovernor nGov = SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)); + SigUtils sigUtils = new SigUtils(nomineeElectionGovernor); + token.delegate(address(this)); + + for (uint i = 0; i < 6; i++) { + bytes memory sig = sigUtils.signAddContenderMessage(proposalId, i + 1000); + nGov.addContender(proposalId, sig); + } + vm.roll(nGov.proposalDeadline(proposalId)); + for (uint i = 0; i < 6; i++) { + nGov.castVoteWithReasonAndParams({ + proposalId: proposalId, + support: 1, + reason: "", + params: abi.encode(vm.addr(i + 1000), 20000000) + }); + } + vm.roll(SecurityCouncilNomineeElectionGovernorTiming(payable(address(nomineeElectionGovernor))).proposalVettingDeadline(proposalId) + 1); + ( + address[] memory targets, + uint256[] memory values, + bytes[] memory callDatas, + string memory description + ) = nGov.getProposeArgs(nGov.electionCount() - 1); + nGov.execute(targets, values, callDatas, keccak256(bytes(description))); + } + + function testRotateMemberNotContender() public { + address originalMember = secondCohort[1]; + uint256 startTime = SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)).electionToTimestamp(0); + vm.warp(startTime); + + // start an election and add a contender + SigUtils sigUtils = new SigUtils(nomineeElectionGovernor); + uint256 proposalId = SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)).createElection(); + bytes memory sig = sigUtils.signAddContenderMessage(proposalId, pk1); + SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)).addContender(proposalId, sig); + + bytes32 digest = scm.getRotateMemberHash(originalMember, scm.updateNonce()); + bytes memory signature = sign(pk1, digest); + uint256 startNonce = scm.updateNonce(); + + // replace in other cohort in ongoing election does not work + vm.expectRevert(abi.encodeWithSelector(ISecurityCouncilManager.NewMemberIsContender.selector, proposalId, memberToRotate1)); + vm.prank(originalMember); + scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); + + uint256 snap = vm.snapshot(); + // proceeding to the next stage of election still doesnt work + addAllContendersVoteAndExecute(proposalId); + assertEq(uint8(IGovernorUpgradeable(nomineeElectionGovernor).state(proposalId)), uint8(IGovernorUpgradeable.ProposalState.Executed), "Not executed"); + vm.roll(block.number + 1); + assertEq(uint8(IGovernorUpgradeable(memberElectionGovernor).state(proposalId)), uint8(IGovernorUpgradeable.ProposalState.Active), "Not active"); + vm.expectRevert(abi.encodeWithSelector(ISecurityCouncilManager.NewMemberIsContender.selector, proposalId, memberToRotate1)); + vm.prank(originalMember); + scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); + vm.revertTo(snap); + + // replacing that member with one in the same cohort does work + bytes32 digestA = scm.getRotateMemberHash(firstCohort[1], scm.updateNonce()); + bytes memory signatureA = sign(pk1, digestA); + vm.prank(firstCohort[1]); + scm.rotateMember(memberToRotate1, memberElectionGovernor, signatureA); + assertEq(startNonce + 1, scm.updateNonce(), "nonce 1"); + checkCohortChange(memberToRotate1, 1, firstCohort, Cohort.FIRST); + vm.revertTo(snap); + + bytes32 digest1 = scm.getRotateMemberHash(originalMember, scm.updateNonce()); + bytes memory signature1 = sign(pk2, digest1); + + vm.recordLogs(); + vm.prank(originalMember); + scm.rotateMember(memberToRotate2, memberElectionGovernor, signature1); + assertEq(startNonce + 1, scm.updateNonce(), "nonce 1"); + checkScheduleWasCalled(); + checkCohortChange(memberToRotate2, 1, secondCohort, Cohort.SECOND); + assertTrue( + TestUtil.areUniqueAddressArraysEqual(firstCohort, scm.getFirstCohort()), + "first cohort untouched" + ); + assertEq(scm.lastRotated(memberToRotate2), startTime, "Member 1 last rotated"); + } + + event MinRotationPeriodSet(uint256 minRotationPeriod); + + function testPostUpgradeInit() public { + ProxyAdmin pa = new ProxyAdmin(); + SecurityCouncilManager logic = new SecurityCouncilManager(); + SecurityCouncilManager s = SecurityCouncilManager(address(new TransparentUpgradeableProxy(address(logic), address(pa), ""))); + uint256 mr = 25; + address mrs = address(88766); + + vm.expectRevert(); + vm.prank(address(137)); + TransparentUpgradeableProxy(payable(address(s))).upgradeToAndCall(address(logic), abi.encodeCall(s.postUpgradeInit, (mr, mrs))); + + vm.expectEmit(true, true, true, true); + emit MinRotationPeriodSet(mr); + vm.prank(address(pa)); + TransparentUpgradeableProxy(payable(address(s))).upgradeToAndCall(address(logic), abi.encodeCall(s.postUpgradeInit, (mr, mrs))); + assertEq(s.minRotationPeriod(), mr, "Min rotation updated"); + assertTrue(s.hasRole(s.MIN_ROTATION_PERIOD_SETTER_ROLE(), mrs), "Min rotation period setter role"); + } + + function testSetMinRotationPeriod() public { + vm.expectRevert(); + scm.setMinRotationPeriod(27); + + vm.prank(minRotationPeriodSetter); + scm.setMinRotationPeriod(27); + assertEq(scm.minRotationPeriod(), 27, "Min rotation period set"); + } function testAddSCAffordances() public { vm.prank(rando); @@ -394,7 +610,7 @@ contract SecurityCouncilManagerTest is Test { scm.addSecurityCouncil(scToAdd); assertEq(len + 1, scm.securityCouncilsLength(), "confimred new SC added"); - (address scAddress, address action, uint256 chainid) = + (address scAddress,, uint256 chainid) = scm.securityCouncils(scm.securityCouncilsLength() - 1); assertEq(scAddress, scToAdd.securityCouncil, "confimred new SC added"); @@ -483,7 +699,7 @@ contract SecurityCouncilManagerTest is Test { scm.replaceCohort(newCohortWithADup, Cohort.SECOND); } - function testUpdateRouterAffordacnes() public { + function testUpdateRouterAffordances() public { UpgradeExecRouteBuilder newRouter = UpgradeExecRouteBuilder(TestUtil.deployStubContract()); vm.prank(rando); vm.expectRevert(); From 2a30471c51f0d9a4a616c5ca1a19f163404a6d92 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Wed, 2 Oct 2024 13:17:47 +0200 Subject: [PATCH 004/108] Formatting --- .../SecurityCouncilManager.sol | 75 +++++++++++-------- ...SecurityCouncilNomineeElectionGovernor.sol | 24 ++++-- .../interfaces/IElectionGovernor.sol | 4 +- .../interfaces/ISecurityCouncilManager.sol | 8 +- ...SecurityCouncilNomineeElectionGovernor.sol | 4 +- 5 files changed, 70 insertions(+), 45 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index f747c002d..aab1f2180 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -95,7 +95,7 @@ contract SecurityCouncilManager is /// @notice The timestamp at which the address was last rotated mapping(address => uint256) public lastRotated; - + /// @notice There is a minimum period between when an address can be rotated /// This is to ensure a single member cannot do many rotations in a row uint256 public minRotationPeriod; @@ -109,7 +109,8 @@ contract SecurityCouncilManager is bytes32 public constant MEMBER_REPLACER_ROLE = keccak256("MEMBER_REPLACER"); bytes32 public constant MEMBER_ROTATOR_ROLE = keccak256("MEMBER_ROTATOR"); bytes32 public constant MEMBER_REMOVER_ROLE = keccak256("MEMBER_REMOVER"); - bytes32 public constant MIN_ROTATION_PERIOD_SETTER_ROLE = keccak256("MIN_ROATATION_PERIOD_SETTER"); + bytes32 public constant MIN_ROTATION_PERIOD_SETTER_ROLE = + keccak256("MIN_ROATATION_PERIOD_SETTER"); constructor() { _disableInitializers(); @@ -151,11 +152,13 @@ contract SecurityCouncilManager is } setMinRotationPeriodImpl(_minRotationPeriod); - + __EIP712_init_unchained("SecurityCouncilManager", "1"); } - function postUpgradeInit(uint256 _minRotationPeriod, address minRotationPeriodSetter) external { + function postUpgradeInit(uint256 _minRotationPeriod, address minRotationPeriodSetter) + external + { address proxyAdmin = ProxyUtil.getProxyAdmin(); require(msg.sender == proxyAdmin, "NOT_FROM_ADMIN"); @@ -164,7 +167,10 @@ contract SecurityCouncilManager is } /// @inheritdoc ISecurityCouncilManager - function setMinRotationPeriod(uint256 _minRotationPeriod) external onlyRole(MIN_ROTATION_PERIOD_SETTER_ROLE) { + function setMinRotationPeriod(uint256 _minRotationPeriod) + external + onlyRole(MIN_ROTATION_PERIOD_SETTER_ROLE) + { setMinRotationPeriodImpl(_minRotationPeriod); } @@ -256,18 +262,23 @@ contract SecurityCouncilManager is } /// @inheritdoc ISecurityCouncilManager - function getRotateMemberHash(address from, uint256 nonce) public view returns(bytes32) { - return _hashTypedDataV4(keccak256(abi.encode( - keccak256("rotateMember(address from, uint256 nonce)"), - from, - nonce - ))); + function getRotateMemberHash(address from, uint256 nonce) public view returns (bytes32) { + return _hashTypedDataV4( + keccak256( + abi.encode(keccak256("rotateMember(address from, uint256 nonce)"), from, nonce) + ) + ); } /// @inheritdoc ISecurityCouncilManager - function rotateMember(address newMemberAddress, address memberElectionGovernor, bytes calldata signature) external { + function rotateMember( + address newMemberAddress, + address memberElectionGovernor, + bytes calldata signature + ) external { uint256 lastRotatedTimestamp = lastRotated[msg.sender]; - if(lastRotatedTimestamp != 0 && block.timestamp < lastRotatedTimestamp + minRotationPeriod) { + if (lastRotatedTimestamp != 0 && block.timestamp < lastRotatedTimestamp + minRotationPeriod) + { revert RotationTooSoon(msg.sender, lastRotatedTimestamp + minRotationPeriod); } @@ -277,7 +288,7 @@ contract SecurityCouncilManager is address newAddress = ECDSAUpgradeable.recover(digest, signature); // we safety check the new member address is the one that we expect to replace here // this isn't strictly necessary but it guards agains the case where the wrong sig is accidentally used - if(newAddress != newMemberAddress) { + if (newAddress != newMemberAddress) { revert InvalidNewAddress(newAddress); } @@ -285,18 +296,19 @@ contract SecurityCouncilManager is // we don't explicitly store the member election governor in this manager // so we pass it in here and verify it as having the correct role // since cohort replacing can change any member it's already a trusted entity - if(!hasRole(COHORT_REPLACER_ROLE, memberElectionGovernor)) { + if (!hasRole(COHORT_REPLACER_ROLE, memberElectionGovernor)) { revert GovernorNotReplacer(); } // use the member election governor to get the nominee governor // we we'll use that to check if there is a clash between the rotation and an ongoing election - ISecurityCouncilNomineeElectionGovernor nomineeGovernor = ISecurityCouncilMemberElectionGovernor(memberElectionGovernor).nomineeElectionGovernor(); + ISecurityCouncilNomineeElectionGovernor nomineeGovernor = + ISecurityCouncilMemberElectionGovernor(memberElectionGovernor).nomineeElectionGovernor(); // election count is incremented after proposal, so the current election is electionCount - 1 // we use this to form the proposal id for that election, and then check isContender uint256 electionCount = nomineeGovernor.electionCount(); // if the election count is still zero then no elections have started or taken place // in that case it is always valid to rotate a member as there can be non clash with contenders - if(electionCount != 0) { + if (electionCount != 0) { uint256 currentElectionIndex = electionCount - 1; ( address[] memory targets, @@ -304,22 +316,27 @@ contract SecurityCouncilManager is bytes[] memory callDatas, string memory description ) = nomineeGovernor.getProposeArgs(currentElectionIndex); - uint256 proposalId = IGovernorUpgradeable(address(nomineeGovernor)).hashProposal(targets, values, callDatas, keccak256(bytes(description))); + uint256 proposalId = IGovernorUpgradeable(address(nomineeGovernor)).hashProposal( + targets, values, callDatas, keccak256(bytes(description)) + ); // there can only be a clash with an incoming member if there is // a. an ongoing election // b. the election is for the other cohort than the member being rotated // c. the address is a contender in that ongoing election - IGovernorUpgradeable.ProposalState nomineePropState = IGovernorUpgradeable(address(nomineeGovernor)).state(proposalId); - if( - nomineePropState != IGovernorUpgradeable.ProposalState.Executed || (// the proposal is ongoing in nomination phase - nomineePropState == IGovernorUpgradeable.ProposalState.Executed // the proposal has passed nomination phase but is still in member selection phase - && IGovernorUpgradeable(memberElectionGovernor).state(proposalId) != IGovernorUpgradeable.ProposalState.Executed - ) + IGovernorUpgradeable.ProposalState nomineePropState = + IGovernorUpgradeable(address(nomineeGovernor)).state(proposalId); + if ( + nomineePropState != IGovernorUpgradeable.ProposalState.Executed // the proposal is ongoing in nomination phase + || ( + nomineePropState == IGovernorUpgradeable.ProposalState.Executed // the proposal has passed nomination phase but is still in member selection phase + && IGovernorUpgradeable(memberElectionGovernor).state(proposalId) + != IGovernorUpgradeable.ProposalState.Executed + ) ) { Cohort otherCohort = nomineeGovernor.otherCohort(); - if(cohortIncludes(otherCohort, msg.sender)) { - if(nomineeGovernor.isContender(proposalId, newAddress)) { + if (cohortIncludes(otherCohort, msg.sender)) { + if (nomineeGovernor.isContender(proposalId, newAddress)) { revert NewMemberIsContender(proposalId, newAddress); } } @@ -328,11 +345,7 @@ contract SecurityCouncilManager is lastRotated[newAddress] = block.timestamp; Cohort cohort = _swapMembers(msg.sender, newAddress); - emit MemberRotated({ - replacedAddress: msg.sender, - newAddress: newAddress, - cohort: cohort - }); + emit MemberRotated({replacedAddress: msg.sender, newAddress: newAddress, cohort: cohort}); } function _swapMembers(address _addressToRemove, address _addressToAdd) diff --git a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol index a8de757a3..616bfa9a1 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol @@ -422,18 +422,24 @@ contract SecurityCouncilNomineeElectionGovernor is public view virtual - override(ISecurityCouncilNomineeElectionGovernor, SecurityCouncilNomineeElectionGovernorCountingUpgradeable) + override( + ISecurityCouncilNomineeElectionGovernor, + SecurityCouncilNomineeElectionGovernorCountingUpgradeable + ) returns (bool) { return _elections[proposalId].isContender[possibleContender]; } /// @notice Recover EIP712 signature for `AddContenderMessage` - function recoverAddContenderMessage(uint256 proposalId, bytes calldata signature) public view returns (address) { - bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( - keccak256("AddContenderMessage(uint256 proposalId)"), - proposalId - ))); + function recoverAddContenderMessage(uint256 proposalId, bytes calldata signature) + public + view + returns (address) + { + bytes32 digest = _hashTypedDataV4( + keccak256(abi.encode(keccak256("AddContenderMessage(uint256 proposalId)"), proposalId)) + ); return ECDSAUpgradeable.recover(digest, signature); } @@ -490,10 +496,12 @@ contract SecurityCouncilNomineeElectionGovernor is } /// @notice Deprecated, use `addContender(uint256 proposalId, bytes calldata signature)` instead - /// @dev This function is deprecated because contenders should only be EOA's that can produce signatures. + /// @dev This function is deprecated because contenders should only be EOA's that can produce signatures. /// If a security council member's address is not an EOA, then they may be unable to sign on all relevant chains. function addContender(uint256) external pure { - revert Deprecated("addContender(uint256 proposalId) has been deprecated. Use addContender(uint256 proposalId, bytes calldata signature) instead"); + revert Deprecated( + "addContender(uint256 proposalId) has been deprecated. Use addContender(uint256 proposalId, bytes calldata signature) instead" + ); } /** diff --git a/src/security-council-mgmt/interfaces/IElectionGovernor.sol b/src/security-council-mgmt/interfaces/IElectionGovernor.sol index ea5f08040..d898bcfe6 100644 --- a/src/security-council-mgmt/interfaces/IElectionGovernor.sol +++ b/src/security-council-mgmt/interfaces/IElectionGovernor.sol @@ -11,5 +11,5 @@ interface IElectionGovernor { function getProposeArgs(uint256 electionIndex) external pure - returns (address[] memory, uint256[] memory, bytes[] memory, string memory); -} \ No newline at end of file + returns (address[] memory, uint256[] memory, bytes[] memory, string memory); +} diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index 48770a01e..38a1fadbb 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -98,7 +98,7 @@ interface ISecurityCouncilManager { /// @notice Get the hash to be signed for member rotation /// @param from The address that will be rotated out. Included in the hash so that other members cant use this message to rotate their address /// @param nonce The message nonce. Must be equal to the update nonce in the contract at the time of execution - function getRotateMemberHash(address from, uint256 nonce) external view returns(bytes32); + function getRotateMemberHash(address from, uint256 nonce) external view returns (bytes32); /// @notice Security council member can rotate out their address for a new one /// @dev Initiates cross chain messages to update the individual Security Councils. /// Cannot rotate to a contender in an ongoing election, as this could cause a clash that would stop the election result executing @@ -108,7 +108,11 @@ interface ISecurityCouncilManager { /// @param newMemberAddress The new member address to be rotated to /// @param memberElectionGovernor The current member election governor - must have the COHORT_REPLACER_ROLE role /// @param signature A signature from the new member address over the 712 addMember hash - function rotateMember(address newMemberAddress, address memberElectionGovernor, bytes calldata signature) external; + function rotateMember( + address newMemberAddress, + address memberElectionGovernor, + bytes calldata signature + ) external; /// @notice Is the account a member of the first cohort function firstCohortIncludes(address account) external view returns (bool); /// @notice Is the account a member of the second cohort diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol index f2a5fa506..3d97248be 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.16; import "./IElectionGovernor.sol"; -import { Cohort } from "../Common.sol"; +import {Cohort} from "../Common.sol"; /// @notice Minimal interface of nominee election governor required by other contracts interface ISecurityCouncilNomineeElectionGovernor is IElectionGovernor { @@ -15,7 +15,7 @@ interface ISecurityCouncilNomineeElectionGovernor is IElectionGovernor { /// A compliant nominee is one who is a nominee, and has not been excluded function compliantNominees(uint256 proposalId) external view returns (address[] memory); /// @notice Number of elections created - function electionCount() external returns(uint256); + function electionCount() external returns (uint256); /// @notice Whether the account is a contender for the proposal function isContender(uint256 proposalId, address possibleContender) external From 30f79ebe564897019ec624cdc743189228357761 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Wed, 2 Oct 2024 13:18:38 +0200 Subject: [PATCH 005/108] Formatted tests --- test/security-council-mgmt/E2E.t.sol | 12 +- .../L2SecurityCouncilMgmtFactory.t.sol | 4 +- .../SecurityCouncilManager.t.sol | 173 ++++++++++++------ ...ecurityCouncilMemberElectionGovernor.t.sol | 4 +- ...curityCouncilNomineeElectionGovernor.t.sol | 45 +++-- .../governors/TopNomineesGas.t.sol | 10 +- 6 files changed, 151 insertions(+), 97 deletions(-) diff --git a/test/security-council-mgmt/E2E.t.sol b/test/security-council-mgmt/E2E.t.sol index 9a19231e5..121f0831e 100644 --- a/test/security-council-mgmt/E2E.t.sol +++ b/test/security-council-mgmt/E2E.t.sol @@ -113,8 +113,6 @@ contract E2E is Test, DeployGnosisWithModule { address member17 = vm.addr(653); address member18 = vm.addr(654); - - address[] members = [ member1, member2, @@ -254,11 +252,7 @@ contract E2E is Test, DeployGnosisWithModule { UpgradeExecutor novaExecutorLogic = new UpgradeExecutor(); UpgradeExecutor novaExecutor = UpgradeExecutor( address( - new TransparentUpgradeableProxy( - address(novaExecutorLogic), - address(novaAdmin), - "" - ) + new TransparentUpgradeableProxy(address(novaExecutorLogic), address(novaAdmin), "") ) ); address[] memory executors = new address[](2); @@ -458,7 +452,9 @@ contract E2E is Test, DeployGnosisWithModule { SigUtils sigUtils = new SigUtils(address(vars.secDeployedContracts.nomineeElectionGovernor)); for (uint256 i = 0; i < newCohort1.length; i++) { uint256 pk = 649 + i; // member 13 - 18 priv keys - vars.secDeployedContracts.nomineeElectionGovernor.addContender(propId, sigUtils.signAddContenderMessage(propId, pk)); + vars.secDeployedContracts.nomineeElectionGovernor.addContender( + propId, sigUtils.signAddContenderMessage(propId, pk) + ); } // vote for them diff --git a/test/security-council-mgmt/L2SecurityCouncilMgmtFactory.t.sol b/test/security-council-mgmt/L2SecurityCouncilMgmtFactory.t.sol index 25fc8cfae..5d8b20b51 100644 --- a/test/security-council-mgmt/L2SecurityCouncilMgmtFactory.t.sol +++ b/test/security-council-mgmt/L2SecurityCouncilMgmtFactory.t.sol @@ -164,9 +164,7 @@ contract L2SecurityCouncilMgmtFactoryTest is Test, DeployGnosisWithModule { "memberElectionGovernor has replacer role" ); assertEq( - securityCouncilManager.minRotationPeriod(), - minRotationPeriod, - "Min rotation period" + securityCouncilManager.minRotationPeriod(), minRotationPeriod, "Min rotation period" ); assertTrue( diff --git a/test/security-council-mgmt/SecurityCouncilManager.t.sol b/test/security-council-mgmt/SecurityCouncilManager.t.sol index b3b41b4da..08fba128c 100644 --- a/test/security-council-mgmt/SecurityCouncilManager.t.sol +++ b/test/security-council-mgmt/SecurityCouncilManager.t.sol @@ -124,7 +124,7 @@ contract SecurityCouncilManagerTest is Test { chainAndUpExecLocation.push(firstChainAndUpExecLocation); chainAndUpExecLocation.push(secondChainAndUpExecLocation); uerb = new UpgradeExecRouteBuilder({ - _upgradeExecutors:chainAndUpExecLocation, + _upgradeExecutors: chainAndUpExecLocation, _l1ArbitrumTimelock: l1ArbitrumTimelock, _l1TimelockMinDelay: l1TimelockMinDelay }); @@ -141,47 +141,49 @@ contract SecurityCouncilManagerTest is Test { l2CoreGovTimelock = payable(address(new MockArbitrumTimelock())); token = L2ArbitrumToken(payable(TestUtil.deployProxy(address(new L2ArbitrumToken())))); - token.initialize( - address(137), - 10000000000, - address(this) - ); - - SecurityCouncilMemberElectionGovernor memGov = SecurityCouncilMemberElectionGovernor(payable(TestUtil.deployProxy(address(new SecurityCouncilMemberElectionGovernor())))); - SecurityCouncilNomineeElectionGovernor nomGov = SecurityCouncilNomineeElectionGovernor(payable(TestUtil.deployProxy(address(new SecurityCouncilNomineeElectionGovernor())))); - - SecurityCouncilNomineeElectionGovernor.InitParams memory initParams = SecurityCouncilNomineeElectionGovernor.InitParams( - Date(2000, 1, 1, 1), - 0, - address(0), - scm, - memGov, - token, - address(0), - 20, - 20 + token.initialize(address(137), 10_000_000_000, address(this)); + + SecurityCouncilMemberElectionGovernor memGov = SecurityCouncilMemberElectionGovernor( + payable(TestUtil.deployProxy(address(new SecurityCouncilMemberElectionGovernor()))) ); - nomGov.initialize(initParams); - memGov.initialize( - nomGov, - scm, - token, - address(10), - 10, - 5 + SecurityCouncilNomineeElectionGovernor nomGov = SecurityCouncilNomineeElectionGovernor( + payable(TestUtil.deployProxy(address(new SecurityCouncilNomineeElectionGovernor()))) + ); + + SecurityCouncilNomineeElectionGovernor.InitParams memory initParams = + SecurityCouncilNomineeElectionGovernor.InitParams( + Date(2000, 1, 1, 1), 0, address(0), scm, memGov, token, address(0), 20, 20 ); + nomGov.initialize(initParams); + memGov.initialize(nomGov, scm, token, address(10), 10, 5); roles.cohortUpdator = address(memGov); memberElectionGovernor = address(memGov); nomineeElectionGovernor = address(nomGov); securityCouncils.push(firstSC); - scm.initialize(firstCohort, secondCohort, securityCouncils, roles, l2CoreGovTimelock, uerb, minRotationPeriod); + scm.initialize( + firstCohort, + secondCohort, + securityCouncils, + roles, + l2CoreGovTimelock, + uerb, + minRotationPeriod + ); } function testInitialization() public { vm.expectRevert("Initializable: contract is already initialized"); - scm.initialize(firstCohort, secondCohort, securityCouncils, roles, l2CoreGovTimelock, uerb, minRotationPeriod); + scm.initialize( + firstCohort, + secondCohort, + securityCouncils, + roles, + l2CoreGovTimelock, + uerb, + minRotationPeriod + ); assertTrue( TestUtil.areUniqueAddressArraysEqual(firstCohort, scm.getFirstCohort()), @@ -394,14 +396,19 @@ contract SecurityCouncilManagerTest is Test { return abi.encodePacked(r, s, v); } - function checkCohortChange(address newMember, uint256 index, address[] memory cohort, Cohort c) public { + function checkCohortChange(address newMember, uint256 index, address[] memory cohort, Cohort c) + public + { address[] memory newSecondCohortArray = new address[](6); for (uint256 i = 0; i < cohort.length; i++) { newSecondCohortArray[i] = cohort[i]; } newSecondCohortArray[index] = newMember; assertTrue( - TestUtil.areUniqueAddressArraysEqual(newSecondCohortArray, c == Cohort.FIRST ? scm.getFirstCohort() : scm.getSecondCohort() ), + TestUtil.areUniqueAddressArraysEqual( + newSecondCohortArray, + c == Cohort.FIRST ? scm.getFirstCohort() : scm.getSecondCohort() + ), "cohort updated" ); } @@ -415,11 +422,18 @@ contract SecurityCouncilManagerTest is Test { bytes memory signature = sign(pk1, digest); uint256 startNonce = scm.updateNonce(); - vm.expectRevert(abi.encodeWithSelector(ISecurityCouncilManager.InvalidNewAddress.selector, 0x00e6008973a133b0e603275498f18321534c3721f3)); + vm.expectRevert( + abi.encodeWithSelector( + ISecurityCouncilManager.InvalidNewAddress.selector, + 0x00e6008973a133b0e603275498f18321534c3721f3 + ) + ); vm.prank(secondCohort[2]); scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); - vm.expectRevert(abi.encodeWithSelector(ISecurityCouncilManager.GovernorNotReplacer.selector)); + vm.expectRevert( + abi.encodeWithSelector(ISecurityCouncilManager.GovernorNotReplacer.selector) + ); vm.prank(originalMember); scm.rotateMember(memberToRotate1, address(137), signature); @@ -438,13 +452,25 @@ contract SecurityCouncilManagerTest is Test { bytes32 digest1 = scm.getRotateMemberHash(memberToRotate1, scm.updateNonce()); bytes memory signature1 = sign(pk2, digest1); - vm.expectRevert(abi.encodeWithSelector(ISecurityCouncilManager.RotationTooSoon.selector, memberToRotate1, startTime + minRotationPeriod)); + vm.expectRevert( + abi.encodeWithSelector( + ISecurityCouncilManager.RotationTooSoon.selector, + memberToRotate1, + startTime + minRotationPeriod + ) + ); vm.prank(memberToRotate1); scm.rotateMember(memberToRotate1, memberElectionGovernor, signature1); vm.warp(startTime + minRotationPeriod - 1); - vm.expectRevert(abi.encodeWithSelector(ISecurityCouncilManager.RotationTooSoon.selector, memberToRotate1, startTime + minRotationPeriod)); + vm.expectRevert( + abi.encodeWithSelector( + ISecurityCouncilManager.RotationTooSoon.selector, + memberToRotate1, + startTime + minRotationPeriod + ) + ); vm.prank(memberToRotate1); scm.rotateMember(memberToRotate1, memberElectionGovernor, signature1); @@ -460,28 +486,34 @@ contract SecurityCouncilManagerTest is Test { TestUtil.areUniqueAddressArraysEqual(firstCohort, scm.getFirstCohort()), "first cohort untouched 2" ); - assertEq(scm.lastRotated(memberToRotate2), startTime + minRotationPeriod, "Member 2 last rotated"); + assertEq( + scm.lastRotated(memberToRotate2), startTime + minRotationPeriod, "Member 2 last rotated" + ); } function addAllContendersVoteAndExecute(uint256 proposalId) public { - SecurityCouncilNomineeElectionGovernor nGov = SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)); + SecurityCouncilNomineeElectionGovernor nGov = + SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)); SigUtils sigUtils = new SigUtils(nomineeElectionGovernor); token.delegate(address(this)); - for (uint i = 0; i < 6; i++) { + for (uint256 i = 0; i < 6; i++) { bytes memory sig = sigUtils.signAddContenderMessage(proposalId, i + 1000); nGov.addContender(proposalId, sig); } vm.roll(nGov.proposalDeadline(proposalId)); - for (uint i = 0; i < 6; i++) { + for (uint256 i = 0; i < 6; i++) { nGov.castVoteWithReasonAndParams({ proposalId: proposalId, support: 1, reason: "", - params: abi.encode(vm.addr(i + 1000), 20000000) - }); + params: abi.encode(vm.addr(i + 1000), 20_000_000) + }); } - vm.roll(SecurityCouncilNomineeElectionGovernorTiming(payable(address(nomineeElectionGovernor))).proposalVettingDeadline(proposalId) + 1); + vm.roll( + SecurityCouncilNomineeElectionGovernorTiming(payable(address(nomineeElectionGovernor))) + .proposalVettingDeadline(proposalId) + 1 + ); ( address[] memory targets, uint256[] memory values, @@ -493,31 +525,52 @@ contract SecurityCouncilManagerTest is Test { function testRotateMemberNotContender() public { address originalMember = secondCohort[1]; - uint256 startTime = SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)).electionToTimestamp(0); + uint256 startTime = SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)) + .electionToTimestamp(0); vm.warp(startTime); // start an election and add a contender SigUtils sigUtils = new SigUtils(nomineeElectionGovernor); - uint256 proposalId = SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)).createElection(); + uint256 proposalId = SecurityCouncilNomineeElectionGovernor( + payable(nomineeElectionGovernor) + ).createElection(); bytes memory sig = sigUtils.signAddContenderMessage(proposalId, pk1); - SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)).addContender(proposalId, sig); + SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)).addContender( + proposalId, sig + ); bytes32 digest = scm.getRotateMemberHash(originalMember, scm.updateNonce()); bytes memory signature = sign(pk1, digest); uint256 startNonce = scm.updateNonce(); // replace in other cohort in ongoing election does not work - vm.expectRevert(abi.encodeWithSelector(ISecurityCouncilManager.NewMemberIsContender.selector, proposalId, memberToRotate1)); + vm.expectRevert( + abi.encodeWithSelector( + ISecurityCouncilManager.NewMemberIsContender.selector, proposalId, memberToRotate1 + ) + ); vm.prank(originalMember); scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); uint256 snap = vm.snapshot(); // proceeding to the next stage of election still doesnt work addAllContendersVoteAndExecute(proposalId); - assertEq(uint8(IGovernorUpgradeable(nomineeElectionGovernor).state(proposalId)), uint8(IGovernorUpgradeable.ProposalState.Executed), "Not executed"); + assertEq( + uint8(IGovernorUpgradeable(nomineeElectionGovernor).state(proposalId)), + uint8(IGovernorUpgradeable.ProposalState.Executed), + "Not executed" + ); vm.roll(block.number + 1); - assertEq(uint8(IGovernorUpgradeable(memberElectionGovernor).state(proposalId)), uint8(IGovernorUpgradeable.ProposalState.Active), "Not active"); - vm.expectRevert(abi.encodeWithSelector(ISecurityCouncilManager.NewMemberIsContender.selector, proposalId, memberToRotate1)); + assertEq( + uint8(IGovernorUpgradeable(memberElectionGovernor).state(proposalId)), + uint8(IGovernorUpgradeable.ProposalState.Active), + "Not active" + ); + vm.expectRevert( + abi.encodeWithSelector( + ISecurityCouncilManager.NewMemberIsContender.selector, proposalId, memberToRotate1 + ) + ); vm.prank(originalMember); scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); vm.revertTo(snap); @@ -552,20 +605,28 @@ contract SecurityCouncilManagerTest is Test { function testPostUpgradeInit() public { ProxyAdmin pa = new ProxyAdmin(); SecurityCouncilManager logic = new SecurityCouncilManager(); - SecurityCouncilManager s = SecurityCouncilManager(address(new TransparentUpgradeableProxy(address(logic), address(pa), ""))); + SecurityCouncilManager s = SecurityCouncilManager( + address(new TransparentUpgradeableProxy(address(logic), address(pa), "")) + ); uint256 mr = 25; - address mrs = address(88766); - + address mrs = address(88_766); + vm.expectRevert(); vm.prank(address(137)); - TransparentUpgradeableProxy(payable(address(s))).upgradeToAndCall(address(logic), abi.encodeCall(s.postUpgradeInit, (mr, mrs))); + TransparentUpgradeableProxy(payable(address(s))).upgradeToAndCall( + address(logic), abi.encodeCall(s.postUpgradeInit, (mr, mrs)) + ); vm.expectEmit(true, true, true, true); emit MinRotationPeriodSet(mr); vm.prank(address(pa)); - TransparentUpgradeableProxy(payable(address(s))).upgradeToAndCall(address(logic), abi.encodeCall(s.postUpgradeInit, (mr, mrs))); + TransparentUpgradeableProxy(payable(address(s))).upgradeToAndCall( + address(logic), abi.encodeCall(s.postUpgradeInit, (mr, mrs)) + ); assertEq(s.minRotationPeriod(), mr, "Min rotation updated"); - assertTrue(s.hasRole(s.MIN_ROTATION_PERIOD_SETTER_ROLE(), mrs), "Min rotation period setter role"); + assertTrue( + s.hasRole(s.MIN_ROTATION_PERIOD_SETTER_ROLE(), mrs), "Min rotation period setter role" + ); } function testSetMinRotationPeriod() public { diff --git a/test/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.t.sol b/test/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.t.sol index eadef41e0..31007ea20 100644 --- a/test/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.t.sol +++ b/test/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.t.sol @@ -875,9 +875,7 @@ contract SecurityCouncilMemberElectionGovernorTest is Test { return SecurityCouncilMemberElectionGovernor( payable( new TransparentUpgradeableProxy( - address(new SecurityCouncilMemberElectionGovernor()), - proxyAdmin, - bytes("") + address(new SecurityCouncilMemberElectionGovernor()), proxyAdmin, bytes("") ) ) ); diff --git a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol index a67dfd2df..7cb019024 100644 --- a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol +++ b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol @@ -13,45 +13,54 @@ import "../../../src/security-council-mgmt/Common.sol"; contract SigUtils is Test { bytes32 private constant _HASHED_NAME = keccak256("SecurityCouncilNomineeElectionGovernor"); bytes32 private constant _HASHED_VERSION = keccak256("1"); - bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); + bytes32 private constant _TYPE_HASH = keccak256( + "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" + ); address private immutable _VERIFIER; constructor(address verifier) { _VERIFIER = verifier; } - function signAddContenderMessage(uint256 proposalId, uint256 privKey) public view returns (bytes memory sig) { - bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( - keccak256("AddContenderMessage(uint256 proposalId)"), - proposalId - ))); + function signAddContenderMessage(uint256 proposalId, uint256 privKey) + public + view + returns (bytes memory sig) + { + bytes32 digest = _hashTypedDataV4( + keccak256(abi.encode(keccak256("AddContenderMessage(uint256 proposalId)"), proposalId)) + ); (uint8 v, bytes32 r, bytes32 s) = vm.sign(privKey, digest); sig = abi.encodePacked(r, s, v); } + function _domainSeparatorV4() internal view returns (bytes32) { return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash()); } - function _buildDomainSeparator( - bytes32 typeHash, - bytes32 nameHash, - bytes32 versionHash - ) private view returns (bytes32) { + + function _buildDomainSeparator(bytes32 typeHash, bytes32 nameHash, bytes32 versionHash) + private + view + returns (bytes32) + { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, _VERIFIER)); } + function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash); } - function _EIP712NameHash() internal virtual view returns (bytes32) { + + function _EIP712NameHash() internal view virtual returns (bytes32) { return _HASHED_NAME; } - function _EIP712VersionHash() internal virtual view returns (bytes32) { + + function _EIP712VersionHash() internal view virtual returns (bytes32) { return _HASHED_VERSION; } } - contract SecurityCouncilNomineeElectionGovernorTest is Test { SecurityCouncilNomineeElectionGovernor governor; @@ -65,7 +74,7 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { securityCouncilManager: ISecurityCouncilManager(address(0x22)), securityCouncilMemberElectionGovernor: ISecurityCouncilMemberElectionGovernor( payable(address(0x33)) - ), + ), token: IVotesUpgradeable(address(0x44)), owner: address(0x55), quorumNumeratorValue: 20, @@ -770,7 +779,7 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { vm.expectRevert( abi.encodeWithSelector(SecurityCouncilNomineeElectionGovernor.ProposeDisabled.selector) ); - governor.propose(new address[](1), new uint[](1), new bytes[](1), ""); + governor.propose(new address[](1), new uint256[](1), new bytes[](1), ""); } function testCastVoteReverts() public { @@ -949,9 +958,7 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { return SecurityCouncilNomineeElectionGovernor( payable( new TransparentUpgradeableProxy( - address(new SecurityCouncilNomineeElectionGovernor()), - proxyAdmin, - bytes("") + address(new SecurityCouncilNomineeElectionGovernor()), proxyAdmin, bytes("") ) ) ); diff --git a/test/security-council-mgmt/governors/TopNomineesGas.t.sol b/test/security-council-mgmt/governors/TopNomineesGas.t.sol index 207792f4d..7e2873e1c 100644 --- a/test/security-council-mgmt/governors/TopNomineesGas.t.sol +++ b/test/security-council-mgmt/governors/TopNomineesGas.t.sol @@ -22,7 +22,7 @@ contract TopNomineesGasTest is Test { securityCouncilManager: ISecurityCouncilManager(address(0x22)), securityCouncilMemberElectionGovernor: ISecurityCouncilMemberElectionGovernor( payable(address(0x33)) - ), + ), token: IVotesUpgradeable(address(0x44)), owner: address(0x55), quorumNumeratorValue: 10_000 / N, @@ -154,13 +154,7 @@ contract TopNomineesGasTest is Test { } function _deployProxy(address impl) internal returns (address) { - return address( - new TransparentUpgradeableProxy( - impl, - proxyAdmin, - bytes("") - ) - ); + return address(new TransparentUpgradeableProxy(impl, proxyAdmin, bytes(""))); } function _mockGetPastVotes(address account, uint256 votes) internal { From e6e3c80a5350b4fb728f00edfa11bc4b3ae82100 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Wed, 2 Oct 2024 13:21:38 +0200 Subject: [PATCH 006/108] Updated snapshot --- test/security-council-mgmt/.gas-snapshot | 250 +++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 test/security-council-mgmt/.gas-snapshot diff --git a/test/security-council-mgmt/.gas-snapshot b/test/security-council-mgmt/.gas-snapshot new file mode 100644 index 000000000..de93dd32b --- /dev/null +++ b/test/security-council-mgmt/.gas-snapshot @@ -0,0 +1,250 @@ +AIP1Point2ActionTest:testAction() (gas: 629328) +AIPNovaFeeRoutingActionTest:testAction() (gas: 3074) +ArbitrumDAOConstitutionTest:testConstructor() (gas: 259383) +ArbitrumDAOConstitutionTest:testMonOwnerCannotSetHash() (gas: 262836) +ArbitrumDAOConstitutionTest:testOwnerCanSetHash() (gas: 261148) +ArbitrumDAOConstitutionTest:testOwnerCanSetHashTwice() (gas: 263824) +ArbitrumFoundationVestingWalletTest:testBeneficiaryCanSetBeneficiary() (gas: 16332093) +ArbitrumFoundationVestingWalletTest:testMigrateEthToNewWalletWithSlowerVesting() (gas: 19243747) +ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithFasterVesting() (gas: 19247090) +ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithSlowerVesting() (gas: 19247035) +ArbitrumFoundationVestingWalletTest:testMigrationTargetMustBeContract() (gas: 16335426) +ArbitrumFoundationVestingWalletTest:testOnlyBeneficiaryCanRelease() (gas: 16327408) +ArbitrumFoundationVestingWalletTest:testOnlyOwnerCanMigrate() (gas: 16329757) +ArbitrumFoundationVestingWalletTest:testOwnerCanSetBeneficiary() (gas: 16332176) +ArbitrumFoundationVestingWalletTest:testProperlyInits() (gas: 16337546) +ArbitrumFoundationVestingWalletTest:testRandomAddressCantSetBeneficiary() (gas: 16329656) +ArbitrumFoundationVestingWalletTest:testRelease() (gas: 16451131) +ArbitrumVestingWalletFactoryTest:testDeploy() (gas: 4589688) +ArbitrumVestingWalletFactoryTest:testOnlyOwnerCanCreateWallets() (gas: 1504286) +ArbitrumVestingWalletTest:testCastVote() (gas: 16201584) +ArbitrumVestingWalletTest:testCastVoteFailsForNonBeneficiary() (gas: 16151341) +ArbitrumVestingWalletTest:testClaim() (gas: 16007768) +ArbitrumVestingWalletTest:testClaimFailsForNonBeneficiary() (gas: 15967955) +ArbitrumVestingWalletTest:testDelegate() (gas: 16081106) +ArbitrumVestingWalletTest:testDelegateFailsForNonBeneficiary() (gas: 16008435) +ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971342) +ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008649) +ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074917) +E2E:testE2E() (gas: 85785140) +FixedDelegateErc20WalletTest:testInit() (gas: 5822575) +FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816805) +FixedDelegateErc20WalletTest:testTransfer() (gas: 5932218) +FixedDelegateErc20WalletTest:testTransferNotOwner() (gas: 5897843) +InboxActionsTest:testPauseAndUpauseInbox() (gas: 370454) +L1AddressRegistryTest:testAddressRegistryAddress() (gas: 47009) +L1ArbitrumTimelockTest:testCancel() (gas: 5324642) +L1ArbitrumTimelockTest:testCancelFailsBadSender() (gas: 5369529) +L1ArbitrumTimelockTest:testDoesDeploy() (gas: 5273077) +L1ArbitrumTimelockTest:testDoesNotDeployZeroInbox() (gas: 4978961) +L1ArbitrumTimelockTest:testDoesNotDeployZeroL2Timelock() (gas: 4976931) +L1ArbitrumTimelockTest:testExecute() (gas: 5405352) +L1ArbitrumTimelockTest:testExecuteInbox() (gas: 5746378) +L1ArbitrumTimelockTest:testExecuteInboxBatch() (gas: 6056741) +L1ArbitrumTimelockTest:testExecuteInboxInvalidData() (gas: 5426399) +L1ArbitrumTimelockTest:testExecuteInboxNotEnoughVal() (gas: 5446210) +L1ArbitrumTimelockTest:testSchedule() (gas: 5357782) +L1ArbitrumTimelockTest:testScheduleFailsBadL2Timelock() (gas: 5286095) +L1ArbitrumTimelockTest:testScheduleFailsBadSender() (gas: 5281079) +L1ArbitrumTokenTest:testBridgeBurn() (gas: 3395571) +L1ArbitrumTokenTest:testBridgeBurnNotGateway() (gas: 3389611) +L1ArbitrumTokenTest:testBridgeMint() (gas: 3390798) +L1ArbitrumTokenTest:testBridgeMintNotGateway() (gas: 3341036) +L1ArbitrumTokenTest:testInit() (gas: 3355939) +L1ArbitrumTokenTest:testInitZeroGateway() (gas: 3177234) +L1ArbitrumTokenTest:testInitZeroNovaGateway() (gas: 3177301) +L1ArbitrumTokenTest:testInitZeroNovaRouter() (gas: 3177235) +L1ArbitrumTokenTest:testRegisterTokenOnL2() (gas: 4568612) +L1ArbitrumTokenTest:testRegisterTokenOnL2NotEnoughVal() (gas: 4425799) +L1GovernanceFactoryTest:testL1GovernanceFactory() (gas: 10771109) +L1GovernanceFactoryTest:testSetMinDelay() (gas: 10746003) +L1GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 10798958) +L2AddressRegistryTest:testAddressRegistryAddress() (gas: 54658) +L2ArbitrumGovernorTest:testCantReinit() (gas: 13669489) +L2ArbitrumGovernorTest:testExecutorPermissions() (gas: 13706483) +L2ArbitrumGovernorTest:testExecutorPermissionsFail() (gas: 13679135) +L2ArbitrumGovernorTest:testPastCirculatingSupply() (gas: 13673238) +L2ArbitrumGovernorTest:testPastCirculatingSupplyExclude() (gas: 13812715) +L2ArbitrumGovernorTest:testPastCirculatingSupplyMint() (gas: 13737218) +L2ArbitrumGovernorTest:testProperlyInitialized() (gas: 13664706) +L2ArbitrumTokenTest:testCanBurn() (gas: 4066835) +L2ArbitrumTokenTest:testCanMint2Percent() (gas: 4101512) +L2ArbitrumTokenTest:testCanMintLessThan2Percent() (gas: 4101514) +L2ArbitrumTokenTest:testCanMintTwiceWithWarp() (gas: 8190691) +L2ArbitrumTokenTest:testCanMintZero() (gas: 4081635) +L2ArbitrumTokenTest:testCanTransferAndCallContract() (gas: 4211883) +L2ArbitrumTokenTest:testCanTransferAndCallEmpty() (gas: 4096932) +L2ArbitrumTokenTest:testCannotMintMoreThan2Percent() (gas: 4071458) +L2ArbitrumTokenTest:testCannotMintNotOwner() (gas: 4069341) +L2ArbitrumTokenTest:testCannotMintTwice() (gas: 8158921) +L2ArbitrumTokenTest:testCannotMintWithoutFastForward() (gas: 4069700) +L2ArbitrumTokenTest:testCannotTransferAndCallNonReceiver() (gas: 4094203) +L2ArbitrumTokenTest:testCannotTransferAndCallReverter() (gas: 4154761) +L2ArbitrumTokenTest:testDoesNotInitialiseZeroInitialSup() (gas: 3800718) +L2ArbitrumTokenTest:testDoesNotInitialiseZeroL1Token() (gas: 3800726) +L2ArbitrumTokenTest:testDoesNotInitialiseZeroOwner() (gas: 3800739) +L2ArbitrumTokenTest:testIsInitialised() (gas: 4072777) +L2ArbitrumTokenTest:testNoLogicContractInit() (gas: 2693127) +L2GovernanceFactoryTest:testContractsDeployed() (gas: 28359365) +L2GovernanceFactoryTest:testContractsInitialized() (gas: 28396315) +L2GovernanceFactoryTest:testDeploySteps() (gas: 28370874) +L2GovernanceFactoryTest:testProxyAdminOwnership() (gas: 28368375) +L2GovernanceFactoryTest:testRoles() (gas: 28391450) +L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28415658) +L2GovernanceFactoryTest:testSetMinDelay() (gas: 28364371) +L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28417242) +L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28657360) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31628990) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31633221) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26672005) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31631221) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31652101) +NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) +OutboxActionsTest:testAddOutbxesAction() (gas: 651398) +OutboxActionsTest:testCantAddEOA() (gas: 968968) +OutboxActionsTest:testCantReAddOutbox() (gas: 974344) +OutboxActionsTest:testRemoveAllOutboxes() (gas: 693007) +OutboxActionsTest:testRemoveOutboxes() (gas: 853882) +ProxyUpgradeAndCallActionTest:testUpgrade() (gas: 137095) +ProxyUpgradeAndCallActionTest:testUpgradeAndCall() (gas: 143042) +SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 249787) +SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20800) +SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 340022) +SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 343319) +SecurityCouncilManagerTest:testAddSC() (gas: 118677) +SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112133) +SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 123130) +SecurityCouncilManagerTest:testCohortMethods() (gas: 136182) +SecurityCouncilManagerTest:testInitialization() (gas: 201641) +SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5074706) +SecurityCouncilManagerTest:testRemoveMember() (gas: 213142) +SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 99080) +SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81331) +SecurityCouncilManagerTest:testRemoveSeC() (gas: 38350) +SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 208648) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 258948) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 262487) +SecurityCouncilManagerTest:testRotateMember() (gas: 557872) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3587319) +SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65822) +SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83057) +SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 295419) +SecurityCouncilManagerTest:testUpdateRouter() (gas: 76302) +SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112336) +SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 295468) +SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 246997) +SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302852) +SecurityCouncilMemberElectionGovernorTest:testCastBySigTwice() (gas: 266244) +SecurityCouncilMemberElectionGovernorTest:testCastVoteReverts() (gas: 35277) +SecurityCouncilMemberElectionGovernorTest:testExecute() (gas: 665450) +SecurityCouncilMemberElectionGovernorTest:testForceSupport() (gas: 165349) +SecurityCouncilMemberElectionGovernorTest:testInitReverts() (gas: 4922497) +SecurityCouncilMemberElectionGovernorTest:testInvalidParams() (gas: 165321) +SecurityCouncilMemberElectionGovernorTest:testMiscVotesViews() (gas: 227939) +SecurityCouncilMemberElectionGovernorTest:testNoVoteForNonCompliantNominee() (gas: 123524) +SecurityCouncilMemberElectionGovernorTest:testNoZeroWeightVotes() (gas: 169595) +SecurityCouncilMemberElectionGovernorTest:testOnlyNomineeElectionGovernorCanPropose() (gas: 111038) +SecurityCouncilMemberElectionGovernorTest:testProperInitialization() (gas: 49388) +SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32916) +SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42229) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340178, ~: 340008) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273335) +SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34951) +SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152898) +SecurityCouncilMemberRemovalGovernorTest:testInitFails() (gas: 10159193) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationCallParamRestriction() (gas: 56157) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationCallRestriction() (gas: 49685) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationTargetLen() (gas: 35392) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationTargetRestriction() (gas: 46987) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationUnexpectedCallDataLen() (gas: 41583) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationValuesRestriction() (gas: 61908) +SecurityCouncilMemberRemovalGovernorTest:testProposalDoesExpire() (gas: 272525) +SecurityCouncilMemberRemovalGovernorTest:testProposalExpirationDeadline() (gas: 134831) +SecurityCouncilMemberRemovalGovernorTest:testRelay() (gas: 42123) +SecurityCouncilMemberRemovalGovernorTest:testSeparateSelector() (gas: 23536) +SecurityCouncilMemberRemovalGovernorTest:testSetVoteSuccessNumerator() (gas: 30049) +SecurityCouncilMemberRemovalGovernorTest:testSetVoteSuccessNumeratorAffordance() (gas: 47631) +SecurityCouncilMemberRemovalGovernorTest:testSuccessNumeratorInsufficientVotes() (gas: 358327) +SecurityCouncilMemberRemovalGovernorTest:testSuccessNumeratorSufficientVotes() (gas: 361245) +SecurityCouncilMemberRemovalGovernorTest:testSuccessfulProposalAndCantAbstain() (gas: 142674) +SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 7938503) +SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 7939341) +SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 7965404) +SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 7965411) +SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 7929385) +SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 7929385) +SecurityCouncilMemberSyncActionTest:testNonces() (gas: 8229875) +SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 7928439) +SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 7929365) +SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 7929685) +SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 7930546) +SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8171934) +SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8172795) +SecurityCouncilMgmtUtilsTests:testIsInArray() (gas: 2102) +SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 270750) +SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 333730) +SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 296589) +SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35278) +SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 582574) +SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 253153) +SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 456505) +SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 677159) +SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 194733) +SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 674020) +SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7256741) +SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78113) +SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19740) +SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42427) +SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 39905) +SequencerActionsTest:testAddAndRemoveSequencer() (gas: 483532) +SequencerActionsTest:testCantAddZeroAddress() (gas: 235614) +SetInitialGovParamsActionTest:testL1() (gas: 259904) +SetInitialGovParamsActionTest:testL2() (gas: 688888) +SetSequencerInboxMaxTimeVariationAction:testSetMaxTimeVariation() (gas: 374262) +SwitchManagerRolesActionTest:testAction() (gas: 6313) +TokenDistributorTest:testClaim() (gas: 5742744) +TokenDistributorTest:testClaimAndDelegate() (gas: 5850827) +TokenDistributorTest:testClaimAndDelegateFailsForExpired() (gas: 5748244) +TokenDistributorTest:testClaimAndDelegateFailsForWrongSender() (gas: 5803385) +TokenDistributorTest:testClaimAndDelegateFailsWrongNonce() (gas: 5803386) +TokenDistributorTest:testClaimFailsAfterEnd() (gas: 5704035) +TokenDistributorTest:testClaimFailsBeforeStart() (gas: 5703530) +TokenDistributorTest:testClaimFailsForFalseTransfer() (gas: 5686246) +TokenDistributorTest:testClaimFailsForTwice() (gas: 5741504) +TokenDistributorTest:testClaimFailsForUnknown() (gas: 5706111) +TokenDistributorTest:testClaimStartAfterClaimEnd() (gas: 4134838) +TokenDistributorTest:testDoesDeploy() (gas: 5339553) +TokenDistributorTest:testDoesDeployAndDeposit() (gas: 5404583) +TokenDistributorTest:testOldClaimStart() (gas: 4135401) +TokenDistributorTest:testSetRecipients() (gas: 5701945) +TokenDistributorTest:testSetRecipientsFailsNotEnoughDeposit() (gas: 5668810) +TokenDistributorTest:testSetRecipientsFailsNotOwner() (gas: 5420359) +TokenDistributorTest:testSetRecipientsFailsWhenAddingTwice() (gas: 5712988) +TokenDistributorTest:testSetRecipientsFailsWrongAmountCount() (gas: 5421819) +TokenDistributorTest:testSetRecipientsFailsWrongRecipientCount() (gas: 5422048) +TokenDistributorTest:testSetRecipientsTwice() (gas: 6391525) +TokenDistributorTest:testSetSweepReceiver() (gas: 5706262) +TokenDistributorTest:testSetSweepReceiverFailsNullAddress() (gas: 5703881) +TokenDistributorTest:testSetSweepReceiverFailsOwner() (gas: 5704842) +TokenDistributorTest:testSweep() (gas: 5751971) +TokenDistributorTest:testSweepAfterClaim() (gas: 5789954) +TokenDistributorTest:testSweepFailsBeforeClaimPeriodEnd() (gas: 5703615) +TokenDistributorTest:testSweepFailsForFailedTransfer() (gas: 5707314) +TokenDistributorTest:testSweepFailsTwice() (gas: 5750930) +TokenDistributorTest:testWithdraw() (gas: 5741198) +TokenDistributorTest:testWithdrawFailsNotOwner() (gas: 5741220) +TokenDistributorTest:testWithdrawFailsTransfer() (gas: 5705817) +TokenDistributorTest:testZeroDelegateTo() (gas: 4132733) +TokenDistributorTest:testZeroOwner() (gas: 4132646) +TokenDistributorTest:testZeroReceiver() (gas: 4132675) +TokenDistributorTest:testZeroToken() (gas: 71889) +TopNomineesGasTest:testTopNomineesGas() (gas: 4502996) +UpgradeExecRouteBuilderTest:testAIP1Point2() (gas: 1322645) +UpgradeExecRouteBuilderTest:testRouteBuilderErrors() (gas: 1127374) +UpgradeExecutorTest:testAdminCanChangeExecutor() (gas: 2583801) +UpgradeExecutorTest:testCantExecuteEOA() (gas: 2439721) +UpgradeExecutorTest:testExecute() (gas: 2677995) +UpgradeExecutorTest:testExecuteFailsForAdmin() (gas: 2663614) +UpgradeExecutorTest:testExecuteFailsForNobody() (gas: 2665855) +UpgradeExecutorTest:testInit() (gas: 2427602) +UpgradeExecutorTest:testInitFailsZeroAdmin() (gas: 2288342) \ No newline at end of file From 066c5b83f0cebe5c98640c220d7a62c83fb1c99c Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Wed, 2 Oct 2024 17:01:28 +0200 Subject: [PATCH 007/108] Gas checks --- .gas-snapshot | 61 +++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index ea2decea1..de93dd32b 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -26,7 +26,7 @@ ArbitrumVestingWalletTest:testDelegateFailsForNonBeneficiary() (gas: 16008435) ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971342) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008649) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074917) -E2E:testE2E() (gas: 84680100) +E2E:testE2E() (gas: 85785140) FixedDelegateErc20WalletTest:testInit() (gas: 5822575) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816805) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932218) @@ -94,11 +94,11 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28415658) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28364371) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28417242) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28657360) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 30524001) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 30528232) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 25659644) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 30526232) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 30545325) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31628990) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31633221) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26672005) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31631221) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31652101) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OutboxActionsTest:testAddOutbxesAction() (gas: 651398) OutboxActionsTest:testCantAddEOA() (gas: 968968) @@ -107,28 +107,31 @@ OutboxActionsTest:testRemoveAllOutboxes() (gas: 693007) OutboxActionsTest:testRemoveOutboxes() (gas: 853882) ProxyUpgradeAndCallActionTest:testUpgrade() (gas: 137095) ProxyUpgradeAndCallActionTest:testUpgradeAndCall() (gas: 143042) -SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 249651) -SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20795) -SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 339764) -SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 343060) -SecurityCouncilManagerTest:testAddSC() (gas: 118567) -SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112083) -SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 123116) -SecurityCouncilManagerTest:testCohortMethods() (gas: 136185) -SecurityCouncilManagerTest:testInitialization() (gas: 193074) -SecurityCouncilManagerTest:testRemoveMember() (gas: 213029) -SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 99074) -SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81253) -SecurityCouncilManagerTest:testRemoveSeC() (gas: 38309) -SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 208560) -SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 258788) -SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 262305) -SecurityCouncilManagerTest:testRotateMember() (gas: 258792) -SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83026) -SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 295311) -SecurityCouncilManagerTest:testUpdateRouter() (gas: 76296) -SecurityCouncilManagerTest:testUpdateRouterAffordacnes() (gas: 112379) -SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 295316) +SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 249787) +SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20800) +SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 340022) +SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 343319) +SecurityCouncilManagerTest:testAddSC() (gas: 118677) +SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112133) +SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 123130) +SecurityCouncilManagerTest:testCohortMethods() (gas: 136182) +SecurityCouncilManagerTest:testInitialization() (gas: 201641) +SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5074706) +SecurityCouncilManagerTest:testRemoveMember() (gas: 213142) +SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 99080) +SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81331) +SecurityCouncilManagerTest:testRemoveSeC() (gas: 38350) +SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 208648) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 258948) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 262487) +SecurityCouncilManagerTest:testRotateMember() (gas: 557872) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3587319) +SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65822) +SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83057) +SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 295419) +SecurityCouncilManagerTest:testUpdateRouter() (gas: 76302) +SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112336) +SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 295468) SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 246997) SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302852) SecurityCouncilMemberElectionGovernorTest:testCastBySigTwice() (gas: 266244) @@ -144,7 +147,7 @@ SecurityCouncilMemberElectionGovernorTest:testOnlyNomineeElectionGovernorCanProp SecurityCouncilMemberElectionGovernorTest:testProperInitialization() (gas: 49388) SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32916) SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42229) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 339999, ~: 339822) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340178, ~: 340008) SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273335) SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34951) SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152898) From 5b12e6dd9cd3c315e996cfba139c6591cb445a28 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 3 Oct 2024 11:05:50 +0200 Subject: [PATCH 008/108] First draft of rotation upgrade action --- .../RotateMembersUpgradeAction.sol | 33 ++++++++++++++++++ .../address-registries/L2AddressRegistry.sol | 26 +++++++++++++- .../L2AddressRegistryInterfaces.sol | 24 ++++++++++++- .../SecurityCouncilManager.sol | 3 +- ...SecurityCouncilNomineeElectionGovernor.sol | 5 ++- .../interfaces/ISecurityCouncilManager.sol | 8 +++++ ...SecurityCouncilNomineeElectionGovernor.sol | 10 ++++++ test/security-council-mgmt/E2E.t.sol | 17 ++++++---- test/util/ActionTestBase.sol | 34 ++++++++++++------- test/util/TestUtil.sol | 4 +++ 10 files changed, 137 insertions(+), 27 deletions(-) create mode 100644 src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol diff --git a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol new file mode 100644 index 000000000..ea64b47dc --- /dev/null +++ b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.16; + +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import "../../address-registries/L2AddressRegistryInterfaces.sol"; +import "@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol"; + +/// @notice Upgrades the sec council manager to allow member rotation and sets min rotation vars +contract RotateMembersUpgradeAction { + IL2AddressRegistry public immutable l2AddressRegistry; + address public immutable secCouncilManagerImpl; + uint256 public immutable minRotationPeriod; + address public immutable minRotationPeriodSetter; + + constructor(IL2AddressRegistry _l2AddressRegistry, address _secCouncilManagerImpl, uint256 _minRotationPeriod, address _minRotationPeriodSetter) { + l2AddressRegistry = _l2AddressRegistry; + secCouncilManagerImpl = _secCouncilManagerImpl; + minRotationPeriod = _minRotationPeriod; + minRotationPeriodSetter = _minRotationPeriodSetter; + } + + function perform() external { + ISecurityCouncilManager secCouncilManager = l2AddressRegistry.securityCouncilManager(); + l2AddressRegistry.govProxyAdmin().upgradeAndCall( + TransparentUpgradeableProxy(payable(address(secCouncilManager))), + secCouncilManagerImpl, + abi.encodeCall(ISecurityCouncilManager(secCouncilManagerImpl).postUpgradeInit, (minRotationPeriod, minRotationPeriodSetter)) + ); + + require(minRotationPeriod == secCouncilManager.minRotationPeriod(), "Min rotation peroid not set"); + require(IAccessControlUpgradeable(address(secCouncilManager)).hasRole(secCouncilManager.MIN_ROTATION_PERIOD_SETTER_ROLE(), minRotationPeriodSetter), "Min rotation period setter not set"); + } +} \ No newline at end of file diff --git a/src/gov-action-contracts/address-registries/L2AddressRegistry.sol b/src/gov-action-contracts/address-registries/L2AddressRegistry.sol index 87fbc2a86..a96baf424 100644 --- a/src/gov-action-contracts/address-registries/L2AddressRegistry.sol +++ b/src/gov-action-contracts/address-registries/L2AddressRegistry.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.16; +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import "./L2AddressRegistryInterfaces.sol"; contract L2AddressRegistry is IL2AddressRegistry { @@ -8,12 +9,16 @@ contract L2AddressRegistry is IL2AddressRegistry { IL2ArbitrumGoverner public immutable treasuryGov; IFixedDelegateErc20Wallet public immutable treasuryWallet; IArbitrumDAOConstitution public immutable arbitrumDAOConstitution; + ProxyAdmin public immutable govProxyAdmin; + ISecurityCouncilNomineeElectionGovernor public immutable scNomineeElectionGovernor; constructor( IL2ArbitrumGoverner _coreGov, IL2ArbitrumGoverner _treasuryGov, IFixedDelegateErc20Wallet _treasuryWallet, - IArbitrumDAOConstitution _arbitrumDAOConstitution + IArbitrumDAOConstitution _arbitrumDAOConstitution, + ProxyAdmin _govProxyAdmin, + ISecurityCouncilNomineeElectionGovernor _scNomineeElectionGovernor ) { require( _treasuryWallet.owner() == _treasuryGov.timelock(), @@ -27,6 +32,13 @@ contract L2AddressRegistry is IL2AddressRegistry { treasuryGov = _treasuryGov; treasuryWallet = _treasuryWallet; arbitrumDAOConstitution = _arbitrumDAOConstitution; + require( + _govProxyAdmin.getProxyAdmin(TransparentUpgradeableProxy(payable(address(_coreGov)))) + == address(_govProxyAdmin), + "GovProxyAdmin must be proxy admin of the core governor" + ); + govProxyAdmin = _govProxyAdmin; + scNomineeElectionGovernor = _scNomineeElectionGovernor; } function coreGovTimelock() external view returns (IArbitrumTimelock) { @@ -40,4 +52,16 @@ contract L2AddressRegistry is IL2AddressRegistry { function l2ArbitrumToken() external view returns (IL2ArbitrumToken) { return IL2ArbitrumGoverner(address(coreGov)).token(); } + + function scMemberElectionGovernor() + external + view + returns (ISecurityCouncilMemberElectionGovernor) + { + return scNomineeElectionGovernor.securityCouncilMemberElectionGovernor(); + } + + function securityCouncilManager() external view returns (ISecurityCouncilManager) { + return scNomineeElectionGovernor.securityCouncilManager(); + } } diff --git a/src/gov-action-contracts/address-registries/L2AddressRegistryInterfaces.sol b/src/gov-action-contracts/address-registries/L2AddressRegistryInterfaces.sol index 54dab50f3..7205b3f2b 100644 --- a/src/gov-action-contracts/address-registries/L2AddressRegistryInterfaces.sol +++ b/src/gov-action-contracts/address-registries/L2AddressRegistryInterfaces.sol @@ -2,11 +2,15 @@ pragma solidity 0.8.16; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import "../../interfaces/IArbitrumTimelock.sol"; import "../../interfaces/IFixedDelegateErc20Wallet.sol"; import "../../interfaces/IL2ArbitrumToken.sol"; import "../../interfaces/IL2ArbitrumGovernor.sol"; import "../../interfaces/IArbitrumDAOConstitution.sol"; +import "../../security-council-mgmt/interfaces/ISecurityCouncilManager.sol"; +import "../../security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol"; +import "../../security-council-mgmt/interfaces/ISecurityCouncilMemberElectionGovernor.sol"; interface ICoreGovTimelockGetter { function coreGovTimelock() external view returns (IArbitrumTimelock); @@ -36,6 +40,22 @@ interface IArbitrumDAOConstitutionGetter { function arbitrumDAOConstitution() external view returns (IArbitrumDAOConstitution); } +interface IGovProxyAdminGetter { + function govProxyAdmin() external view returns (ProxyAdmin); +} + +interface ISecurityCouncilGetters { + function securityCouncilManager() external view returns (ISecurityCouncilManager); + function scNomineeElectionGovernor() + external + view + returns (ISecurityCouncilNomineeElectionGovernor); + function scMemberElectionGovernor() + external + view + returns (ISecurityCouncilMemberElectionGovernor); +} + interface IL2AddressRegistry is ICoreGovGetter, ICoreGovTimelockGetter, @@ -43,5 +63,7 @@ interface IL2AddressRegistry is IDaoTreasuryGetter, ITreasuryGovGetter, IL2ArbitrumTokenGetter, - IArbitrumDAOConstitutionGetter + IArbitrumDAOConstitutionGetter, + IGovProxyAdminGetter, + ISecurityCouncilGetters {} diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index aab1f2180..b088d2fdd 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -96,8 +96,7 @@ contract SecurityCouncilManager is /// @notice The timestamp at which the address was last rotated mapping(address => uint256) public lastRotated; - /// @notice There is a minimum period between when an address can be rotated - /// This is to ensure a single member cannot do many rotations in a row + /// @inheritdoc ISecurityCouncilManager uint256 public minRotationPeriod; /// @notice Magic value used by the L1 timelock to indicate that a retryable ticket should be created diff --git a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol index 616bfa9a1..0a0e0d467 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol @@ -60,11 +60,10 @@ contract SecurityCouncilNomineeElectionGovernor is /// @notice Address responsible for blocking non compliant nominees address public nomineeVetter; - /// @notice Security council manager contract - /// @dev Used to execute the election result immediately if <= 6 compliant nominees are chosen + /// @inheritdoc ISecurityCouncilNomineeElectionGovernor ISecurityCouncilManager public securityCouncilManager; - /// @notice Security council member election governor contract + /// @inheritdoc ISecurityCouncilNomineeElectionGovernor ISecurityCouncilMemberElectionGovernor public securityCouncilMemberElectionGovernor; /// @inheritdoc ISecurityCouncilNomineeElectionGovernor diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index 38a1fadbb..c8b4a20bf 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -47,6 +47,11 @@ interface ISecurityCouncilManager { error NewMemberIsContender(uint256 proposalId, address newMember); error InvalidNewAddress(address newAddress); + /// @notice There is a minimum period between when an address can be rotated + /// This is to ensure a single member cannot do many rotations in a row + function minRotationPeriod() external view returns (uint256); + function MIN_ROTATION_PERIOD_SETTER_ROLE() external view returns (bytes32); + /// @notice initialize SecurityCouncilManager. /// @param _firstCohort addresses of first cohort /// @param _secondCohort addresses of second cohort @@ -158,4 +163,7 @@ interface ISecurityCouncilManager { returns (bytes32); /// @notice Each update increments an internal nonce that keeps updates unique, current value stored here function updateNonce() external returns (uint256); + /// @notice Upgrade an existing contract and add rotation params + function postUpgradeInit(uint256 _minRotationPeriod, address minRotationPeriodSetter) + external; } diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol index 3d97248be..ae3c50457 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol @@ -3,6 +3,8 @@ pragma solidity 0.8.16; import "./IElectionGovernor.sol"; import {Cohort} from "../Common.sol"; +import "./ISecurityCouncilMemberElectionGovernor.sol"; +import "./ISecurityCouncilManager.sol"; /// @notice Minimal interface of nominee election governor required by other contracts interface ISecurityCouncilNomineeElectionGovernor is IElectionGovernor { @@ -22,4 +24,12 @@ interface ISecurityCouncilNomineeElectionGovernor is IElectionGovernor { view returns (bool); function otherCohort() external view returns (Cohort); + /// @notice Security council manager contract + /// @dev Used to execute the election result immediately if <= 6 compliant nominees are chosen + function securityCouncilManager() external view returns (ISecurityCouncilManager); + /// @notice Security council member election governor contract + function securityCouncilMemberElectionGovernor() + external + view + returns (ISecurityCouncilMemberElectionGovernor); } diff --git a/test/security-council-mgmt/E2E.t.sol b/test/security-council-mgmt/E2E.t.sol index 121f0831e..6d9be0b84 100644 --- a/test/security-council-mgmt/E2E.t.sol +++ b/test/security-council-mgmt/E2E.t.sol @@ -305,13 +305,6 @@ contract E2E is Test, DeployGnosisWithModule { vars.novaExecutor = deployNova(address(vars.l1Timelock)); // deploy sec council - vars.l2AddressRegistry = new L2AddressRegistry( - IL2ArbitrumGoverner(address(l2DeployedCoreContracts.coreGov)), - IL2ArbitrumGoverner(address(l2DeployedTreasuryContracts.treasuryGov)), - IFixedDelegateErc20Wallet(address(l2DeployedTreasuryContracts.arbTreasury)), - IArbitrumDAOConstitution(address(l2DeployedCoreContracts.arbitrumDAOConstitution)) - ); - vars.secFac = new L2SecurityCouncilMgmtFactory(); vars.moduleL2Safe = GnosisSafeL2( @@ -398,6 +391,16 @@ contract E2E is Test, DeployGnosisWithModule { vars.secDeployedContracts = vars.secFac.deploy(secDeployParams, contractImpls); } + vars.l2AddressRegistry = new L2AddressRegistry( + IL2ArbitrumGoverner(address(l2DeployedCoreContracts.coreGov)), + IL2ArbitrumGoverner(address(l2DeployedTreasuryContracts.treasuryGov)), + IFixedDelegateErc20Wallet(address(l2DeployedTreasuryContracts.arbTreasury)), + IArbitrumDAOConstitution(address(l2DeployedCoreContracts.arbitrumDAOConstitution)), + l2DeployedCoreContracts.proxyAdmin, + vars.secDeployedContracts.nomineeElectionGovernor + ); + + L1SCMgmtActivationAction installL1 = new L1SCMgmtActivationAction( IGnosisSafe(address(vars.moduleL1Safe)), IGnosisSafe(l1EmergencyCouncil), diff --git a/test/util/ActionTestBase.sol b/test/util/ActionTestBase.sol index d82c7aa8e..642f7c3ad 100644 --- a/test/util/ActionTestBase.sol +++ b/test/util/ActionTestBase.sol @@ -20,6 +20,7 @@ import "../../src/ArbitrumDAOConstitution.sol"; import "../../src/gov-action-contracts/address-registries/L1AddressRegistry.sol" as _ar; import "../../src/gov-action-contracts/address-registries/L2AddressRegistry.sol" as _ar1; import "../../src/gov-action-contracts/address-registries/interfaces.sol" as _ifaces; +import "../../src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol"; contract OwnableStub is Ownable {} @@ -57,12 +58,13 @@ abstract contract ActionTestBase { FixedDelegateErc20Wallet treasuryWallet; function setUp() public { + ProxyAdmin pa = new ProxyAdmin(); outboxesToAdd = [address(new OutboxStub()), address(new OutboxStub()), address(new OutboxStub())]; outboxesToRemove.push(outboxesToAdd[0]); outboxesToRemove.push(outboxesToAdd[1]); - ue = UpgradeExecutor(TestUtil.deployProxy(address(new UpgradeExecutor()))); + ue = UpgradeExecutor(TestUtil.deployProxy(pa, address(new UpgradeExecutor()))); address[] memory executors = new address[](2); executors[0] = executor0; @@ -71,15 +73,15 @@ abstract contract ActionTestBase { rollup = new OwnableStub(); rollup.transferOwnership(address(ue)); - bridge = Bridge(TestUtil.deployProxy(address(new Bridge()))); + bridge = Bridge(TestUtil.deployProxy(pa, address(new Bridge()))); bridge.initialize(IOwnable(address(rollup))); - si = SequencerInbox(TestUtil.deployProxy(address(new SequencerInbox(117964)))); + si = SequencerInbox(TestUtil.deployProxy(pa, address(new SequencerInbox(117964)))); si.initialize(bridge, ISequencerInbox.MaxTimeVariation(0, 0, 0, 0)); - inbox = Inbox(TestUtil.deployProxy(address(new Inbox(117964)))); + inbox = Inbox(TestUtil.deployProxy(pa, address(new Inbox(117964)))); inbox.initialize(bridge, si); l1Timelock = - L1ArbitrumTimelock(payable(TestUtil.deployProxy(address(new L1ArbitrumTimelock())))); + L1ArbitrumTimelock(payable(TestUtil.deployProxy(pa, address(new L1ArbitrumTimelock())))); address[] memory l1Proposers = new address[](1); l1Proposers[0] = address(bridge); l1Timelock.initialize(5, l1Proposers, new address[](0)); @@ -93,7 +95,7 @@ abstract contract ActionTestBase { inboxGetter = _ifaces.IInboxGetter(address(addressRegistry)); sequencerInboxGetter = _ifaces.ISequencerInboxGetter(address(addressRegistry)); - arbOneUe = UpgradeExecutor(TestUtil.deployProxy(address(new UpgradeExecutor()))); + arbOneUe = UpgradeExecutor(TestUtil.deployProxy(pa, address(new UpgradeExecutor()))); address[] memory executors2 = new address[](1); executors2[0] = executor2; arbOneUe.initialize(address(arbOneUe), executors2); @@ -101,12 +103,12 @@ abstract contract ActionTestBase { arbitrumDAOConstitution = new ArbitrumDAOConstitution(constitutionHash); arbitrumDAOConstitution.transferOwnership(address(arbOneUe)); - arbOneToken = L2ArbitrumToken(TestUtil.deployProxy(address(new L2ArbitrumToken()))); + arbOneToken = L2ArbitrumToken(TestUtil.deployProxy(pa, address(new L2ArbitrumToken()))); arbOneToken.initialize(address(4567), 10_000_000_000, address(arbOneUe)); coreTimelock = - ArbitrumTimelock(payable(TestUtil.deployProxy(address(new ArbitrumTimelock())))); + ArbitrumTimelock(payable(TestUtil.deployProxy(pa, address(new ArbitrumTimelock())))); coreGov = - L2ArbitrumGovernor(payable(TestUtil.deployProxy(address(new L2ArbitrumGovernor())))); + L2ArbitrumGovernor(payable(TestUtil.deployProxy(pa, address(new L2ArbitrumGovernor())))); address[] memory proposers = new address[](1); proposers[0] = address(coreGov); coreTimelock.initialize(5, proposers, new address[](0)); @@ -116,9 +118,9 @@ abstract contract ActionTestBase { coreGov.initialize(arbOneToken, coreTimelock, address(arbOneUe), 3, 4, 500, 50, 50); treasuryTimelock = - ArbitrumTimelock(payable(TestUtil.deployProxy(address(new ArbitrumTimelock())))); + ArbitrumTimelock(payable(TestUtil.deployProxy(pa, address(new ArbitrumTimelock())))); treasuryGov = - L2ArbitrumGovernor(payable(TestUtil.deployProxy(address(new L2ArbitrumGovernor())))); + L2ArbitrumGovernor(payable(TestUtil.deployProxy(pa, address(new L2ArbitrumGovernor())))); address[] memory proposers2 = new address[](1); proposers[0] = address(treasuryGov); treasuryTimelock.initialize(7, proposers2, new address[](0)); @@ -130,12 +132,18 @@ abstract contract ActionTestBase { treasuryGov.initialize(arbOneToken, treasuryTimelock, address(arbOneUe), 7, 8, 600, 60, 60); treasuryWallet = - FixedDelegateErc20Wallet(TestUtil.deployProxy(address(new FixedDelegateErc20Wallet()))); + FixedDelegateErc20Wallet(TestUtil.deployProxy(pa, address(new FixedDelegateErc20Wallet()))); treasuryWallet.initialize( address(arbOneToken), treasuryGov.EXCLUDE_ADDRESS(), address(treasuryTimelock) ); arbOneAddressRegistry = - new _ar1.L2AddressRegistry(_ar1.IL2ArbitrumGoverner(address(coreGov)), _ar1.IL2ArbitrumGoverner(address(treasuryGov)), _ar1.IFixedDelegateErc20Wallet(address(treasuryWallet)), _ar1.IArbitrumDAOConstitution(address(arbitrumDAOConstitution))); + new _ar1.L2AddressRegistry( + _ar1.IL2ArbitrumGoverner(address(coreGov)), + _ar1.IL2ArbitrumGoverner(address(treasuryGov)), + _ar1.IFixedDelegateErc20Wallet(address(treasuryWallet)), + _ar1.IArbitrumDAOConstitution(address(arbitrumDAOConstitution)), + pa, + ISecurityCouncilNomineeElectionGovernor(payable(address(0)))); } } diff --git a/test/util/TestUtil.sol b/test/util/TestUtil.sol index e63aa15c4..38033be1e 100644 --- a/test/util/TestUtil.sol +++ b/test/util/TestUtil.sol @@ -13,6 +13,10 @@ library TestUtil { return address(new TransparentUpgradeableProxy(address(logic), address(pa), "")); } + function deployProxy(ProxyAdmin pa, address logic) public returns (address) { + return address(new TransparentUpgradeableProxy(address(logic), address(pa), "")); + } + function deployStubContract() public returns (address) { return address(new StubContract()); } From 5c871aa0ada4b7b0565f19773e770b35ff459947 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 3 Oct 2024 12:53:55 +0200 Subject: [PATCH 009/108] Added member removal action --- .../RotateMembersUpgradeAction.sol | 1 + .../CancelTimelockAndRemoveMemberAction.sol | 25 +++++++++++++++++++ .../interfaces/ISecurityCouncilManager.sol | 1 + 3 files changed, 27 insertions(+) create mode 100644 src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol diff --git a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol index ea64b47dc..a51c73a57 100644 --- a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol +++ b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol @@ -12,6 +12,7 @@ contract RotateMembersUpgradeAction { uint256 public immutable minRotationPeriod; address public immutable minRotationPeriodSetter; + // CHRIS: TODO: tests and dao constitution hash constructor(IL2AddressRegistry _l2AddressRegistry, address _secCouncilManagerImpl, uint256 _minRotationPeriod, address _minRotationPeriodSetter) { l2AddressRegistry = _l2AddressRegistry; secCouncilManagerImpl = _secCouncilManagerImpl; diff --git a/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol b/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol new file mode 100644 index 000000000..a6e4d7ab8 --- /dev/null +++ b/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.16; + +import "../address-registries/L2AddressRegistry.sol"; +import "./CancelTimelockOperation.sol"; + +contract CancelTimelockAndRemoveMemberOAction { + IL2AddressRegistry public immutable l2AddressRegistry; + + constructor(IL2AddressRegistry _l2AddressRegistry) { + l2AddressRegistry = _l2AddressRegistry; + } + + // CHRIS: TODO: restrict this to ony being able to cancel rotation props and not any prop + function perform(address memberToRemove, bytes32 operationId) public { + // first remove the council member + ISecurityCouncilManager scm = l2AddressRegistry.securityCouncilManager(); + IAccessControlUpgradeable(address(scm)).grantRole(scm.MEMBER_REMOVER_ROLE(), address(this)); + scm.removeMember(memberToRemove); + IAccessControlUpgradeable(address(scm)).revokeRole(scm.MEMBER_REMOVER_ROLE(), address(this)); + + // then cancel the rotation operation in the timelock + CancelTimelockOperation.cancel(l2AddressRegistry.coreGov(), operationId); + } +} \ No newline at end of file diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index c8b4a20bf..70d3e79b6 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -51,6 +51,7 @@ interface ISecurityCouncilManager { /// This is to ensure a single member cannot do many rotations in a row function minRotationPeriod() external view returns (uint256); function MIN_ROTATION_PERIOD_SETTER_ROLE() external view returns (bytes32); + function MEMBER_REMOVER_ROLE() external view returns (bytes32); /// @notice initialize SecurityCouncilManager. /// @param _firstCohort addresses of first cohort From cd3608e0e496ceede8bfa3ed4680cb8246ecd241 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 3 Oct 2024 12:55:50 +0200 Subject: [PATCH 010/108] Added 712 init to postupgradeinit --- src/security-council-mgmt/SecurityCouncilManager.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index aab1f2180..f65f09207 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -164,6 +164,8 @@ contract SecurityCouncilManager is _grantRole(MIN_ROTATION_PERIOD_SETTER_ROLE, minRotationPeriodSetter); setMinRotationPeriodImpl(_minRotationPeriod); + + __EIP712_init_unchained("SecurityCouncilManager", "1"); } /// @inheritdoc ISecurityCouncilManager From 5d37f8999dd3630a9e470179081a651889d17bea Mon Sep 17 00:00:00 2001 From: gzeon Date: Thu, 3 Oct 2024 19:07:15 +0800 Subject: [PATCH 011/108] chore: update storage and 4bytes --- test/signatures/SecurityCouncilManager | 10 ++++++++-- test/storage/SecurityCouncilManager | 21 +++++++++++++-------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/test/signatures/SecurityCouncilManager b/test/signatures/SecurityCouncilManager index 3194fe677..08bd9db39 100644 --- a/test/signatures/SecurityCouncilManager +++ b/test/signatures/SecurityCouncilManager @@ -6,6 +6,7 @@ "MEMBER_REMOVER_ROLE()": "b8df7c7f", "MEMBER_REPLACER_ROLE()": "8e8c3210", "MEMBER_ROTATOR_ROLE()": "903e7ad6", + "MIN_ROTATION_PERIOD_SETTER_ROLE()": "5db9bf4e", "RETRYABLE_TICKET_MAGIC()": "3994073d", "addMember(address,uint8)": "62d0d1c3", "addSecurityCouncil((address,address,uint256))": "6eaff79e", @@ -16,23 +17,28 @@ "getBothCohorts()": "d0946961", "getFirstCohort()": "a7b20c29", "getRoleAdmin(bytes32)": "248a9ca3", + "getRotateMemberHash(address,uint256)": "09af9e5f", "getScheduleUpdateInnerData(uint256)": "8bbd5149", "getSecondCohort()": "bdc9f17c", "grantRole(bytes32,address)": "2f2ff15d", "hasRole(bytes32,address)": "91d14854", - "initialize(address[],address[],(address,address,uint256)[],(address,address,address,address[],address,address),address,address)": "a386a802", + "initialize(address[],address[],(address,address,uint256)[],(address,address,address,address[],address,address,address),address,address,uint256)": "caa33e24", "l2CoreGovTimelock()": "eea3e4d4", + "lastRotated(address)": "64f747b6", + "minRotationPeriod()": "cfc02946", + "postUpgradeInit(uint256,address)": "c50e68a0", "removeMember(address)": "0b1ca49a", "removeSecurityCouncil((address,address,uint256))": "60052890", "renounceRole(bytes32,address)": "36568abe", "replaceCohort(address[],uint8)": "b9862f27", "replaceMember(address,address)": "e577e32e", "revokeRole(bytes32,address)": "d547741f", - "rotateMember(address,address)": "0931d37e", + "rotateMember(address,address,bytes)": "02ea6df4", "router()": "f887ea40", "secondCohortIncludes(address)": "e9d9f048", "securityCouncils(uint256)": "bef3f745", "securityCouncilsLength()": "7889acb2", + "setMinRotationPeriod(uint256)": "d4c271b2", "setUpgradeExecRouteBuilder(address)": "0e5e43d7", "supportsInterface(bytes4)": "01ffc9a7", "updateNonce()": "0feca68a" diff --git a/test/storage/SecurityCouncilManager b/test/storage/SecurityCouncilManager index 0aabc0822..1ed981c35 100644 --- a/test/storage/SecurityCouncilManager +++ b/test/storage/SecurityCouncilManager @@ -6,11 +6,16 @@ | __gap | uint256[50] | 51 | 0 | 1600 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | | _roles | mapping(bytes32 => struct AccessControlUpgradeable.RoleData) | 101 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | | __gap | uint256[49] | 102 | 0 | 1568 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| firstCohort | address[] | 151 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| secondCohort | address[] | 152 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| l2CoreGovTimelock | address payable | 153 | 0 | 20 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| securityCouncils | struct SecurityCouncilData[] | 154 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| router | contract UpgradeExecRouteBuilder | 155 | 0 | 20 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| updateNonce | uint256 | 156 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| cohortSize | uint256 | 157 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| __gap | uint256[43] | 158 | 0 | 1376 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| _HASHED_NAME | bytes32 | 151 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| _HASHED_VERSION | bytes32 | 152 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| __gap | uint256[50] | 153 | 0 | 1600 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| firstCohort | address[] | 203 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| secondCohort | address[] | 204 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| l2CoreGovTimelock | address payable | 205 | 0 | 20 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| securityCouncils | struct SecurityCouncilData[] | 206 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| router | contract UpgradeExecRouteBuilder | 207 | 0 | 20 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| updateNonce | uint256 | 208 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| cohortSize | uint256 | 209 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| lastRotated | mapping(address => uint256) | 210 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| minRotationPeriod | uint256 | 211 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| __gap | uint256[43] | 212 | 0 | 1376 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | From 3dd1d3f0c633673e562976e9a39b7f6386ca6a22 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 3 Oct 2024 13:35:51 +0200 Subject: [PATCH 012/108] Own 712 update --- .../SecurityCouncilManager.sol | 37 ++++++++++++++----- .../SecurityCouncilManager.t.sol | 4 ++ 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index f65f09207..be1647d3d 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -12,7 +12,7 @@ import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/governance/IGovernorUpgradeable.sol"; -import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; import "./Common.sol"; import "./interfaces/ISecurityCouncilMemberElectionGovernor.sol"; @@ -43,8 +43,7 @@ library ProxyUtil { contract SecurityCouncilManager is Initializable, AccessControlUpgradeable, - ISecurityCouncilManager, - EIP712Upgradeable + ISecurityCouncilManager { event CohortReplaced(address[] newCohort, Cohort indexed cohort); event MemberAdded(address indexed newMember, Cohort indexed cohort); @@ -100,6 +99,11 @@ contract SecurityCouncilManager is /// This is to ensure a single member cannot do many rotations in a row uint256 public minRotationPeriod; + /// @notice The 712 name hash + bytes32 public NAME_HASH; + /// @notice The 712 version hash + bytes32 public VERSION_HASH; + /// @notice Magic value used by the L1 timelock to indicate that a retryable ticket should be created /// Value is defined in L1ArbitrumTimelock contract https://etherscan.io/address/0xE6841D92B0C345144506576eC13ECf5103aC7f49#readProxyContract#F5 address public constant RETRYABLE_TICKET_MAGIC = 0xa723C008e76E379c55599D2E4d93879BeaFDa79C; @@ -110,7 +114,12 @@ contract SecurityCouncilManager is bytes32 public constant MEMBER_ROTATOR_ROLE = keccak256("MEMBER_ROTATOR"); bytes32 public constant MEMBER_REMOVER_ROLE = keccak256("MEMBER_REMOVER"); bytes32 public constant MIN_ROTATION_PERIOD_SETTER_ROLE = - keccak256("MIN_ROATATION_PERIOD_SETTER"); + keccak256("MIN_ROTATION_PERIOD_SETTER"); + bytes32 public constant DOMAIN_TYPE_HASH = keccak256( + "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" + ); + bytes32 public constant TYPE_HASH = + keccak256(bytes("rotateMember(address from, uint256 nonce)")); constructor() { _disableInitializers(); @@ -153,7 +162,10 @@ contract SecurityCouncilManager is setMinRotationPeriodImpl(_minRotationPeriod); - __EIP712_init_unchained("SecurityCouncilManager", "1"); + // we do our own 712 functionality because inheriting the OZ version + // would change our storage layout + NAME_HASH = keccak256(bytes("SecurityCouncilManager")); + VERSION_HASH = keccak256(bytes("1")); } function postUpgradeInit(uint256 _minRotationPeriod, address minRotationPeriodSetter) @@ -165,7 +177,14 @@ contract SecurityCouncilManager is _grantRole(MIN_ROTATION_PERIOD_SETTER_ROLE, minRotationPeriodSetter); setMinRotationPeriodImpl(_minRotationPeriod); - __EIP712_init_unchained("SecurityCouncilManager", "1"); + NAME_HASH = keccak256(bytes("SecurityCouncilManager")); + VERSION_HASH = keccak256(bytes("1")); + } + + function _domainSeparatorV4() private view returns (bytes32) { + return keccak256( + abi.encode(DOMAIN_TYPE_HASH, NAME_HASH, VERSION_HASH, block.chainid, address(this)) + ); } /// @inheritdoc ISecurityCouncilManager @@ -265,10 +284,8 @@ contract SecurityCouncilManager is /// @inheritdoc ISecurityCouncilManager function getRotateMemberHash(address from, uint256 nonce) public view returns (bytes32) { - return _hashTypedDataV4( - keccak256( - abi.encode(keccak256("rotateMember(address from, uint256 nonce)"), from, nonce) - ) + return ECDSAUpgradeable.toTypedDataHash( + _domainSeparatorV4(), keccak256(abi.encode(TYPE_HASH, from, nonce)) ); } diff --git a/test/security-council-mgmt/SecurityCouncilManager.t.sol b/test/security-council-mgmt/SecurityCouncilManager.t.sol index 08fba128c..6f0aca4a0 100644 --- a/test/security-council-mgmt/SecurityCouncilManager.t.sol +++ b/test/security-council-mgmt/SecurityCouncilManager.t.sol @@ -216,6 +216,8 @@ contract SecurityCouncilManagerTest is Test { assertEq(minRotationPeriod, scm.minRotationPeriod(), "minRotationPeriod set"); assertEq(address(uerb), address(scm.router()), "exec router set"); + assertEq(scm.NAME_HASH(), keccak256(bytes("SecurityCouncilManager"))); + assertEq(scm.VERSION_HASH(), keccak256(bytes("1"))); } function testRemoveMemberAffordances() public { @@ -627,6 +629,8 @@ contract SecurityCouncilManagerTest is Test { assertTrue( s.hasRole(s.MIN_ROTATION_PERIOD_SETTER_ROLE(), mrs), "Min rotation period setter role" ); + assertEq(s.NAME_HASH(), keccak256(bytes("SecurityCouncilManager"))); + assertEq(s.VERSION_HASH(), keccak256(bytes("1"))); } function testSetMinRotationPeriod() public { From 717b0e7f20fcb6ff954d4e8eb02cdcee661631ee Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 3 Oct 2024 13:37:45 +0200 Subject: [PATCH 013/108] Snapshot update --- .gas-snapshot | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 94290ea91..d93a90a8b 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -26,7 +26,7 @@ ArbitrumVestingWalletTest:testDelegateFailsForNonBeneficiary() (gas: 16008435) ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971342) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008649) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074917) -E2E:testE2E() (gas: 85785140) +E2E:testE2E() (gas: 85825323) FixedDelegateErc20WalletTest:testInit() (gas: 5822575) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816805) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932218) @@ -94,14 +94,14 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28415658) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28364371) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28417242) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28657360) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31628990) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31633221) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26672005) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31631221) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31652101) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31669215) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31673446) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26712481) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31671446) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31692326) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) -OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317069, ~: 317184) +OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317072, ~: 317184) OfficeHoursActionTest:testInvalidConstructorParameters() (gas: 235740) OfficeHoursActionTest:testPerformBeforeMinimumTimestamp() (gas: 8646) OfficeHoursActionTest:testPerformDuringOfficeHours() (gas: 9140) @@ -116,30 +116,30 @@ OutboxActionsTest:testRemoveAllOutboxes() (gas: 693007) OutboxActionsTest:testRemoveOutboxes() (gas: 853882) ProxyUpgradeAndCallActionTest:testUpgrade() (gas: 137095) ProxyUpgradeAndCallActionTest:testUpgradeAndCall() (gas: 143042) -SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 249787) -SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20800) +SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 249743) +SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20778) SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 340022) SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 343319) SecurityCouncilManagerTest:testAddSC() (gas: 118677) SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112133) SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 123130) SecurityCouncilManagerTest:testCohortMethods() (gas: 136182) -SecurityCouncilManagerTest:testInitialization() (gas: 201641) -SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5074706) -SecurityCouncilManagerTest:testRemoveMember() (gas: 213142) -SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 99080) -SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81331) -SecurityCouncilManagerTest:testRemoveSeC() (gas: 38350) +SecurityCouncilManagerTest:testInitialization() (gas: 209054) +SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5162749) +SecurityCouncilManagerTest:testRemoveMember() (gas: 213164) +SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 99124) +SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81287) +SecurityCouncilManagerTest:testRemoveSeC() (gas: 38332) SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 208648) SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 258948) SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 262487) -SecurityCouncilManagerTest:testRotateMember() (gas: 557872) -SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3587319) +SecurityCouncilManagerTest:testRotateMember() (gas: 558156) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3587629) SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65822) SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83057) SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 295419) -SecurityCouncilManagerTest:testUpdateRouter() (gas: 76302) -SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112336) +SecurityCouncilManagerTest:testUpdateRouter() (gas: 76258) +SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112248) SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 295468) SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 246997) SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302852) @@ -156,7 +156,7 @@ SecurityCouncilMemberElectionGovernorTest:testOnlyNomineeElectionGovernorCanProp SecurityCouncilMemberElectionGovernorTest:testProperInitialization() (gas: 49388) SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32916) SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42229) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340178, ~: 340008) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340091, ~: 339846) SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273335) SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34951) SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152898) From bb721924446210ce0d76c34249ee811eaad1e4ab Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 3 Oct 2024 14:26:39 +0200 Subject: [PATCH 014/108] Updated test.bash to include arb timelock --- test/storage/ArbitrumTimelock | 13 +++++++++++++ test/storage/SecurityCouncilManager | 25 ++++++++++++------------- test/storage/test.bash | 2 +- 3 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 test/storage/ArbitrumTimelock diff --git a/test/storage/ArbitrumTimelock b/test/storage/ArbitrumTimelock new file mode 100644 index 000000000..982aba982 --- /dev/null +++ b/test/storage/ArbitrumTimelock @@ -0,0 +1,13 @@ +| Name | Type | Slot | Offset | Bytes | Contract | +|---------------|--------------------------------------------------------------|------|--------|-------|-------------------------------------------| +| _initialized | uint8 | 0 | 0 | 1 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +| _initializing | bool | 0 | 1 | 1 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +| __gap | uint256[50] | 1 | 0 | 1600 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +| __gap | uint256[50] | 51 | 0 | 1600 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +| _roles | mapping(bytes32 => struct AccessControlUpgradeable.RoleData) | 101 | 0 | 32 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +| __gap | uint256[49] | 102 | 0 | 1568 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +| _timestamps | mapping(bytes32 => uint256) | 151 | 0 | 32 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +| _minDelay | uint256 | 152 | 0 | 32 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +| __gap | uint256[48] | 153 | 0 | 1536 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +| _arbMinDelay | uint256 | 201 | 0 | 32 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +| __gap | uint256[49] | 202 | 0 | 1568 | src/ArbitrumTimelock.sol:ArbitrumTimelock | diff --git a/test/storage/SecurityCouncilManager b/test/storage/SecurityCouncilManager index 1ed981c35..486474e70 100644 --- a/test/storage/SecurityCouncilManager +++ b/test/storage/SecurityCouncilManager @@ -6,16 +6,15 @@ | __gap | uint256[50] | 51 | 0 | 1600 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | | _roles | mapping(bytes32 => struct AccessControlUpgradeable.RoleData) | 101 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | | __gap | uint256[49] | 102 | 0 | 1568 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| _HASHED_NAME | bytes32 | 151 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| _HASHED_VERSION | bytes32 | 152 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| __gap | uint256[50] | 153 | 0 | 1600 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| firstCohort | address[] | 203 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| secondCohort | address[] | 204 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| l2CoreGovTimelock | address payable | 205 | 0 | 20 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| securityCouncils | struct SecurityCouncilData[] | 206 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| router | contract UpgradeExecRouteBuilder | 207 | 0 | 20 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| updateNonce | uint256 | 208 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| cohortSize | uint256 | 209 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| lastRotated | mapping(address => uint256) | 210 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| minRotationPeriod | uint256 | 211 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| __gap | uint256[43] | 212 | 0 | 1376 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| firstCohort | address[] | 151 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| secondCohort | address[] | 152 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| l2CoreGovTimelock | address payable | 153 | 0 | 20 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| securityCouncils | struct SecurityCouncilData[] | 154 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| router | contract UpgradeExecRouteBuilder | 155 | 0 | 20 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| updateNonce | uint256 | 156 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| cohortSize | uint256 | 157 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| lastRotated | mapping(address => uint256) | 158 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| minRotationPeriod | uint256 | 159 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| NAME_HASH | bytes32 | 160 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| VERSION_HASH | bytes32 | 161 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| __gap | uint256[43] | 162 | 0 | 1376 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | diff --git a/test/storage/test.bash b/test/storage/test.bash index 463b8f877..f44578486 100755 --- a/test/storage/test.bash +++ b/test/storage/test.bash @@ -1,6 +1,6 @@ #!/bin/bash output_dir="./test/storage" -for CONTRACTNAME in SecurityCouncilManager L1ArbitrumTimelock L2ArbitrumTimelock L2ArbitrumGovernor L2ArbitrumToken L1ArbitrumToken FixedDelegateErc20Wallet UpgradeExecutor SecurityCouncilMemberElectionGovernor SecurityCouncilMemberRemovalGovernor SecurityCouncilNomineeElectionGovernor +for CONTRACTNAME in SecurityCouncilManager L1ArbitrumTimelock ArbitrumTimelock L2ArbitrumGovernor L2ArbitrumToken L1ArbitrumToken FixedDelegateErc20Wallet UpgradeExecutor SecurityCouncilMemberElectionGovernor SecurityCouncilMemberRemovalGovernor SecurityCouncilNomineeElectionGovernor do echo "Checking storage change of $CONTRACTNAME" [ -f "$output_dir/$CONTRACTNAME" ] && mv "$output_dir/$CONTRACTNAME" "$output_dir/$CONTRACTNAME-old" From cb5dae16984152e8354b9bdb8b367c6ac69a9a2f Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 3 Oct 2024 14:27:42 +0200 Subject: [PATCH 015/108] Reduced the storage gap --- src/security-council-mgmt/SecurityCouncilManager.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index be1647d3d..1aefab029 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -599,5 +599,5 @@ contract SecurityCouncilManager is * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ - uint256[43] private __gap; + uint256[39] private __gap; } From d1ff7380357fb64619b7fd732997bce0a25fde8c Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 3 Oct 2024 14:29:05 +0200 Subject: [PATCH 016/108] Updated gap storage file --- test/storage/SecurityCouncilManager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/storage/SecurityCouncilManager b/test/storage/SecurityCouncilManager index 486474e70..69f1ec407 100644 --- a/test/storage/SecurityCouncilManager +++ b/test/storage/SecurityCouncilManager @@ -17,4 +17,4 @@ | minRotationPeriod | uint256 | 159 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | | NAME_HASH | bytes32 | 160 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | | VERSION_HASH | bytes32 | 161 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| __gap | uint256[43] | 162 | 0 | 1376 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| __gap | uint256[39] | 162 | 0 | 1248 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | From b0576341534ab17a5ece07c0a2a0da759a59d6cf Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 3 Oct 2024 14:30:11 +0200 Subject: [PATCH 017/108] Updated sigs --- test/signatures/ArbitrumTimelock | 31 ++++++++++++++++++++++++++ test/signatures/SecurityCouncilManager | 4 ++++ test/signatures/test-sigs.bash | 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 test/signatures/ArbitrumTimelock diff --git a/test/signatures/ArbitrumTimelock b/test/signatures/ArbitrumTimelock new file mode 100644 index 000000000..6bf961846 --- /dev/null +++ b/test/signatures/ArbitrumTimelock @@ -0,0 +1,31 @@ +{ + "CANCELLER_ROLE()": "b08e51c0", + "DEFAULT_ADMIN_ROLE()": "a217fddf", + "EXECUTOR_ROLE()": "07bd0265", + "PROPOSER_ROLE()": "8f61f4f5", + "TIMELOCK_ADMIN_ROLE()": "0d3cf6fc", + "cancel(bytes32)": "c4d252f5", + "execute(address,uint256,bytes,bytes32,bytes32)": "134008d3", + "executeBatch(address[],uint256[],bytes[],bytes32,bytes32)": "e38335e5", + "getMinDelay()": "f27a0c92", + "getRoleAdmin(bytes32)": "248a9ca3", + "getTimestamp(bytes32)": "d45c4435", + "grantRole(bytes32,address)": "2f2ff15d", + "hasRole(bytes32,address)": "91d14854", + "hashOperation(address,uint256,bytes,bytes32,bytes32)": "8065657f", + "hashOperationBatch(address[],uint256[],bytes[],bytes32,bytes32)": "b1c5f427", + "initialize(uint256,address[],address[])": "7fbc79c6", + "isOperation(bytes32)": "31d50750", + "isOperationDone(bytes32)": "2ab0f529", + "isOperationPending(bytes32)": "584b153e", + "isOperationReady(bytes32)": "13bc9f20", + "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)": "bc197c81", + "onERC1155Received(address,address,uint256,uint256,bytes)": "f23a6e61", + "onERC721Received(address,address,uint256,bytes)": "150b7a02", + "renounceRole(bytes32,address)": "36568abe", + "revokeRole(bytes32,address)": "d547741f", + "schedule(address,uint256,bytes,bytes32,bytes32,uint256)": "01d5062a", + "scheduleBatch(address[],uint256[],bytes[],bytes32,bytes32,uint256)": "8f2a0bb0", + "supportsInterface(bytes4)": "01ffc9a7", + "updateDelay(uint256)": "64d62353" +} diff --git a/test/signatures/SecurityCouncilManager b/test/signatures/SecurityCouncilManager index 08bd9db39..bb676765e 100644 --- a/test/signatures/SecurityCouncilManager +++ b/test/signatures/SecurityCouncilManager @@ -1,13 +1,17 @@ { "COHORT_REPLACER_ROLE()": "279684e2", "DEFAULT_ADMIN_ROLE()": "a217fddf", + "DOMAIN_TYPE_HASH()": "c0993eea", "MAX_SECURITY_COUNCILS()": "c7b3f5ca", "MEMBER_ADDER_ROLE()": "ab738506", "MEMBER_REMOVER_ROLE()": "b8df7c7f", "MEMBER_REPLACER_ROLE()": "8e8c3210", "MEMBER_ROTATOR_ROLE()": "903e7ad6", "MIN_ROTATION_PERIOD_SETTER_ROLE()": "5db9bf4e", + "NAME_HASH()": "04622c2e", "RETRYABLE_TICKET_MAGIC()": "3994073d", + "TYPE_HASH()": "64d4c819", + "VERSION_HASH()": "9e4e7318", "addMember(address,uint8)": "62d0d1c3", "addSecurityCouncil((address,address,uint256))": "6eaff79e", "cohortIncludes(uint8,address)": "f5f4fde0", diff --git a/test/signatures/test-sigs.bash b/test/signatures/test-sigs.bash index 19d7d9046..11f9deb0e 100755 --- a/test/signatures/test-sigs.bash +++ b/test/signatures/test-sigs.bash @@ -1,6 +1,6 @@ #!/bin/bash output_dir="./test/signatures" -for CONTRACTNAME in SecurityCouncilManager L1ArbitrumTimelock L2ArbitrumTimelock L2ArbitrumGovernor L2ArbitrumToken L1ArbitrumToken FixedDelegateErc20Wallet UpgradeExecutor SecurityCouncilMemberElectionGovernor SecurityCouncilMemberRemovalGovernor SecurityCouncilNomineeElectionGovernor +for CONTRACTNAME in SecurityCouncilManager L1ArbitrumTimelock ArbitrumTimelock L2ArbitrumGovernor L2ArbitrumToken L1ArbitrumToken FixedDelegateErc20Wallet UpgradeExecutor SecurityCouncilMemberElectionGovernor SecurityCouncilMemberRemovalGovernor SecurityCouncilNomineeElectionGovernor do echo "Checking for signature changes in $CONTRACTNAME" [ -f "$output_dir/$CONTRACTNAME" ] && mv "$output_dir/$CONTRACTNAME" "$output_dir/$CONTRACTNAME-old" From 7ba9c8a9f6ba621626587c462a5b9c96d18ecd22 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Fri, 4 Oct 2024 10:03:10 +0200 Subject: [PATCH 018/108] Rotate members test --- .../RotateMembersUpgradeAction.sol | 14 ++- .../RotateMembersUpgradeAction.t.sol | 90 +++++++++++++++++++ 2 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 test/gov-actions/RotateMembersUpgradeAction.t.sol diff --git a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol index a51c73a57..2f0571071 100644 --- a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol +++ b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol @@ -11,8 +11,9 @@ contract RotateMembersUpgradeAction { address public immutable secCouncilManagerImpl; uint256 public immutable minRotationPeriod; address public immutable minRotationPeriodSetter; + // CHRIS: TODO: set the dao constitution hash here + bytes32 public immutable daoConstitutionHash = keccak256("testy"); - // CHRIS: TODO: tests and dao constitution hash constructor(IL2AddressRegistry _l2AddressRegistry, address _secCouncilManagerImpl, uint256 _minRotationPeriod, address _minRotationPeriodSetter) { l2AddressRegistry = _l2AddressRegistry; secCouncilManagerImpl = _secCouncilManagerImpl; @@ -28,7 +29,14 @@ contract RotateMembersUpgradeAction { abi.encodeCall(ISecurityCouncilManager(secCouncilManagerImpl).postUpgradeInit, (minRotationPeriod, minRotationPeriodSetter)) ); - require(minRotationPeriod == secCouncilManager.minRotationPeriod(), "Min rotation peroid not set"); - require(IAccessControlUpgradeable(address(secCouncilManager)).hasRole(secCouncilManager.MIN_ROTATION_PERIOD_SETTER_ROLE(), minRotationPeriodSetter), "Min rotation period setter not set"); + require(minRotationPeriod == secCouncilManager.minRotationPeriod(), "RotateMembersUpgradeAction: Min rotation period not set"); + require(IAccessControlUpgradeable(address(secCouncilManager)).hasRole(secCouncilManager.MIN_ROTATION_PERIOD_SETTER_ROLE(), minRotationPeriodSetter), "RotateMembersUpgradeAction: Min rotation period setter not set"); + + IArbitrumDAOConstitution arbitrumDaoConstitution = l2AddressRegistry.arbitrumDAOConstitution(); + arbitrumDaoConstitution.setConstitutionHash(daoConstitutionHash); + require( + arbitrumDaoConstitution.constitutionHash() == daoConstitutionHash, + "RotateMembersUpgradeAction: new constitution hash not set" + ); } } \ No newline at end of file diff --git a/test/gov-actions/RotateMembersUpgradeAction.t.sol b/test/gov-actions/RotateMembersUpgradeAction.t.sol new file mode 100644 index 000000000..3f41ab3c2 --- /dev/null +++ b/test/gov-actions/RotateMembersUpgradeAction.t.sol @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.16; + +import "forge-std/Test.sol"; + +import "../../src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol"; +import "../../src/security-council-mgmt/SecurityCouncilManager.sol"; +import "../../src/gov-action-contracts/address-registries/L2AddressRegistry.sol"; + +contract RotateMembersUpgradeActionTest is Test { + SecurityCouncilManager scm = SecurityCouncilManager(0xD509E5f5aEe2A205F554f36E8a7d56094494eDFC); + address oldImplementation = 0x468dA0eE5570Bdb1Dd81bFd925BAf028A93Dce64; + ProxyAdmin proxyAdmin = ProxyAdmin(0xdb216562328215E010F819B5aBe947bad4ca961e); + address council = 0x423552c0F05baCCac5Bfa91C6dCF1dc53a0A1641; + UpgradeExecutor arbOneUe = UpgradeExecutor(0xCF57572261c7c2BCF21ffD220ea7d1a27D40A827); + IArbitrumDAOConstitution constitution = IArbitrumDAOConstitution(0x1D62fFeB72e4c360CcBbacf7c965153b00260417); + bytes32 newConstitutionHash = keccak256("testy"); + + function setUp() public { + string memory arbRpc = vm.envOr("ARB_RPC_URL", string("")); + if(bytes(arbRpc).length != 0) { + vm.createSelectFork(arbRpc); + vm.rollFork(260227814); + } + } + + function testAction() external { + if (!_isForkTest()) { + console.log("not fork test, skipping RotateMembersUpgradeActionTest"); + return; + } + + if (_getImplementation() != oldImplementation) { + console.log("implementation not set to old implementation, skipping RotateMembersUpgradeActionTest"); + return; + } + + // we need to deploy a new registry + L2AddressRegistry reg = new L2AddressRegistry( + IL2ArbitrumGoverner(0xf07DeD9dC292157749B6Fd268E37DF6EA38395B9), + IL2ArbitrumGoverner(0x789fC99093B09aD01C34DC7251D0C89ce743e5a4), + IFixedDelegateErc20Wallet(0xF3FC178157fb3c87548bAA86F9d24BA38E649B58), + constitution, + proxyAdmin, + ISecurityCouncilNomineeElectionGovernor(0x8a1cDA8dee421cD06023470608605934c16A05a0) + ); + + address newImplementation = address(new SecurityCouncilManager()); + address rotationSetter = address(137); + uint256 minRotationPeriod = 1 weeks; + + RotateMembersUpgradeAction action = new RotateMembersUpgradeAction( + reg, + newImplementation, + minRotationPeriod, + rotationSetter + ); + + vm.prank(council); + arbOneUe.execute(address(action), abi.encodeWithSelector(action.perform.selector)); + + assertEq( + scm.minRotationPeriod(), + minRotationPeriod, + "min rotation period" + ); + assertTrue( + IAccessControlUpgradeable(address(scm)).hasRole(scm.MIN_ROTATION_PERIOD_SETTER_ROLE(), rotationSetter), + "Min rotation period setter not set" + ); + assertEq( + _getImplementation(), + newImplementation, + "implementation not set" + ); + assertEq( + constitution.constitutionHash(), + newConstitutionHash, + "constitution hash not set" + ); + } + + function _getImplementation() internal view returns (address) { + return proxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(scm)))); + } + + function _isForkTest() internal view returns (bool) { + return address(scm).code.length > 0; + } +} From d8a3cd438babf6bfc73c8d10ec2e5303632482e0 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Fri, 4 Oct 2024 10:03:34 +0200 Subject: [PATCH 019/108] Formatting --- .../RotateMembersUpgradeAction.t.sol | 42 +++++++------------ 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/test/gov-actions/RotateMembersUpgradeAction.t.sol b/test/gov-actions/RotateMembersUpgradeAction.t.sol index 3f41ab3c2..88841e7a2 100644 --- a/test/gov-actions/RotateMembersUpgradeAction.t.sol +++ b/test/gov-actions/RotateMembersUpgradeAction.t.sol @@ -13,25 +13,28 @@ contract RotateMembersUpgradeActionTest is Test { ProxyAdmin proxyAdmin = ProxyAdmin(0xdb216562328215E010F819B5aBe947bad4ca961e); address council = 0x423552c0F05baCCac5Bfa91C6dCF1dc53a0A1641; UpgradeExecutor arbOneUe = UpgradeExecutor(0xCF57572261c7c2BCF21ffD220ea7d1a27D40A827); - IArbitrumDAOConstitution constitution = IArbitrumDAOConstitution(0x1D62fFeB72e4c360CcBbacf7c965153b00260417); + IArbitrumDAOConstitution constitution = + IArbitrumDAOConstitution(0x1D62fFeB72e4c360CcBbacf7c965153b00260417); bytes32 newConstitutionHash = keccak256("testy"); function setUp() public { string memory arbRpc = vm.envOr("ARB_RPC_URL", string("")); - if(bytes(arbRpc).length != 0) { + if (bytes(arbRpc).length != 0) { vm.createSelectFork(arbRpc); - vm.rollFork(260227814); + vm.rollFork(260_227_814); } } - function testAction() external { + function testAction() external { if (!_isForkTest()) { console.log("not fork test, skipping RotateMembersUpgradeActionTest"); return; } if (_getImplementation() != oldImplementation) { - console.log("implementation not set to old implementation, skipping RotateMembersUpgradeActionTest"); + console.log( + "implementation not set to old implementation, skipping RotateMembersUpgradeActionTest" + ); return; } @@ -44,40 +47,27 @@ contract RotateMembersUpgradeActionTest is Test { proxyAdmin, ISecurityCouncilNomineeElectionGovernor(0x8a1cDA8dee421cD06023470608605934c16A05a0) ); - + address newImplementation = address(new SecurityCouncilManager()); address rotationSetter = address(137); uint256 minRotationPeriod = 1 weeks; RotateMembersUpgradeAction action = new RotateMembersUpgradeAction( - reg, - newImplementation, - minRotationPeriod, - rotationSetter + reg, newImplementation, minRotationPeriod, rotationSetter ); vm.prank(council); arbOneUe.execute(address(action), abi.encodeWithSelector(action.perform.selector)); - assertEq( - scm.minRotationPeriod(), - minRotationPeriod, - "min rotation period" - ); + assertEq(scm.minRotationPeriod(), minRotationPeriod, "min rotation period"); assertTrue( - IAccessControlUpgradeable(address(scm)).hasRole(scm.MIN_ROTATION_PERIOD_SETTER_ROLE(), rotationSetter), + IAccessControlUpgradeable(address(scm)).hasRole( + scm.MIN_ROTATION_PERIOD_SETTER_ROLE(), rotationSetter + ), "Min rotation period setter not set" ); - assertEq( - _getImplementation(), - newImplementation, - "implementation not set" - ); - assertEq( - constitution.constitutionHash(), - newConstitutionHash, - "constitution hash not set" - ); + assertEq(_getImplementation(), newImplementation, "implementation not set"); + assertEq(constitution.constitutionHash(), newConstitutionHash, "constitution hash not set"); } function _getImplementation() internal view returns (address) { From 1c58ab93f0b7f1a39a1c3cba9ae7256ce48801e6 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Fri, 4 Oct 2024 10:59:37 +0200 Subject: [PATCH 020/108] Added cancel timelock and rotate test --- src/interfaces/IArbitrumTimelock.sol | 1 + ...elTimelockAndRemoveMemberOActionTest.t.sol | 133 ++++++++++++++++++ .../RotateMembersUpgradeAction.t.sol | 2 - 3 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 test/gov-actions/CancelTimelockAndRemoveMemberOActionTest.t.sol diff --git a/src/interfaces/IArbitrumTimelock.sol b/src/interfaces/IArbitrumTimelock.sol index 89e4409ea..e17250c6d 100644 --- a/src/interfaces/IArbitrumTimelock.sol +++ b/src/interfaces/IArbitrumTimelock.sol @@ -13,4 +13,5 @@ interface IArbitrumTimelock { ) external; function getMinDelay() external view returns (uint256 duration); function updateDelay(uint256 newDelay) external; + function isOperation(bytes32 id) external view returns (bool registered); } diff --git a/test/gov-actions/CancelTimelockAndRemoveMemberOActionTest.t.sol b/test/gov-actions/CancelTimelockAndRemoveMemberOActionTest.t.sol new file mode 100644 index 000000000..6598641bd --- /dev/null +++ b/test/gov-actions/CancelTimelockAndRemoveMemberOActionTest.t.sol @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.16; + +import "forge-std/Test.sol"; + +import "../../src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol"; +import "../../src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol"; +import "../../src/security-council-mgmt/SecurityCouncilManager.sol"; +import "../../src/gov-action-contracts/address-registries/L2AddressRegistry.sol"; + +contract CancelTimelockAndRemoveMemberOActionTest is Test { + address oldImplementation = 0x468dA0eE5570Bdb1Dd81bFd925BAf028A93Dce64; + ProxyAdmin proxyAdmin = ProxyAdmin(0xdb216562328215E010F819B5aBe947bad4ca961e); + address council = 0x423552c0F05baCCac5Bfa91C6dCF1dc53a0A1641; + UpgradeExecutor arbOneUe = UpgradeExecutor(0xCF57572261c7c2BCF21ffD220ea7d1a27D40A827); + IArbitrumDAOConstitution constitution = + IArbitrumDAOConstitution(0x1D62fFeB72e4c360CcBbacf7c965153b00260417); + + function setUp() public { + string memory arbRpc = vm.envOr("ARB_RPC_URL", string("")); + if (bytes(arbRpc).length != 0) { + vm.createSelectFork(arbRpc); + } + } + + function testAction() external { + if (!_isForkTest()) { + console.log("not fork test, skipping RotateMembersUpgradeActionTest"); + return; + } + + // we need to deploy a new registry + L2AddressRegistry reg = new L2AddressRegistry( + IL2ArbitrumGoverner(0xf07DeD9dC292157749B6Fd268E37DF6EA38395B9), + IL2ArbitrumGoverner(0x789fC99093B09aD01C34DC7251D0C89ce743e5a4), + IFixedDelegateErc20Wallet(0xF3FC178157fb3c87548bAA86F9d24BA38E649B58), + constitution, + proxyAdmin, + ISecurityCouncilNomineeElectionGovernor(0x8a1cDA8dee421cD06023470608605934c16A05a0) + ); + // ensure that the scm has been updated + ensureLatestScm(reg); + + // rotate one of the members + ISecurityCouncilManager scm = reg.securityCouncilManager(); + address[] memory fc = scm.getFirstCohort(); + assertEq(fc.length, 6, "Not 6 addresses in first cohort"); + address memberOut = fc[2]; + uint256 memberInKey = 137; + address memberIn = vm.addr(memberInKey); + + // sign the rotation hash + bytes memory sig; + { + (uint8 v, bytes32 r, bytes32 s) = + vm.sign(memberInKey, scm.getRotateMemberHash(memberOut, scm.updateNonce())); + sig = abi.encodePacked(r, s, v); + } + + vm.recordLogs(); + address memberElectionGov = address(reg.scMemberElectionGovernor()); + vm.prank(memberOut); + scm.rotateMember(memberIn, memberElectionGov, sig); + + // use the event to get the data we need for cancelling + // we do minimal checks here since we know what the transaction looked + // like in a live situation more verification would need to be done to ensure + // the correct proposal id and member to remove + address memberToRemove; + bytes32 proposalId; + Vm.Log[] memory logs = vm.getRecordedLogs(); + for (uint256 i = 0; i < logs.length; i++) { + if (logs[i].emitter == address(scm)) { + // first log is the member rotation + // event MemberRotated(address indexed replacedAddress, address indexed newAddress, Cohort cohort); + memberToRemove = address(uint160(uint256(logs[i].topics[2]))); + } else if (logs[i].emitter == address(reg.coreGovTimelock())) { + // second log is call scheduled + // event CallScheduled( + // bytes32 indexed id, + // uint256 indexed index, + // address target, + // uint256 value, + // bytes data, + // bytes32 predecessor, + // uint256 delay + // ); + proposalId = logs[i].topics[1]; + } else { + revert("Unrecognised log"); + } + } + assertTrue(reg.coreGovTimelock().isOperation(proposalId), "Prop does not exist"); + + CancelTimelockAndRemoveMemberOAction action = new CancelTimelockAndRemoveMemberOAction(reg); + vm.prank(council); + arbOneUe.execute( + address(action), abi.encodeCall(action.perform, (memberToRemove, proposalId)) + ); + + address[] memory fc1 = scm.getFirstCohort(); + assertEq(fc1.length, 5, "Not 5 addresses in first cohort"); + assertFalse(reg.coreGovTimelock().isOperation(proposalId), "Prop does not exist"); + for (uint256 i = 0; i < 6; i++) { + if (i == 0 || i == 1 || i == 3 || i == 4) { + assertEq(fc[i], fc[i]); + } else if (i == 2) { + // do nothing this has been removed + assertEq(fc[i], fc[i - 1]); + } else if (i == 5) { + // last place has moved to 2 + assertEq(fc[i], fc[2]); + } else { + revert("Unexpected case"); + } + } + } + + function ensureLatestScm(L2AddressRegistry reg) internal { + address newImplementation = address(new SecurityCouncilManager()); + address rotationSetter = address(1337); + uint256 minRotationPeriod = 1 weeks; + RotateMembersUpgradeAction action = new RotateMembersUpgradeAction( + reg, newImplementation, minRotationPeriod, rotationSetter + ); + vm.prank(council); + arbOneUe.execute(address(action), abi.encodeWithSelector(action.perform.selector)); + } + + function _isForkTest() internal view returns (bool) { + return address(arbOneUe).code.length > 0; + } +} diff --git a/test/gov-actions/RotateMembersUpgradeAction.t.sol b/test/gov-actions/RotateMembersUpgradeAction.t.sol index 88841e7a2..84fc42716 100644 --- a/test/gov-actions/RotateMembersUpgradeAction.t.sol +++ b/test/gov-actions/RotateMembersUpgradeAction.t.sol @@ -51,11 +51,9 @@ contract RotateMembersUpgradeActionTest is Test { address newImplementation = address(new SecurityCouncilManager()); address rotationSetter = address(137); uint256 minRotationPeriod = 1 weeks; - RotateMembersUpgradeAction action = new RotateMembersUpgradeAction( reg, newImplementation, minRotationPeriod, rotationSetter ); - vm.prank(council); arbOneUe.execute(address(action), abi.encodeWithSelector(action.perform.selector)); From 91cc2a8ebe33dc656829bc03d29e15935823ad61 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Fri, 4 Oct 2024 11:01:30 +0200 Subject: [PATCH 021/108] Updated test --- .../CancelTimelockAndRemoveMemberOActionTest.t.sol | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/gov-actions/CancelTimelockAndRemoveMemberOActionTest.t.sol b/test/gov-actions/CancelTimelockAndRemoveMemberOActionTest.t.sol index 6598641bd..d4b290010 100644 --- a/test/gov-actions/CancelTimelockAndRemoveMemberOActionTest.t.sol +++ b/test/gov-actions/CancelTimelockAndRemoveMemberOActionTest.t.sol @@ -103,13 +103,12 @@ contract CancelTimelockAndRemoveMemberOActionTest is Test { assertFalse(reg.coreGovTimelock().isOperation(proposalId), "Prop does not exist"); for (uint256 i = 0; i < 6; i++) { if (i == 0 || i == 1 || i == 3 || i == 4) { - assertEq(fc[i], fc[i]); + assertEq(fc[i], fc1[i]); } else if (i == 2) { // do nothing this has been removed - assertEq(fc[i], fc[i - 1]); } else if (i == 5) { // last place has moved to 2 - assertEq(fc[i], fc[2]); + assertEq(fc[i], fc1[2]); } else { revert("Unexpected case"); } From d4e204e08d9d4ad140a3e3e668b61bd45e67de8b Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Mon, 7 Oct 2024 17:48:12 +0100 Subject: [PATCH 022/108] File rename --- .../governance/CancelTimelockAndRemoveMemberAction.sol | 1 - ...Test.t.sol => CancelTimelockAndRemoveMemberActionTest.t.sol} | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) rename test/gov-actions/{CancelTimelockAndRemoveMemberOActionTest.t.sol => CancelTimelockAndRemoveMemberActionTest.t.sol} (98%) diff --git a/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol b/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol index a6e4d7ab8..ae6c79502 100644 --- a/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol +++ b/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol @@ -11,7 +11,6 @@ contract CancelTimelockAndRemoveMemberOAction { l2AddressRegistry = _l2AddressRegistry; } - // CHRIS: TODO: restrict this to ony being able to cancel rotation props and not any prop function perform(address memberToRemove, bytes32 operationId) public { // first remove the council member ISecurityCouncilManager scm = l2AddressRegistry.securityCouncilManager(); diff --git a/test/gov-actions/CancelTimelockAndRemoveMemberOActionTest.t.sol b/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol similarity index 98% rename from test/gov-actions/CancelTimelockAndRemoveMemberOActionTest.t.sol rename to test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol index d4b290010..3637dc022 100644 --- a/test/gov-actions/CancelTimelockAndRemoveMemberOActionTest.t.sol +++ b/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol @@ -8,7 +8,7 @@ import "../../src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberA import "../../src/security-council-mgmt/SecurityCouncilManager.sol"; import "../../src/gov-action-contracts/address-registries/L2AddressRegistry.sol"; -contract CancelTimelockAndRemoveMemberOActionTest is Test { +contract CancelTimelockAndRemoveMemberActionTest is Test { address oldImplementation = 0x468dA0eE5570Bdb1Dd81bFd925BAf028A93Dce64; ProxyAdmin proxyAdmin = ProxyAdmin(0xdb216562328215E010F819B5aBe947bad4ca961e); address council = 0x423552c0F05baCCac5Bfa91C6dCF1dc53a0A1641; From 315f7f2607a53e55fd889a4ec8e509b786f53246 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Mon, 7 Oct 2024 17:55:44 +0100 Subject: [PATCH 023/108] Removed dao constitution --- Makefile | 2 +- .../RotateMembersUpgradeAction.sol | 11 +---------- test/gov-actions/RotateMembersUpgradeAction.t.sol | 2 -- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 77bfacf19..ecd351007 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ coverage :; forge coverage gas :; forge test --gas-report gas-check :; forge snapshot --check --tolerance 1 snapshot :; forge snapshot -test-unit :; forge test -vvv +test-unit :; ARB_RPC_URL=https://arb1.arbitrum.io/rpc forge test -vvv clean :; forge clean fmt :; forge fmt gen-network :; yarn gen:network diff --git a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol index 2f0571071..2132f1db8 100644 --- a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol +++ b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol @@ -11,9 +11,7 @@ contract RotateMembersUpgradeAction { address public immutable secCouncilManagerImpl; uint256 public immutable minRotationPeriod; address public immutable minRotationPeriodSetter; - // CHRIS: TODO: set the dao constitution hash here - bytes32 public immutable daoConstitutionHash = keccak256("testy"); - + constructor(IL2AddressRegistry _l2AddressRegistry, address _secCouncilManagerImpl, uint256 _minRotationPeriod, address _minRotationPeriodSetter) { l2AddressRegistry = _l2AddressRegistry; secCouncilManagerImpl = _secCouncilManagerImpl; @@ -31,12 +29,5 @@ contract RotateMembersUpgradeAction { require(minRotationPeriod == secCouncilManager.minRotationPeriod(), "RotateMembersUpgradeAction: Min rotation period not set"); require(IAccessControlUpgradeable(address(secCouncilManager)).hasRole(secCouncilManager.MIN_ROTATION_PERIOD_SETTER_ROLE(), minRotationPeriodSetter), "RotateMembersUpgradeAction: Min rotation period setter not set"); - - IArbitrumDAOConstitution arbitrumDaoConstitution = l2AddressRegistry.arbitrumDAOConstitution(); - arbitrumDaoConstitution.setConstitutionHash(daoConstitutionHash); - require( - arbitrumDaoConstitution.constitutionHash() == daoConstitutionHash, - "RotateMembersUpgradeAction: new constitution hash not set" - ); } } \ No newline at end of file diff --git a/test/gov-actions/RotateMembersUpgradeAction.t.sol b/test/gov-actions/RotateMembersUpgradeAction.t.sol index 84fc42716..b63d7c83a 100644 --- a/test/gov-actions/RotateMembersUpgradeAction.t.sol +++ b/test/gov-actions/RotateMembersUpgradeAction.t.sol @@ -15,7 +15,6 @@ contract RotateMembersUpgradeActionTest is Test { UpgradeExecutor arbOneUe = UpgradeExecutor(0xCF57572261c7c2BCF21ffD220ea7d1a27D40A827); IArbitrumDAOConstitution constitution = IArbitrumDAOConstitution(0x1D62fFeB72e4c360CcBbacf7c965153b00260417); - bytes32 newConstitutionHash = keccak256("testy"); function setUp() public { string memory arbRpc = vm.envOr("ARB_RPC_URL", string("")); @@ -65,7 +64,6 @@ contract RotateMembersUpgradeActionTest is Test { "Min rotation period setter not set" ); assertEq(_getImplementation(), newImplementation, "implementation not set"); - assertEq(constitution.constitutionHash(), newConstitutionHash, "constitution hash not set"); } function _getImplementation() internal view returns (address) { From 057638b55bc7b08d010b7d3153a9617e3be4ef83 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Mon, 7 Oct 2024 17:58:27 +0100 Subject: [PATCH 024/108] Formatting --- .../RotateMembersUpgradeAction.sol | 28 +++++++++++++++---- .../CancelTimelockAndRemoveMemberAction.sol | 2 +- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol index 2132f1db8..9bb1df902 100644 --- a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol +++ b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol @@ -11,8 +11,13 @@ contract RotateMembersUpgradeAction { address public immutable secCouncilManagerImpl; uint256 public immutable minRotationPeriod; address public immutable minRotationPeriodSetter; - - constructor(IL2AddressRegistry _l2AddressRegistry, address _secCouncilManagerImpl, uint256 _minRotationPeriod, address _minRotationPeriodSetter) { + + constructor( + IL2AddressRegistry _l2AddressRegistry, + address _secCouncilManagerImpl, + uint256 _minRotationPeriod, + address _minRotationPeriodSetter + ) { l2AddressRegistry = _l2AddressRegistry; secCouncilManagerImpl = _secCouncilManagerImpl; minRotationPeriod = _minRotationPeriod; @@ -24,10 +29,21 @@ contract RotateMembersUpgradeAction { l2AddressRegistry.govProxyAdmin().upgradeAndCall( TransparentUpgradeableProxy(payable(address(secCouncilManager))), secCouncilManagerImpl, - abi.encodeCall(ISecurityCouncilManager(secCouncilManagerImpl).postUpgradeInit, (minRotationPeriod, minRotationPeriodSetter)) + abi.encodeCall( + ISecurityCouncilManager(secCouncilManagerImpl).postUpgradeInit, + (minRotationPeriod, minRotationPeriodSetter) + ) ); - require(minRotationPeriod == secCouncilManager.minRotationPeriod(), "RotateMembersUpgradeAction: Min rotation period not set"); - require(IAccessControlUpgradeable(address(secCouncilManager)).hasRole(secCouncilManager.MIN_ROTATION_PERIOD_SETTER_ROLE(), minRotationPeriodSetter), "RotateMembersUpgradeAction: Min rotation period setter not set"); + require( + minRotationPeriod == secCouncilManager.minRotationPeriod(), + "RotateMembersUpgradeAction: Min rotation period not set" + ); + require( + IAccessControlUpgradeable(address(secCouncilManager)).hasRole( + secCouncilManager.MIN_ROTATION_PERIOD_SETTER_ROLE(), minRotationPeriodSetter + ), + "RotateMembersUpgradeAction: Min rotation period setter not set" + ); } -} \ No newline at end of file +} diff --git a/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol b/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol index ae6c79502..33a0cb307 100644 --- a/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol +++ b/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol @@ -21,4 +21,4 @@ contract CancelTimelockAndRemoveMemberOAction { // then cancel the rotation operation in the timelock CancelTimelockOperation.cancel(l2AddressRegistry.coreGov(), operationId); } -} \ No newline at end of file +} From 9fc3dd53c695dc03aab809872696270116f0d99c Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Mon, 7 Oct 2024 18:11:16 +0100 Subject: [PATCH 025/108] Updates from code review --- src/security-council-mgmt/SecurityCouncilManager.sol | 12 ++++++------ .../SecurityCouncilManager.t.sol | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 1aefab029..f50a67bc7 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -160,7 +160,7 @@ contract SecurityCouncilManager is _addSecurityCouncil(_securityCouncils[i]); } - setMinRotationPeriodImpl(_minRotationPeriod); + _setMinRotationPeriod(_minRotationPeriod); // we do our own 712 functionality because inheriting the OZ version // would change our storage layout @@ -171,11 +171,11 @@ contract SecurityCouncilManager is function postUpgradeInit(uint256 _minRotationPeriod, address minRotationPeriodSetter) external { - address proxyAdmin = ProxyUtil.getProxyAdmin(); - require(msg.sender == proxyAdmin, "NOT_FROM_ADMIN"); + require(msg.sender == ProxyUtil.getProxyAdmin(), "NOT_FROM_ADMIN"); + require(minRotationPeriod == 0, "MIN_ROTATION_ALREADY_SET"); _grantRole(MIN_ROTATION_PERIOD_SETTER_ROLE, minRotationPeriodSetter); - setMinRotationPeriodImpl(_minRotationPeriod); + _setMinRotationPeriod(_minRotationPeriod); NAME_HASH = keccak256(bytes("SecurityCouncilManager")); VERSION_HASH = keccak256(bytes("1")); @@ -192,10 +192,10 @@ contract SecurityCouncilManager is external onlyRole(MIN_ROTATION_PERIOD_SETTER_ROLE) { - setMinRotationPeriodImpl(_minRotationPeriod); + _setMinRotationPeriod(_minRotationPeriod); } - function setMinRotationPeriodImpl(uint256 _minRotationPeriod) internal { + function _setMinRotationPeriod(uint256 _minRotationPeriod) internal { minRotationPeriod = _minRotationPeriod; emit MinRotationPeriodSet(_minRotationPeriod); } diff --git a/test/security-council-mgmt/SecurityCouncilManager.t.sol b/test/security-council-mgmt/SecurityCouncilManager.t.sol index 6f0aca4a0..40b19403a 100644 --- a/test/security-council-mgmt/SecurityCouncilManager.t.sol +++ b/test/security-council-mgmt/SecurityCouncilManager.t.sol @@ -631,6 +631,12 @@ contract SecurityCouncilManagerTest is Test { ); assertEq(s.NAME_HASH(), keccak256(bytes("SecurityCouncilManager"))); assertEq(s.VERSION_HASH(), keccak256(bytes("1"))); + + vm.expectRevert("MIN_ROTATION_ALREADY_SET"); + vm.prank(address(pa)); + TransparentUpgradeableProxy(payable(address(s))).upgradeToAndCall( + address(logic), abi.encodeCall(s.postUpgradeInit, (mr, mrs)) + ); } function testSetMinRotationPeriod() public { From 73593e4c1a390671b22dfea7b2eca69de1eeccef Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Mon, 7 Oct 2024 18:14:14 +0100 Subject: [PATCH 026/108] Updated snapshot --- .gas-snapshot | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index d93a90a8b..be20914f0 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -26,7 +26,7 @@ ArbitrumVestingWalletTest:testDelegateFailsForNonBeneficiary() (gas: 16008435) ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971342) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008649) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074917) -E2E:testE2E() (gas: 85825323) +E2E:testE2E() (gas: 85848560) FixedDelegateErc20WalletTest:testInit() (gas: 5822575) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816805) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932218) @@ -94,14 +94,14 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28415658) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28364371) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28417242) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28657360) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31669215) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31673446) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26712481) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31671446) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31692326) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31692452) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31696683) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26735718) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31694683) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31715563) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) -OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317072, ~: 317184) +OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317070, ~: 317184) OfficeHoursActionTest:testInvalidConstructorParameters() (gas: 235740) OfficeHoursActionTest:testPerformBeforeMinimumTimestamp() (gas: 8646) OfficeHoursActionTest:testPerformDuringOfficeHours() (gas: 9140) @@ -125,7 +125,7 @@ SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112133) SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 123130) SecurityCouncilManagerTest:testCohortMethods() (gas: 136182) SecurityCouncilManagerTest:testInitialization() (gas: 209054) -SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5162749) +SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5191924) SecurityCouncilManagerTest:testRemoveMember() (gas: 213164) SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 99124) SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81287) @@ -156,7 +156,7 @@ SecurityCouncilMemberElectionGovernorTest:testOnlyNomineeElectionGovernorCanProp SecurityCouncilMemberElectionGovernorTest:testProperInitialization() (gas: 49388) SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32916) SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42229) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340091, ~: 339846) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340178, ~: 340008) SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273335) SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34951) SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152898) From 2728de6d365f128a148330e5b46c7a6e7a64364e Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Mon, 7 Oct 2024 18:17:25 +0100 Subject: [PATCH 027/108] Updated snapshot --- .gas-snapshot | 290 +++++++++++++++++++++++++------------------------- 1 file changed, 146 insertions(+), 144 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index be20914f0..99598acff 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,72 +1,73 @@ -AIP1Point2ActionTest:testAction() (gas: 629328) +AIP1Point2ActionTest:testAction() (gas: 629372) AIPNovaFeeRoutingActionTest:testAction() (gas: 3074) ArbitrumDAOConstitutionTest:testConstructor() (gas: 259383) ArbitrumDAOConstitutionTest:testMonOwnerCannotSetHash() (gas: 262836) ArbitrumDAOConstitutionTest:testOwnerCanSetHash() (gas: 261148) ArbitrumDAOConstitutionTest:testOwnerCanSetHashTwice() (gas: 263824) -ArbitrumFoundationVestingWalletTest:testBeneficiaryCanSetBeneficiary() (gas: 16332093) -ArbitrumFoundationVestingWalletTest:testMigrateEthToNewWalletWithSlowerVesting() (gas: 19243747) -ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithFasterVesting() (gas: 19247090) -ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithSlowerVesting() (gas: 19247035) -ArbitrumFoundationVestingWalletTest:testMigrationTargetMustBeContract() (gas: 16335426) -ArbitrumFoundationVestingWalletTest:testOnlyBeneficiaryCanRelease() (gas: 16327408) -ArbitrumFoundationVestingWalletTest:testOnlyOwnerCanMigrate() (gas: 16329757) -ArbitrumFoundationVestingWalletTest:testOwnerCanSetBeneficiary() (gas: 16332176) -ArbitrumFoundationVestingWalletTest:testProperlyInits() (gas: 16337546) -ArbitrumFoundationVestingWalletTest:testRandomAddressCantSetBeneficiary() (gas: 16329656) -ArbitrumFoundationVestingWalletTest:testRelease() (gas: 16451131) +ArbitrumFoundationVestingWalletTest:testBeneficiaryCanSetBeneficiary() (gas: 16332113) +ArbitrumFoundationVestingWalletTest:testMigrateEthToNewWalletWithSlowerVesting() (gas: 19243772) +ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithFasterVesting() (gas: 19247115) +ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithSlowerVesting() (gas: 19247060) +ArbitrumFoundationVestingWalletTest:testMigrationTargetMustBeContract() (gas: 16335446) +ArbitrumFoundationVestingWalletTest:testOnlyBeneficiaryCanRelease() (gas: 16327428) +ArbitrumFoundationVestingWalletTest:testOnlyOwnerCanMigrate() (gas: 16329777) +ArbitrumFoundationVestingWalletTest:testOwnerCanSetBeneficiary() (gas: 16332196) +ArbitrumFoundationVestingWalletTest:testProperlyInits() (gas: 16337566) +ArbitrumFoundationVestingWalletTest:testRandomAddressCantSetBeneficiary() (gas: 16329676) +ArbitrumFoundationVestingWalletTest:testRelease() (gas: 16451151) ArbitrumVestingWalletFactoryTest:testDeploy() (gas: 4589688) ArbitrumVestingWalletFactoryTest:testOnlyOwnerCanCreateWallets() (gas: 1504286) -ArbitrumVestingWalletTest:testCastVote() (gas: 16201584) -ArbitrumVestingWalletTest:testCastVoteFailsForNonBeneficiary() (gas: 16151341) -ArbitrumVestingWalletTest:testClaim() (gas: 16007768) -ArbitrumVestingWalletTest:testClaimFailsForNonBeneficiary() (gas: 15967955) -ArbitrumVestingWalletTest:testDelegate() (gas: 16081106) -ArbitrumVestingWalletTest:testDelegateFailsForNonBeneficiary() (gas: 16008435) -ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971342) -ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008649) -ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074917) -E2E:testE2E() (gas: 85848560) -FixedDelegateErc20WalletTest:testInit() (gas: 5822575) -FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816805) -FixedDelegateErc20WalletTest:testTransfer() (gas: 5932218) -FixedDelegateErc20WalletTest:testTransferNotOwner() (gas: 5897843) +ArbitrumVestingWalletTest:testCastVote() (gas: 16201599) +ArbitrumVestingWalletTest:testCastVoteFailsForNonBeneficiary() (gas: 16151356) +ArbitrumVestingWalletTest:testClaim() (gas: 16007783) +ArbitrumVestingWalletTest:testClaimFailsForNonBeneficiary() (gas: 15967970) +ArbitrumVestingWalletTest:testDelegate() (gas: 16081121) +ArbitrumVestingWalletTest:testDelegateFailsForNonBeneficiary() (gas: 16008450) +ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) +ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) +ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) +CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) +E2E:testE2E() (gas: 85928758) +FixedDelegateErc20WalletTest:testInit() (gas: 5822585) +FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) +FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) +FixedDelegateErc20WalletTest:testTransferNotOwner() (gas: 5897853) InboxActionsTest:testPauseAndUpauseInbox() (gas: 370454) L1AddressRegistryTest:testAddressRegistryAddress() (gas: 47009) -L1ArbitrumTimelockTest:testCancel() (gas: 5324642) -L1ArbitrumTimelockTest:testCancelFailsBadSender() (gas: 5369529) -L1ArbitrumTimelockTest:testDoesDeploy() (gas: 5273077) -L1ArbitrumTimelockTest:testDoesNotDeployZeroInbox() (gas: 4978961) -L1ArbitrumTimelockTest:testDoesNotDeployZeroL2Timelock() (gas: 4976931) -L1ArbitrumTimelockTest:testExecute() (gas: 5405352) -L1ArbitrumTimelockTest:testExecuteInbox() (gas: 5746378) -L1ArbitrumTimelockTest:testExecuteInboxBatch() (gas: 6056741) -L1ArbitrumTimelockTest:testExecuteInboxInvalidData() (gas: 5426399) -L1ArbitrumTimelockTest:testExecuteInboxNotEnoughVal() (gas: 5446210) -L1ArbitrumTimelockTest:testSchedule() (gas: 5357782) -L1ArbitrumTimelockTest:testScheduleFailsBadL2Timelock() (gas: 5286095) -L1ArbitrumTimelockTest:testScheduleFailsBadSender() (gas: 5281079) -L1ArbitrumTokenTest:testBridgeBurn() (gas: 3395571) -L1ArbitrumTokenTest:testBridgeBurnNotGateway() (gas: 3389611) -L1ArbitrumTokenTest:testBridgeMint() (gas: 3390798) -L1ArbitrumTokenTest:testBridgeMintNotGateway() (gas: 3341036) -L1ArbitrumTokenTest:testInit() (gas: 3355939) -L1ArbitrumTokenTest:testInitZeroGateway() (gas: 3177234) -L1ArbitrumTokenTest:testInitZeroNovaGateway() (gas: 3177301) -L1ArbitrumTokenTest:testInitZeroNovaRouter() (gas: 3177235) -L1ArbitrumTokenTest:testRegisterTokenOnL2() (gas: 4568612) -L1ArbitrumTokenTest:testRegisterTokenOnL2NotEnoughVal() (gas: 4425799) +L1ArbitrumTimelockTest:testCancel() (gas: 5324647) +L1ArbitrumTimelockTest:testCancelFailsBadSender() (gas: 5369534) +L1ArbitrumTimelockTest:testDoesDeploy() (gas: 5273082) +L1ArbitrumTimelockTest:testDoesNotDeployZeroInbox() (gas: 4978966) +L1ArbitrumTimelockTest:testDoesNotDeployZeroL2Timelock() (gas: 4976936) +L1ArbitrumTimelockTest:testExecute() (gas: 5405357) +L1ArbitrumTimelockTest:testExecuteInbox() (gas: 5746383) +L1ArbitrumTimelockTest:testExecuteInboxBatch() (gas: 6056746) +L1ArbitrumTimelockTest:testExecuteInboxInvalidData() (gas: 5426404) +L1ArbitrumTimelockTest:testExecuteInboxNotEnoughVal() (gas: 5446215) +L1ArbitrumTimelockTest:testSchedule() (gas: 5357787) +L1ArbitrumTimelockTest:testScheduleFailsBadL2Timelock() (gas: 5286100) +L1ArbitrumTimelockTest:testScheduleFailsBadSender() (gas: 5281084) +L1ArbitrumTokenTest:testBridgeBurn() (gas: 3395576) +L1ArbitrumTokenTest:testBridgeBurnNotGateway() (gas: 3389616) +L1ArbitrumTokenTest:testBridgeMint() (gas: 3390803) +L1ArbitrumTokenTest:testBridgeMintNotGateway() (gas: 3341041) +L1ArbitrumTokenTest:testInit() (gas: 3355944) +L1ArbitrumTokenTest:testInitZeroGateway() (gas: 3177239) +L1ArbitrumTokenTest:testInitZeroNovaGateway() (gas: 3177306) +L1ArbitrumTokenTest:testInitZeroNovaRouter() (gas: 3177240) +L1ArbitrumTokenTest:testRegisterTokenOnL2() (gas: 4568617) +L1ArbitrumTokenTest:testRegisterTokenOnL2NotEnoughVal() (gas: 4425804) L1GovernanceFactoryTest:testL1GovernanceFactory() (gas: 10771109) L1GovernanceFactoryTest:testSetMinDelay() (gas: 10746003) L1GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 10798958) -L2AddressRegistryTest:testAddressRegistryAddress() (gas: 54658) -L2ArbitrumGovernorTest:testCantReinit() (gas: 13669489) -L2ArbitrumGovernorTest:testExecutorPermissions() (gas: 13706483) -L2ArbitrumGovernorTest:testExecutorPermissionsFail() (gas: 13679135) -L2ArbitrumGovernorTest:testPastCirculatingSupply() (gas: 13673238) -L2ArbitrumGovernorTest:testPastCirculatingSupplyExclude() (gas: 13812715) -L2ArbitrumGovernorTest:testPastCirculatingSupplyMint() (gas: 13737218) -L2ArbitrumGovernorTest:testProperlyInitialized() (gas: 13664706) +L2AddressRegistryTest:testAddressRegistryAddress() (gas: 54770) +L2ArbitrumGovernorTest:testCantReinit() (gas: 13669504) +L2ArbitrumGovernorTest:testExecutorPermissions() (gas: 13706498) +L2ArbitrumGovernorTest:testExecutorPermissionsFail() (gas: 13679150) +L2ArbitrumGovernorTest:testPastCirculatingSupply() (gas: 13673253) +L2ArbitrumGovernorTest:testPastCirculatingSupplyExclude() (gas: 13812730) +L2ArbitrumGovernorTest:testPastCirculatingSupplyMint() (gas: 13737233) +L2ArbitrumGovernorTest:testProperlyInitialized() (gas: 13664721) L2ArbitrumTokenTest:testCanBurn() (gas: 4066835) L2ArbitrumTokenTest:testCanMint2Percent() (gas: 4101512) L2ArbitrumTokenTest:testCanMintLessThan2Percent() (gas: 4101514) @@ -94,14 +95,14 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28415658) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28364371) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28417242) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28657360) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31692452) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31696683) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26735718) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31694683) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31715563) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31692496) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31696727) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26735762) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31694727) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31715633) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) -OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317070, ~: 317184) +OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317068, ~: 317184) OfficeHoursActionTest:testInvalidConstructorParameters() (gas: 235740) OfficeHoursActionTest:testPerformBeforeMinimumTimestamp() (gas: 8646) OfficeHoursActionTest:testPerformDuringOfficeHours() (gas: 9140) @@ -116,51 +117,52 @@ OutboxActionsTest:testRemoveAllOutboxes() (gas: 693007) OutboxActionsTest:testRemoveOutboxes() (gas: 853882) ProxyUpgradeAndCallActionTest:testUpgrade() (gas: 137095) ProxyUpgradeAndCallActionTest:testUpgradeAndCall() (gas: 143042) +RotateMembersUpgradeActionTest:testAction() (gas: 8153) SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 249743) SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20778) -SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 340022) -SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 343319) +SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 340628) +SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 343925) SecurityCouncilManagerTest:testAddSC() (gas: 118677) SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112133) SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 123130) -SecurityCouncilManagerTest:testCohortMethods() (gas: 136182) -SecurityCouncilManagerTest:testInitialization() (gas: 209054) +SecurityCouncilManagerTest:testCohortMethods() (gas: 136833) +SecurityCouncilManagerTest:testInitialization() (gas: 209660) SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5191924) -SecurityCouncilManagerTest:testRemoveMember() (gas: 213164) +SecurityCouncilManagerTest:testRemoveMember() (gas: 213409) SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 99124) SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81287) SecurityCouncilManagerTest:testRemoveSeC() (gas: 38332) SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 208648) -SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 258948) -SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 262487) -SecurityCouncilManagerTest:testRotateMember() (gas: 558156) -SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3587629) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 259554) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 263093) +SecurityCouncilManagerTest:testRotateMember() (gas: 559368) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3588538) SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65822) SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83057) -SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 295419) -SecurityCouncilManagerTest:testUpdateRouter() (gas: 76258) -SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112248) -SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 295468) -SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 246997) -SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302852) -SecurityCouncilMemberElectionGovernorTest:testCastBySigTwice() (gas: 266244) +SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 296025) +SecurityCouncilManagerTest:testUpdateRouter() (gas: 76269) +SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112259) +SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 296074) +SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 247018) +SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302873) +SecurityCouncilMemberElectionGovernorTest:testCastBySigTwice() (gas: 266265) SecurityCouncilMemberElectionGovernorTest:testCastVoteReverts() (gas: 35277) -SecurityCouncilMemberElectionGovernorTest:testExecute() (gas: 665450) -SecurityCouncilMemberElectionGovernorTest:testForceSupport() (gas: 165349) +SecurityCouncilMemberElectionGovernorTest:testExecute() (gas: 666011) +SecurityCouncilMemberElectionGovernorTest:testForceSupport() (gas: 165370) SecurityCouncilMemberElectionGovernorTest:testInitReverts() (gas: 4922497) -SecurityCouncilMemberElectionGovernorTest:testInvalidParams() (gas: 165321) -SecurityCouncilMemberElectionGovernorTest:testMiscVotesViews() (gas: 227939) -SecurityCouncilMemberElectionGovernorTest:testNoVoteForNonCompliantNominee() (gas: 123524) -SecurityCouncilMemberElectionGovernorTest:testNoZeroWeightVotes() (gas: 169595) +SecurityCouncilMemberElectionGovernorTest:testInvalidParams() (gas: 165342) +SecurityCouncilMemberElectionGovernorTest:testMiscVotesViews() (gas: 227960) +SecurityCouncilMemberElectionGovernorTest:testNoVoteForNonCompliantNominee() (gas: 123545) +SecurityCouncilMemberElectionGovernorTest:testNoZeroWeightVotes() (gas: 169616) SecurityCouncilMemberElectionGovernorTest:testOnlyNomineeElectionGovernorCanPropose() (gas: 111038) SecurityCouncilMemberElectionGovernorTest:testProperInitialization() (gas: 49388) SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32916) SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42229) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340178, ~: 340008) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273335) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340032, ~: 339806) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273467) SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34951) SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152898) -SecurityCouncilMemberRemovalGovernorTest:testInitFails() (gas: 10159193) +SecurityCouncilMemberRemovalGovernorTest:testInitFails() (gas: 10159203) SecurityCouncilMemberRemovalGovernorTest:testProposalCreationCallParamRestriction() (gas: 56157) SecurityCouncilMemberRemovalGovernorTest:testProposalCreationCallRestriction() (gas: 49685) SecurityCouncilMemberRemovalGovernorTest:testProposalCreationTargetLen() (gas: 35392) @@ -176,19 +178,19 @@ SecurityCouncilMemberRemovalGovernorTest:testSetVoteSuccessNumeratorAffordance() SecurityCouncilMemberRemovalGovernorTest:testSuccessNumeratorInsufficientVotes() (gas: 358327) SecurityCouncilMemberRemovalGovernorTest:testSuccessNumeratorSufficientVotes() (gas: 361245) SecurityCouncilMemberRemovalGovernorTest:testSuccessfulProposalAndCantAbstain() (gas: 142674) -SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 7938503) -SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 7939341) -SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 7965404) -SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 7965411) -SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 7929385) -SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 7929385) -SecurityCouncilMemberSyncActionTest:testNonces() (gas: 8229875) -SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 7928439) -SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 7929365) -SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 7929685) -SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 7930546) -SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8171934) -SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8172795) +SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 7939159) +SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 7939997) +SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 7965409) +SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 7965416) +SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 7929390) +SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 7929390) +SecurityCouncilMemberSyncActionTest:testNonces() (gas: 8233135) +SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 7929095) +SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 7930021) +SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 7930283) +SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 7931144) +SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8172590) +SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8173451) SecurityCouncilMgmtUtilsTests:testIsInArray() (gas: 2102) SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 270750) SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 333730) @@ -208,52 +210,52 @@ SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 39905) SequencerActionsTest:testAddAndRemoveSequencer() (gas: 483532) SequencerActionsTest:testCantAddZeroAddress() (gas: 235614) SetInitialGovParamsActionTest:testL1() (gas: 259904) -SetInitialGovParamsActionTest:testL2() (gas: 688888) +SetInitialGovParamsActionTest:testL2() (gas: 688955) SetSequencerInboxMaxTimeVariationAction:testSetMaxTimeVariation() (gas: 374262) SwitchManagerRolesActionTest:testAction() (gas: 6313) -TokenDistributorTest:testClaim() (gas: 5742744) -TokenDistributorTest:testClaimAndDelegate() (gas: 5850827) -TokenDistributorTest:testClaimAndDelegateFailsForExpired() (gas: 5748244) -TokenDistributorTest:testClaimAndDelegateFailsForWrongSender() (gas: 5803385) -TokenDistributorTest:testClaimAndDelegateFailsWrongNonce() (gas: 5803386) -TokenDistributorTest:testClaimFailsAfterEnd() (gas: 5704035) -TokenDistributorTest:testClaimFailsBeforeStart() (gas: 5703530) -TokenDistributorTest:testClaimFailsForFalseTransfer() (gas: 5686246) -TokenDistributorTest:testClaimFailsForTwice() (gas: 5741504) -TokenDistributorTest:testClaimFailsForUnknown() (gas: 5706111) -TokenDistributorTest:testClaimStartAfterClaimEnd() (gas: 4134838) -TokenDistributorTest:testDoesDeploy() (gas: 5339553) -TokenDistributorTest:testDoesDeployAndDeposit() (gas: 5404583) -TokenDistributorTest:testOldClaimStart() (gas: 4135401) -TokenDistributorTest:testSetRecipients() (gas: 5701945) -TokenDistributorTest:testSetRecipientsFailsNotEnoughDeposit() (gas: 5668810) -TokenDistributorTest:testSetRecipientsFailsNotOwner() (gas: 5420359) -TokenDistributorTest:testSetRecipientsFailsWhenAddingTwice() (gas: 5712988) -TokenDistributorTest:testSetRecipientsFailsWrongAmountCount() (gas: 5421819) -TokenDistributorTest:testSetRecipientsFailsWrongRecipientCount() (gas: 5422048) -TokenDistributorTest:testSetRecipientsTwice() (gas: 6391525) -TokenDistributorTest:testSetSweepReceiver() (gas: 5706262) -TokenDistributorTest:testSetSweepReceiverFailsNullAddress() (gas: 5703881) -TokenDistributorTest:testSetSweepReceiverFailsOwner() (gas: 5704842) -TokenDistributorTest:testSweep() (gas: 5751971) -TokenDistributorTest:testSweepAfterClaim() (gas: 5789954) -TokenDistributorTest:testSweepFailsBeforeClaimPeriodEnd() (gas: 5703615) -TokenDistributorTest:testSweepFailsForFailedTransfer() (gas: 5707314) -TokenDistributorTest:testSweepFailsTwice() (gas: 5750930) -TokenDistributorTest:testWithdraw() (gas: 5741198) -TokenDistributorTest:testWithdrawFailsNotOwner() (gas: 5741220) -TokenDistributorTest:testWithdrawFailsTransfer() (gas: 5705817) -TokenDistributorTest:testZeroDelegateTo() (gas: 4132733) -TokenDistributorTest:testZeroOwner() (gas: 4132646) -TokenDistributorTest:testZeroReceiver() (gas: 4132675) +TokenDistributorTest:testClaim() (gas: 5742749) +TokenDistributorTest:testClaimAndDelegate() (gas: 5850832) +TokenDistributorTest:testClaimAndDelegateFailsForExpired() (gas: 5748249) +TokenDistributorTest:testClaimAndDelegateFailsForWrongSender() (gas: 5803390) +TokenDistributorTest:testClaimAndDelegateFailsWrongNonce() (gas: 5803391) +TokenDistributorTest:testClaimFailsAfterEnd() (gas: 5704040) +TokenDistributorTest:testClaimFailsBeforeStart() (gas: 5703535) +TokenDistributorTest:testClaimFailsForFalseTransfer() (gas: 5686251) +TokenDistributorTest:testClaimFailsForTwice() (gas: 5741509) +TokenDistributorTest:testClaimFailsForUnknown() (gas: 5706116) +TokenDistributorTest:testClaimStartAfterClaimEnd() (gas: 4134843) +TokenDistributorTest:testDoesDeploy() (gas: 5339558) +TokenDistributorTest:testDoesDeployAndDeposit() (gas: 5404588) +TokenDistributorTest:testOldClaimStart() (gas: 4135406) +TokenDistributorTest:testSetRecipients() (gas: 5701950) +TokenDistributorTest:testSetRecipientsFailsNotEnoughDeposit() (gas: 5668815) +TokenDistributorTest:testSetRecipientsFailsNotOwner() (gas: 5420364) +TokenDistributorTest:testSetRecipientsFailsWhenAddingTwice() (gas: 5712993) +TokenDistributorTest:testSetRecipientsFailsWrongAmountCount() (gas: 5421824) +TokenDistributorTest:testSetRecipientsFailsWrongRecipientCount() (gas: 5422053) +TokenDistributorTest:testSetRecipientsTwice() (gas: 6391530) +TokenDistributorTest:testSetSweepReceiver() (gas: 5706267) +TokenDistributorTest:testSetSweepReceiverFailsNullAddress() (gas: 5703886) +TokenDistributorTest:testSetSweepReceiverFailsOwner() (gas: 5704847) +TokenDistributorTest:testSweep() (gas: 5751976) +TokenDistributorTest:testSweepAfterClaim() (gas: 5789959) +TokenDistributorTest:testSweepFailsBeforeClaimPeriodEnd() (gas: 5703620) +TokenDistributorTest:testSweepFailsForFailedTransfer() (gas: 5707319) +TokenDistributorTest:testSweepFailsTwice() (gas: 5750935) +TokenDistributorTest:testWithdraw() (gas: 5741203) +TokenDistributorTest:testWithdrawFailsNotOwner() (gas: 5741225) +TokenDistributorTest:testWithdrawFailsTransfer() (gas: 5705822) +TokenDistributorTest:testZeroDelegateTo() (gas: 4132738) +TokenDistributorTest:testZeroOwner() (gas: 4132651) +TokenDistributorTest:testZeroReceiver() (gas: 4132680) TokenDistributorTest:testZeroToken() (gas: 71889) TopNomineesGasTest:testTopNomineesGas() (gas: 4502996) UpgradeExecRouteBuilderTest:testAIP1Point2() (gas: 1322645) UpgradeExecRouteBuilderTest:testRouteBuilderErrors() (gas: 1127374) -UpgradeExecutorTest:testAdminCanChangeExecutor() (gas: 2583801) -UpgradeExecutorTest:testCantExecuteEOA() (gas: 2439721) -UpgradeExecutorTest:testExecute() (gas: 2677995) -UpgradeExecutorTest:testExecuteFailsForAdmin() (gas: 2663614) -UpgradeExecutorTest:testExecuteFailsForNobody() (gas: 2665855) -UpgradeExecutorTest:testInit() (gas: 2427602) -UpgradeExecutorTest:testInitFailsZeroAdmin() (gas: 2288342) \ No newline at end of file +UpgradeExecutorTest:testAdminCanChangeExecutor() (gas: 2583806) +UpgradeExecutorTest:testCantExecuteEOA() (gas: 2439726) +UpgradeExecutorTest:testExecute() (gas: 2678000) +UpgradeExecutorTest:testExecuteFailsForAdmin() (gas: 2663619) +UpgradeExecutorTest:testExecuteFailsForNobody() (gas: 2665860) +UpgradeExecutorTest:testInit() (gas: 2427607) +UpgradeExecutorTest:testInitFailsZeroAdmin() (gas: 2288347) \ No newline at end of file From 003401ff05acc0a2cb07fd3b1d9cb08646e7d9a8 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Mon, 7 Oct 2024 18:18:33 +0100 Subject: [PATCH 028/108] Removed block fork --- test/gov-actions/RotateMembersUpgradeAction.t.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/gov-actions/RotateMembersUpgradeAction.t.sol b/test/gov-actions/RotateMembersUpgradeAction.t.sol index b63d7c83a..cd31b569c 100644 --- a/test/gov-actions/RotateMembersUpgradeAction.t.sol +++ b/test/gov-actions/RotateMembersUpgradeAction.t.sol @@ -20,7 +20,8 @@ contract RotateMembersUpgradeActionTest is Test { string memory arbRpc = vm.envOr("ARB_RPC_URL", string("")); if (bytes(arbRpc).length != 0) { vm.createSelectFork(arbRpc); - vm.rollFork(260_227_814); + // CHRIS: TODO: need archive for this + // vm.rollFork(260_227_814); } } From 538b2a2f1ae56d9c4f861d3d2f0fc4b6281e8c6b Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Mon, 7 Oct 2024 18:20:34 +0100 Subject: [PATCH 029/108] Removed the roll block forking --- test/gov-actions/RotateMembersUpgradeAction.t.sol | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/gov-actions/RotateMembersUpgradeAction.t.sol b/test/gov-actions/RotateMembersUpgradeAction.t.sol index cd31b569c..6e20a26e1 100644 --- a/test/gov-actions/RotateMembersUpgradeAction.t.sol +++ b/test/gov-actions/RotateMembersUpgradeAction.t.sol @@ -20,8 +20,6 @@ contract RotateMembersUpgradeActionTest is Test { string memory arbRpc = vm.envOr("ARB_RPC_URL", string("")); if (bytes(arbRpc).length != 0) { vm.createSelectFork(arbRpc); - // CHRIS: TODO: need archive for this - // vm.rollFork(260_227_814); } } From 34a2b6b3750383be641d7a9db34d188ab75d3adf Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 10 Oct 2024 14:43:15 +0100 Subject: [PATCH 030/108] Inlined proxy util --- .../SecurityCouncilManager.sol | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index e6eacae48..9a6390238 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -16,18 +16,6 @@ import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable. import "./Common.sol"; import "./interfaces/ISecurityCouncilMemberElectionGovernor.sol"; -library ProxyUtil { - function getProxyAdmin() internal view returns (address admin) { - // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0/contracts/proxy/TransparentUpgradeableProxy.sol#L48 - // Storage slot with the admin of the proxy contract. - // This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is - bytes32 slot = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; - assembly { - admin := sload(slot) - } - } -} - /// @title The Security Council Manager /// @notice The source of truth for an array of Security Councils that are under management. /// Can be used to change members, and replace whole cohorts, ensuring that all managed @@ -167,6 +155,16 @@ contract SecurityCouncilManager is VERSION_HASH = keccak256(bytes("1")); } + function getProxyAdmin() internal view returns (address admin) { + // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0/contracts/proxy/TransparentUpgradeableProxy.sol#L48 + // Storage slot with the admin of the proxy contract. + // This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is + bytes32 slot = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; + assembly { + admin := sload(slot) + } + } + function postUpgradeInit(uint256 _minRotationPeriod, address minRotationPeriodSetter) external { From 28386260a73d25c82bc21d9ad98b0d1046c86e0b Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Fri, 11 Oct 2024 15:25:30 +0100 Subject: [PATCH 031/108] Updated reference --- src/security-council-mgmt/SecurityCouncilManager.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 9a6390238..1b263fad1 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -168,7 +168,7 @@ contract SecurityCouncilManager is function postUpgradeInit(uint256 _minRotationPeriod, address minRotationPeriodSetter) external { - require(msg.sender == ProxyUtil.getProxyAdmin(), "NOT_FROM_ADMIN"); + require(msg.sender == getProxyAdmin(), "NOT_FROM_ADMIN"); require(minRotationPeriod == 0, "MIN_ROTATION_ALREADY_SET"); _grantRole(MIN_ROTATION_PERIOD_SETTER_ROLE, minRotationPeriodSetter); From c7b9a69b9330051b517c47f1cc105786d9446e34 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Fri, 1 Nov 2024 10:31:37 +0000 Subject: [PATCH 032/108] Set 712 vars as constants --- .../SecurityCouncilManager.sol | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 1b263fad1..58912e742 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -87,9 +87,9 @@ contract SecurityCouncilManager is uint256 public minRotationPeriod; /// @notice The 712 name hash - bytes32 public NAME_HASH; + bytes32 public constant NAME_HASH = keccak256(bytes("SecurityCouncilManager")); /// @notice The 712 version hash - bytes32 public VERSION_HASH; + bytes32 public constant VERSION_HASH = keccak256(bytes("1")); /// @notice Magic value used by the L1 timelock to indicate that a retryable ticket should be created /// Value is defined in L1ArbitrumTimelock contract https://etherscan.io/address/0xE6841D92B0C345144506576eC13ECf5103aC7f49#readProxyContract#F5 @@ -148,11 +148,6 @@ contract SecurityCouncilManager is } _setMinRotationPeriod(_minRotationPeriod); - - // we do our own 712 functionality because inheriting the OZ version - // would change our storage layout - NAME_HASH = keccak256(bytes("SecurityCouncilManager")); - VERSION_HASH = keccak256(bytes("1")); } function getProxyAdmin() internal view returns (address admin) { @@ -173,9 +168,6 @@ contract SecurityCouncilManager is _grantRole(MIN_ROTATION_PERIOD_SETTER_ROLE, minRotationPeriodSetter); _setMinRotationPeriod(_minRotationPeriod); - - NAME_HASH = keccak256(bytes("SecurityCouncilManager")); - VERSION_HASH = keccak256(bytes("1")); } function _domainSeparatorV4() private view returns (bytes32) { @@ -596,5 +588,5 @@ contract SecurityCouncilManager is * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ - uint256[39] private __gap; + uint256[41] private __gap; } From 19f7347bf9c37beda5190d002138a914ec424a82 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Fri, 1 Nov 2024 10:33:44 +0000 Subject: [PATCH 033/108] Snapshot update --- .gas-snapshot | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 99598acff..1d175baf2 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -27,7 +27,7 @@ ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 85928758) +E2E:testE2E() (gas: 85875823) FixedDelegateErc20WalletTest:testInit() (gas: 5822585) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) @@ -95,14 +95,14 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28415658) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28364371) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28417242) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28657360) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31692496) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31696727) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26735762) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31694727) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31715633) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31639561) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31643792) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26727148) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31641792) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31662698) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) -OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317068, ~: 317184) +OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317067, ~: 317184) OfficeHoursActionTest:testInvalidConstructorParameters() (gas: 235740) OfficeHoursActionTest:testPerformBeforeMinimumTimestamp() (gas: 8646) OfficeHoursActionTest:testPerformDuringOfficeHours() (gas: 9140) @@ -126,8 +126,8 @@ SecurityCouncilManagerTest:testAddSC() (gas: 118677) SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112133) SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 123130) SecurityCouncilManagerTest:testCohortMethods() (gas: 136833) -SecurityCouncilManagerTest:testInitialization() (gas: 209660) -SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5191924) +SecurityCouncilManagerTest:testInitialization() (gas: 205580) +SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5138902) SecurityCouncilManagerTest:testRemoveMember() (gas: 213409) SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 99124) SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81287) @@ -135,8 +135,8 @@ SecurityCouncilManagerTest:testRemoveSeC() (gas: 38332) SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 208648) SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 259554) SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 263093) -SecurityCouncilManagerTest:testRotateMember() (gas: 559368) -SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3588538) +SecurityCouncilManagerTest:testRotateMember() (gas: 554726) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3583788) SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65822) SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83057) SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 296025) From 0de0668dc14fe3524c0e3047416c4153cb3c4944 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Fri, 1 Nov 2024 11:05:29 +0000 Subject: [PATCH 034/108] Updated storage doc --- test/storage/SecurityCouncilManager | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/storage/SecurityCouncilManager b/test/storage/SecurityCouncilManager index 69f1ec407..afe7ca8f1 100644 --- a/test/storage/SecurityCouncilManager +++ b/test/storage/SecurityCouncilManager @@ -15,6 +15,4 @@ | cohortSize | uint256 | 157 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | | lastRotated | mapping(address => uint256) | 158 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | | minRotationPeriod | uint256 | 159 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| NAME_HASH | bytes32 | 160 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| VERSION_HASH | bytes32 | 161 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| __gap | uint256[39] | 162 | 0 | 1248 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| __gap | uint256[41] | 160 | 0 | 1312 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | From 2e871d7ea237eac28f957e436d8f829d2e7e95eb Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Fri, 8 Nov 2024 11:09:03 +0000 Subject: [PATCH 035/108] Add rotatedTo mapping --- .../SecurityCouncilManager.sol | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 58912e742..8c16a2f6a 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -83,6 +83,9 @@ contract SecurityCouncilManager is /// @notice The timestamp at which the address was last rotated mapping(address => uint256) public lastRotated; + /// @notice If an address was rotated, this is the address that it rotated to + mapping(address => address) public rotatedTo; + /// @inheritdoc ISecurityCouncilManager uint256 public minRotationPeriod; @@ -248,14 +251,22 @@ contract SecurityCouncilManager is emit MemberAdded(_newMember, _cohort); } + function memberRotatedTo(address _member) internal returns(address) { + if(rotatedTo[_member] != address(0) && !SecurityCouncilMgmtUtils.isInArray(_member, getBothCohorts())) { + return rotatedTo[_member]; + } else return _member; + } + /// @inheritdoc ISecurityCouncilManager function removeMember(address _member) external onlyRole(MEMBER_REMOVER_ROLE) { if (_member == address(0)) { revert ZeroAddress(); } - Cohort cohort = _removeMemberFromCohortArray(_member); + address memberIfRotated = memberRotatedTo(_member); + + Cohort cohort = _removeMemberFromCohortArray(memberIfRotated); _scheduleUpdate(); - emit MemberRemoved({member: _member, cohort: cohort}); + emit MemberRemoved({member: memberIfRotated, cohort: cohort}); } /// @inheritdoc ISecurityCouncilManager @@ -263,9 +274,10 @@ contract SecurityCouncilManager is external onlyRole(MEMBER_REPLACER_ROLE) { - Cohort cohort = _swapMembers(_memberToReplace, _newMember); + address memberIfRotated = memberRotatedTo(_member); + Cohort cohort = _swapMembers(memberIfRotated, _newMember); emit MemberReplaced({ - replacedMember: _memberToReplace, + replacedMember: memberIfRotated, newMember: _newMember, cohort: cohort }); @@ -352,6 +364,7 @@ contract SecurityCouncilManager is } lastRotated[newAddress] = block.timestamp; + rotatedTo[msg.sender] = newAddress; Cohort cohort = _swapMembers(msg.sender, newAddress); emit MemberRotated({replacedAddress: msg.sender, newAddress: newAddress, cohort: cohort}); } From ba71a22251e01e2551b981d70ef6981d54c2b89a Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Mon, 25 Nov 2024 13:10:02 +0000 Subject: [PATCH 036/108] Added tests for member rotation --- .../SecurityCouncilManager.sol | 8 +- .../interfaces/ISecurityCouncilManager.sol | 7 ++ .../SecurityCouncilManager.t.sol | 75 +++++++++++++++++++ 3 files changed, 87 insertions(+), 3 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 8c16a2f6a..5a3a7ccff 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -83,7 +83,8 @@ contract SecurityCouncilManager is /// @notice The timestamp at which the address was last rotated mapping(address => uint256) public lastRotated; - /// @notice If an address was rotated, this is the address that it rotated to + /// @notice If an address was rotated, this is the last address it rotated to + /// @dev This can be used to avoid race conditions between rotation and other actions mapping(address => address) public rotatedTo; /// @inheritdoc ISecurityCouncilManager @@ -115,6 +116,7 @@ contract SecurityCouncilManager is _disableInitializers(); } + /// @inheritdoc ISecurityCouncilManager function initialize( address[] memory _firstCohort, address[] memory _secondCohort, @@ -251,7 +253,7 @@ contract SecurityCouncilManager is emit MemberAdded(_newMember, _cohort); } - function memberRotatedTo(address _member) internal returns(address) { + function memberRotatedTo(address _member) internal view returns(address) { if(rotatedTo[_member] != address(0) && !SecurityCouncilMgmtUtils.isInArray(_member, getBothCohorts())) { return rotatedTo[_member]; } else return _member; @@ -274,7 +276,7 @@ contract SecurityCouncilManager is external onlyRole(MEMBER_REPLACER_ROLE) { - address memberIfRotated = memberRotatedTo(_member); + address memberIfRotated = memberRotatedTo(_memberToReplace); Cohort cohort = _swapMembers(memberIfRotated, _newMember); emit MemberReplaced({ replacedMember: memberIfRotated, diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index 70d3e79b6..767bbe3b1 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -61,6 +61,13 @@ interface ISecurityCouncilManager { /// @param _l2CoreGovTimelock timelock for core governance / constitutional proposal /// @param _router UpgradeExecRouteBuilder address /// @param _minRotationPeriod The minimum amount of time that must happen between address rotations by the same council member + /// Rotations are in race conditions with other actions, so care must be taken to set this parameter to be + /// greater than the time taken for other actions. An example of this is if the removal governor has the removal + /// role it may try to remove an address, but doing so requires passing a vote and in the meantime the address may + /// rotate. If the address is only allowed to rotate once during this period the manager can keep track of this and still + /// and still remove the address, however if the rotation period allows for two rotations the address will not get removed + /// A general rule for setting the min rotation period is: make sure it is longer that the amount of time taken to conduct + /// any other actions on the sec council manager. function initialize( address[] memory _firstCohort, address[] memory _secondCohort, diff --git a/test/security-council-mgmt/SecurityCouncilManager.t.sol b/test/security-council-mgmt/SecurityCouncilManager.t.sol index 40b19403a..203145e01 100644 --- a/test/security-council-mgmt/SecurityCouncilManager.t.sol +++ b/test/security-council-mgmt/SecurityCouncilManager.t.sol @@ -245,6 +245,28 @@ contract SecurityCouncilManagerTest is Test { ); } + function testRemoveMemberRotated() public { + address memberToRemove = firstCohort[0]; + bytes32 digest = scm.getRotateMemberHash(memberToRemove, scm.updateNonce()); + bytes memory signature = sign(pk1, digest); + vm.prank(memberToRemove); + scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); + + vm.recordLogs(); + vm.prank(roles.memberRemovers[0]); + scm.removeMember(memberToRemove); + checkScheduleWasCalled(); + + address[] memory remainingMembers = new address[](5); + for (uint256 i = 1; i < firstCohort.length; i++) { + remainingMembers[i - 1] = firstCohort[i]; + } + assertTrue( + TestUtil.areUniqueAddressArraysEqual(remainingMembers, scm.getFirstCohort()), + "member removed from first chohort" + ); + } + function testAddMemberSpecialAddresses() public { vm.prank(roles.memberAdder); vm.expectRevert(ZeroAddress.selector); @@ -372,7 +394,60 @@ contract SecurityCouncilManagerTest is Test { vm.stopPrank(); } + function testReplaceMemberInFirstCohortAfterRotation() public { + bytes32 digest = scm.getRotateMemberHash(firstCohort[0], scm.updateNonce()); + bytes memory signature = sign(pk1, digest); + vm.prank(firstCohort[0]); + scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); + + vm.startPrank(roles.memberReplacer); + vm.recordLogs(); + scm.replaceMember(firstCohort[0], memberToAdd); + checkScheduleWasCalled(); + + address[] memory newFirstCohortArray = new address[](6); + newFirstCohortArray[0] = memberToAdd; + for (uint256 i = 1; i < firstCohort.length; i++) { + newFirstCohortArray[i] = firstCohort[i]; + } + assertTrue( + TestUtil.areUniqueAddressArraysEqual(newFirstCohortArray, scm.getFirstCohort()), + "first cohort updated" + ); + assertTrue( + TestUtil.areUniqueAddressArraysEqual(secondCohort, scm.getSecondCohort()), + "second cohort untouched" + ); + vm.stopPrank(); + } + function testReplaceMemberInSecondCohort() public { + bytes32 digest = scm.getRotateMemberHash(secondCohort[0], scm.updateNonce()); + bytes memory signature = sign(pk2, digest); + vm.prank(secondCohort[0]); + scm.rotateMember(memberToRotate2, memberElectionGovernor, signature); + + vm.startPrank(roles.memberReplacer); + vm.recordLogs(); + scm.replaceMember(secondCohort[0], memberToAdd); + checkScheduleWasCalled(); + address[] memory newSecondCohortArray = new address[](6); + newSecondCohortArray[0] = memberToAdd; + for (uint256 i = 1; i < secondCohort.length; i++) { + newSecondCohortArray[i] = secondCohort[i]; + } + assertTrue( + TestUtil.areUniqueAddressArraysEqual(newSecondCohortArray, scm.getSecondCohort()), + "second cohort updated" + ); + assertTrue( + TestUtil.areUniqueAddressArraysEqual(firstCohort, scm.getFirstCohort()), + "first cohort untouched" + ); + vm.stopPrank(); + } + + function testReplaceMemberInSecondCohortAfterRotation() public { vm.startPrank(roles.memberReplacer); vm.recordLogs(); scm.replaceMember(secondCohort[0], memberToAdd); From e8c831175160de4f59785807f439048b5084f69d Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Mon, 25 Nov 2024 13:11:13 +0000 Subject: [PATCH 037/108] Formatting --- .../SecurityCouncilManager.sol | 19 ++++++++++--------- test/security-council-mgmt/E2E.t.sol | 1 - 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 5a3a7ccff..7c092cee6 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -253,10 +253,15 @@ contract SecurityCouncilManager is emit MemberAdded(_newMember, _cohort); } - function memberRotatedTo(address _member) internal view returns(address) { - if(rotatedTo[_member] != address(0) && !SecurityCouncilMgmtUtils.isInArray(_member, getBothCohorts())) { + function memberRotatedTo(address _member) internal view returns (address) { + if ( + rotatedTo[_member] != address(0) + && !SecurityCouncilMgmtUtils.isInArray(_member, getBothCohorts()) + ) { return rotatedTo[_member]; - } else return _member; + } else { + return _member; + } } /// @inheritdoc ISecurityCouncilManager @@ -265,7 +270,7 @@ contract SecurityCouncilManager is revert ZeroAddress(); } address memberIfRotated = memberRotatedTo(_member); - + Cohort cohort = _removeMemberFromCohortArray(memberIfRotated); _scheduleUpdate(); emit MemberRemoved({member: memberIfRotated, cohort: cohort}); @@ -278,11 +283,7 @@ contract SecurityCouncilManager is { address memberIfRotated = memberRotatedTo(_memberToReplace); Cohort cohort = _swapMembers(memberIfRotated, _newMember); - emit MemberReplaced({ - replacedMember: memberIfRotated, - newMember: _newMember, - cohort: cohort - }); + emit MemberReplaced({replacedMember: memberIfRotated, newMember: _newMember, cohort: cohort}); } /// @inheritdoc ISecurityCouncilManager diff --git a/test/security-council-mgmt/E2E.t.sol b/test/security-council-mgmt/E2E.t.sol index 6d9be0b84..9dce35298 100644 --- a/test/security-council-mgmt/E2E.t.sol +++ b/test/security-council-mgmt/E2E.t.sol @@ -400,7 +400,6 @@ contract E2E is Test, DeployGnosisWithModule { vars.secDeployedContracts.nomineeElectionGovernor ); - L1SCMgmtActivationAction installL1 = new L1SCMgmtActivationAction( IGnosisSafe(address(vars.moduleL1Safe)), IGnosisSafe(l1EmergencyCouncil), From 1fe27a7e434048b44ea0a2c4d55f4ef604513c15 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Mon, 25 Nov 2024 18:39:44 +0000 Subject: [PATCH 038/108] Check is nominee in when rotating --- .../SecurityCouncilManager.sol | 3 ++ ...neeElectionGovernorCountingUpgradeable.sol | 6 ++- .../interfaces/ISecurityCouncilManager.sol | 1 + ...SecurityCouncilNomineeElectionGovernor.sol | 10 +++- .../SecurityCouncilManager.t.sol | 48 +++++++++++++++---- 5 files changed, 57 insertions(+), 11 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 7c092cee6..9ea34d0c4 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -362,6 +362,9 @@ contract SecurityCouncilManager is if (nomineeGovernor.isContender(proposalId, newAddress)) { revert NewMemberIsContender(proposalId, newAddress); } + if (nomineeGovernor.isNominee(proposalId, newAddress)) { + revert NewMemberIsNominee(proposalId, newAddress); + } } } } diff --git a/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorCountingUpgradeable.sol b/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorCountingUpgradeable.sol index 25a568f7f..9cc6d7e3c 100644 --- a/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorCountingUpgradeable.sol +++ b/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorCountingUpgradeable.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.16; +import "../../interfaces/ISecurityCouncilNomineeElectionGovernor.sol"; import "@openzeppelin/contracts-upgradeable/governance/GovernorUpgradeable.sol"; /// @title SecurityCouncilNomineeElectionGovernorCountingUpgradeable @@ -9,7 +10,8 @@ import "@openzeppelin/contracts-upgradeable/governance/GovernorUpgradeable.sol"; /// Voters can spread votes across multiple contenders abstract contract SecurityCouncilNomineeElectionGovernorCountingUpgradeable is Initializable, - GovernorUpgradeable + GovernorUpgradeable, + ISecurityCouncilNomineeElectionGovernorCountingUpgradeable { /// @param votesUsed The amount of votes a voter has used /// @param votesReceived The amount of votes a contender has received @@ -134,7 +136,7 @@ abstract contract SecurityCouncilNomineeElectionGovernorCountingUpgradeable is return _elections[proposalId].votesUsed[account] > 0; } - /// @notice Whether the contender has enough votes to be a nominee + /// @inheritdoc ISecurityCouncilNomineeElectionGovernorCountingUpgradeable function isNominee(uint256 proposalId, address contender) public view returns (bool) { return _elections[proposalId].isNominee[contender]; } diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index 767bbe3b1..f42d36254 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -45,6 +45,7 @@ interface ISecurityCouncilManager { error RotationTooSoon(address rotator, uint256 rotatableWhen); error GovernorNotReplacer(); error NewMemberIsContender(uint256 proposalId, address newMember); + error NewMemberIsNominee(uint256 proposalId, address newMember); error InvalidNewAddress(address newAddress); /// @notice There is a minimum period between when an address can be rotated diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol index ae3c50457..c88452eff 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilNomineeElectionGovernor.sol @@ -6,8 +6,16 @@ import {Cohort} from "../Common.sol"; import "./ISecurityCouncilMemberElectionGovernor.sol"; import "./ISecurityCouncilManager.sol"; +interface ISecurityCouncilNomineeElectionGovernorCountingUpgradeable { + /// @notice Whether the contender has enough votes to be a nominee + function isNominee(uint256 proposalId, address contender) external view returns (bool); +} + /// @notice Minimal interface of nominee election governor required by other contracts -interface ISecurityCouncilNomineeElectionGovernor is IElectionGovernor { +interface ISecurityCouncilNomineeElectionGovernor is + IElectionGovernor, + ISecurityCouncilNomineeElectionGovernorCountingUpgradeable +{ /// @notice Whether the account a compliant nominee for a given proposal /// A compliant nominee is one who is a nominee, and has not been excluded /// @param proposalId The id of the proposal diff --git a/test/security-council-mgmt/SecurityCouncilManager.t.sol b/test/security-council-mgmt/SecurityCouncilManager.t.sol index 203145e01..da6f0a379 100644 --- a/test/security-council-mgmt/SecurityCouncilManager.t.sol +++ b/test/security-council-mgmt/SecurityCouncilManager.t.sol @@ -85,6 +85,7 @@ contract SecurityCouncilManagerTest is Test { address memberToRotate2 = vm.addr(pk2); address l1ArbitrumTimelock = address(8881); + address nomineeVetter = address(8882); address payable l2CoreGovTimelock; @@ -152,7 +153,7 @@ contract SecurityCouncilManagerTest is Test { SecurityCouncilNomineeElectionGovernor.InitParams memory initParams = SecurityCouncilNomineeElectionGovernor.InitParams( - Date(2000, 1, 1, 1), 0, address(0), scm, memGov, token, address(0), 20, 20 + Date(2000, 1, 1, 1), 3, nomineeVetter, scm, memGov, token, address(0), 20, 20 ); nomGov.initialize(initParams); memGov.initialize(nomGov, scm, token, address(10), 10, 5); @@ -568,7 +569,7 @@ contract SecurityCouncilManagerTest is Test { ); } - function addAllContendersVoteAndExecute(uint256 proposalId) public { + function addAllContendersAndVote(uint256 proposalId) public { SecurityCouncilNomineeElectionGovernor nGov = SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)); SigUtils sigUtils = new SigUtils(nomineeElectionGovernor); @@ -587,6 +588,11 @@ contract SecurityCouncilManagerTest is Test { params: abi.encode(vm.addr(i + 1000), 20_000_000) }); } + } + + function execProp(uint256 proposalId) public { + SecurityCouncilNomineeElectionGovernor nGov = + SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)); vm.roll( SecurityCouncilNomineeElectionGovernorTiming(payable(address(nomineeElectionGovernor))) .proposalVettingDeadline(proposalId) + 1 @@ -618,6 +624,8 @@ contract SecurityCouncilManagerTest is Test { bytes32 digest = scm.getRotateMemberHash(originalMember, scm.updateNonce()); bytes memory signature = sign(pk1, digest); + bytes memory signature2 = + sign(pk2, scm.getRotateMemberHash(originalMember, scm.updateNonce())); uint256 startNonce = scm.updateNonce(); // replace in other cohort in ongoing election does not work @@ -630,8 +638,31 @@ contract SecurityCouncilManagerTest is Test { scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); uint256 snap = vm.snapshot(); - // proceeding to the next stage of election still doesnt work - addAllContendersVoteAndExecute(proposalId); + + addAllContendersAndVote(proposalId); + + // check that we cant rotate to a nominee + vm.roll( + SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)) + .proposalDeadline(proposalId) + 1 + ); + vm.prank(nomineeVetter); + SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)).excludeNominee( + proposalId, vm.addr(1004) + ); + vm.prank(nomineeVetter); + SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)).includeNominee( + proposalId, memberToRotate2 + ); + vm.expectRevert( + abi.encodeWithSelector( + ISecurityCouncilManager.NewMemberIsNominee.selector, proposalId, memberToRotate2 + ) + ); + vm.prank(originalMember); + scm.rotateMember(memberToRotate2, memberElectionGovernor, signature2); + + execProp(proposalId); assertEq( uint8(IGovernorUpgradeable(nomineeElectionGovernor).state(proposalId)), uint8(IGovernorUpgradeable.ProposalState.Executed), @@ -650,19 +681,20 @@ contract SecurityCouncilManagerTest is Test { ); vm.prank(originalMember); scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); + vm.revertTo(snap); // replacing that member with one in the same cohort does work - bytes32 digestA = scm.getRotateMemberHash(firstCohort[1], scm.updateNonce()); - bytes memory signatureA = sign(pk1, digestA); + bytes memory signatureA = + sign(pk1, scm.getRotateMemberHash(firstCohort[1], scm.updateNonce())); vm.prank(firstCohort[1]); scm.rotateMember(memberToRotate1, memberElectionGovernor, signatureA); assertEq(startNonce + 1, scm.updateNonce(), "nonce 1"); checkCohortChange(memberToRotate1, 1, firstCohort, Cohort.FIRST); vm.revertTo(snap); - bytes32 digest1 = scm.getRotateMemberHash(originalMember, scm.updateNonce()); - bytes memory signature1 = sign(pk2, digest1); + bytes memory signature1 = + sign(pk2, scm.getRotateMemberHash(originalMember, scm.updateNonce())); vm.recordLogs(); vm.prank(originalMember); From 11080e09d3409ee5022dd3ef605358d39558b798 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Tue, 26 Nov 2024 11:59:18 +0000 Subject: [PATCH 039/108] Reduced gap --- src/security-council-mgmt/SecurityCouncilManager.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 9ea34d0c4..ad983e3fe 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -607,5 +607,5 @@ contract SecurityCouncilManager is * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ - uint256[41] private __gap; + uint256[40] private __gap; } From 16ca9a99618c737bd309ea69ed20c6108622ec9a Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Tue, 26 Nov 2024 11:59:50 +0000 Subject: [PATCH 040/108] Updated storage bash --- test/storage/SecurityCouncilManager | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/storage/SecurityCouncilManager b/test/storage/SecurityCouncilManager index afe7ca8f1..6dd5ad35e 100644 --- a/test/storage/SecurityCouncilManager +++ b/test/storage/SecurityCouncilManager @@ -14,5 +14,6 @@ | updateNonce | uint256 | 156 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | | cohortSize | uint256 | 157 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | | lastRotated | mapping(address => uint256) | 158 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| minRotationPeriod | uint256 | 159 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -| __gap | uint256[41] | 160 | 0 | 1312 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| rotatedTo | mapping(address => address) | 159 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| minRotationPeriod | uint256 | 160 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| __gap | uint256[40] | 161 | 0 | 1280 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | From 8b0d3a0c7cdf54faa78d01eb8743cb0bbc927643 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Tue, 26 Nov 2024 14:17:37 +0000 Subject: [PATCH 041/108] Updated comments --- src/security-council-mgmt/SecurityCouncilManager.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index ad983e3fe..e363e23f8 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -601,11 +601,11 @@ contract SecurityCouncilManager is delay: ArbitrumTimelock(l2CoreGovTimelock).getMinDelay() }); } + /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ - uint256[40] private __gap; } From 43a469aa69bb307d7134950f0b48aa40aa58c136 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Tue, 17 Dec 2024 10:58:45 +0000 Subject: [PATCH 042/108] Updated gas snapshot and signatures --- .gas-snapshot | 69 ++++++++++++++------------ test/signatures/SecurityCouncilManager | 1 + 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 1d175baf2..21074e2d4 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -27,7 +27,7 @@ ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 85875823) +E2E:testE2E() (gas: 85732376) FixedDelegateErc20WalletTest:testInit() (gas: 5822585) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) @@ -95,14 +95,14 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28415658) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28364371) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28417242) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28657360) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31639561) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31643792) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26727148) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31641792) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31662698) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31488070) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31492301) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26575079) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31490301) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31511468) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) -OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317067, ~: 317184) +OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317068, ~: 317184) OfficeHoursActionTest:testInvalidConstructorParameters() (gas: 235740) OfficeHoursActionTest:testPerformBeforeMinimumTimestamp() (gas: 8646) OfficeHoursActionTest:testPerformDuringOfficeHours() (gas: 9140) @@ -118,31 +118,34 @@ OutboxActionsTest:testRemoveOutboxes() (gas: 853882) ProxyUpgradeAndCallActionTest:testUpgrade() (gas: 137095) ProxyUpgradeAndCallActionTest:testUpgradeAndCall() (gas: 143042) RotateMembersUpgradeActionTest:testAction() (gas: 8153) -SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 249743) -SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20778) -SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 340628) -SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 343925) -SecurityCouncilManagerTest:testAddSC() (gas: 118677) -SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112133) -SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 123130) -SecurityCouncilManagerTest:testCohortMethods() (gas: 136833) -SecurityCouncilManagerTest:testInitialization() (gas: 205580) -SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5138902) -SecurityCouncilManagerTest:testRemoveMember() (gas: 213409) -SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 99124) -SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81287) -SecurityCouncilManagerTest:testRemoveSeC() (gas: 38332) -SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 208648) -SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 259554) -SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 263093) -SecurityCouncilManagerTest:testRotateMember() (gas: 554726) -SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3583788) -SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65822) -SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83057) -SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 296025) -SecurityCouncilManagerTest:testUpdateRouter() (gas: 76269) -SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112259) -SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 296074) +SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 253608) +SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20770) +SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 346415) +SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 349850) +SecurityCouncilManagerTest:testAddSC() (gas: 118742) +SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112296) +SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 125194) +SecurityCouncilManagerTest:testCohortMethods() (gas: 137958) +SecurityCouncilManagerTest:testInitialization() (gas: 206439) +SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 4986898) +SecurityCouncilManagerTest:testRemoveMember() (gas: 217210) +SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 101593) +SecurityCouncilManagerTest:testRemoveMemberRotated() (gas: 410473) +SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81441) +SecurityCouncilManagerTest:testRemoveSeC() (gas: 38400) +SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 216437) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 264131) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 456122) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 463344) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 267700) +SecurityCouncilManagerTest:testRotateMember() (gas: 604326) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3810858) +SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65880) +SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83211) +SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 299877) +SecurityCouncilManagerTest:testUpdateRouter() (gas: 76385) +SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112474) +SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 299971) SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 247018) SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302873) SecurityCouncilMemberElectionGovernorTest:testCastBySigTwice() (gas: 266265) @@ -158,7 +161,7 @@ SecurityCouncilMemberElectionGovernorTest:testOnlyNomineeElectionGovernorCanProp SecurityCouncilMemberElectionGovernorTest:testProperInitialization() (gas: 49388) SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32916) SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42229) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340032, ~: 339806) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340116, ~: 339918) SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273467) SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34951) SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152898) diff --git a/test/signatures/SecurityCouncilManager b/test/signatures/SecurityCouncilManager index bb676765e..1d01fd5d7 100644 --- a/test/signatures/SecurityCouncilManager +++ b/test/signatures/SecurityCouncilManager @@ -38,6 +38,7 @@ "replaceMember(address,address)": "e577e32e", "revokeRole(bytes32,address)": "d547741f", "rotateMember(address,address,bytes)": "02ea6df4", + "rotatedTo(address)": "86bc77a3", "router()": "f887ea40", "secondCohortIncludes(address)": "e9d9f048", "securityCouncils(uint256)": "bef3f745", From c61f23c0d65028db143d9ef5b91ca1b1fca132c2 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Tue, 17 Dec 2024 12:05:57 +0000 Subject: [PATCH 043/108] Storage format change --- test/storage/ArbitrumTimelock | 16 ++++++- test/storage/FixedDelegateErc20Wallet | 10 ++++- test/storage/L1ArbitrumTimelock | 18 +++++++- test/storage/L1ArbitrumToken | 24 ++++++++++- test/storage/L2ArbitrumGovernor | 38 ++++++++++++++++- test/storage/L2ArbitrumToken | 29 ++++++++++++- test/storage/SecurityCouncilManager | 22 +++++++++- .../SecurityCouncilMemberElectionGovernor | 33 ++++++++++++++- .../SecurityCouncilMemberRemovalGovernor | 39 ++++++++++++++++- .../SecurityCouncilNomineeElectionGovernor | 42 ++++++++++++++++++- test/storage/UpgradeExecutor | 12 +++++- 11 files changed, 272 insertions(+), 11 deletions(-) diff --git a/test/storage/ArbitrumTimelock b/test/storage/ArbitrumTimelock index 982aba982..6d3cfa413 100644 --- a/test/storage/ArbitrumTimelock +++ b/test/storage/ArbitrumTimelock @@ -1,13 +1,27 @@ + +╭---------------+--------------------------------------------------------------+------+--------+-------+-------------------------------------------╮ | Name | Type | Slot | Offset | Bytes | Contract | -|---------------|--------------------------------------------------------------|------|--------|-------|-------------------------------------------| ++==================================================================================================================================================+ | _initialized | uint8 | 0 | 0 | 1 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +|---------------+--------------------------------------------------------------+------+--------+-------+-------------------------------------------| | _initializing | bool | 0 | 1 | 1 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +|---------------+--------------------------------------------------------------+------+--------+-------+-------------------------------------------| | __gap | uint256[50] | 1 | 0 | 1600 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +|---------------+--------------------------------------------------------------+------+--------+-------+-------------------------------------------| | __gap | uint256[50] | 51 | 0 | 1600 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +|---------------+--------------------------------------------------------------+------+--------+-------+-------------------------------------------| | _roles | mapping(bytes32 => struct AccessControlUpgradeable.RoleData) | 101 | 0 | 32 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +|---------------+--------------------------------------------------------------+------+--------+-------+-------------------------------------------| | __gap | uint256[49] | 102 | 0 | 1568 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +|---------------+--------------------------------------------------------------+------+--------+-------+-------------------------------------------| | _timestamps | mapping(bytes32 => uint256) | 151 | 0 | 32 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +|---------------+--------------------------------------------------------------+------+--------+-------+-------------------------------------------| | _minDelay | uint256 | 152 | 0 | 32 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +|---------------+--------------------------------------------------------------+------+--------+-------+-------------------------------------------| | __gap | uint256[48] | 153 | 0 | 1536 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +|---------------+--------------------------------------------------------------+------+--------+-------+-------------------------------------------| | _arbMinDelay | uint256 | 201 | 0 | 32 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +|---------------+--------------------------------------------------------------+------+--------+-------+-------------------------------------------| | __gap | uint256[49] | 202 | 0 | 1568 | src/ArbitrumTimelock.sol:ArbitrumTimelock | +╰---------------+--------------------------------------------------------------+------+--------+-------+-------------------------------------------╯ + diff --git a/test/storage/FixedDelegateErc20Wallet b/test/storage/FixedDelegateErc20Wallet index 432ebaa42..8a1a7f671 100644 --- a/test/storage/FixedDelegateErc20Wallet +++ b/test/storage/FixedDelegateErc20Wallet @@ -1,7 +1,15 @@ + +╭---------------+-------------+------+--------+-------+-----------------------------------------------------------╮ | Name | Type | Slot | Offset | Bytes | Contract | -|---------------|-------------|------|--------|-------|-----------------------------------------------------------| ++=================================================================================================================+ | _initialized | uint8 | 0 | 0 | 1 | src/FixedDelegateErc20Wallet.sol:FixedDelegateErc20Wallet | +|---------------+-------------+------+--------+-------+-----------------------------------------------------------| | _initializing | bool | 0 | 1 | 1 | src/FixedDelegateErc20Wallet.sol:FixedDelegateErc20Wallet | +|---------------+-------------+------+--------+-------+-----------------------------------------------------------| | __gap | uint256[50] | 1 | 0 | 1600 | src/FixedDelegateErc20Wallet.sol:FixedDelegateErc20Wallet | +|---------------+-------------+------+--------+-------+-----------------------------------------------------------| | _owner | address | 51 | 0 | 20 | src/FixedDelegateErc20Wallet.sol:FixedDelegateErc20Wallet | +|---------------+-------------+------+--------+-------+-----------------------------------------------------------| | __gap | uint256[49] | 52 | 0 | 1568 | src/FixedDelegateErc20Wallet.sol:FixedDelegateErc20Wallet | +╰---------------+-------------+------+--------+-------+-----------------------------------------------------------╯ + diff --git a/test/storage/L1ArbitrumTimelock b/test/storage/L1ArbitrumTimelock index c7cd9f002..8c1d14087 100644 --- a/test/storage/L1ArbitrumTimelock +++ b/test/storage/L1ArbitrumTimelock @@ -1,15 +1,31 @@ + +╭----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------╮ | Name | Type | Slot | Offset | Bytes | Contract | -|----------------------|--------------------------------------------------------------|------|--------|-------|-----------------------------------------------| ++=============================================================================================================================================================+ | _initialized | uint8 | 0 | 0 | 1 | src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock | +|----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _initializing | bool | 0 | 1 | 1 | src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock | +|----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[50] | 1 | 0 | 1600 | src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock | +|----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[50] | 51 | 0 | 1600 | src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock | +|----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _roles | mapping(bytes32 => struct AccessControlUpgradeable.RoleData) | 101 | 0 | 32 | src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock | +|----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[49] | 102 | 0 | 1568 | src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock | +|----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _timestamps | mapping(bytes32 => uint256) | 151 | 0 | 32 | src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock | +|----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _minDelay | uint256 | 152 | 0 | 32 | src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock | +|----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[48] | 153 | 0 | 1536 | src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock | +|----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _arbMinDelay | uint256 | 201 | 0 | 32 | src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock | +|----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[49] | 202 | 0 | 1568 | src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock | +|----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | governanceChainInbox | address | 251 | 0 | 20 | src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock | +|----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | l2Timelock | address | 252 | 0 | 20 | src/L1ArbitrumTimelock.sol:L1ArbitrumTimelock | +╰----------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------╯ + diff --git a/test/storage/L1ArbitrumToken b/test/storage/L1ArbitrumToken index 02095945f..f6fd63dff 100644 --- a/test/storage/L1ArbitrumToken +++ b/test/storage/L1ArbitrumToken @@ -1,21 +1,43 @@ + +╭----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------╮ | Name | Type | Slot | Offset | Bytes | Contract | -|----------------------------------|--------------------------------------------------------|------|--------|-------|-----------------------------------------| ++=============================================================================================================================================================+ | _initialized | uint8 | 0 | 0 | 1 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | _initializing | bool | 0 | 1 | 1 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[50] | 1 | 0 | 1600 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | _balances | mapping(address => uint256) | 51 | 0 | 32 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | _allowances | mapping(address => mapping(address => uint256)) | 52 | 0 | 32 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | _totalSupply | uint256 | 53 | 0 | 32 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | _name | string | 54 | 0 | 32 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | _symbol | string | 55 | 0 | 32 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[45] | 56 | 0 | 1440 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | _HASHED_NAME | bytes32 | 101 | 0 | 32 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | _HASHED_VERSION | bytes32 | 102 | 0 | 32 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[50] | 103 | 0 | 1600 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | _nonces | mapping(address => struct CountersUpgradeable.Counter) | 153 | 0 | 32 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | _PERMIT_TYPEHASH_DEPRECATED_SLOT | bytes32 | 154 | 0 | 32 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[49] | 155 | 0 | 1568 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | shouldRegisterGateway | bool | 204 | 0 | 1 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | arbOneGateway | address | 204 | 1 | 20 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | novaRouter | address | 205 | 0 | 20 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +|----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------| | novaGateway | address | 206 | 0 | 20 | src/L1ArbitrumToken.sol:L1ArbitrumToken | +╰----------------------------------+--------------------------------------------------------+------+--------+-------+-----------------------------------------╯ + diff --git a/test/storage/L2ArbitrumGovernor b/test/storage/L2ArbitrumGovernor index e6965aa80..8068f1fa4 100644 --- a/test/storage/L2ArbitrumGovernor +++ b/test/storage/L2ArbitrumGovernor @@ -1,35 +1,71 @@ + +╭-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------╮ | Name | Type | Slot | Offset | Bytes | Contract | -|-------------------------|---------------------------------------------------------------------------|------|--------|-------|-----------------------------------------------| ++=============================================================================================================================================================================+ | _initialized | uint8 | 0 | 0 | 1 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _initializing | bool | 0 | 1 | 1 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[50] | 1 | 0 | 1600 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[50] | 51 | 0 | 1600 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _HASHED_NAME | bytes32 | 101 | 0 | 32 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _HASHED_VERSION | bytes32 | 102 | 0 | 32 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[50] | 103 | 0 | 1600 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[50] | 153 | 0 | 1600 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[50] | 203 | 0 | 1600 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _name | string | 253 | 0 | 32 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _proposals | mapping(uint256 => struct GovernorUpgradeable.ProposalCore) | 254 | 0 | 32 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _governanceCall | struct DoubleEndedQueueUpgradeable.Bytes32Deque | 255 | 0 | 64 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[46] | 257 | 0 | 1472 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _votingDelay | uint256 | 303 | 0 | 32 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _votingPeriod | uint256 | 304 | 0 | 32 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _proposalThreshold | uint256 | 305 | 0 | 32 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[47] | 306 | 0 | 1504 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _proposalVotes | mapping(uint256 => struct GovernorCountingSimpleUpgradeable.ProposalVote) | 353 | 0 | 32 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[49] | 354 | 0 | 1568 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | token | contract IVotesUpgradeable | 403 | 0 | 20 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[50] | 404 | 0 | 1600 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _timelock | contract TimelockControllerUpgradeable | 454 | 0 | 20 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _timelockIds | mapping(uint256 => bytes32) | 455 | 0 | 32 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[48] | 456 | 0 | 1536 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _quorumNumerator | uint256 | 504 | 0 | 32 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _quorumNumeratorHistory | struct CheckpointsUpgradeable.History | 505 | 0 | 32 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[48] | 506 | 0 | 1536 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _voteExtension | uint64 | 554 | 0 | 8 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _extendedDeadlines | mapping(uint256 => struct TimersUpgradeable.BlockNumber) | 555 | 0 | 32 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[48] | 556 | 0 | 1536 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | _owner | address | 604 | 0 | 20 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[49] | 605 | 0 | 1568 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +|-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------| | __gap | uint256[50] | 654 | 0 | 1600 | src/L2ArbitrumGovernor.sol:L2ArbitrumGovernor | +╰-------------------------+---------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------╯ + diff --git a/test/storage/L2ArbitrumToken b/test/storage/L2ArbitrumToken index be1189c29..93dd0cea2 100644 --- a/test/storage/L2ArbitrumToken +++ b/test/storage/L2ArbitrumToken @@ -1,26 +1,53 @@ + +╭----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------╮ | Name | Type | Slot | Offset | Bytes | Contract | -|----------------------------------|---------------------------------------------------------------|------|--------|-------|-----------------------------------------| ++====================================================================================================================================================================+ | _initialized | uint8 | 0 | 0 | 1 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _initializing | bool | 0 | 1 | 1 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[50] | 1 | 0 | 1600 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _balances | mapping(address => uint256) | 51 | 0 | 32 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _allowances | mapping(address => mapping(address => uint256)) | 52 | 0 | 32 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _totalSupply | uint256 | 53 | 0 | 32 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _name | string | 54 | 0 | 32 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _symbol | string | 55 | 0 | 32 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[45] | 56 | 0 | 1440 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[50] | 101 | 0 | 1600 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _HASHED_NAME | bytes32 | 151 | 0 | 32 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _HASHED_VERSION | bytes32 | 152 | 0 | 32 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[50] | 153 | 0 | 1600 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _nonces | mapping(address => struct CountersUpgradeable.Counter) | 203 | 0 | 32 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _PERMIT_TYPEHASH_DEPRECATED_SLOT | bytes32 | 204 | 0 | 32 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[49] | 205 | 0 | 1568 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _delegates | mapping(address => address) | 254 | 0 | 32 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _checkpoints | mapping(address => struct ERC20VotesUpgradeable.Checkpoint[]) | 255 | 0 | 32 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _totalSupplyCheckpoints | struct ERC20VotesUpgradeable.Checkpoint[] | 256 | 0 | 32 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[47] | 257 | 0 | 1504 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _owner | address | 304 | 0 | 20 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[49] | 305 | 0 | 1568 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | l1Address | address | 354 | 0 | 20 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +|----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------| | nextMint | uint256 | 355 | 0 | 32 | src/L2ArbitrumToken.sol:L2ArbitrumToken | +╰----------------------------------+---------------------------------------------------------------+------+--------+-------+-----------------------------------------╯ + diff --git a/test/storage/SecurityCouncilManager b/test/storage/SecurityCouncilManager index 6dd5ad35e..e60ff2524 100644 --- a/test/storage/SecurityCouncilManager +++ b/test/storage/SecurityCouncilManager @@ -1,19 +1,39 @@ + +╭-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------╮ | Name | Type | Slot | Offset | Bytes | Contract | -|-------------------|--------------------------------------------------------------|------|--------|-------|-----------------------------------------------------------------------------| ++========================================================================================================================================================================================+ | _initialized | uint8 | 0 | 0 | 1 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | _initializing | bool | 0 | 1 | 1 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | __gap | uint256[50] | 1 | 0 | 1600 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | __gap | uint256[50] | 51 | 0 | 1600 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | _roles | mapping(bytes32 => struct AccessControlUpgradeable.RoleData) | 101 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | __gap | uint256[49] | 102 | 0 | 1568 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | firstCohort | address[] | 151 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | secondCohort | address[] | 152 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | l2CoreGovTimelock | address payable | 153 | 0 | 20 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | securityCouncils | struct SecurityCouncilData[] | 154 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | router | contract UpgradeExecRouteBuilder | 155 | 0 | 20 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | updateNonce | uint256 | 156 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | cohortSize | uint256 | 157 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | lastRotated | mapping(address => uint256) | 158 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | rotatedTo | mapping(address => address) | 159 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | minRotationPeriod | uint256 | 160 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | __gap | uint256[40] | 161 | 0 | 1280 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +╰-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------╯ + diff --git a/test/storage/SecurityCouncilMemberElectionGovernor b/test/storage/SecurityCouncilMemberElectionGovernor index a92301cdc..987440a85 100644 --- a/test/storage/SecurityCouncilMemberElectionGovernor +++ b/test/storage/SecurityCouncilMemberElectionGovernor @@ -1,30 +1,61 @@ + +╭-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------╮ | Name | Type | Slot | Offset | Bytes | Contract | -|-------------------------|--------------------------------------------------------------------------------------------------|------|--------|-------|---------------------------------------------------------------------------------------------------------------------| ++==========================================================================================================================================================================================================================================================================+ | _initialized | uint8 | 0 | 0 | 1 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | _initializing | bool | 0 | 1 | 1 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 1 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 51 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | _HASHED_NAME | bytes32 | 101 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | _HASHED_VERSION | bytes32 | 102 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 103 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 153 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | _name | string | 203 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | _proposals | mapping(uint256 => struct GovernorUpgradeable.ProposalCore) | 204 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | _governanceCall | struct DoubleEndedQueueUpgradeable.Bytes32Deque | 205 | 0 | 64 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | __gap | uint256[46] | 207 | 0 | 1472 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | token | contract IVotesUpgradeable | 253 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 254 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | fullWeightDuration | uint256 | 304 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | _elections | mapping(uint256 => struct SecurityCouncilMemberElectionGovernorCountingUpgradeable.ElectionInfo) | 305 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | __gap | uint256[48] | 306 | 0 | 1536 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | _votingDelay | uint256 | 354 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | _votingPeriod | uint256 | 355 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | _proposalThreshold | uint256 | 356 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | __gap | uint256[47] | 357 | 0 | 1504 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | _owner | address | 404 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | __gap | uint256[49] | 405 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | usedNonces | mapping(bytes32 => bool) | 454 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | __gap | uint256[49] | 455 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | nomineeElectionGovernor | contract ISecurityCouncilNomineeElectionGovernor | 504 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | securityCouncilManager | contract ISecurityCouncilManager | 505 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| | __gap | uint256[48] | 506 | 0 | 1536 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +╰-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------╯ + diff --git a/test/storage/SecurityCouncilMemberRemovalGovernor b/test/storage/SecurityCouncilMemberRemovalGovernor index 1ec4c1de6..92a73d8d9 100644 --- a/test/storage/SecurityCouncilMemberRemovalGovernor +++ b/test/storage/SecurityCouncilMemberRemovalGovernor @@ -1,36 +1,73 @@ + +╭--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------╮ | Name | Type | Slot | Offset | Bytes | Contract | -|--------------------------|---------------------------------------------------------------------------|------|--------|-------|-------------------------------------------------------------------------------------------------------------------| ++==================================================================================================================================================================================================================================================+ | _initialized | uint8 | 0 | 0 | 1 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _initializing | bool | 0 | 1 | 1 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 1 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 51 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _HASHED_NAME | bytes32 | 101 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _HASHED_VERSION | bytes32 | 102 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 103 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 153 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _name | string | 203 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _proposals | mapping(uint256 => struct GovernorUpgradeable.ProposalCore) | 204 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _governanceCall | struct DoubleEndedQueueUpgradeable.Bytes32Deque | 205 | 0 | 64 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[46] | 207 | 0 | 1472 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | token | contract IVotesUpgradeable | 253 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 254 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _voteExtension | uint64 | 304 | 0 | 8 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _extendedDeadlines | mapping(uint256 => struct TimersUpgradeable.BlockNumber) | 305 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[48] | 306 | 0 | 1536 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _proposalVotes | mapping(uint256 => struct GovernorCountingSimpleUpgradeable.ProposalVote) | 354 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[49] | 355 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _quorumNumerator | uint256 | 404 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _quorumNumeratorHistory | struct CheckpointsUpgradeable.History | 405 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[48] | 406 | 0 | 1536 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 454 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _votingDelay | uint256 | 504 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _votingPeriod | uint256 | 505 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _proposalThreshold | uint256 | 506 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[47] | 507 | 0 | 1504 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | proposalExpirationBlocks | uint256 | 554 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[49] | 555 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | _owner | address | 604 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[49] | 605 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | voteSuccessNumerator | uint256 | 654 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | securityCouncilManager | contract ISecurityCouncilManager | 655 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| | __gap | uint256[48] | 656 | 0 | 1536 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +╰--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------╯ + diff --git a/test/storage/SecurityCouncilNomineeElectionGovernor b/test/storage/SecurityCouncilNomineeElectionGovernor index 74f8481d3..235fb7592 100644 --- a/test/storage/SecurityCouncilNomineeElectionGovernor +++ b/test/storage/SecurityCouncilNomineeElectionGovernor @@ -1,39 +1,79 @@ + +╭---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------╮ | Name | Type | Slot | Offset | Bytes | Contract | -|---------------------------------------|------------------------------------------------------------------------------------------------------------------|------|--------|-------|-----------------------------------------------------------------------------------------------------------------------| ++==========================================================================================================================================================================================================================================================================================================+ | _initialized | uint8 | 0 | 0 | 1 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _initializing | bool | 0 | 1 | 1 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 1 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 51 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _HASHED_NAME | bytes32 | 101 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _HASHED_VERSION | bytes32 | 102 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 103 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 153 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _name | string | 203 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _proposals | mapping(uint256 => struct GovernorUpgradeable.ProposalCore) | 204 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _governanceCall | struct DoubleEndedQueueUpgradeable.Bytes32Deque | 205 | 0 | 64 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[46] | 207 | 0 | 1472 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | token | contract IVotesUpgradeable | 253 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 254 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _elections | mapping(uint256 => struct SecurityCouncilNomineeElectionGovernorCountingUpgradeable.NomineeElectionCountingInfo) | 304 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[49] | 305 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _quorumNumerator | uint256 | 354 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _quorumNumeratorHistory | struct CheckpointsUpgradeable.History | 355 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[48] | 356 | 0 | 1536 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[50] | 404 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _votingDelay | uint256 | 454 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _votingPeriod | uint256 | 455 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _proposalThreshold | uint256 | 456 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[47] | 457 | 0 | 1504 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _owner | address | 504 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[49] | 505 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | firstNominationStartDate | struct Date | 554 | 0 | 128 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | nomineeVettingDuration | uint256 | 558 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[45] | 559 | 0 | 1440 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | usedNonces | mapping(bytes32 => bool) | 604 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[49] | 605 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | nomineeVetter | address | 654 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | securityCouncilManager | contract ISecurityCouncilManager | 655 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | securityCouncilMemberElectionGovernor | contract ISecurityCouncilMemberElectionGovernor | 656 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | electionCount | uint256 | 657 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | _elections | mapping(uint256 => struct SecurityCouncilNomineeElectionGovernor.ElectionInfo) | 658 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | __gap | uint256[45] | 659 | 0 | 1440 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +╰---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------╯ + diff --git a/test/storage/UpgradeExecutor b/test/storage/UpgradeExecutor index 85636f270..17b41d91d 100644 --- a/test/storage/UpgradeExecutor +++ b/test/storage/UpgradeExecutor @@ -1,9 +1,19 @@ + +╭---------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------╮ | Name | Type | Slot | Offset | Bytes | Contract | -|---------------|--------------------------------------------------------------|------|--------|-------|-----------------------------------------| ++================================================================================================================================================+ | _initialized | uint8 | 0 | 0 | 1 | src/UpgradeExecutor.sol:UpgradeExecutor | +|---------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _initializing | bool | 0 | 1 | 1 | src/UpgradeExecutor.sol:UpgradeExecutor | +|---------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[50] | 1 | 0 | 1600 | src/UpgradeExecutor.sol:UpgradeExecutor | +|---------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[50] | 51 | 0 | 1600 | src/UpgradeExecutor.sol:UpgradeExecutor | +|---------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _roles | mapping(bytes32 => struct AccessControlUpgradeable.RoleData) | 101 | 0 | 32 | src/UpgradeExecutor.sol:UpgradeExecutor | +|---------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------| | __gap | uint256[49] | 102 | 0 | 1568 | src/UpgradeExecutor.sol:UpgradeExecutor | +|---------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------| | _status | uint256 | 151 | 0 | 32 | src/UpgradeExecutor.sol:UpgradeExecutor | +╰---------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------╯ + From 5baddae430f53cce42ad7a3587828daa854dc430 Mon Sep 17 00:00:00 2001 From: gzeon Date: Wed, 18 Dec 2024 16:37:32 +0800 Subject: [PATCH 044/108] chore: update storage --- test/storage/SecurityCouncilManager | 1 + 1 file changed, 1 insertion(+) diff --git a/test/storage/SecurityCouncilManager b/test/storage/SecurityCouncilManager index 3f7b05172..e60ff2524 100644 --- a/test/storage/SecurityCouncilManager +++ b/test/storage/SecurityCouncilManager @@ -36,3 +36,4 @@ |-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | __gap | uint256[40] | 161 | 0 | 1280 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | ╰-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------╯ + From 4b2abc5e3ff9a227273f3534abb754391ebd9db6 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Fri, 20 Dec 2024 14:36:35 +0000 Subject: [PATCH 045/108] Switched test node runs to release --- .github/workflows/build-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 5a7433891..66ace61cc 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -134,7 +134,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive - - uses: OffchainLabs/actions/run-nitro-test-node@main + - uses: OffchainLabs/actions/run-nitro-test-node@release with: no-token-bridge: true @@ -197,7 +197,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive - - uses: OffchainLabs/actions/run-nitro-test-node@main + - uses: OffchainLabs/actions/run-nitro-test-node@release with: no-token-bridge: true From 1d35f8632b8d0b4698e88bdcdea0787f643cab50 Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 27 Dec 2024 19:51:56 +0800 Subject: [PATCH 046/108] ci: nitro-testnode-ref --- .github/workflows/build-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 66ace61cc..35af35654 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -134,9 +134,10 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive - - uses: OffchainLabs/actions/run-nitro-test-node@release + - uses: OffchainLabs/actions/run-nitro-test-node@main with: no-token-bridge: true + nitro-testnode-ref: release - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 From 11d61fde58f2e07c8a25fa31a549ff3402f630bc Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 27 Dec 2024 19:53:55 +0800 Subject: [PATCH 047/108] ci: same fix --- .github/workflows/build-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 35af35654..98cb122fe 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -198,9 +198,10 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive - - uses: OffchainLabs/actions/run-nitro-test-node@release + - uses: OffchainLabs/actions/run-nitro-test-node@main with: no-token-bridge: true + nitro-testnode-ref: release - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 From cf10f6e86ad34c6af6deea8f93b35bfd605eca34 Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 27 Dec 2024 22:08:07 +0800 Subject: [PATCH 048/108] fix: propmon redeemed ticket race condition --- src-ts/proposalStage.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src-ts/proposalStage.ts b/src-ts/proposalStage.ts index c8059b385..defd7a7ff 100644 --- a/src-ts/proposalStage.ts +++ b/src-ts/proposalStage.ts @@ -1385,6 +1385,13 @@ export class RetryableExecutionStage implements ProposalStage { } while (true) { + const status = await this.l1ToL2Message.status(); + if (status === L1ToL2MessageStatus.REDEEMED) { + break; + } else if (status === L1ToL2MessageStatus.EXPIRED) { + const id = this.l1ToL2Message.retryableCreationId.toLowerCase(); + throw new ProposalStageError(`Retryable ticket expired ${id}`, this.identifier, this.name); + } try { await (await this.l1ToL2Message.redeem()).wait(); break; From 9defeb4c61433ba46a0052cc90ffe9293de6b9ca Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 27 Dec 2024 22:31:58 +0800 Subject: [PATCH 049/108] fix: parse error instead --- src-ts/proposalStage.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src-ts/proposalStage.ts b/src-ts/proposalStage.ts index defd7a7ff..c0a18be6a 100644 --- a/src-ts/proposalStage.ts +++ b/src-ts/proposalStage.ts @@ -40,6 +40,7 @@ import { import { hasTimelock, hasVettingPeriod, getL1BlockNumberFromL2, wait } from "./utils"; import { CallScheduledEvent } from "../typechain-types/src/ArbitrumTimelock"; import { GnosisSafeL2__factory } from "../types/ethers-contracts/factories/GnosisSafeL2__factory"; +import { ArbSdkError } from "@arbitrum/sdk/dist/lib/dataEntities/errors"; type Provider = providers.Provider; @@ -1385,17 +1386,13 @@ export class RetryableExecutionStage implements ProposalStage { } while (true) { - const status = await this.l1ToL2Message.status(); - if (status === L1ToL2MessageStatus.REDEEMED) { - break; - } else if (status === L1ToL2MessageStatus.EXPIRED) { - const id = this.l1ToL2Message.retryableCreationId.toLowerCase(); - throw new ProposalStageError(`Retryable ticket expired ${id}`, this.identifier, this.name); - } try { await (await this.l1ToL2Message.redeem()).wait(); break; - } catch { + } catch (e) { + if (e instanceof ArbSdkError && e.message.includes("Message status: REDEEMED")) { + break; + } const id = this.l1ToL2Message.retryableCreationId.toLowerCase(); console.error(`Failed to redeem retryable ${id}, retrying in 60s`); await wait(60_000); From f1fa549b6ea8277abd43b627d6741211b10119c8 Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 27 Dec 2024 22:34:40 +0800 Subject: [PATCH 050/108] perf: reduce the retry time to 5000ms --- src-ts/proposalStage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ts/proposalStage.ts b/src-ts/proposalStage.ts index c0a18be6a..1c552438d 100644 --- a/src-ts/proposalStage.ts +++ b/src-ts/proposalStage.ts @@ -1395,7 +1395,7 @@ export class RetryableExecutionStage implements ProposalStage { } const id = this.l1ToL2Message.retryableCreationId.toLowerCase(); console.error(`Failed to redeem retryable ${id}, retrying in 60s`); - await wait(60_000); + await wait(5_000); } } } From 0e9304d67885f3762b24927f4c31d50ad87bd4d9 Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 27 Dec 2024 22:39:43 +0800 Subject: [PATCH 051/108] chore: remove unnecessary diffs --- .github/workflows/build-test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 98cb122fe..5a7433891 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -137,7 +137,6 @@ jobs: - uses: OffchainLabs/actions/run-nitro-test-node@main with: no-token-bridge: true - nitro-testnode-ref: release - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 @@ -201,7 +200,6 @@ jobs: - uses: OffchainLabs/actions/run-nitro-test-node@main with: no-token-bridge: true - nitro-testnode-ref: release - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 From 519976e669d30b3ed30d4527be14c78376e15db3 Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 27 Dec 2024 22:40:45 +0800 Subject: [PATCH 052/108] fix: typo --- src-ts/proposalStage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ts/proposalStage.ts b/src-ts/proposalStage.ts index 1c552438d..3e1e791bf 100644 --- a/src-ts/proposalStage.ts +++ b/src-ts/proposalStage.ts @@ -1394,7 +1394,7 @@ export class RetryableExecutionStage implements ProposalStage { break; } const id = this.l1ToL2Message.retryableCreationId.toLowerCase(); - console.error(`Failed to redeem retryable ${id}, retrying in 60s`); + console.error(`Failed to redeem retryable ${id}, retrying in 5s`); await wait(5_000); } } From 481d8010d855050a1b495ae4722e964fa99ba188 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 6 Feb 2025 12:20:12 +0000 Subject: [PATCH 053/108] Updated rotateTo logic --- src/security-council-mgmt/SecurityCouncilManager.sol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index e363e23f8..1c7b16037 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -230,6 +230,10 @@ contract SecurityCouncilManager is } cohort.push(_newMember); + // we use the rotatedTo mapping to ensure that a member is to be removed they cant rotate away from that + // however we assume that if a member is added after being rotated away, then the removal is actually targetting that member + // and not the one previously rotated away from, so we we wipe the rotation record + rotatedTo[_newMember] = address(0); } function _removeMemberFromCohortArray(address _member) internal returns (Cohort) { @@ -256,7 +260,6 @@ contract SecurityCouncilManager is function memberRotatedTo(address _member) internal view returns (address) { if ( rotatedTo[_member] != address(0) - && !SecurityCouncilMgmtUtils.isInArray(_member, getBothCohorts()) ) { return rotatedTo[_member]; } else { From 24a0b52bdcf7b9a4dcd95fe0582bb695ab8a7563 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 6 Feb 2025 12:21:23 +0000 Subject: [PATCH 054/108] Updated formatting --- src/security-council-mgmt/SecurityCouncilManager.sol | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 1c7b16037..ec35295d2 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -258,9 +258,7 @@ contract SecurityCouncilManager is } function memberRotatedTo(address _member) internal view returns (address) { - if ( - rotatedTo[_member] != address(0) - ) { + if (rotatedTo[_member] != address(0)) { return rotatedTo[_member]; } else { return _member; @@ -604,7 +602,7 @@ contract SecurityCouncilManager is delay: ArbitrumTimelock(l2CoreGovTimelock).getMinDelay() }); } - + /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. From 1fd6125a885bd087a360aa43b42a364021b56a10 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 6 Feb 2025 12:57:30 +0000 Subject: [PATCH 055/108] Updated to stable foundry --- .github/workflows/build-test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 5a7433891..ff56ce7ea 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -14,7 +14,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - name: Setup node/yarn uses: actions/setup-node@v3 @@ -46,7 +46,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - name: Setup node/yarn uses: actions/setup-node@v3 @@ -79,7 +79,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - name: Install packages run: yarn @@ -105,7 +105,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - name: Install packages run: yarn @@ -141,7 +141,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - name: Setup node/yarn uses: actions/setup-node@v3 @@ -204,7 +204,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - name: Setup node/yarn uses: actions/setup-node@v3 From 9a5ffc6456c44614ab503d034e4fabbb70c9ce44 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 6 Feb 2025 13:09:05 +0000 Subject: [PATCH 056/108] Updated gas snapshot --- .gas-snapshot | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 21074e2d4..3e19288e9 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -27,7 +27,7 @@ ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 85732376) +E2E:testE2E() (gas: 85744277) FixedDelegateErc20WalletTest:testInit() (gas: 5822585) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) @@ -95,11 +95,11 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28415658) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28364371) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28417242) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28657360) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31488070) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31492301) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26575079) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31490301) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31511468) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31486267) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31490498) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26573276) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31488498) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31509665) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317068, ~: 317184) @@ -118,34 +118,34 @@ OutboxActionsTest:testRemoveOutboxes() (gas: 853882) ProxyUpgradeAndCallActionTest:testUpgrade() (gas: 137095) ProxyUpgradeAndCallActionTest:testUpgradeAndCall() (gas: 143042) RotateMembersUpgradeActionTest:testAction() (gas: 8153) -SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 253608) +SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 253582) SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20770) -SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 346415) -SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 349850) +SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 348673) +SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 352108) SecurityCouncilManagerTest:testAddSC() (gas: 118742) SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112296) -SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 125194) +SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 136614) SecurityCouncilManagerTest:testCohortMethods() (gas: 137958) SecurityCouncilManagerTest:testInitialization() (gas: 206439) -SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 4986898) -SecurityCouncilManagerTest:testRemoveMember() (gas: 217210) -SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 101593) -SecurityCouncilManagerTest:testRemoveMemberRotated() (gas: 410473) +SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 4985090) +SecurityCouncilManagerTest:testRemoveMember() (gas: 217184) +SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 101567) +SecurityCouncilManagerTest:testRemoveMemberRotated() (gas: 400541) SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81441) SecurityCouncilManagerTest:testRemoveSeC() (gas: 38400) -SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 216437) -SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 264131) -SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 456122) -SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 463344) -SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 267700) -SecurityCouncilManagerTest:testRotateMember() (gas: 604326) -SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3810858) +SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 216359) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 266389) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 448472) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 455694) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 269958) +SecurityCouncilManagerTest:testRotateMember() (gas: 606894) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3815426) SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65880) SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83211) -SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 299877) +SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 313581) SecurityCouncilManagerTest:testUpdateRouter() (gas: 76385) SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112474) -SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 299971) +SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 313675) SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 247018) SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302873) SecurityCouncilMemberElectionGovernorTest:testCastBySigTwice() (gas: 266265) From 406bebe5e85ff2554def085b25901c1e94fd46f9 Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 7 Feb 2025 00:29:02 +0900 Subject: [PATCH 057/108] poc: mid election change --- .../SecurityCouncilManager.sol | 54 +++++++++++++++---- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index ec35295d2..e400b8d62 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -38,6 +38,7 @@ contract SecurityCouncilManager is event MemberRemoved(address indexed member, Cohort indexed cohort); event MemberReplaced(address indexed replacedMember, address indexed newMember, Cohort cohort); event MemberRotated(address indexed replacedAddress, address indexed newAddress, Cohort cohort); + event MemberChanging(address indexed changingAddress, address indexed newAddress); event SecurityCouncilAdded( address indexed securityCouncil, address indexed updateAction, @@ -87,6 +88,12 @@ contract SecurityCouncilManager is /// @dev This can be used to avoid race conditions between rotation and other actions mapping(address => address) public rotatedTo; + /// @notice The timestamp at which the address was last changed + mapping(address => uint256) public lastChanging; + + /// @notice Store the address to be changed to for new members + mapping(address => address) public changingTo; + /// @inheritdoc ISecurityCouncilManager uint256 public minRotationPeriod; @@ -207,6 +214,10 @@ contract SecurityCouncilManager is _cohort == Cohort.FIRST ? delete firstCohort : delete secondCohort; for (uint256 i = 0; i < _newCohort.length; i++) { + address newMember = _newCohort[i]; + if (changingTo[newMember] != address(0)) { + newMember = changingTo[newMember]; + } _addMemberToCohortArray(_newCohort[i], _cohort); } @@ -294,18 +305,11 @@ contract SecurityCouncilManager is ); } - /// @inheritdoc ISecurityCouncilManager - function rotateMember( + function _rotateMemberChecks( address newMemberAddress, address memberElectionGovernor, bytes calldata signature - ) external { - uint256 lastRotatedTimestamp = lastRotated[msg.sender]; - if (lastRotatedTimestamp != 0 && block.timestamp < lastRotatedTimestamp + minRotationPeriod) - { - revert RotationTooSoon(msg.sender, lastRotatedTimestamp + minRotationPeriod); - } - + ) internal returns (address) { // we enforce that a the new address is an eoa in the same way do // in NomineeGovernor.addContender by requiring a signature bytes32 digest = getRotateMemberHash(msg.sender, updateNonce); @@ -369,6 +373,20 @@ contract SecurityCouncilManager is } } } + } + + /// @inheritdoc ISecurityCouncilManager + function rotateMember( + address newMemberAddress, + address memberElectionGovernor, + bytes calldata signature + ) external { + uint256 lastRotatedTimestamp = lastRotated[msg.sender]; + if (lastRotatedTimestamp != 0 && block.timestamp < lastRotatedTimestamp + minRotationPeriod) + { + revert RotationTooSoon(msg.sender, lastRotatedTimestamp + minRotationPeriod); + } + address newAddress = _rotateMemberChecks(newMemberAddress, memberElectionGovernor, signature); lastRotated[newAddress] = block.timestamp; rotatedTo[msg.sender] = newAddress; @@ -376,6 +394,24 @@ contract SecurityCouncilManager is emit MemberRotated({replacedAddress: msg.sender, newAddress: newAddress, cohort: cohort}); } + /// @notice change incomming member (mid election rotation) + function changeIncomming( + address newMemberAddress, + address memberElectionGovernor, + bytes calldata signature + ) external { + uint256 lastChangingTimestamp = lastChanging[msg.sender]; + if (lastChangingTimestamp != 0 && block.timestamp < lastChangingTimestamp + minRotationPeriod) + { + revert RotationTooSoon(msg.sender, lastChangingTimestamp + minRotationPeriod); + } + address newAddress = _rotateMemberChecks(newMemberAddress, memberElectionGovernor, signature); + + lastChanging[newAddress] = block.timestamp; + changingTo[msg.sender] = newAddress; + emit MemberChanging({changingAddress: msg.sender, newAddress: newAddress}); + } + function _swapMembers(address _addressToRemove, address _addressToAdd) internal returns (Cohort) From 7f38f4b306c37cd09fb2b677d5ef16ac2459c2a4 Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 7 Feb 2025 00:51:21 +0900 Subject: [PATCH 058/108] fix: disallow rotate in the change target --- src/security-council-mgmt/SecurityCouncilManager.sol | 11 +++++++++++ .../interfaces/ISecurityCouncilManager.sol | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index e400b8d62..120d0efb2 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -373,6 +373,16 @@ contract SecurityCouncilManager is } } } + + if (newAddress == msg.sender) { + revert CannotRotateToSelf(); + } + + if (changingTo[newAddress] != address(0)) { + revert InvalidTarget(); + } + + return newAddress; } /// @inheritdoc ISecurityCouncilManager @@ -409,6 +419,7 @@ contract SecurityCouncilManager is lastChanging[newAddress] = block.timestamp; changingTo[msg.sender] = newAddress; + changingTo[newAddress] = newAddress; // this is to prevert further changes to the new member emit MemberChanging({changingAddress: msg.sender, newAddress: newAddress}); } diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index f42d36254..d720447b3 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -48,6 +48,10 @@ interface ISecurityCouncilManager { error NewMemberIsNominee(uint256 proposalId, address newMember); error InvalidNewAddress(address newAddress); + error InvalidTarget(); + error CannotRotateToSelf(); + error NewMemberIsTarget(); + /// @notice There is a minimum period between when an address can be rotated /// This is to ensure a single member cannot do many rotations in a row function minRotationPeriod() external view returns (uint256); From 5bdfba3f8cc53a8d8b4d6342d7cddadaf934fdd4 Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 7 Feb 2025 18:55:28 +0900 Subject: [PATCH 059/108] feat: rotateForFutureMember --- .../SecurityCouncilManager.sol | 102 +++++++++--------- .../interfaces/ISecurityCouncilManager.sol | 13 ++- 2 files changed, 60 insertions(+), 55 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 120d0efb2..4b9e6d291 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -38,7 +38,7 @@ contract SecurityCouncilManager is event MemberRemoved(address indexed member, Cohort indexed cohort); event MemberReplaced(address indexed replacedMember, address indexed newMember, Cohort cohort); event MemberRotated(address indexed replacedAddress, address indexed newAddress, Cohort cohort); - event MemberChanging(address indexed changingAddress, address indexed newAddress); + event MemberToBeRotated(address indexed replacedAddress, address indexed newAddress); event SecurityCouncilAdded( address indexed securityCouncil, address indexed updateAction, @@ -88,11 +88,9 @@ contract SecurityCouncilManager is /// @dev This can be used to avoid race conditions between rotation and other actions mapping(address => address) public rotatedTo; - /// @notice The timestamp at which the address was last changed - mapping(address => uint256) public lastChanging; - - /// @notice Store the address to be changed to for new members - mapping(address => address) public changingTo; + /// @notice Store the address to be rotated to for new members in the future + /// @dev `rotatingTo[X] = Y` means if X is installed as a new member, Y will be installed instead + mapping(address => address) public rotatingTo; /// @inheritdoc ISecurityCouncilManager uint256 public minRotationPeriod; @@ -212,11 +210,19 @@ contract SecurityCouncilManager is // delete the old cohort _cohort == Cohort.FIRST ? delete firstCohort : delete secondCohort; + address[] storage otherCohort = _cohort == Cohort.FIRST ? secondCohort : firstCohort; for (uint256 i = 0; i < _newCohort.length; i++) { - address newMember = _newCohort[i]; - if (changingTo[newMember] != address(0)) { - newMember = changingTo[newMember]; + // we have to change the array so correct _newCohort can be emitted + address rotatingAddress = rotatingTo[_newCohort[i]]; + if (rotatingAddress != address(0)) { + // only replace if there is no clash + if ( + !SecurityCouncilMgmtUtils.isInArray(rotatingAddress, _newCohort) + && !SecurityCouncilMgmtUtils.isInArray(rotatingAddress, otherCohort) + ) { + _newCohort[i] = rotatingAddress; + } } _addMemberToCohortArray(_newCohort[i], _cohort); } @@ -305,13 +311,15 @@ contract SecurityCouncilManager is ); } - function _rotateMemberChecks( - address newMemberAddress, - address memberElectionGovernor, - bytes calldata signature - ) internal returns (address) { + function _verifyNewAddress(address newMemberAddress, bytes calldata signature) + internal + returns (address) + { // we enforce that a the new address is an eoa in the same way do // in NomineeGovernor.addContender by requiring a signature + // TODO: this updateNonce is global and only updated when an update is scheduled + // permissionless `rotateForFutureMember` will not update the nonce + // permissioned `rotateMember` will allow other member to dos rotation bytes32 digest = getRotateMemberHash(msg.sender, updateNonce); address newAddress = ECDSAUpgradeable.recover(digest, signature); // we safety check the new member address is the one that we expect to replace here @@ -319,6 +327,21 @@ contract SecurityCouncilManager is if (newAddress != newMemberAddress) { revert InvalidNewAddress(newAddress); } + return newAddress; + } + + /// @inheritdoc ISecurityCouncilManager + function rotateMember( + address newMemberAddress, + address memberElectionGovernor, + bytes calldata signature + ) external { + uint256 lastRotatedTimestamp = lastRotated[msg.sender]; + if (lastRotatedTimestamp != 0 && block.timestamp < lastRotatedTimestamp + minRotationPeriod) + { + revert RotationTooSoon(msg.sender, lastRotatedTimestamp + minRotationPeriod); + } + address newAddress = _verifyNewAddress(newMemberAddress, signature); // the cohort replacer should be the member election governor // we don't explicitly store the member election governor in this manager @@ -374,53 +397,28 @@ contract SecurityCouncilManager is } } - if (newAddress == msg.sender) { - revert CannotRotateToSelf(); - } - - if (changingTo[newAddress] != address(0)) { - revert InvalidTarget(); + if (rotatingTo[newAddress] != newAddress) { + revert NewMemberIsRotatingTarget(newAddress); } - return newAddress; - } - - /// @inheritdoc ISecurityCouncilManager - function rotateMember( - address newMemberAddress, - address memberElectionGovernor, - bytes calldata signature - ) external { - uint256 lastRotatedTimestamp = lastRotated[msg.sender]; - if (lastRotatedTimestamp != 0 && block.timestamp < lastRotatedTimestamp + minRotationPeriod) - { - revert RotationTooSoon(msg.sender, lastRotatedTimestamp + minRotationPeriod); - } - address newAddress = _rotateMemberChecks(newMemberAddress, memberElectionGovernor, signature); - lastRotated[newAddress] = block.timestamp; rotatedTo[msg.sender] = newAddress; Cohort cohort = _swapMembers(msg.sender, newAddress); emit MemberRotated({replacedAddress: msg.sender, newAddress: newAddress, cohort: cohort}); } - /// @notice change incomming member (mid election rotation) - function changeIncomming( - address newMemberAddress, - address memberElectionGovernor, - bytes calldata signature - ) external { - uint256 lastChangingTimestamp = lastChanging[msg.sender]; - if (lastChangingTimestamp != 0 && block.timestamp < lastChangingTimestamp + minRotationPeriod) - { - revert RotationTooSoon(msg.sender, lastChangingTimestamp + minRotationPeriod); - } - address newAddress = _rotateMemberChecks(newMemberAddress, memberElectionGovernor, signature); + /// @inheritdoc ISecurityCouncilManager + function rotateForFutureMember(address newMemberAddress, bytes calldata signature) external { + // we don't have to check timestamp here, because dos is not possible + address newAddress = _verifyNewAddress(newMemberAddress, signature); + + rotatingTo[msg.sender] = newAddress; - lastChanging[newAddress] = block.timestamp; - changingTo[msg.sender] = newAddress; - changingTo[newAddress] = newAddress; // this is to prevert further changes to the new member - emit MemberChanging({changingAddress: msg.sender, newAddress: newAddress}); + // this serves 2 purposes: + // 1. it prevents "chained" rotations + // 2. it allow one to check rotatingTo[x] to see if x can be a rotation target + rotatingTo[newAddress] = newAddress; + emit MemberToBeRotated({replacedAddress: msg.sender, newAddress: newAddress}); } function _swapMembers(address _addressToRemove, address _addressToAdd) diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index d720447b3..41b529b3d 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -46,11 +46,11 @@ interface ISecurityCouncilManager { error GovernorNotReplacer(); error NewMemberIsContender(uint256 proposalId, address newMember); error NewMemberIsNominee(uint256 proposalId, address newMember); + error NewMemberIsRotatingTarget(address newMember); error InvalidNewAddress(address newAddress); - error InvalidTarget(); - error CannotRotateToSelf(); - error NewMemberIsTarget(); + function rotatedTo(address) external view returns (address); + function rotatingTo(address) external view returns (address); /// @notice There is a minimum period between when an address can be rotated /// This is to ensure a single member cannot do many rotations in a row @@ -131,6 +131,13 @@ interface ISecurityCouncilManager { address memberElectionGovernor, bytes calldata signature ) external; + /// @notice Allow rotation to another address when the sender becomes a member of the Security Council in the future through election + /// @dev Cannot rotate to a contender in an ongoing election, as this could cause a clash that would stop the election result executing + /// If this future rotation causes a clash, the rotation will not be executed and the original address will be installed + /// This rotation only applies to future replaceCohort, mainly used by the member election governor + /// @param newMemberAddress The new member address to be rotated to + /// @param signature A signature from the new member address over the 712 addMember hash + function rotateForFutureMember(address newMemberAddress, bytes calldata signature) external; /// @notice Is the account a member of the first cohort function firstCohortIncludes(address account) external view returns (bool); /// @notice Is the account a member of the second cohort From 712956e178cac31489d7e57bcaedf1d6c159ad4e Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 7 Feb 2025 19:11:58 +0900 Subject: [PATCH 060/108] fix: checks --- src/security-council-mgmt/SecurityCouncilManager.sol | 10 ++++++++-- .../interfaces/ISecurityCouncilManager.sol | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 4b9e6d291..db10499c8 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -397,8 +397,14 @@ contract SecurityCouncilManager is } } - if (rotatingTo[newAddress] != newAddress) { - revert NewMemberIsRotatingTarget(newAddress); + address rotatingTarget = rotatingTo[newAddress]; + if (rotatingTarget != address(0)) { + // if newAddress is a rotating target, it might cause a clash when new members are elected + if (rotatingTarget == newAddress) { + revert NewMemberIsRotatingTarget(newAddress); + } + // if newAddress is rotating, it likely make no sense to rotate into it now + revert NewMemberIsRotating(newAddress); } lastRotated[newAddress] = block.timestamp; diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index 41b529b3d..15f795cfa 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -46,6 +46,7 @@ interface ISecurityCouncilManager { error GovernorNotReplacer(); error NewMemberIsContender(uint256 proposalId, address newMember); error NewMemberIsNominee(uint256 proposalId, address newMember); + error NewMemberIsRotating(address newMember); error NewMemberIsRotatingTarget(address newMember); error InvalidNewAddress(address newAddress); From 6f3a1f1e59ad32cd0849a16a3ea46d00871dea9f Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 7 Feb 2025 19:18:21 +0900 Subject: [PATCH 061/108] fix: _checkNotRotatingSrcOrTarget --- .../SecurityCouncilManager.sol | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index db10499c8..b059e2250 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -330,6 +330,18 @@ contract SecurityCouncilManager is return newAddress; } + function _checkNotRotatingSrcOrTarget(address newAddress) internal view { + address rotatingTarget = rotatingTo[newAddress]; + if (rotatingTarget != address(0)) { + // if newAddress is a rotating target, it might cause a clash when new members are elected + if (rotatingTarget == newAddress) { + revert NewMemberIsRotatingTarget(newAddress); + } + // if newAddress is rotating, it likely make no sense to rotate into it now + revert NewMemberIsRotating(newAddress); + } + } + /// @inheritdoc ISecurityCouncilManager function rotateMember( address newMemberAddress, @@ -397,15 +409,7 @@ contract SecurityCouncilManager is } } - address rotatingTarget = rotatingTo[newAddress]; - if (rotatingTarget != address(0)) { - // if newAddress is a rotating target, it might cause a clash when new members are elected - if (rotatingTarget == newAddress) { - revert NewMemberIsRotatingTarget(newAddress); - } - // if newAddress is rotating, it likely make no sense to rotate into it now - revert NewMemberIsRotating(newAddress); - } + _checkNotRotatingSrcOrTarget(newAddress); lastRotated[newAddress] = block.timestamp; rotatedTo[msg.sender] = newAddress; @@ -423,6 +427,7 @@ contract SecurityCouncilManager is // this serves 2 purposes: // 1. it prevents "chained" rotations // 2. it allow one to check rotatingTo[x] to see if x can be a rotation target + _checkNotRotatingSrcOrTarget(newAddress); rotatingTo[newAddress] = newAddress; emit MemberToBeRotated({replacedAddress: msg.sender, newAddress: newAddress}); } From 2f22b01c85c8e4bc5c25ef0e6e4035a56ca2204a Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Fri, 7 Feb 2025 17:15:10 +0000 Subject: [PATCH 062/108] Updated function names and added rotatingToNonce --- .../SecurityCouncilManager.sol | 80 +++++++++---------- .../interfaces/ISecurityCouncilManager.sol | 12 ++- 2 files changed, 45 insertions(+), 47 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index b059e2250..33e29f2fb 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -88,12 +88,15 @@ contract SecurityCouncilManager is /// @dev This can be used to avoid race conditions between rotation and other actions mapping(address => address) public rotatedTo; + /// @inheritdoc ISecurityCouncilManager + uint256 public minRotationPeriod; + /// @notice Store the address to be rotated to for new members in the future /// @dev `rotatingTo[X] = Y` means if X is installed as a new member, Y will be installed instead mapping(address => address) public rotatingTo; - /// @inheritdoc ISecurityCouncilManager - uint256 public minRotationPeriod; + /// @notice Nonce used when setting rotatingTo + mapping(address => uint256) public rotatingToNonce; /// @notice The 712 name hash bytes32 public constant NAME_HASH = keccak256(bytes("SecurityCouncilManager")); @@ -114,8 +117,11 @@ contract SecurityCouncilManager is bytes32 public constant DOMAIN_TYPE_HASH = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); - bytes32 public constant TYPE_HASH = + bytes32 public constant ROTATE_MEMBER_TYPE_HASH = keccak256(bytes("rotateMember(address from, uint256 nonce)")); + bytes32 public constant SET_ROTATING_TO_TYPE_HASH = + keccak256(bytes("setRotatingTo(address from, uint256 nonce)")); + constructor() { _disableInitializers(); @@ -307,39 +313,15 @@ contract SecurityCouncilManager is /// @inheritdoc ISecurityCouncilManager function getRotateMemberHash(address from, uint256 nonce) public view returns (bytes32) { return ECDSAUpgradeable.toTypedDataHash( - _domainSeparatorV4(), keccak256(abi.encode(TYPE_HASH, from, nonce)) + _domainSeparatorV4(), keccak256(abi.encode(ROTATE_MEMBER_TYPE_HASH, from, nonce)) ); } - function _verifyNewAddress(address newMemberAddress, bytes calldata signature) - internal - returns (address) - { - // we enforce that a the new address is an eoa in the same way do - // in NomineeGovernor.addContender by requiring a signature - // TODO: this updateNonce is global and only updated when an update is scheduled - // permissionless `rotateForFutureMember` will not update the nonce - // permissioned `rotateMember` will allow other member to dos rotation - bytes32 digest = getRotateMemberHash(msg.sender, updateNonce); - address newAddress = ECDSAUpgradeable.recover(digest, signature); - // we safety check the new member address is the one that we expect to replace here - // this isn't strictly necessary but it guards agains the case where the wrong sig is accidentally used - if (newAddress != newMemberAddress) { - revert InvalidNewAddress(newAddress); - } - return newAddress; - } - - function _checkNotRotatingSrcOrTarget(address newAddress) internal view { - address rotatingTarget = rotatingTo[newAddress]; - if (rotatingTarget != address(0)) { - // if newAddress is a rotating target, it might cause a clash when new members are elected - if (rotatingTarget == newAddress) { - revert NewMemberIsRotatingTarget(newAddress); - } - // if newAddress is rotating, it likely make no sense to rotate into it now - revert NewMemberIsRotating(newAddress); - } + /// @inheritdoc ISecurityCouncilManager + function getSetRotatingToHash(address from, uint256 nonce) public view returns (bytes32) { + return ECDSAUpgradeable.toTypedDataHash( + _domainSeparatorV4(), keccak256(abi.encode(SET_ROTATING_TO_TYPE_HASH, from, nonce)) + ); } /// @inheritdoc ISecurityCouncilManager @@ -353,7 +335,15 @@ contract SecurityCouncilManager is { revert RotationTooSoon(msg.sender, lastRotatedTimestamp + minRotationPeriod); } - address newAddress = _verifyNewAddress(newMemberAddress, signature); + // we enforce that a the new address is an eoa in the same way do + // in NomineeGovernor.addContender by requiring a signature + bytes32 digest = getRotateMemberHash(msg.sender, updateNonce); + address newAddress = ECDSAUpgradeable.recover(digest, signature); + // we safety check the new member address is the one that we expect to replace here + // this isn't strictly necessary but it guards agains the case where the wrong sig is accidentally used + if (newAddress != newMemberAddress) { + revert InvalidNewAddress(newAddress); + } // the cohort replacer should be the member election governor // we don't explicitly store the member election governor in this manager @@ -409,8 +399,6 @@ contract SecurityCouncilManager is } } - _checkNotRotatingSrcOrTarget(newAddress); - lastRotated[newAddress] = block.timestamp; rotatedTo[msg.sender] = newAddress; Cohort cohort = _swapMembers(msg.sender, newAddress); @@ -418,17 +406,21 @@ contract SecurityCouncilManager is } /// @inheritdoc ISecurityCouncilManager - function rotateForFutureMember(address newMemberAddress, bytes calldata signature) external { - // we don't have to check timestamp here, because dos is not possible - address newAddress = _verifyNewAddress(newMemberAddress, signature); + function setRotatingTo(address newMemberAddress, bytes calldata signature) external { + uint256 currentRotatingToNonce = rotatingToNonce[msg.sender]; + // we enforce that a the new address is an eoa in the same way do + // in NomineeGovernor.addContender by requiring a signature + bytes32 digest = getSetRotatingToHash(msg.sender, currentRotatingToNonce); + address newAddress = ECDSAUpgradeable.recover(digest, signature); + // we safety check the new member address is the one that we expect to replace here + // this isn't strictly necessary but it guards against the case where the wrong sig is accidentally used + if (newAddress != newMemberAddress) { + revert InvalidNewAddress(newAddress); + } rotatingTo[msg.sender] = newAddress; + rotatingToNonce[msg.sender] = currentRotatingToNonce + 1; - // this serves 2 purposes: - // 1. it prevents "chained" rotations - // 2. it allow one to check rotatingTo[x] to see if x can be a rotation target - _checkNotRotatingSrcOrTarget(newAddress); - rotatingTo[newAddress] = newAddress; emit MemberToBeRotated({replacedAddress: msg.sender, newAddress: newAddress}); } diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index 15f795cfa..d85726e29 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -52,6 +52,7 @@ interface ISecurityCouncilManager { function rotatedTo(address) external view returns (address); function rotatingTo(address) external view returns (address); + function rotatingToNonce(address) external view returns(uint256); /// @notice There is a minimum period between when an address can be rotated /// This is to ensure a single member cannot do many rotations in a row @@ -114,7 +115,7 @@ interface ISecurityCouncilManager { /// @param _memberToReplace Security Council member to remove /// @param _newMember Security Council member to add in their place function replaceMember(address _memberToReplace, address _newMember) external; - /// @notice Get the hash to be signed for member rotation + /// @notice Get the hash to be signed for an existing member rotation /// @param from The address that will be rotated out. Included in the hash so that other members cant use this message to rotate their address /// @param nonce The message nonce. Must be equal to the update nonce in the contract at the time of execution function getRotateMemberHash(address from, uint256 nonce) external view returns (bytes32); @@ -132,13 +133,18 @@ interface ISecurityCouncilManager { address memberElectionGovernor, bytes calldata signature ) external; + /// @notice Get the hash to be signed for future member rotation + /// @param from The address that will be rotated out. Included in the hash so that other members cant use this message to rotate their address + /// @param nonce The message nonce. Must be the from address's current futureRotationNonce + function getSetRotatingToHash(address from, uint256 nonce) external view returns (bytes32); + // CHRIS: TODO: check docs for all new functions /// @notice Allow rotation to another address when the sender becomes a member of the Security Council in the future through election /// @dev Cannot rotate to a contender in an ongoing election, as this could cause a clash that would stop the election result executing /// If this future rotation causes a clash, the rotation will not be executed and the original address will be installed /// This rotation only applies to future replaceCohort, mainly used by the member election governor /// @param newMemberAddress The new member address to be rotated to - /// @param signature A signature from the new member address over the 712 addMember hash - function rotateForFutureMember(address newMemberAddress, bytes calldata signature) external; + /// @param signature A signature from the new member address over the 712 rotatingTo hash + function setRotatingTo(address newMemberAddress, bytes calldata signature) external; /// @notice Is the account a member of the first cohort function firstCohortIncludes(address account) external view returns (bool); /// @notice Is the account a member of the second cohort From a56fed7a23565589a6413e3f6d883911cbeb79d8 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Tue, 11 Feb 2025 17:49:51 +0000 Subject: [PATCH 063/108] Change name to rotationNonce and use it standard rotation --- .../SecurityCouncilManager.sol | 14 ++++++++------ .../interfaces/ISecurityCouncilManager.sol | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 33e29f2fb..52e8e4fb6 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -95,8 +95,8 @@ contract SecurityCouncilManager is /// @dev `rotatingTo[X] = Y` means if X is installed as a new member, Y will be installed instead mapping(address => address) public rotatingTo; - /// @notice Nonce used when setting rotatingTo - mapping(address => uint256) public rotatingToNonce; + /// @notice Nonce used when setting rotatingTo or rotatedTo + mapping(address => uint256) public rotationNonce; /// @notice The 712 name hash bytes32 public constant NAME_HASH = keccak256(bytes("SecurityCouncilManager")); @@ -337,7 +337,8 @@ contract SecurityCouncilManager is } // we enforce that a the new address is an eoa in the same way do // in NomineeGovernor.addContender by requiring a signature - bytes32 digest = getRotateMemberHash(msg.sender, updateNonce); + uint256 currentRotationNonce = rotationNonce[msg.sender]; + bytes32 digest = getRotateMemberHash(msg.sender, currentRotationNonce); address newAddress = ECDSAUpgradeable.recover(digest, signature); // we safety check the new member address is the one that we expect to replace here // this isn't strictly necessary but it guards agains the case where the wrong sig is accidentally used @@ -401,16 +402,17 @@ contract SecurityCouncilManager is lastRotated[newAddress] = block.timestamp; rotatedTo[msg.sender] = newAddress; + rotationNonce[msg.sender] = currentRotationNonce + 1; Cohort cohort = _swapMembers(msg.sender, newAddress); emit MemberRotated({replacedAddress: msg.sender, newAddress: newAddress, cohort: cohort}); } /// @inheritdoc ISecurityCouncilManager function setRotatingTo(address newMemberAddress, bytes calldata signature) external { - uint256 currentRotatingToNonce = rotatingToNonce[msg.sender]; + uint256 currentRotationNonce = rotationNonce[msg.sender]; // we enforce that a the new address is an eoa in the same way do // in NomineeGovernor.addContender by requiring a signature - bytes32 digest = getSetRotatingToHash(msg.sender, currentRotatingToNonce); + bytes32 digest = getSetRotatingToHash(msg.sender, currentRotationNonce); address newAddress = ECDSAUpgradeable.recover(digest, signature); // we safety check the new member address is the one that we expect to replace here // this isn't strictly necessary but it guards against the case where the wrong sig is accidentally used @@ -419,7 +421,7 @@ contract SecurityCouncilManager is } rotatingTo[msg.sender] = newAddress; - rotatingToNonce[msg.sender] = currentRotatingToNonce + 1; + rotationNonce[msg.sender] = currentRotationNonce + 1; emit MemberToBeRotated({replacedAddress: msg.sender, newAddress: newAddress}); } diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index d85726e29..132e29277 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -52,7 +52,7 @@ interface ISecurityCouncilManager { function rotatedTo(address) external view returns (address); function rotatingTo(address) external view returns (address); - function rotatingToNonce(address) external view returns(uint256); + function rotationNonce(address) external view returns(uint256); /// @notice There is a minimum period between when an address can be rotated /// This is to ensure a single member cannot do many rotations in a row From 050a0cfdc9d34670ee2e3b972dee068a3b50bd40 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Wed, 12 Feb 2025 09:37:36 +0000 Subject: [PATCH 064/108] Test updates for new nonce --- .../SecurityCouncilManager.sol | 3 +- .../SecurityCouncilManager.t.sol | 38 +++++++++---------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 52e8e4fb6..0936b4a89 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -338,8 +338,7 @@ contract SecurityCouncilManager is // we enforce that a the new address is an eoa in the same way do // in NomineeGovernor.addContender by requiring a signature uint256 currentRotationNonce = rotationNonce[msg.sender]; - bytes32 digest = getRotateMemberHash(msg.sender, currentRotationNonce); - address newAddress = ECDSAUpgradeable.recover(digest, signature); + address newAddress = ECDSAUpgradeable.recover(getRotateMemberHash(msg.sender, currentRotationNonce), signature); // we safety check the new member address is the one that we expect to replace here // this isn't strictly necessary but it guards agains the case where the wrong sig is accidentally used if (newAddress != newMemberAddress) { diff --git a/test/security-council-mgmt/SecurityCouncilManager.t.sol b/test/security-council-mgmt/SecurityCouncilManager.t.sol index da6f0a379..b4b0e581d 100644 --- a/test/security-council-mgmt/SecurityCouncilManager.t.sol +++ b/test/security-council-mgmt/SecurityCouncilManager.t.sol @@ -248,7 +248,7 @@ contract SecurityCouncilManagerTest is Test { function testRemoveMemberRotated() public { address memberToRemove = firstCohort[0]; - bytes32 digest = scm.getRotateMemberHash(memberToRemove, scm.updateNonce()); + bytes32 digest = scm.getRotateMemberHash(memberToRemove, scm.rotationNonce(memberToRemove)); bytes memory signature = sign(pk1, digest); vm.prank(memberToRemove); scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); @@ -396,7 +396,7 @@ contract SecurityCouncilManagerTest is Test { } function testReplaceMemberInFirstCohortAfterRotation() public { - bytes32 digest = scm.getRotateMemberHash(firstCohort[0], scm.updateNonce()); + bytes32 digest = scm.getRotateMemberHash(firstCohort[0], scm.rotationNonce(firstCohort[0])); bytes memory signature = sign(pk1, digest); vm.prank(firstCohort[0]); scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); @@ -423,7 +423,7 @@ contract SecurityCouncilManagerTest is Test { } function testReplaceMemberInSecondCohort() public { - bytes32 digest = scm.getRotateMemberHash(secondCohort[0], scm.updateNonce()); + bytes32 digest = scm.getRotateMemberHash(secondCohort[0], scm.rotationNonce(secondCohort[0])); bytes memory signature = sign(pk2, digest); vm.prank(secondCohort[0]); scm.rotateMember(memberToRotate2, memberElectionGovernor, signature); @@ -496,9 +496,9 @@ contract SecurityCouncilManagerTest is Test { uint256 startTime = 5678; vm.warp(startTime); - bytes32 digest = scm.getRotateMemberHash(originalMember, scm.updateNonce()); + bytes32 digest = scm.getRotateMemberHash(originalMember, scm.rotationNonce(originalMember)); bytes memory signature = sign(pk1, digest); - uint256 startNonce = scm.updateNonce(); + uint256 startNonce = scm.rotationNonce(originalMember); vm.expectRevert( abi.encodeWithSelector( @@ -518,7 +518,7 @@ contract SecurityCouncilManagerTest is Test { vm.recordLogs(); vm.prank(originalMember); scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); - assertEq(startNonce + 1, scm.updateNonce(), "nonce 1"); + assertEq(startNonce + 1, scm.rotationNonce(originalMember), "nonce 1"); checkScheduleWasCalled(); checkCohortChange(memberToRotate1, 1, secondCohort, Cohort.SECOND); assertTrue( @@ -527,7 +527,7 @@ contract SecurityCouncilManagerTest is Test { ); assertEq(scm.lastRotated(memberToRotate1), startTime, "Member 1 last rotated"); - bytes32 digest1 = scm.getRotateMemberHash(memberToRotate1, scm.updateNonce()); + bytes32 digest1 = scm.getRotateMemberHash(memberToRotate1, scm.rotationNonce(memberToRotate1)); bytes memory signature1 = sign(pk2, digest1); vm.expectRevert( @@ -554,10 +554,11 @@ contract SecurityCouncilManagerTest is Test { vm.warp(startTime + minRotationPeriod); + startNonce = scm.rotationNonce(memberToRotate1); vm.recordLogs(); vm.prank(memberToRotate1); scm.rotateMember(memberToRotate2, memberElectionGovernor, signature1); - assertEq(startNonce + 2, scm.updateNonce(), "nonce 2"); + assertEq(startNonce + 1, scm.rotationNonce(memberToRotate1), "nonce 2"); checkScheduleWasCalled(); checkCohortChange(memberToRotate2, 1, secondCohort, Cohort.SECOND); assertTrue( @@ -613,20 +614,17 @@ contract SecurityCouncilManagerTest is Test { vm.warp(startTime); // start an election and add a contender - SigUtils sigUtils = new SigUtils(nomineeElectionGovernor); uint256 proposalId = SecurityCouncilNomineeElectionGovernor( payable(nomineeElectionGovernor) ).createElection(); - bytes memory sig = sigUtils.signAddContenderMessage(proposalId, pk1); SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)).addContender( - proposalId, sig + proposalId, new SigUtils(nomineeElectionGovernor).signAddContenderMessage(proposalId, pk1) ); - bytes32 digest = scm.getRotateMemberHash(originalMember, scm.updateNonce()); - bytes memory signature = sign(pk1, digest); + bytes memory signature = sign(pk1, scm.getRotateMemberHash(originalMember, scm.rotationNonce(originalMember))); bytes memory signature2 = - sign(pk2, scm.getRotateMemberHash(originalMember, scm.updateNonce())); - uint256 startNonce = scm.updateNonce(); + sign(pk2, scm.getRotateMemberHash(originalMember, scm.rotationNonce(originalMember))); + uint256 startNonce = scm.rotationNonce(originalMember); // replace in other cohort in ongoing election does not work vm.expectRevert( @@ -686,20 +684,22 @@ contract SecurityCouncilManagerTest is Test { // replacing that member with one in the same cohort does work bytes memory signatureA = - sign(pk1, scm.getRotateMemberHash(firstCohort[1], scm.updateNonce())); + sign(pk1, scm.getRotateMemberHash(firstCohort[1], scm.rotationNonce(firstCohort[1]))); + startNonce = scm.rotationNonce(firstCohort[1]); vm.prank(firstCohort[1]); scm.rotateMember(memberToRotate1, memberElectionGovernor, signatureA); - assertEq(startNonce + 1, scm.updateNonce(), "nonce 1"); + assertEq(startNonce + 1, scm.rotationNonce(firstCohort[1]), "nonce 1"); checkCohortChange(memberToRotate1, 1, firstCohort, Cohort.FIRST); vm.revertTo(snap); bytes memory signature1 = - sign(pk2, scm.getRotateMemberHash(originalMember, scm.updateNonce())); + sign(pk2, scm.getRotateMemberHash(originalMember, scm.rotationNonce(originalMember))); + startNonce = scm.rotationNonce(originalMember); vm.recordLogs(); vm.prank(originalMember); scm.rotateMember(memberToRotate2, memberElectionGovernor, signature1); - assertEq(startNonce + 1, scm.updateNonce(), "nonce 1"); + assertEq(startNonce + 1, scm.rotationNonce(originalMember), "nonce 1"); checkScheduleWasCalled(); checkCohortChange(memberToRotate2, 1, secondCohort, Cohort.SECOND); assertTrue( From 94bb76983da5570d5a450d0314b061ffb0606308 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Wed, 12 Feb 2025 09:38:48 +0000 Subject: [PATCH 065/108] Test formatting --- src/security-council-mgmt/SecurityCouncilManager.sol | 5 +++-- .../SecurityCouncilManager.t.sol | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 0936b4a89..a200f97e2 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -121,7 +121,6 @@ contract SecurityCouncilManager is keccak256(bytes("rotateMember(address from, uint256 nonce)")); bytes32 public constant SET_ROTATING_TO_TYPE_HASH = keccak256(bytes("setRotatingTo(address from, uint256 nonce)")); - constructor() { _disableInitializers(); @@ -338,7 +337,9 @@ contract SecurityCouncilManager is // we enforce that a the new address is an eoa in the same way do // in NomineeGovernor.addContender by requiring a signature uint256 currentRotationNonce = rotationNonce[msg.sender]; - address newAddress = ECDSAUpgradeable.recover(getRotateMemberHash(msg.sender, currentRotationNonce), signature); + address newAddress = ECDSAUpgradeable.recover( + getRotateMemberHash(msg.sender, currentRotationNonce), signature + ); // we safety check the new member address is the one that we expect to replace here // this isn't strictly necessary but it guards agains the case where the wrong sig is accidentally used if (newAddress != newMemberAddress) { diff --git a/test/security-council-mgmt/SecurityCouncilManager.t.sol b/test/security-council-mgmt/SecurityCouncilManager.t.sol index b4b0e581d..781b431ac 100644 --- a/test/security-council-mgmt/SecurityCouncilManager.t.sol +++ b/test/security-council-mgmt/SecurityCouncilManager.t.sol @@ -423,7 +423,8 @@ contract SecurityCouncilManagerTest is Test { } function testReplaceMemberInSecondCohort() public { - bytes32 digest = scm.getRotateMemberHash(secondCohort[0], scm.rotationNonce(secondCohort[0])); + bytes32 digest = + scm.getRotateMemberHash(secondCohort[0], scm.rotationNonce(secondCohort[0])); bytes memory signature = sign(pk2, digest); vm.prank(secondCohort[0]); scm.rotateMember(memberToRotate2, memberElectionGovernor, signature); @@ -527,7 +528,8 @@ contract SecurityCouncilManagerTest is Test { ); assertEq(scm.lastRotated(memberToRotate1), startTime, "Member 1 last rotated"); - bytes32 digest1 = scm.getRotateMemberHash(memberToRotate1, scm.rotationNonce(memberToRotate1)); + bytes32 digest1 = + scm.getRotateMemberHash(memberToRotate1, scm.rotationNonce(memberToRotate1)); bytes memory signature1 = sign(pk2, digest1); vm.expectRevert( @@ -618,10 +620,12 @@ contract SecurityCouncilManagerTest is Test { payable(nomineeElectionGovernor) ).createElection(); SecurityCouncilNomineeElectionGovernor(payable(nomineeElectionGovernor)).addContender( - proposalId, new SigUtils(nomineeElectionGovernor).signAddContenderMessage(proposalId, pk1) + proposalId, + new SigUtils(nomineeElectionGovernor).signAddContenderMessage(proposalId, pk1) ); - bytes memory signature = sign(pk1, scm.getRotateMemberHash(originalMember, scm.rotationNonce(originalMember))); + bytes memory signature = + sign(pk1, scm.getRotateMemberHash(originalMember, scm.rotationNonce(originalMember))); bytes memory signature2 = sign(pk2, scm.getRotateMemberHash(originalMember, scm.rotationNonce(originalMember))); uint256 startNonce = scm.rotationNonce(originalMember); From 27ef32a3a168fa770255bcaa5ad16d6f625d5894 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Wed, 12 Feb 2025 14:34:36 +0000 Subject: [PATCH 066/108] Test updates --- .../SecurityCouncilManager.sol | 4 +- .../interfaces/ISecurityCouncilManager.sol | 2 +- .../SecurityCouncilManager.t.sol | 173 +++++++++++++++++- 3 files changed, 170 insertions(+), 9 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index a200f97e2..9c2cd6853 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -38,7 +38,7 @@ contract SecurityCouncilManager is event MemberRemoved(address indexed member, Cohort indexed cohort); event MemberReplaced(address indexed replacedMember, address indexed newMember, Cohort cohort); event MemberRotated(address indexed replacedAddress, address indexed newAddress, Cohort cohort); - event MemberToBeRotated(address indexed replacedAddress, address indexed newAddress); + event RotatingToSet(address indexed replacedAddress, address indexed newAddress); event SecurityCouncilAdded( address indexed securityCouncil, address indexed updateAction, @@ -423,7 +423,7 @@ contract SecurityCouncilManager is rotatingTo[msg.sender] = newAddress; rotationNonce[msg.sender] = currentRotationNonce + 1; - emit MemberToBeRotated({replacedAddress: msg.sender, newAddress: newAddress}); + emit RotatingToSet({replacedAddress: msg.sender, newAddress: newAddress}); } function _swapMembers(address _addressToRemove, address _addressToAdd) diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index 132e29277..8dedfe5ee 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -52,7 +52,7 @@ interface ISecurityCouncilManager { function rotatedTo(address) external view returns (address); function rotatingTo(address) external view returns (address); - function rotationNonce(address) external view returns(uint256); + function rotationNonce(address) external view returns (uint256); /// @notice There is a minimum period between when an address can be rotated /// This is to ensure a single member cannot do many rotations in a row diff --git a/test/security-council-mgmt/SecurityCouncilManager.t.sol b/test/security-council-mgmt/SecurityCouncilManager.t.sol index 781b431ac..dc3f757a5 100644 --- a/test/security-council-mgmt/SecurityCouncilManager.t.sol +++ b/test/security-council-mgmt/SecurityCouncilManager.t.sol @@ -41,17 +41,22 @@ contract MockArbitrumTimelock { } contract SecurityCouncilManagerTest is Test { + uint256 pknc1 = 9772; + address pkncAddr1 = vm.addr(pknc1); + uint256 pknc2 = 9773; + address pkncAddr2 = vm.addr(pknc2); + address[] firstCohort = new address[](6); address[6] _firstCohort = [address(1111), address(1112), address(1113), address(1114), address(1115), address(1116)]; address[] secondCohort = new address[](6); address[6] _secondCohort = - [address(2221), address(2222), address(2223), address(2224), address(2225), address(2226)]; + [address(2221), address(2222), address(2223), pkncAddr2, address(2225), address(2226)]; address[] newCohort = new address[](6); address[6] _newCohort = - [address(3331), address(3332), address(3333), address(3334), address(3335), address(3336)]; + [address(3331), address(3332), address(3333), address(3334), pkncAddr1, address(3336)]; address[] newCohortWithADup = new address[](6); address dup = address(3335); @@ -493,7 +498,7 @@ contract SecurityCouncilManagerTest is Test { } function testRotateMember() public { - address originalMember = secondCohort[1]; + address originalMember = secondCohort[3]; uint256 startTime = 5678; vm.warp(startTime); @@ -504,7 +509,7 @@ contract SecurityCouncilManagerTest is Test { vm.expectRevert( abi.encodeWithSelector( ISecurityCouncilManager.InvalidNewAddress.selector, - 0x00e6008973a133b0e603275498f18321534c3721f3 + 0xf1ba0050017D0A16690e3Be7B4A2Ab75F22CFFA2 ) ); vm.prank(secondCohort[2]); @@ -521,7 +526,7 @@ contract SecurityCouncilManagerTest is Test { scm.rotateMember(memberToRotate1, memberElectionGovernor, signature); assertEq(startNonce + 1, scm.rotationNonce(originalMember), "nonce 1"); checkScheduleWasCalled(); - checkCohortChange(memberToRotate1, 1, secondCohort, Cohort.SECOND); + checkCohortChange(memberToRotate1, 3, secondCohort, Cohort.SECOND); assertTrue( TestUtil.areUniqueAddressArraysEqual(firstCohort, scm.getFirstCohort()), "first cohort untouched" @@ -562,7 +567,7 @@ contract SecurityCouncilManagerTest is Test { scm.rotateMember(memberToRotate2, memberElectionGovernor, signature1); assertEq(startNonce + 1, scm.rotationNonce(memberToRotate1), "nonce 2"); checkScheduleWasCalled(); - checkCohortChange(memberToRotate2, 1, secondCohort, Cohort.SECOND); + checkCohortChange(memberToRotate2, 3, secondCohort, Cohort.SECOND); assertTrue( TestUtil.areUniqueAddressArraysEqual(firstCohort, scm.getFirstCohort()), "first cohort untouched 2" @@ -570,6 +575,41 @@ contract SecurityCouncilManagerTest is Test { assertEq( scm.lastRotated(memberToRotate2), startTime + minRotationPeriod, "Member 2 last rotated" ); + + // now do another rotation from the original address - we rotate back to it then away from it - this tests the nonce updates + signature1 = sign( + pknc2, scm.getRotateMemberHash(memberToRotate2, scm.rotationNonce(memberToRotate2)) + ); + vm.warp(startTime + 2 * minRotationPeriod); + vm.recordLogs(); + vm.prank(memberToRotate2); + scm.rotateMember(pkncAddr2, memberElectionGovernor, signature1); + checkScheduleWasCalled(); + + assertTrue( + TestUtil.areUniqueAddressArraysEqual(firstCohort, scm.getFirstCohort()), + "first cohort untouched 1" + ); + assertTrue( + TestUtil.areUniqueAddressArraysEqual(secondCohort, scm.getSecondCohort()), + "first cohort back to original" + ); + + signature1 = + sign(pk1, scm.getRotateMemberHash(originalMember, scm.rotationNonce(originalMember))); + vm.warp(startTime + 3 * minRotationPeriod); + startNonce = scm.rotationNonce(originalMember); + vm.recordLogs(); + vm.prank(originalMember); + scm.rotateMember(memberToRotate1, memberElectionGovernor, signature1); + checkScheduleWasCalled(); + assertEq(startNonce + 1, scm.rotationNonce(originalMember), "nonce 3"); + + assertTrue( + TestUtil.areUniqueAddressArraysEqual(firstCohort, scm.getFirstCohort()), + "first cohort untouched 1" + ); + checkCohortChange(memberToRotate1, 3, secondCohort, Cohort.SECOND); } function addAllContendersAndVote(uint256 proposalId) public { @@ -881,6 +921,127 @@ contract SecurityCouncilManagerTest is Test { scm.replaceCohort(newCohortWithADup, Cohort.SECOND); } + function testReplaceCohortRotatingTo() public { + // set a rotatingTo for a member of the first cohort + address[] memory newCohortCopy = newCohort; + address rotatingFrom = newCohortCopy[1]; + bytes32 digest = scm.getSetRotatingToHash(rotatingFrom, scm.rotationNonce(rotatingFrom)); + bytes memory signature = sign(pk1, digest); + vm.prank(rotatingFrom); + scm.setRotatingTo(memberToRotate1, signature); + + vm.startPrank(roles.cohortUpdator); + vm.recordLogs(); + scm.replaceCohort(newCohortCopy, Cohort.FIRST); + checkScheduleWasCalled(); + vm.stopPrank(); + + newCohortCopy[1] = memberToRotate1; + + assertTrue( + TestUtil.areUniqueAddressArraysEqual(newCohortCopy, scm.getFirstCohort()), + "first cohort updated" + ); + + assertTrue( + TestUtil.areUniqueAddressArraysEqual(secondCohort, scm.getSecondCohort()), + "second cohort untouched" + ); + + rotatingFrom = newCohortCopy[2]; + digest = scm.getSetRotatingToHash(rotatingFrom, scm.rotationNonce(rotatingFrom)); + signature = sign(pknc1, digest); + vm.prank(rotatingFrom); + scm.setRotatingTo(pkncAddr1, signature); + + // set rotation to a member of the incoming cohort + vm.startPrank(roles.cohortUpdator); + vm.recordLogs(); + scm.replaceCohort(newCohortCopy, Cohort.FIRST); + checkScheduleWasCalled(); + vm.stopPrank(); + + // should still just equal the newcohort copy + assertTrue( + TestUtil.areUniqueAddressArraysEqual(newCohortCopy, scm.getFirstCohort()), + "first cohort updated" + ); + assertTrue( + TestUtil.areUniqueAddressArraysEqual(secondCohort, scm.getSecondCohort()), + "second cohort untouched" + ); + + // now try rotate to a member of the other cohort + rotatingFrom = newCohortCopy[2]; + digest = scm.getSetRotatingToHash(rotatingFrom, scm.rotationNonce(rotatingFrom)); + signature = sign(pknc2, digest); + vm.prank(rotatingFrom); + scm.setRotatingTo(pkncAddr2, signature); + + // set rotation to a member of the incoming cohort + vm.startPrank(roles.cohortUpdator); + vm.recordLogs(); + scm.replaceCohort(newCohortCopy, Cohort.FIRST); + checkScheduleWasCalled(); + vm.stopPrank(); + + // should still just equal the newcohort copy + assertTrue( + TestUtil.areUniqueAddressArraysEqual(newCohortCopy, scm.getFirstCohort()), + "first cohort updated" + ); + assertTrue( + TestUtil.areUniqueAddressArraysEqual(secondCohort, scm.getSecondCohort()), + "second cohort untouched" + ); + + // put it back to how we found it + vm.startPrank(roles.cohortUpdator); + vm.recordLogs(); + scm.replaceCohort(firstCohort, Cohort.FIRST); + checkScheduleWasCalled(); + vm.stopPrank(); + } + + event RotatingToSet(address indexed replacedAddress, address indexed newAddress); + + function testSetRotatingTo() public { + address testAddr = vm.addr(97_990); + + uint256 testPk1 = 45_678; + address addr1 = vm.addr(testPk1); + uint256 testPk2 = 45_679; + address addr2 = vm.addr(testPk2); + + assertEq(scm.rotatingTo(testAddr), address(0)); + assertEq(scm.rotationNonce(testAddr), 0); + + bytes32 digest = scm.getSetRotatingToHash(testAddr, scm.rotationNonce(testAddr)); + bytes memory signature = sign(testPk1, digest); + + vm.prank(testAddr); + vm.expectRevert( + abi.encodeWithSelector(ISecurityCouncilManager.InvalidNewAddress.selector, addr1) + ); + scm.setRotatingTo(address(1), signature); + + vm.prank(testAddr); + vm.expectEmit(true, true, true, true); + emit RotatingToSet({replacedAddress: testAddr, newAddress: addr1}); + scm.setRotatingTo(addr1, signature); + assertEq(scm.rotatingTo(testAddr), addr1); + assertEq(scm.rotationNonce(testAddr), 1); + + digest = scm.getSetRotatingToHash(testAddr, scm.rotationNonce(testAddr)); + signature = sign(testPk2, digest); + vm.prank(testAddr); + vm.expectEmit(true, true, true, true); + emit RotatingToSet({replacedAddress: testAddr, newAddress: addr2}); + scm.setRotatingTo(addr2, signature); + assertEq(scm.rotatingTo(testAddr), addr2); + assertEq(scm.rotationNonce(testAddr), 2); + } + function testUpdateRouterAffordances() public { UpgradeExecRouteBuilder newRouter = UpgradeExecRouteBuilder(TestUtil.deployStubContract()); vm.prank(rando); From 20cf16d094cb142485acf3a6b61df275ebe9dbe0 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Wed, 12 Feb 2025 14:46:10 +0000 Subject: [PATCH 067/108] Updated comments --- .../interfaces/ISecurityCouncilManager.sol | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index 8dedfe5ee..8376b8844 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -117,33 +117,31 @@ interface ISecurityCouncilManager { function replaceMember(address _memberToReplace, address _newMember) external; /// @notice Get the hash to be signed for an existing member rotation /// @param from The address that will be rotated out. Included in the hash so that other members cant use this message to rotate their address - /// @param nonce The message nonce. Must be equal to the update nonce in the contract at the time of execution + /// @param nonce The message nonce. Must be equal to the rotationNonce for the member being rotated out function getRotateMemberHash(address from, uint256 nonce) external view returns (bytes32); /// @notice Security council member can rotate out their address for a new one /// @dev Initiates cross chain messages to update the individual Security Councils. /// Cannot rotate to a contender in an ongoing election, as this could cause a clash that would stop the election result executing - /// Since the signature is over the update nonce, it is understood that other updates can invalidate the signed message, however since - /// other updates are either from the council itself (trusted), the election (infrequent) or another member rotation (also infrequent due - /// to the minRotationPeriod) the invalidation cannot occur often and in those cases the member should sign a new rotation message /// @param newMemberAddress The new member address to be rotated to /// @param memberElectionGovernor The current member election governor - must have the COHORT_REPLACER_ROLE role - /// @param signature A signature from the new member address over the 712 addMember hash + /// @param signature A signature from the new member address over the 712 rotateMember hash function rotateMember( address newMemberAddress, address memberElectionGovernor, bytes calldata signature ) external; /// @notice Get the hash to be signed for future member rotation - /// @param from The address that will be rotated out. Included in the hash so that other members cant use this message to rotate their address - /// @param nonce The message nonce. Must be the from address's current futureRotationNonce + /// @param from The address that will be rotated out. This is included in the hash so that other members cant use this message to rotate their address + /// @param nonce The message nonce. Must be the from address's current rotationNonce function getSetRotatingToHash(address from, uint256 nonce) external view returns (bytes32); - // CHRIS: TODO: check docs for all new functions - /// @notice Allow rotation to another address when the sender becomes a member of the Security Council in the future through election - /// @dev Cannot rotate to a contender in an ongoing election, as this could cause a clash that would stop the election result executing + /// @notice Set an address to be rotated to if the sender is ever elected as a member + /// This enables unelected members to decide where their election address will update to. When a member is elected to the council they + /// are expected to have a high level of security on their member key. Election candidates may not have set up that high level of security before + /// registering their election key, so this method allows them to set up a new key that will be actually installed as the member upon election. /// If this future rotation causes a clash, the rotation will not be executed and the original address will be installed /// This rotation only applies to future replaceCohort, mainly used by the member election governor - /// @param newMemberAddress The new member address to be rotated to - /// @param signature A signature from the new member address over the 712 rotatingTo hash + /// @param newMemberAddress The new member address to be rotated to + /// @param signature A signature from the new member address over the 712 setRotatingTo hash function setRotatingTo(address newMemberAddress, bytes calldata signature) external; /// @notice Is the account a member of the first cohort function firstCohortIncludes(address account) external view returns (bool); From 8e4100532c2e452806462f6c29f87d6d6d843399 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Wed, 12 Feb 2025 14:48:00 +0000 Subject: [PATCH 068/108] Gap update --- src/security-council-mgmt/SecurityCouncilManager.sol | 2 +- test/storage/SecurityCouncilManager | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 9c2cd6853..ce5e44b81 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -658,5 +658,5 @@ contract SecurityCouncilManager is * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ - uint256[40] private __gap; + uint256[38] private __gap; } diff --git a/test/storage/SecurityCouncilManager b/test/storage/SecurityCouncilManager index e60ff2524..ffd9b0e5c 100644 --- a/test/storage/SecurityCouncilManager +++ b/test/storage/SecurityCouncilManager @@ -34,6 +34,10 @@ |-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | minRotationPeriod | uint256 | 160 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | |-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| -| __gap | uint256[40] | 161 | 0 | 1280 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| rotatingTo | mapping(address => address) | 161 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| rotationNonce | mapping(address => uint256) | 162 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| __gap | uint256[38] | 163 | 0 | 1216 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | ╰-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------╯ From 4bd4692083f3e028d47c8e9a771269d26e5a6e4a Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Wed, 12 Feb 2025 14:49:59 +0000 Subject: [PATCH 069/108] Gas snapshot --- .gas-snapshot | 64 ++++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 3e19288e9..07f6545bf 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -27,7 +27,7 @@ ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 85744277) +E2E:testE2E() (gas: 86029203) FixedDelegateErc20WalletTest:testInit() (gas: 5822585) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) @@ -95,14 +95,14 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28415658) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28364371) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28417242) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28657360) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31486267) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31490498) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26573276) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31488498) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31509665) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31757348) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31761579) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26844357) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31759579) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31781044) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) -OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317068, ~: 317184) +OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317076, ~: 317184) OfficeHoursActionTest:testInvalidConstructorParameters() (gas: 235740) OfficeHoursActionTest:testPerformBeforeMinimumTimestamp() (gas: 8646) OfficeHoursActionTest:testPerformDuringOfficeHours() (gas: 9140) @@ -120,32 +120,34 @@ ProxyUpgradeAndCallActionTest:testUpgradeAndCall() (gas: 143042) RotateMembersUpgradeActionTest:testAction() (gas: 8153) SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 253582) SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20770) -SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 348673) -SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 352108) +SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 348540) +SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 351975) SecurityCouncilManagerTest:testAddSC() (gas: 118742) SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112296) -SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 136614) +SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 148550) SecurityCouncilManagerTest:testCohortMethods() (gas: 137958) -SecurityCouncilManagerTest:testInitialization() (gas: 206439) -SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 4985090) -SecurityCouncilManagerTest:testRemoveMember() (gas: 217184) -SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 101567) -SecurityCouncilManagerTest:testRemoveMemberRotated() (gas: 400541) -SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81441) -SecurityCouncilManagerTest:testRemoveSeC() (gas: 38400) -SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 216359) -SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 266389) -SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 448472) -SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 455694) -SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 269958) -SecurityCouncilManagerTest:testRotateMember() (gas: 606894) -SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3815426) -SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65880) -SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83211) -SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 313581) -SecurityCouncilManagerTest:testUpdateRouter() (gas: 76385) -SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112474) -SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 313675) +SecurityCouncilManagerTest:testInitialization() (gas: 206820) +SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5256512) +SecurityCouncilManagerTest:testRemoveMember() (gas: 217162) +SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 101612) +SecurityCouncilManagerTest:testRemoveMemberRotated() (gas: 422948) +SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81486) +SecurityCouncilManagerTest:testRemoveSeC() (gas: 38435) +SecurityCouncilManagerTest:testReplaceCohortRotatingTo() (gas: 962400) +SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 216337) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 266256) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 471153) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 478397) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 269847) +SecurityCouncilManagerTest:testRotateMember() (gas: 1014991) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3868444) +SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65924) +SecurityCouncilManagerTest:testSetRotatingTo() (gas: 113076) +SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83230) +SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 327400) +SecurityCouncilManagerTest:testUpdateRouter() (gas: 76429) +SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112452) +SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 327504) SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 247018) SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302873) SecurityCouncilMemberElectionGovernorTest:testCastBySigTwice() (gas: 266265) @@ -161,7 +163,7 @@ SecurityCouncilMemberElectionGovernorTest:testOnlyNomineeElectionGovernorCanProp SecurityCouncilMemberElectionGovernorTest:testProperInitialization() (gas: 49388) SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32916) SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42229) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340116, ~: 339918) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340069, ~: 339927) SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273467) SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34951) SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152898) From 18b137f948ef03fee62814d88812f0afb0cd1151 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Wed, 12 Feb 2025 14:51:56 +0000 Subject: [PATCH 070/108] Updated sigs --- test/signatures/SecurityCouncilManager | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/signatures/SecurityCouncilManager b/test/signatures/SecurityCouncilManager index 1d01fd5d7..236167096 100644 --- a/test/signatures/SecurityCouncilManager +++ b/test/signatures/SecurityCouncilManager @@ -10,7 +10,8 @@ "MIN_ROTATION_PERIOD_SETTER_ROLE()": "5db9bf4e", "NAME_HASH()": "04622c2e", "RETRYABLE_TICKET_MAGIC()": "3994073d", - "TYPE_HASH()": "64d4c819", + "ROTATE_MEMBER_TYPE_HASH()": "aea6b1e7", + "SET_ROTATING_TO_TYPE_HASH()": "ff57aaed", "VERSION_HASH()": "9e4e7318", "addMember(address,uint8)": "62d0d1c3", "addSecurityCouncil((address,address,uint256))": "6eaff79e", @@ -24,6 +25,7 @@ "getRotateMemberHash(address,uint256)": "09af9e5f", "getScheduleUpdateInnerData(uint256)": "8bbd5149", "getSecondCohort()": "bdc9f17c", + "getSetRotatingToHash(address,uint256)": "2bf9dbfe", "grantRole(bytes32,address)": "2f2ff15d", "hasRole(bytes32,address)": "91d14854", "initialize(address[],address[],(address,address,uint256)[],(address,address,address,address[],address,address,address),address,address,uint256)": "caa33e24", @@ -39,11 +41,14 @@ "revokeRole(bytes32,address)": "d547741f", "rotateMember(address,address,bytes)": "02ea6df4", "rotatedTo(address)": "86bc77a3", + "rotatingTo(address)": "cd6150a4", + "rotationNonce(address)": "ac823694", "router()": "f887ea40", "secondCohortIncludes(address)": "e9d9f048", "securityCouncils(uint256)": "bef3f745", "securityCouncilsLength()": "7889acb2", "setMinRotationPeriod(uint256)": "d4c271b2", + "setRotatingTo(address,bytes)": "62cd078d", "setUpgradeExecRouteBuilder(address)": "0e5e43d7", "supportsInterface(bytes4)": "01ffc9a7", "updateNonce()": "0feca68a" From bda01694753f51b580fb104af92bf03ba69fb2fd Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Wed, 12 Feb 2025 14:55:52 +0000 Subject: [PATCH 071/108] Updated remove member action test for new nonce --- test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol b/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol index 3637dc022..aef54115f 100644 --- a/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol +++ b/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol @@ -53,7 +53,7 @@ contract CancelTimelockAndRemoveMemberActionTest is Test { bytes memory sig; { (uint8 v, bytes32 r, bytes32 s) = - vm.sign(memberInKey, scm.getRotateMemberHash(memberOut, scm.updateNonce())); + vm.sign(memberInKey, scm.getRotateMemberHash(memberOut, scm.rotationNonce(memberOut))); sig = abi.encodePacked(r, s, v); } From 57f495c1e8546675f7596ae28431961fd0f84c95 Mon Sep 17 00:00:00 2001 From: Chris Buckland Date: Thu, 13 Feb 2025 14:34:25 +0000 Subject: [PATCH 072/108] Inline the digest --- src/security-council-mgmt/SecurityCouncilManager.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index ce5e44b81..f506b8d96 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -412,8 +412,9 @@ contract SecurityCouncilManager is uint256 currentRotationNonce = rotationNonce[msg.sender]; // we enforce that a the new address is an eoa in the same way do // in NomineeGovernor.addContender by requiring a signature - bytes32 digest = getSetRotatingToHash(msg.sender, currentRotationNonce); - address newAddress = ECDSAUpgradeable.recover(digest, signature); + address newAddress = ECDSAUpgradeable.recover( + getSetRotatingToHash(msg.sender, currentRotationNonce), signature + ); // we safety check the new member address is the one that we expect to replace here // this isn't strictly necessary but it guards against the case where the wrong sig is accidentally used if (newAddress != newMemberAddress) { From 5bb2f8903988ae008a7466c48da363831751ecc1 Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 3 Mar 2025 21:41:41 +0800 Subject: [PATCH 073/108] chore: whitelist audit ci --- audit-ci.jsonc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/audit-ci.jsonc b/audit-ci.jsonc index c881ad28d..60f8ba6a8 100644 --- a/audit-ci.jsonc +++ b/audit-ci.jsonc @@ -109,6 +109,10 @@ // secp256k1-node allows private key extraction over ECDH "GHSA-584q-6j8j-r5pm", // Regular Expression Denial of Service (ReDoS) in cross-spawn - "GHSA-3xgq-45jj-v275" + "GHSA-3xgq-45jj-v275", + // Use of Insufficiently Random Values in undici + "GHSA-c76h-2ccp-4975", + // Cross-site Scripting (XSS) in serialize-javascript + "GHSA-76p7-773f-r4q5" ] } \ No newline at end of file From 0d6bf1cd4012b380e51af347a9604ac7419d2dc2 Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 3 Mar 2025 21:42:07 +0800 Subject: [PATCH 074/108] chore: bump dependencies --- yarn.lock | 1338 +++++++++++++++++++++-------------------------------- 1 file changed, 528 insertions(+), 810 deletions(-) diff --git a/yarn.lock b/yarn.lock index d4ee3322d..2ee098f38 100644 --- a/yarn.lock +++ b/yarn.lock @@ -123,7 +123,22 @@ ethereum-cryptography "^2.0.0" micro-ftch "^0.3.1" -"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.0.0-beta.146", "@ethersproject/abi@^5.0.9", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.6.3", "@ethersproject/abi@^5.7.0": +"@ethersproject/abi@5.8.0", "@ethersproject/abi@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.8.0.tgz#e79bb51940ac35fe6f3262d7fe2cdb25ad5f07d9" + integrity sha512-b9YS/43ObplgyV6SlyQsG53/vkSal0MNA1fskSC4mbnCMi8R+NkcH8K9FPYNESf6jUefBUniE4SOKms0E/KK1Q== + dependencies: + "@ethersproject/address" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/constants" "^5.8.0" + "@ethersproject/hash" "^5.8.0" + "@ethersproject/keccak256" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + +"@ethersproject/abi@^5.0.9", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.6.3", "@ethersproject/abi@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz" integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== @@ -138,7 +153,20 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.7.0": +"@ethersproject/abstract-provider@5.8.0", "@ethersproject/abstract-provider@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.8.0.tgz#7581f9be601afa1d02b95d26b9d9840926a35b0c" + integrity sha512-wC9SFcmh4UK0oKuLJQItoQdzS/qZ51EJegK6EmAWlh+OptpQ/npECOR3QqECd8iGHC0RJb4WKbVdSfif4ammrg== + dependencies: + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/networks" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/transactions" "^5.8.0" + "@ethersproject/web" "^5.8.0" + +"@ethersproject/abstract-provider@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz" integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== @@ -151,7 +179,18 @@ "@ethersproject/transactions" "^5.7.0" "@ethersproject/web" "^5.7.0" -"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": +"@ethersproject/abstract-signer@5.8.0", "@ethersproject/abstract-signer@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.8.0.tgz#8d7417e95e4094c1797a9762e6789c7356db0754" + integrity sha512-N0XhZTswXcmIZQdYtUnd79VJzvEwXQw6PK0dTl9VoYrEBxxCPXqS0Eod7q5TNKRxe1/5WUMuR0u0nqTF/avdCA== + dependencies: + "@ethersproject/abstract-provider" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + +"@ethersproject/abstract-signer@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz" integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== @@ -162,7 +201,18 @@ "@ethersproject/logger" "^5.7.0" "@ethersproject/properties" "^5.7.0" -"@ethersproject/address@5.7.0", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.0.8", "@ethersproject/address@^5.7.0": +"@ethersproject/address@5.8.0", "@ethersproject/address@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.8.0.tgz#3007a2c352eee566ad745dca1dbbebdb50a6a983" + integrity sha512-GhH/abcC46LJwshoN+uBNoKVFPxUuZm6dA257z0vZkKmU1+t8xTn8oK7B9qrj8W2rFRMch4gbJl6PmVxjxBEBA== + dependencies: + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/keccak256" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/rlp" "^5.8.0" + +"@ethersproject/address@^5.0.2", "@ethersproject/address@^5.0.8", "@ethersproject/address@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz" integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== @@ -173,14 +223,29 @@ "@ethersproject/logger" "^5.7.0" "@ethersproject/rlp" "^5.7.0" -"@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.7.0": +"@ethersproject/base64@5.8.0", "@ethersproject/base64@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.8.0.tgz#61c669c648f6e6aad002c228465d52ac93ee83eb" + integrity sha512-lN0oIwfkYj9LbPx4xEkie6rAMJtySbpOAFXSDVQaBnAzYfB4X2Qr+FXJGxMoc3Bxp2Sm8OwvzMrywxyw0gLjIQ== + dependencies: + "@ethersproject/bytes" "^5.8.0" + +"@ethersproject/base64@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz" integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== dependencies: "@ethersproject/bytes" "^5.7.0" -"@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.7.0": +"@ethersproject/basex@5.8.0", "@ethersproject/basex@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.8.0.tgz#1d279a90c4be84d1c1139114a1f844869e57d03a" + integrity sha512-PIgTszMlDRmNwW9nhS6iqtVfdTAKosA7llYXNmGPw4YAI1PUyMv28988wAb41/gHF/WqGdoLv0erHaRcHRKW2Q== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + +"@ethersproject/basex@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz" integrity sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw== @@ -188,7 +253,16 @@ "@ethersproject/bytes" "^5.7.0" "@ethersproject/properties" "^5.7.0" -"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.1.1", "@ethersproject/bignumber@^5.7.0": +"@ethersproject/bignumber@5.8.0", "@ethersproject/bignumber@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.8.0.tgz#c381d178f9eeb370923d389284efa19f69efa5d7" + integrity sha512-ZyaT24bHaSeJon2tGPKIiHszWjD/54Sz8t57Toch475lCLljC6MgPmxk7Gtzz+ddNN5LuHea9qhAe0x3D+uYPA== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + bn.js "^5.2.1" + +"@ethersproject/bignumber@^5.1.1", "@ethersproject/bignumber@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz" integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== @@ -197,21 +271,51 @@ "@ethersproject/logger" "^5.7.0" bn.js "^5.2.1" -"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.0.8", "@ethersproject/bytes@^5.7.0": +"@ethersproject/bytes@5.8.0", "@ethersproject/bytes@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.8.0.tgz#9074820e1cac7507a34372cadeb035461463be34" + integrity sha512-vTkeohgJVCPVHu5c25XWaWQOZ4v+DkGoC42/TS2ond+PARCxTJvgTFUNDZovyQ/uAQ4EcpqqowKydcdmRKjg7A== + dependencies: + "@ethersproject/logger" "^5.8.0" + +"@ethersproject/bytes@^5.0.8", "@ethersproject/bytes@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz" integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.7.0": +"@ethersproject/constants@5.8.0", "@ethersproject/constants@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.8.0.tgz#12f31c2f4317b113a4c19de94e50933648c90704" + integrity sha512-wigX4lrf5Vu+axVTIvNsuL6YrV4O5AXl5ubcURKMEME5TnWBouUh0CDTWxZ2GpnRn1kcCgE7l8O5+VbV9QTTcg== + dependencies: + "@ethersproject/bignumber" "^5.8.0" + +"@ethersproject/constants@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz" integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== dependencies: "@ethersproject/bignumber" "^5.7.0" -"@ethersproject/contracts@5.7.0", "@ethersproject/contracts@^5.7.0": +"@ethersproject/contracts@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.8.0.tgz#243a38a2e4aa3e757215ea64e276f8a8c9d8ed73" + integrity sha512-0eFjGz9GtuAi6MZwhb4uvUM216F38xiuR0yYCjKJpNfSEy4HUM8hvqqBj9Jmm0IUz8l0xKEhWwLIhPgxNY0yvQ== + dependencies: + "@ethersproject/abi" "^5.8.0" + "@ethersproject/abstract-provider" "^5.8.0" + "@ethersproject/abstract-signer" "^5.8.0" + "@ethersproject/address" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/constants" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/transactions" "^5.8.0" + +"@ethersproject/contracts@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz" integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg== @@ -227,7 +331,22 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/transactions" "^5.7.0" -"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": +"@ethersproject/hash@5.8.0", "@ethersproject/hash@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.8.0.tgz#b8893d4629b7f8462a90102572f8cd65a0192b4c" + integrity sha512-ac/lBcTbEWW/VGJij0CNSw/wPcw9bSRgCB0AIBz8CvED/jfvDoV9hsIIiWfvWmFEi8RcXtlNwp2jv6ozWOsooA== + dependencies: + "@ethersproject/abstract-signer" "^5.8.0" + "@ethersproject/address" "^5.8.0" + "@ethersproject/base64" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/keccak256" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + +"@ethersproject/hash@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz" integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== @@ -242,44 +361,52 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": - version "5.7.0" - resolved "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz" - integrity sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/basex" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/pbkdf2" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wordlists" "^5.7.0" - -"@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.7.0": - version "5.7.0" - resolved "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz" - integrity sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hdnode" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/pbkdf2" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" +"@ethersproject/hdnode@5.8.0", "@ethersproject/hdnode@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.8.0.tgz#a51ae2a50bcd48ef6fd108c64cbae5e6ff34a761" + integrity sha512-4bK1VF6E83/3/Im0ERnnUeWOY3P1BZml4ZD3wcH8Ys0/d1h1xaFt6Zc+Dh9zXf9TapGro0T4wvO71UTCp3/uoA== + dependencies: + "@ethersproject/abstract-signer" "^5.8.0" + "@ethersproject/basex" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/pbkdf2" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/sha2" "^5.8.0" + "@ethersproject/signing-key" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + "@ethersproject/transactions" "^5.8.0" + "@ethersproject/wordlists" "^5.8.0" + +"@ethersproject/json-wallets@5.8.0", "@ethersproject/json-wallets@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.8.0.tgz#d18de0a4cf0f185f232eb3c17d5e0744d97eb8c9" + integrity sha512-HxblNck8FVUtNxS3VTEYJAcwiKYsBIF77W15HufqlBF9gGfhmYOJtYZp8fSDZtn9y5EaXTE87zDwzxRoTFk11w== + dependencies: + "@ethersproject/abstract-signer" "^5.8.0" + "@ethersproject/address" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/hdnode" "^5.8.0" + "@ethersproject/keccak256" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/pbkdf2" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/random" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + "@ethersproject/transactions" "^5.8.0" aes-js "3.0.0" scrypt-js "3.0.1" -"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.7.0": +"@ethersproject/keccak256@5.8.0", "@ethersproject/keccak256@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.8.0.tgz#d2123a379567faf2d75d2aaea074ffd4df349e6a" + integrity sha512-A1pkKLZSz8pDaQ1ftutZoaN46I6+jvuqugx5KYNeQOPqq+JZ0Txm7dlWesCHB5cndJSu5vP2VKptKf7cksERng== + dependencies: + "@ethersproject/bytes" "^5.8.0" + js-sha3 "0.8.0" + +"@ethersproject/keccak256@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz" integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== @@ -287,34 +414,79 @@ "@ethersproject/bytes" "^5.7.0" js-sha3 "0.8.0" -"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.7.0": +"@ethersproject/logger@5.8.0", "@ethersproject/logger@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.8.0.tgz#f0232968a4f87d29623a0481690a2732662713d6" + integrity sha512-Qe6knGmY+zPPWTC+wQrpitodgBfH7XoceCGL5bJVejmH+yCS3R8jJm8iiWuvWbG76RUmyEG53oqv6GMVWqunjA== + +"@ethersproject/logger@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz" integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== -"@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0": +"@ethersproject/networks@5.8.0", "@ethersproject/networks@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.8.0.tgz#8b4517a3139380cba9fb00b63ffad0a979671fde" + integrity sha512-egPJh3aPVAzbHwq8DD7Po53J4OUSsA1MjQp8Vf/OZPav5rlmWUaFLiq8cvQiGK0Z5K6LYzm29+VA/p4RL1FzNg== + dependencies: + "@ethersproject/logger" "^5.8.0" + +"@ethersproject/networks@^5.7.0": version "5.7.1" resolved "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz" integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.7.0": - version "5.7.0" - resolved "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz" - integrity sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw== +"@ethersproject/pbkdf2@5.8.0", "@ethersproject/pbkdf2@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.8.0.tgz#cd2621130e5dd51f6a0172e63a6e4a0c0a0ec37e" + integrity sha512-wuHiv97BrzCmfEaPbUFpMjlVg/IDkZThp9Ri88BpjRleg4iePJaj2SW8AIyE8cXn5V1tuAaMj6lzvsGJkGWskg== dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/sha2" "^5.8.0" -"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.7.0": +"@ethersproject/properties@5.8.0", "@ethersproject/properties@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.8.0.tgz#405a8affb6311a49a91dabd96aeeae24f477020e" + integrity sha512-PYuiEoQ+FMaZZNGrStmN7+lWjlsoufGIHdww7454FIaGdbe/p5rnaCXTr5MtBYl3NkeoVhHZuyzChPeGeKIpQw== + dependencies: + "@ethersproject/logger" "^5.8.0" + +"@ethersproject/properties@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz" integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/providers@5.7.2", "@ethersproject/providers@^5.7.1", "@ethersproject/providers@^5.7.2": +"@ethersproject/providers@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.8.0.tgz#6c2ae354f7f96ee150439f7de06236928bc04cb4" + integrity sha512-3Il3oTzEx3o6kzcg9ZzbE+oCZYyY+3Zh83sKkn4s1DZfTUjIegHnN2Cm0kbn9YFy45FDVcuCLLONhU7ny0SsCw== + dependencies: + "@ethersproject/abstract-provider" "^5.8.0" + "@ethersproject/abstract-signer" "^5.8.0" + "@ethersproject/address" "^5.8.0" + "@ethersproject/base64" "^5.8.0" + "@ethersproject/basex" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/constants" "^5.8.0" + "@ethersproject/hash" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/networks" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/random" "^5.8.0" + "@ethersproject/rlp" "^5.8.0" + "@ethersproject/sha2" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + "@ethersproject/transactions" "^5.8.0" + "@ethersproject/web" "^5.8.0" + bech32 "1.1.4" + ws "8.18.0" + +"@ethersproject/providers@^5.7.1", "@ethersproject/providers@^5.7.2": version "5.7.2" resolved "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz" integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== @@ -340,7 +512,15 @@ bech32 "1.1.4" ws "7.4.6" -"@ethersproject/random@5.7.0", "@ethersproject/random@^5.7.0": +"@ethersproject/random@5.8.0", "@ethersproject/random@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.8.0.tgz#1bced04d49449f37c6437c701735a1a022f0057a" + integrity sha512-E4I5TDl7SVqyg4/kkA/qTfuLWAQGXmSOgYyO01So8hLfwgKvYK5snIlzxJMk72IFdG/7oh8yuSqY2KX7MMwg+A== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + +"@ethersproject/random@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz" integrity sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ== @@ -348,7 +528,15 @@ "@ethersproject/bytes" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.7.0": +"@ethersproject/rlp@5.8.0", "@ethersproject/rlp@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.8.0.tgz#5a0d49f61bc53e051532a5179472779141451de5" + integrity sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + +"@ethersproject/rlp@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz" integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== @@ -356,7 +544,16 @@ "@ethersproject/bytes" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.7.0": +"@ethersproject/sha2@5.8.0", "@ethersproject/sha2@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.8.0.tgz#8954a613bb78dac9b46829c0a95de561ef74e5e1" + integrity sha512-dDOUrXr9wF/YFltgTBYS0tKslPEKr6AekjqDW2dbn1L1xmjGR+9GiKu4ajxovnrDbwxAKdHjW8jNcwfz8PAz4A== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + hash.js "1.1.7" + +"@ethersproject/sha2@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz" integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== @@ -365,19 +562,31 @@ "@ethersproject/logger" "^5.7.0" hash.js "1.1.7" -"@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": - version "5.7.0" - resolved "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz" - integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== +"@ethersproject/signing-key@5.8.0", "@ethersproject/signing-key@^5.7.0", "@ethersproject/signing-key@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.8.0.tgz#9797e02c717b68239c6349394ea85febf8893119" + integrity sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w== dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" bn.js "^5.2.1" - elliptic "6.5.4" + elliptic "6.6.1" hash.js "1.1.7" -"@ethersproject/solidity@5.7.0", "@ethersproject/solidity@^5.7.0": +"@ethersproject/solidity@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.8.0.tgz#429bb9fcf5521307a9448d7358c26b93695379b9" + integrity sha512-4CxFeCgmIWamOHwYN9d+QWGxye9qQLilpgTU0XhYs1OahkclF+ewO+3V1U0mvpiuQxm5EHHmv8f7ClVII8EHsA== + dependencies: + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/keccak256" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/sha2" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + +"@ethersproject/solidity@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz" integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA== @@ -389,7 +598,16 @@ "@ethersproject/sha2" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.7.0": +"@ethersproject/strings@5.8.0", "@ethersproject/strings@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.8.0.tgz#ad79fafbf0bd272d9765603215ac74fd7953908f" + integrity sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/constants" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + +"@ethersproject/strings@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz" integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== @@ -398,7 +616,22 @@ "@ethersproject/constants" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.6.2", "@ethersproject/transactions@^5.7.0": +"@ethersproject/transactions@5.8.0", "@ethersproject/transactions@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.8.0.tgz#1e518822403abc99def5a043d1c6f6fe0007e46b" + integrity sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg== + dependencies: + "@ethersproject/address" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/constants" "^5.8.0" + "@ethersproject/keccak256" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/rlp" "^5.8.0" + "@ethersproject/signing-key" "^5.8.0" + +"@ethersproject/transactions@^5.6.2", "@ethersproject/transactions@^5.7.0": version "5.7.0" resolved "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz" integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== @@ -413,37 +646,48 @@ "@ethersproject/rlp" "^5.7.0" "@ethersproject/signing-key" "^5.7.0" -"@ethersproject/units@5.7.0": - version "5.7.0" - resolved "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz" - integrity sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/wallet@5.7.0": - version "5.7.0" - resolved "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz" - integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/hdnode" "^5.7.0" - "@ethersproject/json-wallets" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wordlists" "^5.7.0" - -"@ethersproject/web@5.7.1", "@ethersproject/web@^5.7.0": +"@ethersproject/units@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.8.0.tgz#c12f34ba7c3a2de0e9fa0ed0ee32f3e46c5c2c6a" + integrity sha512-lxq0CAnc5kMGIiWW4Mr041VT8IhNM+Pn5T3haO74XZWFulk7wH1Gv64HqE96hT4a7iiNMdOCFEBgaxWuk8ETKQ== + dependencies: + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/constants" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + +"@ethersproject/wallet@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.8.0.tgz#49c300d10872e6986d953e8310dc33d440da8127" + integrity sha512-G+jnzmgg6UxurVKRKvw27h0kvG75YKXZKdlLYmAHeF32TGUzHkOFd7Zn6QHOTYRFWnfjtSSFjBowKo7vfrXzPA== + dependencies: + "@ethersproject/abstract-provider" "^5.8.0" + "@ethersproject/abstract-signer" "^5.8.0" + "@ethersproject/address" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/hash" "^5.8.0" + "@ethersproject/hdnode" "^5.8.0" + "@ethersproject/json-wallets" "^5.8.0" + "@ethersproject/keccak256" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/random" "^5.8.0" + "@ethersproject/signing-key" "^5.8.0" + "@ethersproject/transactions" "^5.8.0" + "@ethersproject/wordlists" "^5.8.0" + +"@ethersproject/web@5.8.0", "@ethersproject/web@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.8.0.tgz#3e54badc0013b7a801463a7008a87988efce8a37" + integrity sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw== + dependencies: + "@ethersproject/base64" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + +"@ethersproject/web@^5.7.0": version "5.7.1" resolved "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz" integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== @@ -454,16 +698,16 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/wordlists@5.7.0", "@ethersproject/wordlists@^5.7.0": - version "5.7.0" - resolved "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz" - integrity sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA== +"@ethersproject/wordlists@5.8.0", "@ethersproject/wordlists@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.8.0.tgz#7a5654ee8d1bb1f4dbe43f91d217356d650ad821" + integrity sha512-2df9bbXicZws2Sb5S6ET493uJ0Z84Fjr3pC4tu/qlnZERibZCeUVuqdtt+7Tv9xxhUxHoIekIA7avrKUWHrezg== dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/hash" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/strings" "^5.8.0" "@gnosis.pm/safe-contracts@1.3.0": version "1.3.0" @@ -1472,17 +1716,12 @@ amdefine@>=0.0.4: resolved "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz" integrity sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg== -ansi-colors@3.2.3: - version "3.2.3" - resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz" - integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== - ansi-colors@4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-colors@^4.1.1: +ansi-colors@^4.1.1, ansi-colors@^4.1.3: version "4.1.3" resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz" integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== @@ -1499,17 +1738,12 @@ ansi-regex@^3.0.0: resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz" integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== -ansi-regex@^4.1.0: - version "4.1.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz" - integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== - ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.0, ansi-styles@^3.2.1: +ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -1528,7 +1762,7 @@ antlr4ts@^0.5.0-alpha.4: resolved "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz" integrity sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ== -anymatch@~3.1.1, anymatch@~3.1.2: +anymatch@~3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz" integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== @@ -1578,17 +1812,6 @@ array-uniq@1.0.3: resolved "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz" integrity sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q== -array.prototype.reduce@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.4.tgz" - integrity sha512-WnM+AjG/DvLRLo4DDl+r+SvCzYtD2Jd9oeBYMcEaI7t3fFrHY9M53/wdLcTvmZNQ70IU6Htj0emFkZ5TS+lrdw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.2" - es-array-method-boxes-properly "^1.0.0" - is-string "^1.0.7" - asap@~2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz" @@ -1679,6 +1902,15 @@ aws4@^1.8.0: resolved "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== +axios@^1.5.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.8.1.tgz#7c118d2146e9ebac512b7d1128771cdd738d11e3" + integrity sha512-NN+fvwH/kV01dYUQ3PTOZns4LWtWhOFCAhQ/pHb88WQ1hNe5V/dvFwc4VJcDL11LT9xSX0QtsR8sWUuyOuOq7g== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axios@^1.6.8: version "1.6.8" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" @@ -1849,7 +2081,7 @@ browser-level@^1.0.1: module-error "^1.0.2" run-parallel-limit "^1.1.0" -browser-stdout@1.3.1: +browser-stdout@1.3.1, browser-stdout@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== @@ -1963,11 +2195,6 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" -camelcase@^5.0.0: - version "5.3.1" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - camelcase@^6.0.0: version "6.3.0" resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz" @@ -2050,25 +2277,25 @@ check-error@^1.0.2: resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz" integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== -chokidar@3.3.0: - version "3.3.0" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz" - integrity sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A== +chokidar@3.5.3, chokidar@^3.4.0: + version "3.5.3" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: - anymatch "~3.1.1" + anymatch "~3.1.2" braces "~3.0.2" - glob-parent "~5.1.0" + glob-parent "~5.1.2" is-binary-path "~2.1.0" is-glob "~4.0.1" normalize-path "~3.0.0" - readdirp "~3.2.0" + readdirp "~3.6.0" optionalDependencies: - fsevents "~2.1.1" + fsevents "~2.3.2" -chokidar@3.5.3, chokidar@^3.4.0: - version "3.5.3" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== +chokidar@^3.5.3: + version "3.6.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== dependencies: anymatch "~3.1.2" braces "~3.0.2" @@ -2140,15 +2367,6 @@ cli-table3@^0.5.0: optionalDependencies: colors "^1.1.2" -cliui@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz" - integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== - dependencies: - string-width "^3.1.0" - strip-ansi "^5.2.0" - wrap-ansi "^5.1.0" - cliui@^7.0.2: version "7.0.4" resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" @@ -2411,13 +2629,6 @@ debug@2.6.9, debug@^2.2.0: dependencies: ms "2.0.0" -debug@3.2.6: - version "3.2.6" - resolved "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - debug@4, debug@4.3.4, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" @@ -2432,10 +2643,12 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== +debug@^4.3.5: + version "4.4.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" + integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== + dependencies: + ms "^2.1.3" decamelize@^4.0.0: version "4.0.0" @@ -2490,14 +2703,6 @@ defer-to-connect@^2.0.0, defer-to-connect@^2.0.1: resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== -define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz" - integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== - dependencies: - has-property-descriptors "^1.0.0" - object-keys "^1.1.1" - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" @@ -2521,11 +2726,6 @@ detect-port@^1.3.0: address "^1.0.1" debug "4" -diff@3.5.0: - version "3.5.0" - resolved "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - diff@5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz" @@ -2536,6 +2736,11 @@ diff@^4.0.1: resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +diff@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531" + integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A== + difflib@^0.2.4: version "0.2.4" resolved "https://registry.npmjs.org/difflib/-/difflib-0.2.4.tgz" @@ -2578,10 +2783,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== -elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.4: - version "6.5.4" - resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== +elliptic@6.6.1, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.4: + version "6.6.1" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.6.1.tgz#3b8ffb02670bf69e382c7f65bf524c97c5405c06" + integrity sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g== dependencies: bn.js "^4.11.9" brorand "^1.1.0" @@ -2591,11 +2796,6 @@ elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.4: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" @@ -2625,50 +2825,6 @@ env-paths@^2.2.0: resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz" integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== -es-abstract@^1.19.0, es-abstract@^1.19.2, es-abstract@^1.19.5, es-abstract@^1.20.1: - version "1.20.4" - resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.4.tgz" - integrity sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA== - dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - function.prototype.name "^1.1.5" - get-intrinsic "^1.1.3" - get-symbol-description "^1.0.0" - has "^1.0.3" - has-property-descriptors "^1.0.0" - has-symbols "^1.0.3" - internal-slot "^1.0.3" - is-callable "^1.2.7" - is-negative-zero "^2.0.2" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.2" - is-string "^1.0.7" - is-weakref "^1.0.2" - object-inspect "^1.12.2" - object-keys "^1.1.1" - object.assign "^4.1.4" - regexp.prototype.flags "^1.4.3" - safe-regex-test "^1.0.0" - string.prototype.trimend "^1.0.5" - string.prototype.trimstart "^1.0.5" - unbox-primitive "^1.0.2" - -es-array-method-boxes-properly@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz" - integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== - -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - es5-ext@^0.10.35, es5-ext@^0.10.50: version "0.10.62" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.62.tgz#5e6adc19a6da524bf3d1e02bbc8960e5eb49a9a5" @@ -2710,16 +2866,16 @@ escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + escodegen@1.8.x: version "1.8.1" resolved "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz" @@ -2766,23 +2922,21 @@ eth-ens-namehash@2.0.8: js-sha3 "^0.5.7" eth-gas-reporter@^0.2.25: - version "0.2.25" - resolved "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.2.25.tgz" - integrity sha512-1fRgyE4xUB8SoqLgN3eDfpDfwEfRxh2Sz1b7wzFbyQA+9TekMmvSjjoRu9SKcSVyK+vLkLIsVbJDsTWjw195OQ== + version "0.2.27" + resolved "https://registry.yarnpkg.com/eth-gas-reporter/-/eth-gas-reporter-0.2.27.tgz#928de8548a674ed64c7ba0bf5795e63079150d4e" + integrity sha512-femhvoAM7wL0GcI8ozTdxfuBtBFJ9qsyIAsmKVjlWAHUbdnnXHt+lKzz/kmldM5lA9jLuNHGwuIxorNpLbR1Zw== dependencies: - "@ethersproject/abi" "^5.0.0-beta.146" "@solidity-parser/parser" "^0.14.0" + axios "^1.5.1" cli-table3 "^0.5.0" colors "1.4.0" ethereum-cryptography "^1.0.3" - ethers "^4.0.40" + ethers "^5.7.2" fs-readdir-recursive "^1.1.0" lodash "^4.17.14" markdown-table "^1.1.3" - mocha "^7.1.1" + mocha "^10.2.0" req-cwd "^2.0.0" - request "^2.88.0" - request-promise-native "^1.0.5" sha1 "^1.1.1" sync-request "^6.0.0" @@ -2887,56 +3041,41 @@ ethereumjs-util@^7.0.3, ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.1, ethereum ethereum-cryptography "^0.1.3" rlp "^2.2.4" -ethers@^4.0.40: - version "4.0.49" - resolved "https://registry.npmjs.org/ethers/-/ethers-4.0.49.tgz" - integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg== - dependencies: - aes-js "3.0.0" - bn.js "^4.11.9" - elliptic "6.5.4" - hash.js "1.1.3" - js-sha3 "0.5.7" - scrypt-js "2.0.4" - setimmediate "1.0.4" - uuid "2.0.1" - xmlhttprequest "1.8.0" - ethers@^5.1.0, ethers@^5.7.1, ethers@^5.7.2: - version "5.7.2" - resolved "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz" - integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== - dependencies: - "@ethersproject/abi" "5.7.0" - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/abstract-signer" "5.7.0" - "@ethersproject/address" "5.7.0" - "@ethersproject/base64" "5.7.0" - "@ethersproject/basex" "5.7.0" - "@ethersproject/bignumber" "5.7.0" - "@ethersproject/bytes" "5.7.0" - "@ethersproject/constants" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/hash" "5.7.0" - "@ethersproject/hdnode" "5.7.0" - "@ethersproject/json-wallets" "5.7.0" - "@ethersproject/keccak256" "5.7.0" - "@ethersproject/logger" "5.7.0" - "@ethersproject/networks" "5.7.1" - "@ethersproject/pbkdf2" "5.7.0" - "@ethersproject/properties" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@ethersproject/random" "5.7.0" - "@ethersproject/rlp" "5.7.0" - "@ethersproject/sha2" "5.7.0" - "@ethersproject/signing-key" "5.7.0" - "@ethersproject/solidity" "5.7.0" - "@ethersproject/strings" "5.7.0" - "@ethersproject/transactions" "5.7.0" - "@ethersproject/units" "5.7.0" - "@ethersproject/wallet" "5.7.0" - "@ethersproject/web" "5.7.1" - "@ethersproject/wordlists" "5.7.0" + version "5.8.0" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.8.0.tgz#97858dc4d4c74afce83ea7562fe9493cedb4d377" + integrity sha512-DUq+7fHrCg1aPDFCHx6UIPb3nmt2XMpM7Y/g2gLhsl3lIBqeAfOJIl1qEvRf2uq3BiKxmh6Fh5pfp2ieyek7Kg== + dependencies: + "@ethersproject/abi" "5.8.0" + "@ethersproject/abstract-provider" "5.8.0" + "@ethersproject/abstract-signer" "5.8.0" + "@ethersproject/address" "5.8.0" + "@ethersproject/base64" "5.8.0" + "@ethersproject/basex" "5.8.0" + "@ethersproject/bignumber" "5.8.0" + "@ethersproject/bytes" "5.8.0" + "@ethersproject/constants" "5.8.0" + "@ethersproject/contracts" "5.8.0" + "@ethersproject/hash" "5.8.0" + "@ethersproject/hdnode" "5.8.0" + "@ethersproject/json-wallets" "5.8.0" + "@ethersproject/keccak256" "5.8.0" + "@ethersproject/logger" "5.8.0" + "@ethersproject/networks" "5.8.0" + "@ethersproject/pbkdf2" "5.8.0" + "@ethersproject/properties" "5.8.0" + "@ethersproject/providers" "5.8.0" + "@ethersproject/random" "5.8.0" + "@ethersproject/rlp" "5.8.0" + "@ethersproject/sha2" "5.8.0" + "@ethersproject/signing-key" "5.8.0" + "@ethersproject/solidity" "5.8.0" + "@ethersproject/strings" "5.8.0" + "@ethersproject/transactions" "5.8.0" + "@ethersproject/units" "5.8.0" + "@ethersproject/wallet" "5.8.0" + "@ethersproject/web" "5.8.0" + "@ethersproject/wordlists" "5.8.0" ethjs-unit@0.1.6: version "0.1.6" @@ -3109,14 +3248,7 @@ find-replace@^3.0.0: dependencies: array-back "^3.0.1" -find-up@3.0.0, find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - -find-up@5.0.0: +find-up@5.0.0, find-up@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== @@ -3138,13 +3270,6 @@ find-yarn-workspace-root@^2.0.0: dependencies: micromatch "^4.0.2" -flat@^4.1.0: - version "4.1.1" - resolved "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz" - integrity sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA== - dependencies: - is-buffer "~2.0.3" - flat@^5.0.2: version "5.0.2" resolved "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz" @@ -3294,11 +3419,6 @@ fs.realpath@^1.0.0: resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@~2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== - fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" @@ -3309,27 +3429,12 @@ function-bind@^1.1.1: resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -function.prototype.name@^1.1.5: - version "1.1.5" - resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz" - integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.0" - functions-have-names "^1.2.2" - functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz" integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== -functions-have-names@^1.2.2: - version "1.2.3" - resolved "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz" - integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== - -get-caller-file@^2.0.1, get-caller-file@^2.0.5: +get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -3339,7 +3444,7 @@ get-func-name@^2.0.0: resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz" integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz" integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== @@ -3365,14 +3470,6 @@ get-stream@^6.0.1: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -get-symbol-description@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz" - integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.1" - getpass@^0.1.1: version "0.1.7" resolved "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz" @@ -3388,25 +3485,13 @@ ghost-testrpc@^0.0.2: chalk "^2.4.2" node-emoji "^1.10.0" -glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2: +glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" -glob@7.1.3: - version "7.1.3" - resolved "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - glob@7.1.7: version "7.1.7" resolved "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz" @@ -3454,6 +3539,17 @@ glob@^7.0.0, glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + global-modules@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz" @@ -3540,11 +3636,6 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -growl@1.10.5: - version "1.10.5" - resolved "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - handlebars@^4.0.1: version "4.7.7" resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz" @@ -3690,11 +3781,6 @@ hardhat@^2.6.6: uuid "^8.3.2" ws "^7.4.6" -has-bigints@^1.0.1, has-bigints@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz" - integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== - has-flag@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz" @@ -3710,14 +3796,7 @@ has-flag@^4.0.0: resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-property-descriptors@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz" - integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== - dependencies: - get-intrinsic "^1.1.1" - -has-symbols@^1.0.0, has-symbols@^1.0.2, has-symbols@^1.0.3: +has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== @@ -3745,14 +3824,6 @@ hash-base@^3.0.0: readable-stream "^3.6.0" safe-buffer "^5.2.0" -hash.js@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz" - integrity sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.0" - hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: version "1.1.7" resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz" @@ -3945,15 +4016,6 @@ ini@^1.3.5: resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== -internal-slot@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz" - integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== - dependencies: - get-intrinsic "^1.1.0" - has "^1.0.3" - side-channel "^1.0.4" - interpret@^1.0.0: version "1.4.0" resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz" @@ -3979,13 +4041,6 @@ is-arguments@^1.0.4: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-bigint@^1.0.1: - version "1.0.4" - resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz" - integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== - dependencies: - has-bigints "^1.0.1" - is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" @@ -3993,20 +4048,12 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" -is-boolean-object@^1.1.0: - version "1.1.2" - resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz" - integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-buffer@^2.0.5, is-buffer@~2.0.3: +is-buffer@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: +is-callable@^1.1.3: version "1.2.7" resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== @@ -4025,13 +4072,6 @@ is-core-module@^2.9.0: dependencies: has "^1.0.3" -is-date-object@^1.0.1: - version "1.0.5" - resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz" - integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== - dependencies: - has-tostringtag "^1.0.0" - is-docker@^2.0.0: version "2.2.1" resolved "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz" @@ -4076,18 +4116,6 @@ is-hex-prefixed@1.0.0: resolved "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz" integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== -is-negative-zero@^2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz" - integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== - -is-number-object@^1.0.4: - version "1.0.7" - resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz" - integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== - dependencies: - has-tostringtag "^1.0.0" - is-number@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" @@ -4098,35 +4126,6 @@ is-plain-obj@^2.1.0: resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz" integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== -is-regex@^1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz" - integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-shared-array-buffer@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz" - integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== - dependencies: - call-bind "^1.0.2" - -is-string@^1.0.5, is-string@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz" - integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== - dependencies: - has-tostringtag "^1.0.0" - -is-symbol@^1.0.2, is-symbol@^1.0.3: - version "1.0.4" - resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz" - integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== - dependencies: - has-symbols "^1.0.2" - is-typed-array@^1.1.3: version "1.1.12" resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" @@ -4144,13 +4143,6 @@ is-unicode-supported@^0.1.0: resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== -is-weakref@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz" - integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== - dependencies: - call-bind "^1.0.2" - is-wsl@^2.1.1: version "2.2.0" resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz" @@ -4183,23 +4175,15 @@ js-sdsl@^4.1.4: resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.2.tgz#2e3c031b1f47d3aca8b775532e3ebb0818e7f847" integrity sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w== -js-sha3@0.5.7, js-sha3@^0.5.7: - version "0.5.7" - resolved "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz" - integrity sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g== - js-sha3@0.8.0, js-sha3@^0.8.0: version "0.8.0" resolved "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== -js-yaml@3.13.1: - version "3.13.1" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" +js-sha3@^0.5.7: + version "0.5.7" + resolved "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz" + integrity sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g== js-yaml@3.x: version "3.14.1" @@ -4209,7 +4193,7 @@ js-yaml@3.x: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@4.1.0: +js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== @@ -4361,14 +4345,6 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - locate-path@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" @@ -4386,19 +4362,12 @@ lodash.truncate@^4.4.2: resolved "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz" integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== -lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21: +lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== - dependencies: - chalk "^2.4.2" - -log-symbols@4.1.0: +log-symbols@4.1.0, log-symbols@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== @@ -4583,6 +4552,13 @@ minimatch@5.0.1: dependencies: brace-expansion "^2.0.1" +minimatch@^5.0.1, minimatch@^5.1.6: + version "5.1.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.2.5, minimist@^1.2.6: version "1.2.7" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz" @@ -4615,13 +4591,6 @@ mkdirp@*: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg== -mkdirp@0.5.5: - version "0.5.5" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - mkdirp@0.5.x, mkdirp@^0.5.5, mkdirp@^0.5.6: version "0.5.6" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz" @@ -4695,35 +4664,31 @@ mocha@^10.0.0: yargs-parser "20.2.4" yargs-unparser "2.0.0" -mocha@^7.1.1: - version "7.2.0" - resolved "https://registry.npmjs.org/mocha/-/mocha-7.2.0.tgz" - integrity sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ== +mocha@^10.2.0: + version "10.8.2" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.8.2.tgz#8d8342d016ed411b12a429eb731b825f961afb96" + integrity sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg== dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - chokidar "3.3.0" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" - growl "1.10.5" - he "1.2.0" - js-yaml "3.13.1" - log-symbols "3.0.0" - minimatch "3.0.4" - mkdirp "0.5.5" - ms "2.1.1" - node-environment-flags "1.0.6" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" - wide-align "1.1.3" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "1.6.0" + ansi-colors "^4.1.3" + browser-stdout "^1.3.1" + chokidar "^3.5.3" + debug "^4.3.5" + diff "^5.2.0" + escape-string-regexp "^4.0.0" + find-up "^5.0.0" + glob "^8.1.0" + he "^1.2.0" + js-yaml "^4.1.0" + log-symbols "^4.1.0" + minimatch "^5.1.6" + ms "^2.1.3" + serialize-javascript "^6.0.2" + strip-json-comments "^3.1.1" + supports-color "^8.1.1" + workerpool "^6.5.1" + yargs "^16.2.0" + yargs-parser "^20.2.9" + yargs-unparser "^2.0.0" mock-fs@^4.1.0: version "4.14.0" @@ -4740,21 +4705,21 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== -ms@2.1.1, ms@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - ms@2.1.2: version "2.1.2" resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3: +ms@2.1.3, ms@^2.1.3: version "2.1.3" resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + multibase@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.7.0.tgz#1adfc1c50abe05eefeb5091ac0c2728d6b84581b" @@ -4842,14 +4807,6 @@ node-emoji@^1.10.0: dependencies: lodash "^4.17.21" -node-environment-flags@1.0.6: - version "1.0.6" - resolved "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz" - integrity sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" - node-fetch@^2.6.12: version "2.6.12" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" @@ -4907,46 +4864,11 @@ object-assign@^4, object-assign@^4.1.0, object-assign@^4.1.1: resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-inspect@^1.12.2, object-inspect@^1.9.0: +object-inspect@^1.9.0: version "1.12.2" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz" integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== -object-keys@^1.0.11, object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object.assign@4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - -object.assign@^4.1.4: - version "4.1.4" - resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz" - integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - has-symbols "^1.0.3" - object-keys "^1.1.1" - -object.getownpropertydescriptors@^2.0.3: - version "2.1.4" - resolved "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.4.tgz" - integrity sha512-sccv3L/pMModT6dJAYF3fzGMVcb38ysQ0tEE6ixv2yXJDtEIPph268OlAdJj5/qZMZDq2g/jqvwppt36uS/uQQ== - dependencies: - array.prototype.reduce "^1.0.4" - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.1" - obliterator@^2.0.0: version "2.0.4" resolved "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz" @@ -5025,13 +4947,6 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" -p-limit@^2.0.0: - version "2.3.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - p-limit@^3.0.2: version "3.1.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" @@ -5046,13 +4961,6 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - p-locate@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" @@ -5072,11 +4980,6 @@ p-try@^1.0.0: resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz" integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - parse-cache-control@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz" @@ -5356,13 +5259,6 @@ readable-stream@^3.6.0: string_decoder "^1.1.1" util-deprecate "^1.0.1" -readdirp@~3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz" - integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ== - dependencies: - picomatch "^2.0.4" - readdirp@~3.6.0: version "3.6.0" resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" @@ -5394,15 +5290,6 @@ reduce-flatten@^2.0.0: resolved "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz" integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== -regexp.prototype.flags@^1.4.3: - version "1.4.3" - resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz" - integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - functions-have-names "^1.2.2" - req-cwd@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/req-cwd/-/req-cwd-2.0.0.tgz" @@ -5417,23 +5304,7 @@ req-from@^2.0.0: dependencies: resolve-from "^3.0.0" -request-promise-core@1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz" - integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== - dependencies: - lodash "^4.17.19" - -request-promise-native@^1.0.5: - version "1.0.9" - resolved "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz" - integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== - dependencies: - request-promise-core "1.1.4" - stealthy-require "^1.1.1" - tough-cookie "^2.3.3" - -request@^2.79.0, request@^2.88.0: +request@^2.79.0: version "2.88.2" resolved "https://registry.npmjs.org/request/-/request-2.88.2.tgz" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== @@ -5469,11 +5340,6 @@ require-from-string@^2.0.0, require-from-string@^2.0.2: resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -5578,15 +5444,6 @@ safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, s resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-regex-test@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz" - integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.3" - is-regex "^1.1.4" - "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" @@ -5612,11 +5469,6 @@ sc-istanbul@^0.4.5: which "^1.1.1" wordwrap "^1.0.0" -scrypt-js@2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz" - integrity sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw== - scrypt-js@3.0.1, scrypt-js@^3.0.0, scrypt-js@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz" @@ -5636,7 +5488,7 @@ secure-compare@3.0.1: resolved "https://registry.yarnpkg.com/secure-compare/-/secure-compare-3.0.1.tgz#f1a0329b308b221fae37b9974f3d578d0ca999e3" integrity sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw== -semver@^5.5.0, semver@^5.6.0, semver@^5.7.0: +semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -5686,6 +5538,13 @@ serialize-javascript@6.0.0: dependencies: randombytes "^2.1.0" +serialize-javascript@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== + dependencies: + randombytes "^2.1.0" + serve-static@1.15.0: version "1.15.0" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" @@ -5707,16 +5566,6 @@ servify@^0.1.12: request "^2.79.0" xhr "^2.3.3" -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" - integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== - -setimmediate@1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz" - integrity sha512-/TjEmXQVEzdod/FFskf3o7oOAsGhHf2j1dZqRFbDzq4F3mvvxflIIi4Hd3bLQE9y/CpwqfSQam5JakI/mi3Pog== - setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz" @@ -5928,11 +5777,6 @@ statuses@2.0.1: resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -stealthy-require@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz" - integrity sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g== - stream-combiner@^0.2.2: version "0.2.2" resolved "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz" @@ -5956,7 +5800,7 @@ string-format@^2.0.0: resolved "https://registry.npmjs.org/string-format/-/string-format-2.0.0.tgz" integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== -"string-width@^1.0.2 || 2", string-width@^2.1.1: +string-width@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -5964,15 +5808,6 @@ string-format@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^3.0.0, string-width@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" @@ -5982,24 +5817,6 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string.prototype.trimend@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz" - integrity sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.19.5" - -string.prototype.trimstart@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz" - integrity sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.19.5" - string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" @@ -6021,13 +5838,6 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" @@ -6042,24 +5852,12 @@ strip-hex-prefix@1.0.0: dependencies: is-hex-prefixed "1.0.0" -strip-json-comments@2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" - integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== - -strip-json-comments@3.1.1: +strip-json-comments@3.1.1, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -supports-color@6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz" - integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== - dependencies: - has-flag "^3.0.0" - -supports-color@8.1.1: +supports-color@8.1.1, supports-color@^8.1.1: version "8.1.1" resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== @@ -6205,7 +6003,7 @@ toidentifier@1.0.1: resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -tough-cookie@^2.3.3, tough-cookie@~2.5.0: +tough-cookie@~2.5.0: version "2.5.0" resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz" integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== @@ -6377,16 +6175,6 @@ ultron@~1.1.0: resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== -unbox-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz" - integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== - dependencies: - call-bind "^1.0.2" - has-bigints "^1.0.2" - has-symbols "^1.0.3" - which-boxed-primitive "^1.0.2" - undici@^5.14.0: version "5.22.1" resolved "https://registry.yarnpkg.com/undici/-/undici-5.22.1.tgz#877d512effef2ac8be65e695f3586922e1a57d7b" @@ -6473,11 +6261,6 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== -uuid@2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz" - integrity sha512-nWg9+Oa3qD2CQzHIP4qKUqwNfzKn8P0LtFhotaCTFchsV7ZfDhAybeip/HZVeMIpZi9JgY1E3nUlwaCmZT1sEg== - uuid@^3.3.2: version "3.4.0" resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz" @@ -6792,22 +6575,6 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -which-boxed-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz" - integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== - dependencies: - is-bigint "^1.0.1" - is-boolean-object "^1.1.0" - is-number-object "^1.0.4" - is-string "^1.0.5" - is-symbol "^1.0.3" - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz" - integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== - which-typed-array@^1.1.11, which-typed-array@^1.1.2: version "1.1.11" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" @@ -6819,7 +6586,7 @@ which-typed-array@^1.1.11, which-typed-array@^1.1.2: gopd "^1.0.1" has-tostringtag "^1.0.0" -which@1.3.1, which@^1.1.1, which@^1.2.9, which@^1.3.1: +which@^1.1.1, which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -6833,13 +6600,6 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wide-align@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz" @@ -6863,14 +6623,10 @@ workerpool@6.2.1: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -wrap-ansi@^5.1.0: - version "5.1.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz" - integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== - dependencies: - ansi-styles "^3.2.0" - string-width "^3.0.0" - strip-ansi "^5.0.0" +workerpool@^6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" + integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== wrap-ansi@^7.0.0: version "7.0.0" @@ -6891,6 +6647,11 @@ ws@7.4.6: resolved "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@8.18.0: + version "8.18.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== + ws@^3.0.0: version "3.3.3" resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" @@ -6935,21 +6696,11 @@ xhr@^2.0.4, xhr@^2.3.3: parse-headers "^2.0.0" xtend "^4.0.0" -xmlhttprequest@1.8.0: - version "1.8.0" - resolved "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz" - integrity sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA== - xtend@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== -y18n@^4.0.0: - version "4.0.3" - resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== - y18n@^5.0.5: version "5.0.8" resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" @@ -6975,20 +6726,12 @@ yaml@^1.10.2: resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== -yargs-parser@13.1.2, yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@20.2.4: version "20.2.4" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== -yargs-parser@^20.2.2: +yargs-parser@^20.2.2, yargs-parser@^20.2.9: version "20.2.9" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== @@ -6998,16 +6741,7 @@ yargs-parser@^21.1.1: resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== -yargs-unparser@1.6.0: - version "1.6.0" - resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz" - integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== - dependencies: - flat "^4.1.0" - lodash "^4.17.15" - yargs "^13.3.0" - -yargs-unparser@2.0.0: +yargs-unparser@2.0.0, yargs-unparser@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz" integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== @@ -7017,23 +6751,7 @@ yargs-unparser@2.0.0: flat "^5.0.2" is-plain-obj "^2.1.0" -yargs@13.3.2, yargs@^13.3.0: - version "13.3.2" - resolved "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.2" - -yargs@16.2.0: +yargs@16.2.0, yargs@^16.2.0: version "16.2.0" resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== From 25b4777b515755391e664ef07aff51a8e91cfb26 Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 3 Mar 2025 21:43:56 +0800 Subject: [PATCH 075/108] chore: remove from audit whitelist --- audit-ci.jsonc | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/audit-ci.jsonc b/audit-ci.jsonc index 60f8ba6a8..f734b1320 100644 --- a/audit-ci.jsonc +++ b/audit-ci.jsonc @@ -36,22 +36,16 @@ "GHSA-7grf-83vw-6f5x", // Improper Initialization in OpenZeppelin "GHSA-88g8-f5mf-f5rj", - // flat vulnerable to Prototype Pollution - "GHSA-2j2x-2gpw-g8fm", // tough-cookie Prototype Pollution vulnerability "GHSA-72xf-g2v4-qvf3", // Server-Side Request Forgery in Request "GHSA-p8p7-x288-28g6", // OpenZeppelin: Using ERC2771Context with a custom forwarder can yield address(0) "GHSA-g4vp-m682-qqmp", - // regular expression DoS in debug - low severity - "GHSA-gxpj-cx7g-858c", // undici - only used in hardhat, not used in prod "GHSA-wqq4-5wpv-mx2g", // get-func-name - only used in chai, not used in prod "GHSA-4q6p-r6v2-jvc5", - // axios used only in sol2uml - "GHSA-wf5p-g6vw-rhxx", // follow-redirects url.parse bug. Not used in prod "GHSA-jchw-25xp-jwwc", // OpenZeppelin Contracts base64 encoding may read from potentially dirty memory @@ -76,20 +70,10 @@ "GHSA-grv7-fg5c-xmjg", // ws dos too many http - we only use in dev "GHSA-3h5v-q93c-6h6q", - // BER sig malleability vuln - only used in dev - "GHSA-49q7-c7j4-3p7m", - // ECDSA missing leading bit r and s check - only used in dev - "GHSA-977x-g7h5-7qgw", - // EDDSA missing sig length check - package only used in dev - "GHSA-f7q4-pwc6-w24p", // Server-Side Request Forgery in axios "GHSA-8hc4-vh64-cxmj", // Regular Expression Denial of Service (ReDoS) in micromatch "GHSA-952p-6rrq-rcjv", - // Elliptic's verify function omits uniqueness validation - "GHSA-434g-2637-qmqr", - // Valid ECDSA signatures erroneously rejected in Elliptic - "GHSA-fc9h-whq2-v747", // body-parser vulnerable to denial of service when url encoding is enabled "GHSA-qwcr-r2fm-qrc7", // path-to-regexp outputs backtracking regular expressions From 631d3be800a51d71fcf355db476df86941730f85 Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 3 Mar 2025 21:56:03 +0800 Subject: [PATCH 076/108] fix: foundry pretty is now default and new format --- test/signatures/ArbitrumTimelock | 94 ++++--- test/signatures/FixedDelegateErc20Wallet | 22 +- test/signatures/L1ArbitrumTimelock | 106 +++++--- test/signatures/L1ArbitrumToken | 76 ++++-- test/signatures/L2ArbitrumGovernor | 154 ++++++++---- test/signatures/L2ArbitrumToken | 112 ++++++--- test/signatures/SecurityCouncilManager | 166 ++++++++----- .../SecurityCouncilMemberElectionGovernor | 160 ++++++++---- .../SecurityCouncilMemberRemovalGovernor | 163 ++++++++----- .../SecurityCouncilNomineeElectionGovernor | 229 ++++++++++++------ test/signatures/UpgradeExecutor | 40 ++- test/storage/test.bash | 2 +- 12 files changed, 886 insertions(+), 438 deletions(-) diff --git a/test/signatures/ArbitrumTimelock b/test/signatures/ArbitrumTimelock index 6bf961846..73bcc1a84 100644 --- a/test/signatures/ArbitrumTimelock +++ b/test/signatures/ArbitrumTimelock @@ -1,31 +1,63 @@ -{ - "CANCELLER_ROLE()": "b08e51c0", - "DEFAULT_ADMIN_ROLE()": "a217fddf", - "EXECUTOR_ROLE()": "07bd0265", - "PROPOSER_ROLE()": "8f61f4f5", - "TIMELOCK_ADMIN_ROLE()": "0d3cf6fc", - "cancel(bytes32)": "c4d252f5", - "execute(address,uint256,bytes,bytes32,bytes32)": "134008d3", - "executeBatch(address[],uint256[],bytes[],bytes32,bytes32)": "e38335e5", - "getMinDelay()": "f27a0c92", - "getRoleAdmin(bytes32)": "248a9ca3", - "getTimestamp(bytes32)": "d45c4435", - "grantRole(bytes32,address)": "2f2ff15d", - "hasRole(bytes32,address)": "91d14854", - "hashOperation(address,uint256,bytes,bytes32,bytes32)": "8065657f", - "hashOperationBatch(address[],uint256[],bytes[],bytes32,bytes32)": "b1c5f427", - "initialize(uint256,address[],address[])": "7fbc79c6", - "isOperation(bytes32)": "31d50750", - "isOperationDone(bytes32)": "2ab0f529", - "isOperationPending(bytes32)": "584b153e", - "isOperationReady(bytes32)": "13bc9f20", - "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)": "bc197c81", - "onERC1155Received(address,address,uint256,uint256,bytes)": "f23a6e61", - "onERC721Received(address,address,uint256,bytes)": "150b7a02", - "renounceRole(bytes32,address)": "36568abe", - "revokeRole(bytes32,address)": "d547741f", - "schedule(address,uint256,bytes,bytes32,bytes32,uint256)": "01d5062a", - "scheduleBatch(address[],uint256[],bytes[],bytes32,bytes32,uint256)": "8f2a0bb0", - "supportsInterface(bytes4)": "01ffc9a7", - "updateDelay(uint256)": "64d62353" -} + +╭--------------------------------------------------------------------+------------╮ +| Method | Identifier | ++=================================================================================+ +| CANCELLER_ROLE() | b08e51c0 | +|--------------------------------------------------------------------+------------| +| DEFAULT_ADMIN_ROLE() | a217fddf | +|--------------------------------------------------------------------+------------| +| EXECUTOR_ROLE() | 07bd0265 | +|--------------------------------------------------------------------+------------| +| PROPOSER_ROLE() | 8f61f4f5 | +|--------------------------------------------------------------------+------------| +| TIMELOCK_ADMIN_ROLE() | 0d3cf6fc | +|--------------------------------------------------------------------+------------| +| cancel(bytes32) | c4d252f5 | +|--------------------------------------------------------------------+------------| +| execute(address,uint256,bytes,bytes32,bytes32) | 134008d3 | +|--------------------------------------------------------------------+------------| +| executeBatch(address[],uint256[],bytes[],bytes32,bytes32) | e38335e5 | +|--------------------------------------------------------------------+------------| +| getMinDelay() | f27a0c92 | +|--------------------------------------------------------------------+------------| +| getRoleAdmin(bytes32) | 248a9ca3 | +|--------------------------------------------------------------------+------------| +| getTimestamp(bytes32) | d45c4435 | +|--------------------------------------------------------------------+------------| +| grantRole(bytes32,address) | 2f2ff15d | +|--------------------------------------------------------------------+------------| +| hasRole(bytes32,address) | 91d14854 | +|--------------------------------------------------------------------+------------| +| hashOperation(address,uint256,bytes,bytes32,bytes32) | 8065657f | +|--------------------------------------------------------------------+------------| +| hashOperationBatch(address[],uint256[],bytes[],bytes32,bytes32) | b1c5f427 | +|--------------------------------------------------------------------+------------| +| initialize(uint256,address[],address[]) | 7fbc79c6 | +|--------------------------------------------------------------------+------------| +| isOperation(bytes32) | 31d50750 | +|--------------------------------------------------------------------+------------| +| isOperationDone(bytes32) | 2ab0f529 | +|--------------------------------------------------------------------+------------| +| isOperationPending(bytes32) | 584b153e | +|--------------------------------------------------------------------+------------| +| isOperationReady(bytes32) | 13bc9f20 | +|--------------------------------------------------------------------+------------| +| onERC1155BatchReceived(address,address,uint256[],uint256[],bytes) | bc197c81 | +|--------------------------------------------------------------------+------------| +| onERC1155Received(address,address,uint256,uint256,bytes) | f23a6e61 | +|--------------------------------------------------------------------+------------| +| onERC721Received(address,address,uint256,bytes) | 150b7a02 | +|--------------------------------------------------------------------+------------| +| renounceRole(bytes32,address) | 36568abe | +|--------------------------------------------------------------------+------------| +| revokeRole(bytes32,address) | d547741f | +|--------------------------------------------------------------------+------------| +| schedule(address,uint256,bytes,bytes32,bytes32,uint256) | 01d5062a | +|--------------------------------------------------------------------+------------| +| scheduleBatch(address[],uint256[],bytes[],bytes32,bytes32,uint256) | 8f2a0bb0 | +|--------------------------------------------------------------------+------------| +| supportsInterface(bytes4) | 01ffc9a7 | +|--------------------------------------------------------------------+------------| +| updateDelay(uint256) | 64d62353 | +╰--------------------------------------------------------------------+------------╯ + diff --git a/test/signatures/FixedDelegateErc20Wallet b/test/signatures/FixedDelegateErc20Wallet index 1d61bf07e..bb2716544 100644 --- a/test/signatures/FixedDelegateErc20Wallet +++ b/test/signatures/FixedDelegateErc20Wallet @@ -1,7 +1,15 @@ -{ - "initialize(address,address,address)": "c0c53b8b", - "owner()": "8da5cb5b", - "renounceOwnership()": "715018a6", - "transfer(address,address,uint256)": "beabacc8", - "transferOwnership(address)": "f2fde38b" -} + +╭-------------------------------------+------------╮ +| Method | Identifier | ++==================================================+ +| initialize(address,address,address) | c0c53b8b | +|-------------------------------------+------------| +| owner() | 8da5cb5b | +|-------------------------------------+------------| +| renounceOwnership() | 715018a6 | +|-------------------------------------+------------| +| transfer(address,address,uint256) | beabacc8 | +|-------------------------------------+------------| +| transferOwnership(address) | f2fde38b | +╰-------------------------------------+------------╯ + diff --git a/test/signatures/L1ArbitrumTimelock b/test/signatures/L1ArbitrumTimelock index 9dae01951..c6480f937 100644 --- a/test/signatures/L1ArbitrumTimelock +++ b/test/signatures/L1ArbitrumTimelock @@ -1,35 +1,71 @@ -{ - "CANCELLER_ROLE()": "b08e51c0", - "DEFAULT_ADMIN_ROLE()": "a217fddf", - "EXECUTOR_ROLE()": "07bd0265", - "PROPOSER_ROLE()": "8f61f4f5", - "RETRYABLE_TICKET_MAGIC()": "3994073d", - "TIMELOCK_ADMIN_ROLE()": "0d3cf6fc", - "cancel(bytes32)": "c4d252f5", - "execute(address,uint256,bytes,bytes32,bytes32)": "134008d3", - "executeBatch(address[],uint256[],bytes[],bytes32,bytes32)": "e38335e5", - "getMinDelay()": "f27a0c92", - "getRoleAdmin(bytes32)": "248a9ca3", - "getTimestamp(bytes32)": "d45c4435", - "governanceChainInbox()": "c4c31307", - "grantRole(bytes32,address)": "2f2ff15d", - "hasRole(bytes32,address)": "91d14854", - "hashOperation(address,uint256,bytes,bytes32,bytes32)": "8065657f", - "hashOperationBatch(address[],uint256[],bytes[],bytes32,bytes32)": "b1c5f427", - "initialize(uint256,address[],address,address)": "f9538ff5", - "initialize(uint256,address[],address[])": "7fbc79c6", - "isOperation(bytes32)": "31d50750", - "isOperationDone(bytes32)": "2ab0f529", - "isOperationPending(bytes32)": "584b153e", - "isOperationReady(bytes32)": "13bc9f20", - "l2Timelock()": "72152844", - "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)": "bc197c81", - "onERC1155Received(address,address,uint256,uint256,bytes)": "f23a6e61", - "onERC721Received(address,address,uint256,bytes)": "150b7a02", - "renounceRole(bytes32,address)": "36568abe", - "revokeRole(bytes32,address)": "d547741f", - "schedule(address,uint256,bytes,bytes32,bytes32,uint256)": "01d5062a", - "scheduleBatch(address[],uint256[],bytes[],bytes32,bytes32,uint256)": "8f2a0bb0", - "supportsInterface(bytes4)": "01ffc9a7", - "updateDelay(uint256)": "64d62353" -} + +╭--------------------------------------------------------------------+------------╮ +| Method | Identifier | ++=================================================================================+ +| CANCELLER_ROLE() | b08e51c0 | +|--------------------------------------------------------------------+------------| +| DEFAULT_ADMIN_ROLE() | a217fddf | +|--------------------------------------------------------------------+------------| +| EXECUTOR_ROLE() | 07bd0265 | +|--------------------------------------------------------------------+------------| +| PROPOSER_ROLE() | 8f61f4f5 | +|--------------------------------------------------------------------+------------| +| RETRYABLE_TICKET_MAGIC() | 3994073d | +|--------------------------------------------------------------------+------------| +| TIMELOCK_ADMIN_ROLE() | 0d3cf6fc | +|--------------------------------------------------------------------+------------| +| cancel(bytes32) | c4d252f5 | +|--------------------------------------------------------------------+------------| +| execute(address,uint256,bytes,bytes32,bytes32) | 134008d3 | +|--------------------------------------------------------------------+------------| +| executeBatch(address[],uint256[],bytes[],bytes32,bytes32) | e38335e5 | +|--------------------------------------------------------------------+------------| +| getMinDelay() | f27a0c92 | +|--------------------------------------------------------------------+------------| +| getRoleAdmin(bytes32) | 248a9ca3 | +|--------------------------------------------------------------------+------------| +| getTimestamp(bytes32) | d45c4435 | +|--------------------------------------------------------------------+------------| +| governanceChainInbox() | c4c31307 | +|--------------------------------------------------------------------+------------| +| grantRole(bytes32,address) | 2f2ff15d | +|--------------------------------------------------------------------+------------| +| hasRole(bytes32,address) | 91d14854 | +|--------------------------------------------------------------------+------------| +| hashOperation(address,uint256,bytes,bytes32,bytes32) | 8065657f | +|--------------------------------------------------------------------+------------| +| hashOperationBatch(address[],uint256[],bytes[],bytes32,bytes32) | b1c5f427 | +|--------------------------------------------------------------------+------------| +| initialize(uint256,address[],address,address) | f9538ff5 | +|--------------------------------------------------------------------+------------| +| initialize(uint256,address[],address[]) | 7fbc79c6 | +|--------------------------------------------------------------------+------------| +| isOperation(bytes32) | 31d50750 | +|--------------------------------------------------------------------+------------| +| isOperationDone(bytes32) | 2ab0f529 | +|--------------------------------------------------------------------+------------| +| isOperationPending(bytes32) | 584b153e | +|--------------------------------------------------------------------+------------| +| isOperationReady(bytes32) | 13bc9f20 | +|--------------------------------------------------------------------+------------| +| l2Timelock() | 72152844 | +|--------------------------------------------------------------------+------------| +| onERC1155BatchReceived(address,address,uint256[],uint256[],bytes) | bc197c81 | +|--------------------------------------------------------------------+------------| +| onERC1155Received(address,address,uint256,uint256,bytes) | f23a6e61 | +|--------------------------------------------------------------------+------------| +| onERC721Received(address,address,uint256,bytes) | 150b7a02 | +|--------------------------------------------------------------------+------------| +| renounceRole(bytes32,address) | 36568abe | +|--------------------------------------------------------------------+------------| +| revokeRole(bytes32,address) | d547741f | +|--------------------------------------------------------------------+------------| +| schedule(address,uint256,bytes,bytes32,bytes32,uint256) | 01d5062a | +|--------------------------------------------------------------------+------------| +| scheduleBatch(address[],uint256[],bytes[],bytes32,bytes32,uint256) | 8f2a0bb0 | +|--------------------------------------------------------------------+------------| +| supportsInterface(bytes4) | 01ffc9a7 | +|--------------------------------------------------------------------+------------| +| updateDelay(uint256) | 64d62353 | +╰--------------------------------------------------------------------+------------╯ + diff --git a/test/signatures/L1ArbitrumToken b/test/signatures/L1ArbitrumToken index 12b0d363e..2f05abbe4 100644 --- a/test/signatures/L1ArbitrumToken +++ b/test/signatures/L1ArbitrumToken @@ -1,25 +1,51 @@ -{ - "DOMAIN_SEPARATOR()": "3644e515", - "allowance(address,address)": "dd62ed3e", - "approve(address,uint256)": "095ea7b3", - "arbOneGateway()": "eaeb679b", - "balanceOf(address)": "70a08231", - "bridgeBurn(address,uint256)": "74f4f547", - "bridgeMint(address,uint256)": "8c2a993e", - "decimals()": "313ce567", - "decreaseAllowance(address,uint256)": "a457c2d7", - "increaseAllowance(address,uint256)": "39509351", - "initialize(address,address,address)": "c0c53b8b", - "isArbitrumEnabled()": "8e5f5ad1", - "name()": "06fdde03", - "nonces(address)": "7ecebe00", - "novaGateway()": "04e48887", - "novaRouter()": "0cf2e808", - "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": "d505accf", - "registerTokenOnL2((address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,address))": "67d71a32", - "symbol()": "95d89b41", - "totalSupply()": "18160ddd", - "transfer(address,uint256)": "a9059cbb", - "transferAndCall(address,uint256,bytes)": "4000aea0", - "transferFrom(address,address,uint256)": "23b872dd" -} + +╭----------------------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++===========================================================================================================+ +| DOMAIN_SEPARATOR() | 3644e515 | +|----------------------------------------------------------------------------------------------+------------| +| allowance(address,address) | dd62ed3e | +|----------------------------------------------------------------------------------------------+------------| +| approve(address,uint256) | 095ea7b3 | +|----------------------------------------------------------------------------------------------+------------| +| arbOneGateway() | eaeb679b | +|----------------------------------------------------------------------------------------------+------------| +| balanceOf(address) | 70a08231 | +|----------------------------------------------------------------------------------------------+------------| +| bridgeBurn(address,uint256) | 74f4f547 | +|----------------------------------------------------------------------------------------------+------------| +| bridgeMint(address,uint256) | 8c2a993e | +|----------------------------------------------------------------------------------------------+------------| +| decimals() | 313ce567 | +|----------------------------------------------------------------------------------------------+------------| +| decreaseAllowance(address,uint256) | a457c2d7 | +|----------------------------------------------------------------------------------------------+------------| +| increaseAllowance(address,uint256) | 39509351 | +|----------------------------------------------------------------------------------------------+------------| +| initialize(address,address,address) | c0c53b8b | +|----------------------------------------------------------------------------------------------+------------| +| isArbitrumEnabled() | 8e5f5ad1 | +|----------------------------------------------------------------------------------------------+------------| +| name() | 06fdde03 | +|----------------------------------------------------------------------------------------------+------------| +| nonces(address) | 7ecebe00 | +|----------------------------------------------------------------------------------------------+------------| +| novaGateway() | 04e48887 | +|----------------------------------------------------------------------------------------------+------------| +| novaRouter() | 0cf2e808 | +|----------------------------------------------------------------------------------------------+------------| +| permit(address,address,uint256,uint256,uint8,bytes32,bytes32) | d505accf | +|----------------------------------------------------------------------------------------------+------------| +| registerTokenOnL2((address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,address)) | 67d71a32 | +|----------------------------------------------------------------------------------------------+------------| +| symbol() | 95d89b41 | +|----------------------------------------------------------------------------------------------+------------| +| totalSupply() | 18160ddd | +|----------------------------------------------------------------------------------------------+------------| +| transfer(address,uint256) | a9059cbb | +|----------------------------------------------------------------------------------------------+------------| +| transferAndCall(address,uint256,bytes) | 4000aea0 | +|----------------------------------------------------------------------------------------------+------------| +| transferFrom(address,address,uint256) | 23b872dd | +╰----------------------------------------------------------------------------------------------+------------╯ + diff --git a/test/signatures/L2ArbitrumGovernor b/test/signatures/L2ArbitrumGovernor index 630d36fea..db1263e36 100644 --- a/test/signatures/L2ArbitrumGovernor +++ b/test/signatures/L2ArbitrumGovernor @@ -1,51 +1,103 @@ -{ - "BALLOT_TYPEHASH()": "deaaa7cc", - "COUNTING_MODE()": "dd4e2ba5", - "EXCLUDE_ADDRESS()": "5e12ebbd", - "EXTENDED_BALLOT_TYPEHASH()": "2fe3e261", - "castVote(uint256,uint8)": "56781388", - "castVoteBySig(uint256,uint8,uint8,bytes32,bytes32)": "3bccf4fd", - "castVoteWithReason(uint256,uint8,string)": "7b3c71d3", - "castVoteWithReasonAndParams(uint256,uint8,string,bytes)": "5f398a14", - "castVoteWithReasonAndParamsBySig(uint256,uint8,string,bytes,uint8,bytes32,bytes32)": "03420181", - "execute(address[],uint256[],bytes[],bytes32)": "2656227d", - "getPastCirculatingSupply(uint256)": "6e462680", - "getVotes(address,uint256)": "eb9019d4", - "getVotesWithParams(address,uint256,bytes)": "9a802a6d", - "hasVoted(uint256,address)": "43859632", - "hashProposal(address[],uint256[],bytes[],bytes32)": "c59057e4", - "initialize(address,address,address,uint256,uint256,uint256,uint256,uint64)": "5b447a57", - "lateQuorumVoteExtension()": "32b8113e", - "name()": "06fdde03", - "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)": "bc197c81", - "onERC1155Received(address,address,uint256,uint256,bytes)": "f23a6e61", - "onERC721Received(address,address,uint256,bytes)": "150b7a02", - "owner()": "8da5cb5b", - "proposalDeadline(uint256)": "c01f9e37", - "proposalEta(uint256)": "ab58fb8e", - "proposalSnapshot(uint256)": "2d63f693", - "proposalThreshold()": "b58131b0", - "proposalVotes(uint256)": "544ffc9c", - "propose(address[],uint256[],bytes[],string)": "7d5e81e2", - "queue(address[],uint256[],bytes[],bytes32)": "160cbed7", - "quorum(uint256)": "f8ce560a", - "quorumDenominator()": "97c3d334", - "quorumNumerator()": "a7713a70", - "quorumNumerator(uint256)": "60c4247f", - "relay(address,uint256,bytes)": "c28bc2fa", - "renounceOwnership()": "715018a6", - "setLateQuorumVoteExtension(uint64)": "d07f91e9", - "setProposalThreshold(uint256)": "ece40cc1", - "setVotingDelay(uint256)": "70b0f660", - "setVotingPeriod(uint256)": "ea0217cf", - "state(uint256)": "3e4f49e6", - "supportsInterface(bytes4)": "01ffc9a7", - "timelock()": "d33219b4", - "token()": "fc0c546a", - "transferOwnership(address)": "f2fde38b", - "updateQuorumNumerator(uint256)": "06f3f9e6", - "updateTimelock(address)": "a890c910", - "version()": "54fd4d50", - "votingDelay()": "3932abb1", - "votingPeriod()": "02a251a3" -} + +╭------------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++=================================================================================================+ +| BALLOT_TYPEHASH() | deaaa7cc | +|------------------------------------------------------------------------------------+------------| +| COUNTING_MODE() | dd4e2ba5 | +|------------------------------------------------------------------------------------+------------| +| EXCLUDE_ADDRESS() | 5e12ebbd | +|------------------------------------------------------------------------------------+------------| +| EXTENDED_BALLOT_TYPEHASH() | 2fe3e261 | +|------------------------------------------------------------------------------------+------------| +| castVote(uint256,uint8) | 56781388 | +|------------------------------------------------------------------------------------+------------| +| castVoteBySig(uint256,uint8,uint8,bytes32,bytes32) | 3bccf4fd | +|------------------------------------------------------------------------------------+------------| +| castVoteWithReason(uint256,uint8,string) | 7b3c71d3 | +|------------------------------------------------------------------------------------+------------| +| castVoteWithReasonAndParams(uint256,uint8,string,bytes) | 5f398a14 | +|------------------------------------------------------------------------------------+------------| +| castVoteWithReasonAndParamsBySig(uint256,uint8,string,bytes,uint8,bytes32,bytes32) | 03420181 | +|------------------------------------------------------------------------------------+------------| +| execute(address[],uint256[],bytes[],bytes32) | 2656227d | +|------------------------------------------------------------------------------------+------------| +| getPastCirculatingSupply(uint256) | 6e462680 | +|------------------------------------------------------------------------------------+------------| +| getVotes(address,uint256) | eb9019d4 | +|------------------------------------------------------------------------------------+------------| +| getVotesWithParams(address,uint256,bytes) | 9a802a6d | +|------------------------------------------------------------------------------------+------------| +| hasVoted(uint256,address) | 43859632 | +|------------------------------------------------------------------------------------+------------| +| hashProposal(address[],uint256[],bytes[],bytes32) | c59057e4 | +|------------------------------------------------------------------------------------+------------| +| initialize(address,address,address,uint256,uint256,uint256,uint256,uint64) | 5b447a57 | +|------------------------------------------------------------------------------------+------------| +| lateQuorumVoteExtension() | 32b8113e | +|------------------------------------------------------------------------------------+------------| +| name() | 06fdde03 | +|------------------------------------------------------------------------------------+------------| +| onERC1155BatchReceived(address,address,uint256[],uint256[],bytes) | bc197c81 | +|------------------------------------------------------------------------------------+------------| +| onERC1155Received(address,address,uint256,uint256,bytes) | f23a6e61 | +|------------------------------------------------------------------------------------+------------| +| onERC721Received(address,address,uint256,bytes) | 150b7a02 | +|------------------------------------------------------------------------------------+------------| +| owner() | 8da5cb5b | +|------------------------------------------------------------------------------------+------------| +| proposalDeadline(uint256) | c01f9e37 | +|------------------------------------------------------------------------------------+------------| +| proposalEta(uint256) | ab58fb8e | +|------------------------------------------------------------------------------------+------------| +| proposalSnapshot(uint256) | 2d63f693 | +|------------------------------------------------------------------------------------+------------| +| proposalThreshold() | b58131b0 | +|------------------------------------------------------------------------------------+------------| +| proposalVotes(uint256) | 544ffc9c | +|------------------------------------------------------------------------------------+------------| +| propose(address[],uint256[],bytes[],string) | 7d5e81e2 | +|------------------------------------------------------------------------------------+------------| +| queue(address[],uint256[],bytes[],bytes32) | 160cbed7 | +|------------------------------------------------------------------------------------+------------| +| quorum(uint256) | f8ce560a | +|------------------------------------------------------------------------------------+------------| +| quorumDenominator() | 97c3d334 | +|------------------------------------------------------------------------------------+------------| +| quorumNumerator() | a7713a70 | +|------------------------------------------------------------------------------------+------------| +| quorumNumerator(uint256) | 60c4247f | +|------------------------------------------------------------------------------------+------------| +| relay(address,uint256,bytes) | c28bc2fa | +|------------------------------------------------------------------------------------+------------| +| renounceOwnership() | 715018a6 | +|------------------------------------------------------------------------------------+------------| +| setLateQuorumVoteExtension(uint64) | d07f91e9 | +|------------------------------------------------------------------------------------+------------| +| setProposalThreshold(uint256) | ece40cc1 | +|------------------------------------------------------------------------------------+------------| +| setVotingDelay(uint256) | 70b0f660 | +|------------------------------------------------------------------------------------+------------| +| setVotingPeriod(uint256) | ea0217cf | +|------------------------------------------------------------------------------------+------------| +| state(uint256) | 3e4f49e6 | +|------------------------------------------------------------------------------------+------------| +| supportsInterface(bytes4) | 01ffc9a7 | +|------------------------------------------------------------------------------------+------------| +| timelock() | d33219b4 | +|------------------------------------------------------------------------------------+------------| +| token() | fc0c546a | +|------------------------------------------------------------------------------------+------------| +| transferOwnership(address) | f2fde38b | +|------------------------------------------------------------------------------------+------------| +| updateQuorumNumerator(uint256) | 06f3f9e6 | +|------------------------------------------------------------------------------------+------------| +| updateTimelock(address) | a890c910 | +|------------------------------------------------------------------------------------+------------| +| version() | 54fd4d50 | +|------------------------------------------------------------------------------------+------------| +| votingDelay() | 3932abb1 | +|------------------------------------------------------------------------------------+------------| +| votingPeriod() | 02a251a3 | +╰------------------------------------------------------------------------------------+------------╯ + diff --git a/test/signatures/L2ArbitrumToken b/test/signatures/L2ArbitrumToken index 3d9c8b840..e2ecfc269 100644 --- a/test/signatures/L2ArbitrumToken +++ b/test/signatures/L2ArbitrumToken @@ -1,37 +1,75 @@ -{ - "DOMAIN_SEPARATOR()": "3644e515", - "MINT_CAP_DENOMINATOR()": "89110e5d", - "MINT_CAP_NUMERATOR()": "e6be4876", - "MIN_MINT_INTERVAL()": "a9f8ad04", - "allowance(address,address)": "dd62ed3e", - "approve(address,uint256)": "095ea7b3", - "balanceOf(address)": "70a08231", - "burn(uint256)": "42966c68", - "burnFrom(address,uint256)": "79cc6790", - "checkpoints(address,uint32)": "f1127ed8", - "decimals()": "313ce567", - "decreaseAllowance(address,uint256)": "a457c2d7", - "delegate(address)": "5c19a95c", - "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": "c3cda520", - "delegates(address)": "587cde1e", - "getPastTotalSupply(uint256)": "8e539e8c", - "getPastVotes(address,uint256)": "3a46b1a8", - "getVotes(address)": "9ab24eb0", - "increaseAllowance(address,uint256)": "39509351", - "initialize(address,uint256,address)": "c350a1b5", - "l1Address()": "c2eeeebd", - "mint(address,uint256)": "40c10f19", - "name()": "06fdde03", - "nextMint()": "cf665443", - "nonces(address)": "7ecebe00", - "numCheckpoints(address)": "6fcfff45", - "owner()": "8da5cb5b", - "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": "d505accf", - "renounceOwnership()": "715018a6", - "symbol()": "95d89b41", - "totalSupply()": "18160ddd", - "transfer(address,uint256)": "a9059cbb", - "transferAndCall(address,uint256,bytes)": "4000aea0", - "transferFrom(address,address,uint256)": "23b872dd", - "transferOwnership(address)": "f2fde38b" -} + +╭---------------------------------------------------------------+------------╮ +| Method | Identifier | ++============================================================================+ +| DOMAIN_SEPARATOR() | 3644e515 | +|---------------------------------------------------------------+------------| +| MINT_CAP_DENOMINATOR() | 89110e5d | +|---------------------------------------------------------------+------------| +| MINT_CAP_NUMERATOR() | e6be4876 | +|---------------------------------------------------------------+------------| +| MIN_MINT_INTERVAL() | a9f8ad04 | +|---------------------------------------------------------------+------------| +| allowance(address,address) | dd62ed3e | +|---------------------------------------------------------------+------------| +| approve(address,uint256) | 095ea7b3 | +|---------------------------------------------------------------+------------| +| balanceOf(address) | 70a08231 | +|---------------------------------------------------------------+------------| +| burn(uint256) | 42966c68 | +|---------------------------------------------------------------+------------| +| burnFrom(address,uint256) | 79cc6790 | +|---------------------------------------------------------------+------------| +| checkpoints(address,uint32) | f1127ed8 | +|---------------------------------------------------------------+------------| +| decimals() | 313ce567 | +|---------------------------------------------------------------+------------| +| decreaseAllowance(address,uint256) | a457c2d7 | +|---------------------------------------------------------------+------------| +| delegate(address) | 5c19a95c | +|---------------------------------------------------------------+------------| +| delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32) | c3cda520 | +|---------------------------------------------------------------+------------| +| delegates(address) | 587cde1e | +|---------------------------------------------------------------+------------| +| getPastTotalSupply(uint256) | 8e539e8c | +|---------------------------------------------------------------+------------| +| getPastVotes(address,uint256) | 3a46b1a8 | +|---------------------------------------------------------------+------------| +| getVotes(address) | 9ab24eb0 | +|---------------------------------------------------------------+------------| +| increaseAllowance(address,uint256) | 39509351 | +|---------------------------------------------------------------+------------| +| initialize(address,uint256,address) | c350a1b5 | +|---------------------------------------------------------------+------------| +| l1Address() | c2eeeebd | +|---------------------------------------------------------------+------------| +| mint(address,uint256) | 40c10f19 | +|---------------------------------------------------------------+------------| +| name() | 06fdde03 | +|---------------------------------------------------------------+------------| +| nextMint() | cf665443 | +|---------------------------------------------------------------+------------| +| nonces(address) | 7ecebe00 | +|---------------------------------------------------------------+------------| +| numCheckpoints(address) | 6fcfff45 | +|---------------------------------------------------------------+------------| +| owner() | 8da5cb5b | +|---------------------------------------------------------------+------------| +| permit(address,address,uint256,uint256,uint8,bytes32,bytes32) | d505accf | +|---------------------------------------------------------------+------------| +| renounceOwnership() | 715018a6 | +|---------------------------------------------------------------+------------| +| symbol() | 95d89b41 | +|---------------------------------------------------------------+------------| +| totalSupply() | 18160ddd | +|---------------------------------------------------------------+------------| +| transfer(address,uint256) | a9059cbb | +|---------------------------------------------------------------+------------| +| transferAndCall(address,uint256,bytes) | 4000aea0 | +|---------------------------------------------------------------+------------| +| transferFrom(address,address,uint256) | 23b872dd | +|---------------------------------------------------------------+------------| +| transferOwnership(address) | f2fde38b | +╰---------------------------------------------------------------+------------╯ + diff --git a/test/signatures/SecurityCouncilManager b/test/signatures/SecurityCouncilManager index 236167096..025a874f4 100644 --- a/test/signatures/SecurityCouncilManager +++ b/test/signatures/SecurityCouncilManager @@ -1,55 +1,111 @@ -{ - "COHORT_REPLACER_ROLE()": "279684e2", - "DEFAULT_ADMIN_ROLE()": "a217fddf", - "DOMAIN_TYPE_HASH()": "c0993eea", - "MAX_SECURITY_COUNCILS()": "c7b3f5ca", - "MEMBER_ADDER_ROLE()": "ab738506", - "MEMBER_REMOVER_ROLE()": "b8df7c7f", - "MEMBER_REPLACER_ROLE()": "8e8c3210", - "MEMBER_ROTATOR_ROLE()": "903e7ad6", - "MIN_ROTATION_PERIOD_SETTER_ROLE()": "5db9bf4e", - "NAME_HASH()": "04622c2e", - "RETRYABLE_TICKET_MAGIC()": "3994073d", - "ROTATE_MEMBER_TYPE_HASH()": "aea6b1e7", - "SET_ROTATING_TO_TYPE_HASH()": "ff57aaed", - "VERSION_HASH()": "9e4e7318", - "addMember(address,uint8)": "62d0d1c3", - "addSecurityCouncil((address,address,uint256))": "6eaff79e", - "cohortIncludes(uint8,address)": "f5f4fde0", - "cohortSize()": "c6db8129", - "firstCohortIncludes(address)": "53901f8f", - "generateSalt(address[],uint256)": "927a0380", - "getBothCohorts()": "d0946961", - "getFirstCohort()": "a7b20c29", - "getRoleAdmin(bytes32)": "248a9ca3", - "getRotateMemberHash(address,uint256)": "09af9e5f", - "getScheduleUpdateInnerData(uint256)": "8bbd5149", - "getSecondCohort()": "bdc9f17c", - "getSetRotatingToHash(address,uint256)": "2bf9dbfe", - "grantRole(bytes32,address)": "2f2ff15d", - "hasRole(bytes32,address)": "91d14854", - "initialize(address[],address[],(address,address,uint256)[],(address,address,address,address[],address,address,address),address,address,uint256)": "caa33e24", - "l2CoreGovTimelock()": "eea3e4d4", - "lastRotated(address)": "64f747b6", - "minRotationPeriod()": "cfc02946", - "postUpgradeInit(uint256,address)": "c50e68a0", - "removeMember(address)": "0b1ca49a", - "removeSecurityCouncil((address,address,uint256))": "60052890", - "renounceRole(bytes32,address)": "36568abe", - "replaceCohort(address[],uint8)": "b9862f27", - "replaceMember(address,address)": "e577e32e", - "revokeRole(bytes32,address)": "d547741f", - "rotateMember(address,address,bytes)": "02ea6df4", - "rotatedTo(address)": "86bc77a3", - "rotatingTo(address)": "cd6150a4", - "rotationNonce(address)": "ac823694", - "router()": "f887ea40", - "secondCohortIncludes(address)": "e9d9f048", - "securityCouncils(uint256)": "bef3f745", - "securityCouncilsLength()": "7889acb2", - "setMinRotationPeriod(uint256)": "d4c271b2", - "setRotatingTo(address,bytes)": "62cd078d", - "setUpgradeExecRouteBuilder(address)": "0e5e43d7", - "supportsInterface(bytes4)": "01ffc9a7", - "updateNonce()": "0feca68a" -} + +╭-------------------------------------------------------------------------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++==============================================================================================================================================================+ +| COHORT_REPLACER_ROLE() | 279684e2 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| DEFAULT_ADMIN_ROLE() | a217fddf | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| DOMAIN_TYPE_HASH() | c0993eea | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| MAX_SECURITY_COUNCILS() | c7b3f5ca | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| MEMBER_ADDER_ROLE() | ab738506 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| MEMBER_REMOVER_ROLE() | b8df7c7f | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| MEMBER_REPLACER_ROLE() | 8e8c3210 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| MEMBER_ROTATOR_ROLE() | 903e7ad6 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| MIN_ROTATION_PERIOD_SETTER_ROLE() | 5db9bf4e | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| NAME_HASH() | 04622c2e | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| RETRYABLE_TICKET_MAGIC() | 3994073d | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| ROTATE_MEMBER_TYPE_HASH() | aea6b1e7 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| SET_ROTATING_TO_TYPE_HASH() | ff57aaed | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| VERSION_HASH() | 9e4e7318 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| addMember(address,uint8) | 62d0d1c3 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| addSecurityCouncil((address,address,uint256)) | 6eaff79e | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| cohortIncludes(uint8,address) | f5f4fde0 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| cohortSize() | c6db8129 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| firstCohortIncludes(address) | 53901f8f | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| generateSalt(address[],uint256) | 927a0380 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getBothCohorts() | d0946961 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getFirstCohort() | a7b20c29 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getRoleAdmin(bytes32) | 248a9ca3 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getRotateMemberHash(address,uint256) | 09af9e5f | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getScheduleUpdateInnerData(uint256) | 8bbd5149 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getSecondCohort() | bdc9f17c | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getSetRotatingToHash(address,uint256) | 2bf9dbfe | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| grantRole(bytes32,address) | 2f2ff15d | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| hasRole(bytes32,address) | 91d14854 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| initialize(address[],address[],(address,address,uint256)[],(address,address,address,address[],address,address,address),address,address,uint256) | caa33e24 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| l2CoreGovTimelock() | eea3e4d4 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| lastRotated(address) | 64f747b6 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| minRotationPeriod() | cfc02946 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| postUpgradeInit(uint256,address) | c50e68a0 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| removeMember(address) | 0b1ca49a | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| removeSecurityCouncil((address,address,uint256)) | 60052890 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| renounceRole(bytes32,address) | 36568abe | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| replaceCohort(address[],uint8) | b9862f27 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| replaceMember(address,address) | e577e32e | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| revokeRole(bytes32,address) | d547741f | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| rotateMember(address,address,bytes) | 02ea6df4 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| rotatedTo(address) | 86bc77a3 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| rotatingTo(address) | cd6150a4 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| rotationNonce(address) | ac823694 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| router() | f887ea40 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| secondCohortIncludes(address) | e9d9f048 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| securityCouncils(uint256) | bef3f745 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| securityCouncilsLength() | 7889acb2 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| setMinRotationPeriod(uint256) | d4c271b2 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| setRotatingTo(address,bytes) | 62cd078d | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| setUpgradeExecRouteBuilder(address) | 0e5e43d7 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| supportsInterface(bytes4) | 01ffc9a7 | +|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| updateNonce() | 0feca68a | +╰-------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ + diff --git a/test/signatures/SecurityCouncilMemberElectionGovernor b/test/signatures/SecurityCouncilMemberElectionGovernor index 44944ec83..3f74e1541 100644 --- a/test/signatures/SecurityCouncilMemberElectionGovernor +++ b/test/signatures/SecurityCouncilMemberElectionGovernor @@ -1,53 +1,107 @@ -{ - "BALLOT_TYPEHASH()": "deaaa7cc", - "COUNTING_MODE()": "dd4e2ba5", - "EXTENDED_BALLOT_TYPEHASH()": "2fe3e261", - "castVote(uint256,uint8)": "56781388", - "castVoteBySig(uint256,uint8,uint8,bytes32,bytes32)": "3bccf4fd", - "castVoteWithReason(uint256,uint8,string)": "7b3c71d3", - "castVoteWithReasonAndParams(uint256,uint8,string,bytes)": "5f398a14", - "castVoteWithReasonAndParamsBySig(uint256,uint8,string,bytes,uint8,bytes32,bytes32)": "03420181", - "electionIndexToCohort(uint256)": "33bb6f4b", - "electionIndexToDescription(uint256)": "276ae91a", - "execute(address[],uint256[],bytes[],bytes32)": "2656227d", - "fullWeightDuration()": "d63e9c67", - "fullWeightVotingDeadline(uint256)": "03da91f9", - "getProposeArgs(uint256)": "1f0ac182", - "getVotes(address,uint256)": "eb9019d4", - "getVotesWithParams(address,uint256,bytes)": "9a802a6d", - "hasVoted(uint256,address)": "43859632", - "hashProposal(address[],uint256[],bytes[],bytes32)": "c59057e4", - "initialize(address,address,address,address,uint256,uint256)": "d7c41c79", - "name()": "06fdde03", - "nomineeElectionGovernor()": "a6b2a892", - "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)": "bc197c81", - "onERC1155Received(address,address,uint256,uint256,bytes)": "f23a6e61", - "onERC721Received(address,address,uint256,bytes)": "150b7a02", - "owner()": "8da5cb5b", - "proposalDeadline(uint256)": "c01f9e37", - "proposalSnapshot(uint256)": "2d63f693", - "proposalThreshold()": "b58131b0", - "propose(address[],uint256[],bytes[],string)": "7d5e81e2", - "proposeFromNomineeElectionGovernor(uint256)": "f2ff01e6", - "quorum(uint256)": "f8ce560a", - "relay(address,uint256,bytes)": "c28bc2fa", - "renounceOwnership()": "715018a6", - "securityCouncilManager()": "03d1ce8a", - "selectTopNominees(address[],uint240[],uint256)": "9a9d6102", - "setFullWeightDuration(uint256)": "1395bfcd", - "setProposalThreshold(uint256)": "ece40cc1", - "setVotingDelay(uint256)": "70b0f660", - "setVotingPeriod(uint256)": "ea0217cf", - "state(uint256)": "3e4f49e6", - "supportsInterface(bytes4)": "01ffc9a7", - "token()": "fc0c546a", - "topNominees(uint256)": "b8f9270b", - "transferOwnership(address)": "f2fde38b", - "usedNonces(bytes32)": "feb61724", - "version()": "54fd4d50", - "votesToWeight(uint256,uint256,uint256)": "5fdef9d5", - "votesUsed(uint256,address)": "9523730e", - "votingDelay()": "3932abb1", - "votingPeriod()": "02a251a3", - "weightReceived(uint256,address)": "d39fb128" -} + +╭------------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++=================================================================================================+ +| BALLOT_TYPEHASH() | deaaa7cc | +|------------------------------------------------------------------------------------+------------| +| COUNTING_MODE() | dd4e2ba5 | +|------------------------------------------------------------------------------------+------------| +| EXTENDED_BALLOT_TYPEHASH() | 2fe3e261 | +|------------------------------------------------------------------------------------+------------| +| castVote(uint256,uint8) | 56781388 | +|------------------------------------------------------------------------------------+------------| +| castVoteBySig(uint256,uint8,uint8,bytes32,bytes32) | 3bccf4fd | +|------------------------------------------------------------------------------------+------------| +| castVoteWithReason(uint256,uint8,string) | 7b3c71d3 | +|------------------------------------------------------------------------------------+------------| +| castVoteWithReasonAndParams(uint256,uint8,string,bytes) | 5f398a14 | +|------------------------------------------------------------------------------------+------------| +| castVoteWithReasonAndParamsBySig(uint256,uint8,string,bytes,uint8,bytes32,bytes32) | 03420181 | +|------------------------------------------------------------------------------------+------------| +| electionIndexToCohort(uint256) | 33bb6f4b | +|------------------------------------------------------------------------------------+------------| +| electionIndexToDescription(uint256) | 276ae91a | +|------------------------------------------------------------------------------------+------------| +| execute(address[],uint256[],bytes[],bytes32) | 2656227d | +|------------------------------------------------------------------------------------+------------| +| fullWeightDuration() | d63e9c67 | +|------------------------------------------------------------------------------------+------------| +| fullWeightVotingDeadline(uint256) | 03da91f9 | +|------------------------------------------------------------------------------------+------------| +| getProposeArgs(uint256) | 1f0ac182 | +|------------------------------------------------------------------------------------+------------| +| getVotes(address,uint256) | eb9019d4 | +|------------------------------------------------------------------------------------+------------| +| getVotesWithParams(address,uint256,bytes) | 9a802a6d | +|------------------------------------------------------------------------------------+------------| +| hasVoted(uint256,address) | 43859632 | +|------------------------------------------------------------------------------------+------------| +| hashProposal(address[],uint256[],bytes[],bytes32) | c59057e4 | +|------------------------------------------------------------------------------------+------------| +| initialize(address,address,address,address,uint256,uint256) | d7c41c79 | +|------------------------------------------------------------------------------------+------------| +| name() | 06fdde03 | +|------------------------------------------------------------------------------------+------------| +| nomineeElectionGovernor() | a6b2a892 | +|------------------------------------------------------------------------------------+------------| +| onERC1155BatchReceived(address,address,uint256[],uint256[],bytes) | bc197c81 | +|------------------------------------------------------------------------------------+------------| +| onERC1155Received(address,address,uint256,uint256,bytes) | f23a6e61 | +|------------------------------------------------------------------------------------+------------| +| onERC721Received(address,address,uint256,bytes) | 150b7a02 | +|------------------------------------------------------------------------------------+------------| +| owner() | 8da5cb5b | +|------------------------------------------------------------------------------------+------------| +| proposalDeadline(uint256) | c01f9e37 | +|------------------------------------------------------------------------------------+------------| +| proposalSnapshot(uint256) | 2d63f693 | +|------------------------------------------------------------------------------------+------------| +| proposalThreshold() | b58131b0 | +|------------------------------------------------------------------------------------+------------| +| propose(address[],uint256[],bytes[],string) | 7d5e81e2 | +|------------------------------------------------------------------------------------+------------| +| proposeFromNomineeElectionGovernor(uint256) | f2ff01e6 | +|------------------------------------------------------------------------------------+------------| +| quorum(uint256) | f8ce560a | +|------------------------------------------------------------------------------------+------------| +| relay(address,uint256,bytes) | c28bc2fa | +|------------------------------------------------------------------------------------+------------| +| renounceOwnership() | 715018a6 | +|------------------------------------------------------------------------------------+------------| +| securityCouncilManager() | 03d1ce8a | +|------------------------------------------------------------------------------------+------------| +| selectTopNominees(address[],uint240[],uint256) | 9a9d6102 | +|------------------------------------------------------------------------------------+------------| +| setFullWeightDuration(uint256) | 1395bfcd | +|------------------------------------------------------------------------------------+------------| +| setProposalThreshold(uint256) | ece40cc1 | +|------------------------------------------------------------------------------------+------------| +| setVotingDelay(uint256) | 70b0f660 | +|------------------------------------------------------------------------------------+------------| +| setVotingPeriod(uint256) | ea0217cf | +|------------------------------------------------------------------------------------+------------| +| state(uint256) | 3e4f49e6 | +|------------------------------------------------------------------------------------+------------| +| supportsInterface(bytes4) | 01ffc9a7 | +|------------------------------------------------------------------------------------+------------| +| token() | fc0c546a | +|------------------------------------------------------------------------------------+------------| +| topNominees(uint256) | b8f9270b | +|------------------------------------------------------------------------------------+------------| +| transferOwnership(address) | f2fde38b | +|------------------------------------------------------------------------------------+------------| +| usedNonces(bytes32) | feb61724 | +|------------------------------------------------------------------------------------+------------| +| version() | 54fd4d50 | +|------------------------------------------------------------------------------------+------------| +| votesToWeight(uint256,uint256,uint256) | 5fdef9d5 | +|------------------------------------------------------------------------------------+------------| +| votesUsed(uint256,address) | 9523730e | +|------------------------------------------------------------------------------------+------------| +| votingDelay() | 3932abb1 | +|------------------------------------------------------------------------------------+------------| +| votingPeriod() | 02a251a3 | +|------------------------------------------------------------------------------------+------------| +| weightReceived(uint256,address) | d39fb128 | +╰------------------------------------------------------------------------------------+------------╯ + diff --git a/test/signatures/SecurityCouncilMemberRemovalGovernor b/test/signatures/SecurityCouncilMemberRemovalGovernor index f30e6c8c3..2154eecbd 100644 --- a/test/signatures/SecurityCouncilMemberRemovalGovernor +++ b/test/signatures/SecurityCouncilMemberRemovalGovernor @@ -1,54 +1,109 @@ -{ - "BALLOT_TYPEHASH()": "deaaa7cc", - "COUNTING_MODE()": "dd4e2ba5", - "EXCLUDE_ADDRESS()": "5e12ebbd", - "EXTENDED_BALLOT_TYPEHASH()": "2fe3e261", - "VOTE_SUCCESS_DENOMINATOR()": "b565aa1f", - "castVote(uint256,uint8)": "56781388", - "castVoteBySig(uint256,uint8,uint8,bytes32,bytes32)": "3bccf4fd", - "castVoteWithReason(uint256,uint8,string)": "7b3c71d3", - "castVoteWithReasonAndParams(uint256,uint8,string,bytes)": "5f398a14", - "castVoteWithReasonAndParamsBySig(uint256,uint8,string,bytes,uint8,bytes32,bytes32)": "03420181", - "execute(address[],uint256[],bytes[],bytes32)": "2656227d", - "getPastCirculatingSupply(uint256)": "6e462680", - "getVotes(address,uint256)": "eb9019d4", - "getVotesWithParams(address,uint256,bytes)": "9a802a6d", - "hasVoted(uint256,address)": "43859632", - "hashProposal(address[],uint256[],bytes[],bytes32)": "c59057e4", - "initialize(uint256,address,address,address,uint256,uint256,uint256,uint256,uint64,uint256)": "3a707fc3", - "lateQuorumVoteExtension()": "32b8113e", - "name()": "06fdde03", - "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)": "bc197c81", - "onERC1155Received(address,address,uint256,uint256,bytes)": "f23a6e61", - "onERC721Received(address,address,uint256,bytes)": "150b7a02", - "owner()": "8da5cb5b", - "proposalDeadline(uint256)": "c01f9e37", - "proposalExpirationBlocks()": "8a897387", - "proposalExpirationDeadline(uint256)": "7ed2a469", - "proposalSnapshot(uint256)": "2d63f693", - "proposalThreshold()": "b58131b0", - "proposalVotes(uint256)": "544ffc9c", - "propose(address[],uint256[],bytes[],string)": "7d5e81e2", - "quorum(uint256)": "f8ce560a", - "quorumDenominator()": "97c3d334", - "quorumNumerator()": "a7713a70", - "quorumNumerator(uint256)": "60c4247f", - "relay(address,uint256,bytes)": "c28bc2fa", - "renounceOwnership()": "715018a6", - "securityCouncilManager()": "03d1ce8a", - "separateSelector(bytes)": "4de20e79", - "setLateQuorumVoteExtension(uint64)": "d07f91e9", - "setProposalThreshold(uint256)": "ece40cc1", - "setVoteSuccessNumerator(uint256)": "b1305218", - "setVotingDelay(uint256)": "70b0f660", - "setVotingPeriod(uint256)": "ea0217cf", - "state(uint256)": "3e4f49e6", - "supportsInterface(bytes4)": "01ffc9a7", - "token()": "fc0c546a", - "transferOwnership(address)": "f2fde38b", - "updateQuorumNumerator(uint256)": "06f3f9e6", - "version()": "54fd4d50", - "voteSuccessNumerator()": "c7bd35b6", - "votingDelay()": "3932abb1", - "votingPeriod()": "02a251a3" -} + +╭--------------------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++=========================================================================================================+ +| BALLOT_TYPEHASH() | deaaa7cc | +|--------------------------------------------------------------------------------------------+------------| +| COUNTING_MODE() | dd4e2ba5 | +|--------------------------------------------------------------------------------------------+------------| +| EXCLUDE_ADDRESS() | 5e12ebbd | +|--------------------------------------------------------------------------------------------+------------| +| EXTENDED_BALLOT_TYPEHASH() | 2fe3e261 | +|--------------------------------------------------------------------------------------------+------------| +| VOTE_SUCCESS_DENOMINATOR() | b565aa1f | +|--------------------------------------------------------------------------------------------+------------| +| castVote(uint256,uint8) | 56781388 | +|--------------------------------------------------------------------------------------------+------------| +| castVoteBySig(uint256,uint8,uint8,bytes32,bytes32) | 3bccf4fd | +|--------------------------------------------------------------------------------------------+------------| +| castVoteWithReason(uint256,uint8,string) | 7b3c71d3 | +|--------------------------------------------------------------------------------------------+------------| +| castVoteWithReasonAndParams(uint256,uint8,string,bytes) | 5f398a14 | +|--------------------------------------------------------------------------------------------+------------| +| castVoteWithReasonAndParamsBySig(uint256,uint8,string,bytes,uint8,bytes32,bytes32) | 03420181 | +|--------------------------------------------------------------------------------------------+------------| +| execute(address[],uint256[],bytes[],bytes32) | 2656227d | +|--------------------------------------------------------------------------------------------+------------| +| getPastCirculatingSupply(uint256) | 6e462680 | +|--------------------------------------------------------------------------------------------+------------| +| getVotes(address,uint256) | eb9019d4 | +|--------------------------------------------------------------------------------------------+------------| +| getVotesWithParams(address,uint256,bytes) | 9a802a6d | +|--------------------------------------------------------------------------------------------+------------| +| hasVoted(uint256,address) | 43859632 | +|--------------------------------------------------------------------------------------------+------------| +| hashProposal(address[],uint256[],bytes[],bytes32) | c59057e4 | +|--------------------------------------------------------------------------------------------+------------| +| initialize(uint256,address,address,address,uint256,uint256,uint256,uint256,uint64,uint256) | 3a707fc3 | +|--------------------------------------------------------------------------------------------+------------| +| lateQuorumVoteExtension() | 32b8113e | +|--------------------------------------------------------------------------------------------+------------| +| name() | 06fdde03 | +|--------------------------------------------------------------------------------------------+------------| +| onERC1155BatchReceived(address,address,uint256[],uint256[],bytes) | bc197c81 | +|--------------------------------------------------------------------------------------------+------------| +| onERC1155Received(address,address,uint256,uint256,bytes) | f23a6e61 | +|--------------------------------------------------------------------------------------------+------------| +| onERC721Received(address,address,uint256,bytes) | 150b7a02 | +|--------------------------------------------------------------------------------------------+------------| +| owner() | 8da5cb5b | +|--------------------------------------------------------------------------------------------+------------| +| proposalDeadline(uint256) | c01f9e37 | +|--------------------------------------------------------------------------------------------+------------| +| proposalExpirationBlocks() | 8a897387 | +|--------------------------------------------------------------------------------------------+------------| +| proposalExpirationDeadline(uint256) | 7ed2a469 | +|--------------------------------------------------------------------------------------------+------------| +| proposalSnapshot(uint256) | 2d63f693 | +|--------------------------------------------------------------------------------------------+------------| +| proposalThreshold() | b58131b0 | +|--------------------------------------------------------------------------------------------+------------| +| proposalVotes(uint256) | 544ffc9c | +|--------------------------------------------------------------------------------------------+------------| +| propose(address[],uint256[],bytes[],string) | 7d5e81e2 | +|--------------------------------------------------------------------------------------------+------------| +| quorum(uint256) | f8ce560a | +|--------------------------------------------------------------------------------------------+------------| +| quorumDenominator() | 97c3d334 | +|--------------------------------------------------------------------------------------------+------------| +| quorumNumerator() | a7713a70 | +|--------------------------------------------------------------------------------------------+------------| +| quorumNumerator(uint256) | 60c4247f | +|--------------------------------------------------------------------------------------------+------------| +| relay(address,uint256,bytes) | c28bc2fa | +|--------------------------------------------------------------------------------------------+------------| +| renounceOwnership() | 715018a6 | +|--------------------------------------------------------------------------------------------+------------| +| securityCouncilManager() | 03d1ce8a | +|--------------------------------------------------------------------------------------------+------------| +| separateSelector(bytes) | 4de20e79 | +|--------------------------------------------------------------------------------------------+------------| +| setLateQuorumVoteExtension(uint64) | d07f91e9 | +|--------------------------------------------------------------------------------------------+------------| +| setProposalThreshold(uint256) | ece40cc1 | +|--------------------------------------------------------------------------------------------+------------| +| setVoteSuccessNumerator(uint256) | b1305218 | +|--------------------------------------------------------------------------------------------+------------| +| setVotingDelay(uint256) | 70b0f660 | +|--------------------------------------------------------------------------------------------+------------| +| setVotingPeriod(uint256) | ea0217cf | +|--------------------------------------------------------------------------------------------+------------| +| state(uint256) | 3e4f49e6 | +|--------------------------------------------------------------------------------------------+------------| +| supportsInterface(bytes4) | 01ffc9a7 | +|--------------------------------------------------------------------------------------------+------------| +| token() | fc0c546a | +|--------------------------------------------------------------------------------------------+------------| +| transferOwnership(address) | f2fde38b | +|--------------------------------------------------------------------------------------------+------------| +| updateQuorumNumerator(uint256) | 06f3f9e6 | +|--------------------------------------------------------------------------------------------+------------| +| version() | 54fd4d50 | +|--------------------------------------------------------------------------------------------+------------| +| voteSuccessNumerator() | c7bd35b6 | +|--------------------------------------------------------------------------------------------+------------| +| votingDelay() | 3932abb1 | +|--------------------------------------------------------------------------------------------+------------| +| votingPeriod() | 02a251a3 | +╰--------------------------------------------------------------------------------------------+------------╯ + diff --git a/test/signatures/SecurityCouncilNomineeElectionGovernor b/test/signatures/SecurityCouncilNomineeElectionGovernor index f39515a33..4e192dc98 100644 --- a/test/signatures/SecurityCouncilNomineeElectionGovernor +++ b/test/signatures/SecurityCouncilNomineeElectionGovernor @@ -1,76 +1,153 @@ -{ - "BALLOT_TYPEHASH()": "deaaa7cc", - "COUNTING_MODE()": "dd4e2ba5", - "EXCLUDE_ADDRESS()": "5e12ebbd", - "EXTENDED_BALLOT_TYPEHASH()": "2fe3e261", - "addContender(uint256)": "140af012", - "addContender(uint256,bytes)": "a8f38759", - "castVote(uint256,uint8)": "56781388", - "castVoteBySig(uint256,uint8,uint8,bytes32,bytes32)": "3bccf4fd", - "castVoteWithReason(uint256,uint8,string)": "7b3c71d3", - "castVoteWithReasonAndParams(uint256,uint8,string,bytes)": "5f398a14", - "castVoteWithReasonAndParamsBySig(uint256,uint8,string,bytes,uint8,bytes32,bytes32)": "03420181", - "compliantNomineeCount(uint256)": "e0c11ff6", - "compliantNominees(uint256)": "f3dfd61c", - "createElection()": "24c2286c", - "currentCohort()": "e0f9c970", - "electionCount()": "997d2830", - "electionIndexToCohort(uint256)": "33bb6f4b", - "electionIndexToDescription(uint256)": "276ae91a", - "electionToTimestamp(uint256)": "c2192dc1", - "excludeNominee(uint256,address)": "e97ada39", - "excludedNomineeCount(uint256)": "b0ee63f2", - "execute(address[],uint256[],bytes[],bytes32)": "2656227d", - "firstNominationStartDate()": "beb28536", - "getPastCirculatingSupply(uint256)": "6e462680", - "getProposeArgs(uint256)": "1f0ac182", - "getVotes(address,uint256)": "eb9019d4", - "getVotesWithParams(address,uint256,bytes)": "9a802a6d", - "hasVoted(uint256,address)": "43859632", - "hashProposal(address[],uint256[],bytes[],bytes32)": "c59057e4", - "includeNominee(uint256,address)": "35334628", - "initialize(((uint256,uint256,uint256,uint256),uint256,address,address,address,address,address,uint256,uint256))": "40e8c5cb", - "isCompliantNominee(uint256,address)": "c16e0ec6", - "isContender(uint256,address)": "eba4b237", - "isExcluded(uint256,address)": "3b158390", - "isNominee(uint256,address)": "7d60af91", - "name()": "06fdde03", - "nomineeCount(uint256)": "e63f88a8", - "nomineeVetter()": "0298ad49", - "nomineeVettingDuration()": "45110965", - "nominees(uint256)": "eec6b91e", - "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)": "bc197c81", - "onERC1155Received(address,address,uint256,uint256,bytes)": "f23a6e61", - "onERC721Received(address,address,uint256,bytes)": "150b7a02", - "otherCohort()": "cf5d27c4", - "owner()": "8da5cb5b", - "proposalDeadline(uint256)": "c01f9e37", - "proposalSnapshot(uint256)": "2d63f693", - "proposalThreshold()": "b58131b0", - "proposalVettingDeadline(uint256)": "2df2c649", - "propose(address[],uint256[],bytes[],string)": "7d5e81e2", - "quorum(uint256)": "f8ce560a", - "quorumDenominator()": "97c3d334", - "quorumNumerator()": "a7713a70", - "quorumNumerator(uint256)": "60c4247f", - "recoverAddContenderMessage(uint256,bytes)": "5a756eaf", - "relay(address,uint256,bytes)": "c28bc2fa", - "renounceOwnership()": "715018a6", - "securityCouncilManager()": "03d1ce8a", - "securityCouncilMemberElectionGovernor()": "1b6a7673", - "setNomineeVetter(address)": "ae8acb5e", - "setProposalThreshold(uint256)": "ece40cc1", - "setVotingDelay(uint256)": "70b0f660", - "setVotingPeriod(uint256)": "ea0217cf", - "state(uint256)": "3e4f49e6", - "supportsInterface(bytes4)": "01ffc9a7", - "token()": "fc0c546a", - "transferOwnership(address)": "f2fde38b", - "updateQuorumNumerator(uint256)": "06f3f9e6", - "usedNonces(bytes32)": "feb61724", - "version()": "54fd4d50", - "votesReceived(uint256,address)": "33dd6bed", - "votesUsed(uint256,address)": "9523730e", - "votingDelay()": "3932abb1", - "votingPeriod()": "02a251a3" -} + +╭-----------------------------------------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++==============================================================================================================================+ +| BALLOT_TYPEHASH() | deaaa7cc | +|-----------------------------------------------------------------------------------------------------------------+------------| +| COUNTING_MODE() | dd4e2ba5 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| EXCLUDE_ADDRESS() | 5e12ebbd | +|-----------------------------------------------------------------------------------------------------------------+------------| +| EXTENDED_BALLOT_TYPEHASH() | 2fe3e261 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| addContender(uint256) | 140af012 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| addContender(uint256,bytes) | a8f38759 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| castVote(uint256,uint8) | 56781388 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| castVoteBySig(uint256,uint8,uint8,bytes32,bytes32) | 3bccf4fd | +|-----------------------------------------------------------------------------------------------------------------+------------| +| castVoteWithReason(uint256,uint8,string) | 7b3c71d3 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| castVoteWithReasonAndParams(uint256,uint8,string,bytes) | 5f398a14 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| castVoteWithReasonAndParamsBySig(uint256,uint8,string,bytes,uint8,bytes32,bytes32) | 03420181 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| compliantNomineeCount(uint256) | e0c11ff6 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| compliantNominees(uint256) | f3dfd61c | +|-----------------------------------------------------------------------------------------------------------------+------------| +| createElection() | 24c2286c | +|-----------------------------------------------------------------------------------------------------------------+------------| +| currentCohort() | e0f9c970 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| electionCount() | 997d2830 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| electionIndexToCohort(uint256) | 33bb6f4b | +|-----------------------------------------------------------------------------------------------------------------+------------| +| electionIndexToDescription(uint256) | 276ae91a | +|-----------------------------------------------------------------------------------------------------------------+------------| +| electionToTimestamp(uint256) | c2192dc1 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| excludeNominee(uint256,address) | e97ada39 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| excludedNomineeCount(uint256) | b0ee63f2 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| execute(address[],uint256[],bytes[],bytes32) | 2656227d | +|-----------------------------------------------------------------------------------------------------------------+------------| +| firstNominationStartDate() | beb28536 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| getPastCirculatingSupply(uint256) | 6e462680 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| getProposeArgs(uint256) | 1f0ac182 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| getVotes(address,uint256) | eb9019d4 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| getVotesWithParams(address,uint256,bytes) | 9a802a6d | +|-----------------------------------------------------------------------------------------------------------------+------------| +| hasVoted(uint256,address) | 43859632 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| hashProposal(address[],uint256[],bytes[],bytes32) | c59057e4 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| includeNominee(uint256,address) | 35334628 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| initialize(((uint256,uint256,uint256,uint256),uint256,address,address,address,address,address,uint256,uint256)) | 40e8c5cb | +|-----------------------------------------------------------------------------------------------------------------+------------| +| isCompliantNominee(uint256,address) | c16e0ec6 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| isContender(uint256,address) | eba4b237 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| isExcluded(uint256,address) | 3b158390 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| isNominee(uint256,address) | 7d60af91 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| name() | 06fdde03 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| nomineeCount(uint256) | e63f88a8 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| nomineeVetter() | 0298ad49 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| nomineeVettingDuration() | 45110965 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| nominees(uint256) | eec6b91e | +|-----------------------------------------------------------------------------------------------------------------+------------| +| onERC1155BatchReceived(address,address,uint256[],uint256[],bytes) | bc197c81 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| onERC1155Received(address,address,uint256,uint256,bytes) | f23a6e61 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| onERC721Received(address,address,uint256,bytes) | 150b7a02 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| otherCohort() | cf5d27c4 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| owner() | 8da5cb5b | +|-----------------------------------------------------------------------------------------------------------------+------------| +| proposalDeadline(uint256) | c01f9e37 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| proposalSnapshot(uint256) | 2d63f693 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| proposalThreshold() | b58131b0 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| proposalVettingDeadline(uint256) | 2df2c649 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| propose(address[],uint256[],bytes[],string) | 7d5e81e2 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| quorum(uint256) | f8ce560a | +|-----------------------------------------------------------------------------------------------------------------+------------| +| quorumDenominator() | 97c3d334 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| quorumNumerator() | a7713a70 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| quorumNumerator(uint256) | 60c4247f | +|-----------------------------------------------------------------------------------------------------------------+------------| +| recoverAddContenderMessage(uint256,bytes) | 5a756eaf | +|-----------------------------------------------------------------------------------------------------------------+------------| +| relay(address,uint256,bytes) | c28bc2fa | +|-----------------------------------------------------------------------------------------------------------------+------------| +| renounceOwnership() | 715018a6 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| securityCouncilManager() | 03d1ce8a | +|-----------------------------------------------------------------------------------------------------------------+------------| +| securityCouncilMemberElectionGovernor() | 1b6a7673 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| setNomineeVetter(address) | ae8acb5e | +|-----------------------------------------------------------------------------------------------------------------+------------| +| setProposalThreshold(uint256) | ece40cc1 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| setVotingDelay(uint256) | 70b0f660 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| setVotingPeriod(uint256) | ea0217cf | +|-----------------------------------------------------------------------------------------------------------------+------------| +| state(uint256) | 3e4f49e6 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| supportsInterface(bytes4) | 01ffc9a7 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| token() | fc0c546a | +|-----------------------------------------------------------------------------------------------------------------+------------| +| transferOwnership(address) | f2fde38b | +|-----------------------------------------------------------------------------------------------------------------+------------| +| updateQuorumNumerator(uint256) | 06f3f9e6 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| usedNonces(bytes32) | feb61724 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| version() | 54fd4d50 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| votesReceived(uint256,address) | 33dd6bed | +|-----------------------------------------------------------------------------------------------------------------+------------| +| votesUsed(uint256,address) | 9523730e | +|-----------------------------------------------------------------------------------------------------------------+------------| +| votingDelay() | 3932abb1 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| votingPeriod() | 02a251a3 | +╰-----------------------------------------------------------------------------------------------------------------+------------╯ + diff --git a/test/signatures/UpgradeExecutor b/test/signatures/UpgradeExecutor index 9ddde1f1b..42683e764 100644 --- a/test/signatures/UpgradeExecutor +++ b/test/signatures/UpgradeExecutor @@ -1,13 +1,27 @@ -{ - "ADMIN_ROLE()": "75b238fc", - "DEFAULT_ADMIN_ROLE()": "a217fddf", - "EXECUTOR_ROLE()": "07bd0265", - "execute(address,bytes)": "1cff79cd", - "getRoleAdmin(bytes32)": "248a9ca3", - "grantRole(bytes32,address)": "2f2ff15d", - "hasRole(bytes32,address)": "91d14854", - "initialize(address,address[])": "946d9204", - "renounceRole(bytes32,address)": "36568abe", - "revokeRole(bytes32,address)": "d547741f", - "supportsInterface(bytes4)": "01ffc9a7" -} + +╭-------------------------------+------------╮ +| Method | Identifier | ++============================================+ +| ADMIN_ROLE() | 75b238fc | +|-------------------------------+------------| +| DEFAULT_ADMIN_ROLE() | a217fddf | +|-------------------------------+------------| +| EXECUTOR_ROLE() | 07bd0265 | +|-------------------------------+------------| +| execute(address,bytes) | 1cff79cd | +|-------------------------------+------------| +| getRoleAdmin(bytes32) | 248a9ca3 | +|-------------------------------+------------| +| grantRole(bytes32,address) | 2f2ff15d | +|-------------------------------+------------| +| hasRole(bytes32,address) | 91d14854 | +|-------------------------------+------------| +| initialize(address,address[]) | 946d9204 | +|-------------------------------+------------| +| renounceRole(bytes32,address) | 36568abe | +|-------------------------------+------------| +| revokeRole(bytes32,address) | d547741f | +|-------------------------------+------------| +| supportsInterface(bytes4) | 01ffc9a7 | +╰-------------------------------+------------╯ + diff --git a/test/storage/test.bash b/test/storage/test.bash index f44578486..2f55781cf 100755 --- a/test/storage/test.bash +++ b/test/storage/test.bash @@ -4,7 +4,7 @@ for CONTRACTNAME in SecurityCouncilManager L1ArbitrumTimelock ArbitrumTimelock L do echo "Checking storage change of $CONTRACTNAME" [ -f "$output_dir/$CONTRACTNAME" ] && mv "$output_dir/$CONTRACTNAME" "$output_dir/$CONTRACTNAME-old" - forge inspect "$CONTRACTNAME" --pretty storage > "$output_dir/$CONTRACTNAME" + forge inspect "$CONTRACTNAME" storage > "$output_dir/$CONTRACTNAME" diff "$output_dir/$CONTRACTNAME-old" "$output_dir/$CONTRACTNAME" if [[ $? != "0" ]] then From e6ea921b546911581f70dea343ca5bbad7ab77b5 Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 3 Mar 2025 22:03:13 +0800 Subject: [PATCH 077/108] fix: workaround different ethers version --- scripts/governanceDeployer.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/governanceDeployer.ts b/scripts/governanceDeployer.ts index 3f3c091d5..7fdc75e59 100644 --- a/scripts/governanceDeployer.ts +++ b/scripts/governanceDeployer.ts @@ -486,15 +486,15 @@ async function deployTokenToNova( const novaTokenLogic = await getOrInitDefault( "novaTokenLogic", novaDeployer, - L2CustomGatewayToken__factory + L2CustomGatewayToken__factory as unknown as TypeChainContractFactoryStatic ); // deploy token proxy const novaTokenProxy = await getOrInit( "novaTokenProxy", novaDeployer, - L2CustomGatewayToken__factory, - async () => { + L2CustomGatewayToken__factory as unknown as TypeChainContractFactoryStatic, + (async () => { const proxy = await new TransparentUpgradeableProxy__factory(novaDeployer).deploy( novaTokenLogic.address, proxyAdmin.address, @@ -512,11 +512,11 @@ async function deployTokenToNova( ) ).wait(); - return novaToken; - } + return novaToken as unknown as Contract; + }) as () => Promise ); - return novaTokenProxy; + return novaTokenProxy as unknown as L2CustomGatewayToken; } async function initL2Governance( From 6b1dda76203aff41bcd0330e1637e8592ea72ea7 Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 11 Mar 2025 18:23:38 +0800 Subject: [PATCH 078/108] fix: use new inspect script --- test/signatures/test-sigs.bash | 18 ++---------------- test/storage/test.bash | 18 ++---------------- 2 files changed, 4 insertions(+), 32 deletions(-) diff --git a/test/signatures/test-sigs.bash b/test/signatures/test-sigs.bash index 951075817..316789aff 100755 --- a/test/signatures/test-sigs.bash +++ b/test/signatures/test-sigs.bash @@ -1,17 +1,3 @@ #!/bin/bash -output_dir="./test/signatures" -for CONTRACTNAME in SecurityCouncilManager L1ArbitrumTimelock ArbitrumTimelock L2ArbitrumGovernor L2ArbitrumToken L1ArbitrumToken FixedDelegateErc20Wallet UpgradeExecutor SecurityCouncilMemberElectionGovernor SecurityCouncilMemberRemovalGovernor SecurityCouncilNomineeElectionGovernor -do - echo "Checking for signature changes in $CONTRACTNAME" - [ -f "$output_dir/$CONTRACTNAME" ] && mv "$output_dir/$CONTRACTNAME" "$output_dir/$CONTRACTNAME-old" - forge inspect "$CONTRACTNAME" methods > "$output_dir/$CONTRACTNAME" - diff "$output_dir/$CONTRACTNAME-old" "$output_dir/$CONTRACTNAME" - if [[ $? != "0" ]] - then - CHANGED=1 - fi -done -if [[ $CHANGED == 1 ]] -then - exit 1 -fi + +./test/util/forge-inspect.bash ./test/signatures methods \ No newline at end of file diff --git a/test/storage/test.bash b/test/storage/test.bash index 79c2c6bc0..8d2519c98 100755 --- a/test/storage/test.bash +++ b/test/storage/test.bash @@ -1,17 +1,3 @@ #!/bin/bash -output_dir="./test/storage" -for CONTRACTNAME in SecurityCouncilManager L1ArbitrumTimelock ArbitrumTimelock L2ArbitrumGovernor L2ArbitrumToken L1ArbitrumToken FixedDelegateErc20Wallet UpgradeExecutor SecurityCouncilMemberElectionGovernor SecurityCouncilMemberRemovalGovernor SecurityCouncilNomineeElectionGovernor -do - echo "Checking storage change of $CONTRACTNAME" - [ -f "$output_dir/$CONTRACTNAME" ] && mv "$output_dir/$CONTRACTNAME" "$output_dir/$CONTRACTNAME-old" - forge inspect "$CONTRACTNAME" storage > "$output_dir/$CONTRACTNAME" - diff "$output_dir/$CONTRACTNAME-old" "$output_dir/$CONTRACTNAME" - if [[ $? != "0" ]] - then - CHANGED=1 - fi -done -if [[ $CHANGED == 1 ]] -then - exit 1 -fi + +./test/util/forge-inspect.bash ./test/storage storage \ No newline at end of file From 99a007aae21c40048b26162a6d11c988c33ba85b Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 11 Mar 2025 18:25:45 +0800 Subject: [PATCH 079/108] chore: update storage --- .../CancelTimelockAndRemoveMemberOAction | 6 ++ test/storage/RotateMembersUpgradeAction | 6 ++ test/storage/SecurityCouncilManager | 43 ++++++++++ .../SecurityCouncilMemberElectionGovernor | 61 ++++++++++++++ .../SecurityCouncilMemberRemovalGovernor | 73 +++++++++++++++++ .../SecurityCouncilNomineeElectionGovernor | 79 +++++++++++++++++++ 6 files changed, 268 insertions(+) create mode 100644 test/storage/CancelTimelockAndRemoveMemberOAction create mode 100644 test/storage/RotateMembersUpgradeAction diff --git a/test/storage/CancelTimelockAndRemoveMemberOAction b/test/storage/CancelTimelockAndRemoveMemberOAction new file mode 100644 index 000000000..1ec5dc079 --- /dev/null +++ b/test/storage/CancelTimelockAndRemoveMemberOAction @@ -0,0 +1,6 @@ + +╭------+------+------+--------+-------+----------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++================================================+ +╰------+------+------+--------+-------+----------╯ + diff --git a/test/storage/RotateMembersUpgradeAction b/test/storage/RotateMembersUpgradeAction new file mode 100644 index 000000000..1ec5dc079 --- /dev/null +++ b/test/storage/RotateMembersUpgradeAction @@ -0,0 +1,6 @@ + +╭------+------+------+--------+-------+----------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++================================================+ +╰------+------+------+--------+-------+----------╯ + diff --git a/test/storage/SecurityCouncilManager b/test/storage/SecurityCouncilManager index e69de29bb..ffd9b0e5c 100644 --- a/test/storage/SecurityCouncilManager +++ b/test/storage/SecurityCouncilManager @@ -0,0 +1,43 @@ + +╭-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++========================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| _initializing | bool | 0 | 1 | 1 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| __gap | uint256[50] | 51 | 0 | 1600 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| _roles | mapping(bytes32 => struct AccessControlUpgradeable.RoleData) | 101 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| __gap | uint256[49] | 102 | 0 | 1568 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| firstCohort | address[] | 151 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| secondCohort | address[] | 152 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| l2CoreGovTimelock | address payable | 153 | 0 | 20 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| securityCouncils | struct SecurityCouncilData[] | 154 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| router | contract UpgradeExecRouteBuilder | 155 | 0 | 20 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| updateNonce | uint256 | 156 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| cohortSize | uint256 | 157 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| lastRotated | mapping(address => uint256) | 158 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| rotatedTo | mapping(address => address) | 159 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| minRotationPeriod | uint256 | 160 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| rotatingTo | mapping(address => address) | 161 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| rotationNonce | mapping(address => uint256) | 162 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| +| __gap | uint256[38] | 163 | 0 | 1216 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +╰-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------╯ + diff --git a/test/storage/SecurityCouncilMemberElectionGovernor b/test/storage/SecurityCouncilMemberElectionGovernor index e69de29bb..987440a85 100644 --- a/test/storage/SecurityCouncilMemberElectionGovernor +++ b/test/storage/SecurityCouncilMemberElectionGovernor @@ -0,0 +1,61 @@ + +╭-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++==========================================================================================================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| _initializing | bool | 0 | 1 | 1 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 51 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| _HASHED_NAME | bytes32 | 101 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| _HASHED_VERSION | bytes32 | 102 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 103 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 153 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| _name | string | 203 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| _proposals | mapping(uint256 => struct GovernorUpgradeable.ProposalCore) | 204 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| _governanceCall | struct DoubleEndedQueueUpgradeable.Bytes32Deque | 205 | 0 | 64 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[46] | 207 | 0 | 1472 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| token | contract IVotesUpgradeable | 253 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 254 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| fullWeightDuration | uint256 | 304 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| _elections | mapping(uint256 => struct SecurityCouncilMemberElectionGovernorCountingUpgradeable.ElectionInfo) | 305 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[48] | 306 | 0 | 1536 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| _votingDelay | uint256 | 354 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| _votingPeriod | uint256 | 355 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| _proposalThreshold | uint256 | 356 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[47] | 357 | 0 | 1504 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| _owner | address | 404 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[49] | 405 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| usedNonces | mapping(bytes32 => bool) | 454 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[49] | 455 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| nomineeElectionGovernor | contract ISecurityCouncilNomineeElectionGovernor | 504 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| securityCouncilManager | contract ISecurityCouncilManager | 505 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +|-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[48] | 506 | 0 | 1536 | src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol:SecurityCouncilMemberElectionGovernor | +╰-------------------------+--------------------------------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------------------------------╯ + diff --git a/test/storage/SecurityCouncilMemberRemovalGovernor b/test/storage/SecurityCouncilMemberRemovalGovernor index e69de29bb..92a73d8d9 100644 --- a/test/storage/SecurityCouncilMemberRemovalGovernor +++ b/test/storage/SecurityCouncilMemberRemovalGovernor @@ -0,0 +1,73 @@ + +╭--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++==================================================================================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _initializing | bool | 0 | 1 | 1 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 51 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _HASHED_NAME | bytes32 | 101 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _HASHED_VERSION | bytes32 | 102 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 103 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 153 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _name | string | 203 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _proposals | mapping(uint256 => struct GovernorUpgradeable.ProposalCore) | 204 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _governanceCall | struct DoubleEndedQueueUpgradeable.Bytes32Deque | 205 | 0 | 64 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[46] | 207 | 0 | 1472 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| token | contract IVotesUpgradeable | 253 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 254 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _voteExtension | uint64 | 304 | 0 | 8 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _extendedDeadlines | mapping(uint256 => struct TimersUpgradeable.BlockNumber) | 305 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[48] | 306 | 0 | 1536 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _proposalVotes | mapping(uint256 => struct GovernorCountingSimpleUpgradeable.ProposalVote) | 354 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[49] | 355 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _quorumNumerator | uint256 | 404 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _quorumNumeratorHistory | struct CheckpointsUpgradeable.History | 405 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[48] | 406 | 0 | 1536 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 454 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _votingDelay | uint256 | 504 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _votingPeriod | uint256 | 505 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _proposalThreshold | uint256 | 506 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[47] | 507 | 0 | 1504 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| proposalExpirationBlocks | uint256 | 554 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[49] | 555 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| _owner | address | 604 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[49] | 605 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| voteSuccessNumerator | uint256 | 654 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| securityCouncilManager | contract ISecurityCouncilManager | 655 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +|--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[48] | 656 | 0 | 1536 | src/security-council-mgmt/governors/SecurityCouncilMemberRemovalGovernor.sol:SecurityCouncilMemberRemovalGovernor | +╰--------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------------------------------------╯ + diff --git a/test/storage/SecurityCouncilNomineeElectionGovernor b/test/storage/SecurityCouncilNomineeElectionGovernor index e69de29bb..235fb7592 100644 --- a/test/storage/SecurityCouncilNomineeElectionGovernor +++ b/test/storage/SecurityCouncilNomineeElectionGovernor @@ -0,0 +1,79 @@ + +╭---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++==========================================================================================================================================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _initializing | bool | 0 | 1 | 1 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 51 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _HASHED_NAME | bytes32 | 101 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _HASHED_VERSION | bytes32 | 102 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 103 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 153 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _name | string | 203 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _proposals | mapping(uint256 => struct GovernorUpgradeable.ProposalCore) | 204 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _governanceCall | struct DoubleEndedQueueUpgradeable.Bytes32Deque | 205 | 0 | 64 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[46] | 207 | 0 | 1472 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| token | contract IVotesUpgradeable | 253 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 254 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _elections | mapping(uint256 => struct SecurityCouncilNomineeElectionGovernorCountingUpgradeable.NomineeElectionCountingInfo) | 304 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[49] | 305 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _quorumNumerator | uint256 | 354 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _quorumNumeratorHistory | struct CheckpointsUpgradeable.History | 355 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[48] | 356 | 0 | 1536 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[50] | 404 | 0 | 1600 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _votingDelay | uint256 | 454 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _votingPeriod | uint256 | 455 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _proposalThreshold | uint256 | 456 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[47] | 457 | 0 | 1504 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _owner | address | 504 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[49] | 505 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| firstNominationStartDate | struct Date | 554 | 0 | 128 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| nomineeVettingDuration | uint256 | 558 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[45] | 559 | 0 | 1440 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| usedNonces | mapping(bytes32 => bool) | 604 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[49] | 605 | 0 | 1568 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| nomineeVetter | address | 654 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| securityCouncilManager | contract ISecurityCouncilManager | 655 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| securityCouncilMemberElectionGovernor | contract ISecurityCouncilMemberElectionGovernor | 656 | 0 | 20 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| electionCount | uint256 | 657 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| _elections | mapping(uint256 => struct SecurityCouncilNomineeElectionGovernor.ElectionInfo) | 658 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[45] | 659 | 0 | 1440 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +╰---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------╯ + From f2f478f20b42b156b87aada8dbc0afd783a453d1 Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 11 Mar 2025 18:26:55 +0800 Subject: [PATCH 080/108] chore: update 4bytes --- .../CancelTimelockAndRemoveMemberOAction | 9 ++++ test/signatures/L2AddressRegistry | 42 +++++++++++-------- test/signatures/L2SecurityCouncilMgmtFactory | 22 +++++----- test/signatures/RotateMembersUpgradeAction | 15 +++++++ 4 files changed, 60 insertions(+), 28 deletions(-) create mode 100644 test/signatures/CancelTimelockAndRemoveMemberOAction create mode 100644 test/signatures/RotateMembersUpgradeAction diff --git a/test/signatures/CancelTimelockAndRemoveMemberOAction b/test/signatures/CancelTimelockAndRemoveMemberOAction new file mode 100644 index 000000000..ffb14b107 --- /dev/null +++ b/test/signatures/CancelTimelockAndRemoveMemberOAction @@ -0,0 +1,9 @@ + +╭--------------------------+------------╮ +| Method | Identifier | ++=======================================+ +| l2AddressRegistry() | 9b491216 | +|--------------------------+------------| +| perform(address,bytes32) | afdb2e38 | +╰--------------------------+------------╯ + diff --git a/test/signatures/L2AddressRegistry b/test/signatures/L2AddressRegistry index a89b23bbc..65339017e 100644 --- a/test/signatures/L2AddressRegistry +++ b/test/signatures/L2AddressRegistry @@ -1,19 +1,27 @@ -╭---------------------------+------------╮ -| Method | Identifier | -+========================================+ -| arbitrumDAOConstitution() | 25efa844 | -|---------------------------+------------| -| coreGov() | c53d7d5c | -|---------------------------+------------| -| coreGovTimelock() | 662e4b50 | -|---------------------------+------------| -| l2ArbitrumToken() | dbbcb30b | -|---------------------------+------------| -| treasuryGov() | 2d475c9a | -|---------------------------+------------| -| treasuryGovTimelock() | 17eb758e | -|---------------------------+------------| -| treasuryWallet() | 4626402b | -╰---------------------------+------------╯ +╭-----------------------------+------------╮ +| Method | Identifier | ++==========================================+ +| arbitrumDAOConstitution() | 25efa844 | +|-----------------------------+------------| +| coreGov() | c53d7d5c | +|-----------------------------+------------| +| coreGovTimelock() | 662e4b50 | +|-----------------------------+------------| +| govProxyAdmin() | 8086e788 | +|-----------------------------+------------| +| l2ArbitrumToken() | dbbcb30b | +|-----------------------------+------------| +| scMemberElectionGovernor() | b249944f | +|-----------------------------+------------| +| scNomineeElectionGovernor() | 033084c9 | +|-----------------------------+------------| +| securityCouncilManager() | 03d1ce8a | +|-----------------------------+------------| +| treasuryGov() | 2d475c9a | +|-----------------------------+------------| +| treasuryGovTimelock() | 17eb758e | +|-----------------------------+------------| +| treasuryWallet() | 4626402b | +╰-----------------------------+------------╯ diff --git a/test/signatures/L2SecurityCouncilMgmtFactory b/test/signatures/L2SecurityCouncilMgmtFactory index 3ae8e88d4..cca23eee6 100644 --- a/test/signatures/L2SecurityCouncilMgmtFactory +++ b/test/signatures/L2SecurityCouncilMgmtFactory @@ -1,13 +1,13 @@ -╭----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╮ -| Method | Identifier | -+=========================================================================================================================================================================================================================================================================================================================================+ -| deploy(((uint256,(address,address))[],address,address,address,address,address[],address[],address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint256,(address,address,uint256)[],(uint256,uint256,uint256,uint256),uint256,address,uint256,uint256,uint256,uint256),(address,address,address,address)) | 22cc2946 | -|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| owner() | 8da5cb5b | -|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| renounceOwnership() | 715018a6 | -|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| transferOwnership(address) | f2fde38b | -╰----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ +╭--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++=========================================================================================================================================================================================================================================================================================================================================================+ +| deploy(((uint256,(address,address))[],address,address,address,address,address[],address[],address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint256,(address,address,uint256)[],(uint256,uint256,uint256,uint256),uint256,address,uint256,uint256,uint256,uint256,uint256,address),(address,address,address,address)) | a7985550 | +|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| owner() | 8da5cb5b | +|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| renounceOwnership() | 715018a6 | +|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| transferOwnership(address) | f2fde38b | +╰--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ diff --git a/test/signatures/RotateMembersUpgradeAction b/test/signatures/RotateMembersUpgradeAction new file mode 100644 index 000000000..d465c78f0 --- /dev/null +++ b/test/signatures/RotateMembersUpgradeAction @@ -0,0 +1,15 @@ + +╭---------------------------+------------╮ +| Method | Identifier | ++========================================+ +| l2AddressRegistry() | 9b491216 | +|---------------------------+------------| +| minRotationPeriod() | cfc02946 | +|---------------------------+------------| +| minRotationPeriodSetter() | 7a5c8992 | +|---------------------------+------------| +| perform() | b147f40c | +|---------------------------+------------| +| secCouncilManagerImpl() | a03700cc | +╰---------------------------+------------╯ + From 97b97e2c9c5ca404526e4d16163f5c266383f496 Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 11 Mar 2025 18:29:23 +0800 Subject: [PATCH 081/108] format: forge fmt --- ...celTimelockAndRemoveMemberActionTest.t.sol | 5 ++-- test/util/ActionTestBase.sol | 29 +++++++++++-------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol b/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol index aef54115f..36dfff13a 100644 --- a/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol +++ b/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol @@ -52,8 +52,9 @@ contract CancelTimelockAndRemoveMemberActionTest is Test { // sign the rotation hash bytes memory sig; { - (uint8 v, bytes32 r, bytes32 s) = - vm.sign(memberInKey, scm.getRotateMemberHash(memberOut, scm.rotationNonce(memberOut))); + (uint8 v, bytes32 r, bytes32 s) = vm.sign( + memberInKey, scm.getRotateMemberHash(memberOut, scm.rotationNonce(memberOut)) + ); sig = abi.encodePacked(r, s, v); } diff --git a/test/util/ActionTestBase.sol b/test/util/ActionTestBase.sol index 642f7c3ad..f34644a49 100644 --- a/test/util/ActionTestBase.sol +++ b/test/util/ActionTestBase.sol @@ -75,9 +75,9 @@ abstract contract ActionTestBase { rollup.transferOwnership(address(ue)); bridge = Bridge(TestUtil.deployProxy(pa, address(new Bridge()))); bridge.initialize(IOwnable(address(rollup))); - si = SequencerInbox(TestUtil.deployProxy(pa, address(new SequencerInbox(117964)))); + si = SequencerInbox(TestUtil.deployProxy(pa, address(new SequencerInbox(117_964)))); si.initialize(bridge, ISequencerInbox.MaxTimeVariation(0, 0, 0, 0)); - inbox = Inbox(TestUtil.deployProxy(pa, address(new Inbox(117964)))); + inbox = Inbox(TestUtil.deployProxy(pa, address(new Inbox(117_964)))); inbox.initialize(bridge, si); l1Timelock = @@ -89,8 +89,12 @@ abstract contract ActionTestBase { l1Timelock.revokeRole(l1Timelock.TIMELOCK_ADMIN_ROLE(), address(l1Timelock)); l1Timelock.revokeRole(l1Timelock.TIMELOCK_ADMIN_ROLE(), address(this)); - addressRegistry = - new _ar.L1AddressRegistry(IInbox(address(inbox)), _ifaces.IL1Timelock(address(l1Timelock)), _ifaces.IL1CustomGateway(address(0)), _ifaces.IL1GatewayRouter(address(0))); + addressRegistry = new _ar.L1AddressRegistry( + IInbox(address(inbox)), + _ifaces.IL1Timelock(address(l1Timelock)), + _ifaces.IL1CustomGateway(address(0)), + _ifaces.IL1GatewayRouter(address(0)) + ); bridgeGetter = _ifaces.IBridgeGetter(address(addressRegistry)); inboxGetter = _ifaces.IInboxGetter(address(addressRegistry)); sequencerInboxGetter = _ifaces.ISequencerInboxGetter(address(addressRegistry)); @@ -131,19 +135,20 @@ abstract contract ActionTestBase { treasuryTimelock.revokeRole(treasuryTimelock.TIMELOCK_ADMIN_ROLE(), address(this)); treasuryGov.initialize(arbOneToken, treasuryTimelock, address(arbOneUe), 7, 8, 600, 60, 60); - treasuryWallet = - FixedDelegateErc20Wallet(TestUtil.deployProxy(pa, address(new FixedDelegateErc20Wallet()))); + treasuryWallet = FixedDelegateErc20Wallet( + TestUtil.deployProxy(pa, address(new FixedDelegateErc20Wallet())) + ); treasuryWallet.initialize( address(arbOneToken), treasuryGov.EXCLUDE_ADDRESS(), address(treasuryTimelock) ); - arbOneAddressRegistry = - new _ar1.L2AddressRegistry( - _ar1.IL2ArbitrumGoverner(address(coreGov)), - _ar1.IL2ArbitrumGoverner(address(treasuryGov)), - _ar1.IFixedDelegateErc20Wallet(address(treasuryWallet)), + arbOneAddressRegistry = new _ar1.L2AddressRegistry( + _ar1.IL2ArbitrumGoverner(address(coreGov)), + _ar1.IL2ArbitrumGoverner(address(treasuryGov)), + _ar1.IFixedDelegateErc20Wallet(address(treasuryWallet)), _ar1.IArbitrumDAOConstitution(address(arbitrumDAOConstitution)), pa, - ISecurityCouncilNomineeElectionGovernor(payable(address(0)))); + ISecurityCouncilNomineeElectionGovernor(payable(address(0))) + ); } } From 7d13573a10054f807945892c6505fd36ed66efbe Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 11 Mar 2025 18:32:03 +0800 Subject: [PATCH 082/108] fmt: more fmt --- src/gov-action-contracts/AIPs/AIPNovaFeeRoutingAction.sol | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gov-action-contracts/AIPs/AIPNovaFeeRoutingAction.sol b/src/gov-action-contracts/AIPs/AIPNovaFeeRoutingAction.sol index 24e51852a..975096019 100644 --- a/src/gov-action-contracts/AIPs/AIPNovaFeeRoutingAction.sol +++ b/src/gov-action-contracts/AIPs/AIPNovaFeeRoutingAction.sol @@ -58,7 +58,9 @@ contract AIPNovaFeeRoutingAction { // upgrade executor should have at least 3 * fullWeight ETH to fund the distributors // we need each of the reward distributors to have at least fullWeight in balance // otherwise we may get NoFundsToDistribute() errors - require(address(this).balance >= 3 * fullWeight, "AIPNovaFeeRoutingAction: insufficient balance"); + require( + address(this).balance >= 3 * fullWeight, "AIPNovaFeeRoutingAction: insufficient balance" + ); _fundDistributor(novaL1SurplusFeeDistr); _fundDistributor(novaL2SurplusFeeDistr); _fundDistributor(novaL2BaseFeeDistr); @@ -134,7 +136,7 @@ contract AIPNovaFeeRoutingAction { } function _fundDistributor(address recipient) internal { - (bool b, ) = recipient.call{value: fullWeight}(""); + (bool b,) = recipient.call{value: fullWeight}(""); require(b, "AIPNovaFeeRoutingAction: funding failed"); } } From bf20d99d7ad2124eeeea452cf3cb137f05fab4ce Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 11 Mar 2025 18:33:32 +0800 Subject: [PATCH 083/108] chore: whitelist yarn audit issue --- audit-ci.jsonc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/audit-ci.jsonc b/audit-ci.jsonc index f734b1320..60b9b3671 100644 --- a/audit-ci.jsonc +++ b/audit-ci.jsonc @@ -97,6 +97,8 @@ // Use of Insufficiently Random Values in undici "GHSA-c76h-2ccp-4975", // Cross-site Scripting (XSS) in serialize-javascript - "GHSA-76p7-773f-r4q5" + "GHSA-76p7-773f-r4q5", + // axios Requests Vulnerable To Possible SSRF and Credential Leakage via Absolute URL + "GHSA-jr5f-v2jv-69x6" ] } \ No newline at end of file From 8231da14cb43afcf56fb34f1e3575a0c9d275add Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 11 Mar 2025 18:34:01 +0800 Subject: [PATCH 084/108] chore: update gas snapshot --- .gas-snapshot | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 07f6545bf..97b8681e0 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -27,7 +27,7 @@ ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 86029203) +E2E:testE2E() (gas: 86028203) FixedDelegateErc20WalletTest:testInit() (gas: 5822585) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) @@ -95,14 +95,14 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28415658) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28364371) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28417242) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28657360) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31757348) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31761579) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26844357) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31759579) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31781044) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31756348) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31760579) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26843357) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31758579) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31780044) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) -OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317076, ~: 317184) +OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 258, μ: 317069, ~: 317184) OfficeHoursActionTest:testInvalidConstructorParameters() (gas: 235740) OfficeHoursActionTest:testPerformBeforeMinimumTimestamp() (gas: 8646) OfficeHoursActionTest:testPerformDuringOfficeHours() (gas: 9140) @@ -127,13 +127,13 @@ SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112296) SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 148550) SecurityCouncilManagerTest:testCohortMethods() (gas: 137958) SecurityCouncilManagerTest:testInitialization() (gas: 206820) -SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5256512) +SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5255512) SecurityCouncilManagerTest:testRemoveMember() (gas: 217162) SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 101612) SecurityCouncilManagerTest:testRemoveMemberRotated() (gas: 422948) SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81486) SecurityCouncilManagerTest:testRemoveSeC() (gas: 38435) -SecurityCouncilManagerTest:testReplaceCohortRotatingTo() (gas: 962400) +SecurityCouncilManagerTest:testReplaceCohortRotatingTo() (gas: 962370) SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 216337) SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 266256) SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 471153) @@ -142,7 +142,7 @@ SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: SecurityCouncilManagerTest:testRotateMember() (gas: 1014991) SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3868444) SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65924) -SecurityCouncilManagerTest:testSetRotatingTo() (gas: 113076) +SecurityCouncilManagerTest:testSetRotatingTo() (gas: 113048) SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83230) SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 327400) SecurityCouncilManagerTest:testUpdateRouter() (gas: 76429) @@ -163,7 +163,7 @@ SecurityCouncilMemberElectionGovernorTest:testOnlyNomineeElectionGovernorCanProp SecurityCouncilMemberElectionGovernorTest:testProperInitialization() (gas: 49388) SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32916) SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42229) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340069, ~: 339927) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 258, μ: 340131, ~: 339928) SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273467) SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34951) SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152898) @@ -216,7 +216,7 @@ SequencerActionsTest:testAddAndRemoveSequencer() (gas: 483532) SequencerActionsTest:testCantAddZeroAddress() (gas: 235614) SetInitialGovParamsActionTest:testL1() (gas: 259904) SetInitialGovParamsActionTest:testL2() (gas: 688955) -SetSequencerInboxMaxTimeVariationAction:testSetMaxTimeVariation() (gas: 374262) +SetSequencerInboxMaxTimeVariationActionTest:testSetMaxTimeVariation() (gas: 374262) SwitchManagerRolesActionTest:testAction() (gas: 6313) TokenDistributorTest:testClaim() (gas: 5742749) TokenDistributorTest:testClaimAndDelegate() (gas: 5850832) From dba2054d1048e94568cac98e2ecbe932b86377e2 Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 14 Mar 2025 02:41:30 +0800 Subject: [PATCH 085/108] chore: new l2AddressRegistry deployment --- files/mainnet/deployedContracts.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/mainnet/deployedContracts.json b/files/mainnet/deployedContracts.json index 6129f6f21..da589a9dc 100644 --- a/files/mainnet/deployedContracts.json +++ b/files/mainnet/deployedContracts.json @@ -31,6 +31,6 @@ "l1ProxyAdmin": "0x5613AF0474EB9c528A34701A5b1662E3C8FA0678", "l1Timelock": "0xE6841D92B0C345144506576eC13ECf5103aC7f49", "l1AddressRegistry": "0xd514C2b3aaBDBfa10800B9C96dc1eB25427520A0", - "l2AddressRegistry":"0x56C4E9Eb6c63aCDD19AeC2b1a00e4f0d7aBda9d3", + "l2AddressRegistry":"0x1dFA102bc097446bb2B836082367991dE24A1c64", "novaL1AddressRegistry":"0x2F06643fc2CC18585Ae790b546388F0DE4Ec6635" } \ No newline at end of file From 207876eb6e26d52c4c56f78defc24a8e24a46c34 Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 14 Mar 2025 02:44:12 +0800 Subject: [PATCH 086/108] chore: sec council rotate payload --- scripts/proposals/sec-council-rotate/data.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 scripts/proposals/sec-council-rotate/data.json diff --git a/scripts/proposals/sec-council-rotate/data.json b/scripts/proposals/sec-council-rotate/data.json new file mode 100644 index 000000000..3560a9fd7 --- /dev/null +++ b/scripts/proposals/sec-council-rotate/data.json @@ -0,0 +1,12 @@ +{ + "actionChainIds": [ + 42161 + ], + "actionAddresses": [ + "0x86E93E21AD108CaE7ADe482C34C230Bfd94D4A8B" + ], + "arbSysSendTxToL1Args": { + "l1Timelock": "0xE6841D92B0C345144506576eC13ECf5103aC7f49", + "calldata": "0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000008e40c6e3e3ea77546fc470efab6a7eb5b3896023b6a7c80fd8a11ea1920a2710000000000000000000000000000000000000000000000000000000000003f4800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001800000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f000000000000000000000000cf57572261c7c2bcf21ffd220ea7d1a27d40a82700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd00000000000000000000000086e93e21ad108cae7ade482c34c230bfd94d4a8b00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } +} \ No newline at end of file From ea13503837702c22bfa33eb14a0e975a2664daa8 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 18 Mar 2025 20:20:42 -0400 Subject: [PATCH 087/108] Small SC Rotation Fixes (#335) * typo * add bash script * fix sigs and storage --- scripts/proposals/sec-council-rotate/generate.bash | 8 ++++++++ .../governance/CancelTimelockAndRemoveMemberAction.sol | 2 +- .../CancelTimelockAndRemoveMemberActionTest.t.sol | 2 +- ...eMemberOAction => CancelTimelockAndRemoveMemberAction} | 0 ...eMemberOAction => CancelTimelockAndRemoveMemberAction} | 0 5 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 scripts/proposals/sec-council-rotate/generate.bash rename test/signatures/{CancelTimelockAndRemoveMemberOAction => CancelTimelockAndRemoveMemberAction} (100%) rename test/storage/{CancelTimelockAndRemoveMemberOAction => CancelTimelockAndRemoveMemberAction} (100%) diff --git a/scripts/proposals/sec-council-rotate/generate.bash b/scripts/proposals/sec-council-rotate/generate.bash new file mode 100755 index 000000000..cffe65b64 --- /dev/null +++ b/scripts/proposals/sec-council-rotate/generate.bash @@ -0,0 +1,8 @@ +#!/bin/bash + +yarn gen:proposalData \ + --govChainProviderRPC https://arb1.arbitrum.io/rpc \ + --actionChainIds 42161 \ + --actionAddresses \ + 0x86E93E21AD108CaE7ADe482C34C230Bfd94D4A8B \ + --writeToJsonPath ./scripts/proposals/sec-council-rotate/data.json \ No newline at end of file diff --git a/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol b/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol index 33a0cb307..0d0c3e6da 100644 --- a/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol +++ b/src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.16; import "../address-registries/L2AddressRegistry.sol"; import "./CancelTimelockOperation.sol"; -contract CancelTimelockAndRemoveMemberOAction { +contract CancelTimelockAndRemoveMemberAction { IL2AddressRegistry public immutable l2AddressRegistry; constructor(IL2AddressRegistry _l2AddressRegistry) { diff --git a/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol b/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol index 36dfff13a..3bc65b930 100644 --- a/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol +++ b/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol @@ -93,7 +93,7 @@ contract CancelTimelockAndRemoveMemberActionTest is Test { } assertTrue(reg.coreGovTimelock().isOperation(proposalId), "Prop does not exist"); - CancelTimelockAndRemoveMemberOAction action = new CancelTimelockAndRemoveMemberOAction(reg); + CancelTimelockAndRemoveMemberAction action = new CancelTimelockAndRemoveMemberAction(reg); vm.prank(council); arbOneUe.execute( address(action), abi.encodeCall(action.perform, (memberToRemove, proposalId)) diff --git a/test/signatures/CancelTimelockAndRemoveMemberOAction b/test/signatures/CancelTimelockAndRemoveMemberAction similarity index 100% rename from test/signatures/CancelTimelockAndRemoveMemberOAction rename to test/signatures/CancelTimelockAndRemoveMemberAction diff --git a/test/storage/CancelTimelockAndRemoveMemberOAction b/test/storage/CancelTimelockAndRemoveMemberAction similarity index 100% rename from test/storage/CancelTimelockAndRemoveMemberOAction rename to test/storage/CancelTimelockAndRemoveMemberAction From 00aa9b5f96d01d7818a38347aba05a3465b0d23e Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Thu, 31 Jul 2025 10:50:12 -0500 Subject: [PATCH 088/108] feat: outgoing members automatically become nominees (#350) * automatically make members nominees * member must add themself as contender before nomination * test auto nomination * fix tests * gas snapshot * test: reelection * chore: update snapshot --------- Co-authored-by: gzeon --- .gas-snapshot | 30 ++++++++--------- ...SecurityCouncilNomineeElectionGovernor.sol | 5 +++ ...curityCouncilNomineeElectionGovernor.t.sol | 33 +++++++++++++++++++ .../governors/TopNomineesGas.t.sol | 1 + 4 files changed, 54 insertions(+), 15 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 6cdb11e5a..1e9c6ec38 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -27,7 +27,7 @@ ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 86427645) +E2E:testE2E() (gas: 86487452) FixedDelegateErc20WalletTest:testInit() (gas: 5822585) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) @@ -95,11 +95,11 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28571182) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28519939) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28572810) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28812928) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32000018) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32004249) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26965169) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32002249) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32023714) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32028304) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32032535) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26993455) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32030535) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32052000) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317059, ~: 317184) @@ -140,7 +140,7 @@ SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 4 SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 479079) SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 270188) SecurityCouncilManagerTest:testRotateMember() (gas: 1016355) -SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3869126) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3891932) SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65924) SecurityCouncilManagerTest:testSetRotatingTo() (gas: 113048) SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83230) @@ -197,17 +197,17 @@ SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 8086867) SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8328313) SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8329174) SecurityCouncilMgmtUtilsTests:testIsInArray() (gas: 2102) -SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 270750) -SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 333730) -SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 296589) +SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 415952) +SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 336423) +SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 299282) SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35278) -SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 582574) +SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 590700) SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 253153) -SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 456505) +SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 459197) SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 677159) -SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 194733) -SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 674020) -SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7256741) +SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 197425) +SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 676717) +SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7285027) SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78113) SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19740) SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42427) diff --git a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol index 0d8e498e1..688eaac3e 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol @@ -245,6 +245,11 @@ contract SecurityCouncilNomineeElectionGovernor is election.isContender[signer] = true; emit ContenderAdded(proposalId, signer); + + // if the signer is part of the outgoing cohort, we automatically add them as a nominee + if (securityCouncilManager.cohortIncludes(currentCohort(), signer)) { + _addNominee(proposalId, signer); + } } /// @notice Allows the owner to change the nomineeVetter diff --git a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol index 7cb019024..c8a086195 100644 --- a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol +++ b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol @@ -248,6 +248,7 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { sig = sigUtils.signAddContenderMessage(proposalId, _contenderPrivKey(0)); // test in other cohort + _mockCohortIncludes(Cohort.FIRST, _contender(0), false); _mockCohortIncludes(Cohort.SECOND, _contender(0), true); vm.expectRevert( abi.encodeWithSelector( @@ -259,6 +260,7 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { governor.addContender(proposalId, sig); // should fail if the proposal is not pending + _mockCohortIncludes(Cohort.FIRST, _contender(0), false); _mockCohortIncludes(Cohort.SECOND, _contender(0), false); vm.roll(governor.proposalSnapshot(proposalId) + 1); assertTrue(governor.state(proposalId) == IGovernorUpgradeable.ProposalState.Active); @@ -277,6 +279,7 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { // check that it correctly mutated the state assertTrue(governor.isContender(proposalId, _contender(0))); + assertFalse(governor.isNominee(proposalId, _contender(0))); // adding again should fail vm.expectRevert( @@ -285,6 +288,35 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { ) ); governor.addContender(proposalId, sig); + + // adding a member up for reelection should succeed and automatically add them as a nominee + _mockCohortIncludes(Cohort.FIRST, _contender(1), true); + _mockCohortIncludes(Cohort.SECOND, _contender(1), false); + sig = sigUtils.signAddContenderMessage(proposalId, _contenderPrivKey(1)); + governor.addContender(proposalId, sig); + + // check that it correctly mutated the state + assertTrue(governor.isContender(proposalId, _contender(1))); + assertTrue(governor.isNominee(proposalId, _contender(1))); + + // reelection member should not be able to receive votes + vm.roll(governor.proposalSnapshot(proposalId) + 1); + _mockGetPastVotes(_voter(0), governor.quorum(proposalId)); + vm.prank(_voter(0)); + vm.expectRevert( + abi.encodeWithSelector( + SecurityCouncilNomineeElectionGovernorCountingUpgradeable + .NomineeAlreadyAdded + .selector, + _contender(1) + ) + ); + governor.castVoteWithReasonAndParams({ + proposalId: proposalId, + support: 1, + reason: "", + params: abi.encode(_contender(1), 1) + }); } function testSetNomineeVetter() public { @@ -917,6 +949,7 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { function _addContender(uint256 proposalId, uint8 contender) internal { uint256 privKey = _contenderPrivKey(contender); address addr = _contender(contender); + _mockCohortIncludes(Cohort.FIRST, addr, false); _mockCohortIncludes(Cohort.SECOND, addr, false); bytes memory sig = sigUtils.signAddContenderMessage(proposalId, privKey); governor.addContender(proposalId, sig); diff --git a/test/security-council-mgmt/governors/TopNomineesGas.t.sol b/test/security-council-mgmt/governors/TopNomineesGas.t.sol index 7e2873e1c..9637283e9 100644 --- a/test/security-council-mgmt/governors/TopNomineesGas.t.sol +++ b/test/security-council-mgmt/governors/TopNomineesGas.t.sol @@ -91,6 +91,7 @@ contract TopNomineesGasTest is Test { // vote for N nominees uint256 quorum = nomineeGov.quorum(proposalId); for (uint16 i = 0; i < N; i++) { + _mockCohortIncludes(Cohort.FIRST, _nominee(i), false); _mockCohortIncludes(Cohort.SECOND, _nominee(i), false); vm.roll(nomineeGov.proposalSnapshot(proposalId)); From 8737f43861a1a8533dfd3afb40213e8d856983c1 Mon Sep 17 00:00:00 2001 From: gzeon Date: Wed, 13 Aug 2025 00:14:35 +0800 Subject: [PATCH 089/108] feat: setCadence (#349) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: setCadence * test: setCadence * chore: update misc * test: 36 months * feat: CadenceChanged event * refactor: move CadenceChanged to Timing abstract contract * update optimizer runs * refactor: cut some size * refactor: equal 0 * fix: return * docs: currentElectionCount * refactor: use solady add and subMonths * chore: reduce sec_council_mgmt opt-run to 500 due to contract size * chore: cleanup lint warning * Simple cadence minor fixes (#359) --------- Co-authored-by: Henry <11198460+godzillaba@users.noreply.github.com> Co-authored-by: José FP <105675159+TucksonDev@users.noreply.github.com> --- .gas-snapshot | 61 ++++--- foundry.toml | 2 +- hardhat.config.ts | 2 +- ...SecurityCouncilNomineeElectionGovernor.sol | 31 +++- ...tyCouncilNomineeElectionGovernorTiming.sol | 78 ++++++++- ...curityCouncilNomineeElectionGovernor.t.sol | 161 +++++++++++++++++- .../SecurityCouncilNomineeElectionGovernor | 6 + .../SecurityCouncilNomineeElectionGovernor | 4 +- 8 files changed, 308 insertions(+), 37 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 108f0b682..9e401fed3 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -27,7 +27,7 @@ ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 86487452) +E2E:testE2E() (gas: 86859267) FixedDelegateErc20WalletTest:testInit() (gas: 5822585) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) @@ -95,11 +95,11 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28571182) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28519939) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28572810) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28812928) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32028301) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32032532) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26993452) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32030532) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32051997) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32400694) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32404948) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 27343716) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32402925) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32424390) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317059, ~: 317184) @@ -130,17 +130,17 @@ SecurityCouncilManagerTest:testInitialization() (gas: 206820) SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5255512) SecurityCouncilManagerTest:testRemoveMember() (gas: 217503) SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 101612) -SecurityCouncilManagerTest:testRemoveMemberRotated() (gas: 423630) +SecurityCouncilManagerTest:testRemoveMemberRotated() (gas: 423607) SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81486) SecurityCouncilManagerTest:testRemoveSeC() (gas: 38435) SecurityCouncilManagerTest:testReplaceCohortRotatingTo() (gas: 963734) SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 216337) SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 266597) -SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 471835) -SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 479079) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 471812) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 479056) SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 270188) -SecurityCouncilManagerTest:testRotateMember() (gas: 1016355) -SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3891932) +SecurityCouncilManagerTest:testRotateMember() (gas: 1016263) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3893898) SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65924) SecurityCouncilManagerTest:testSetRotatingTo() (gas: 113048) SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83230) @@ -197,21 +197,30 @@ SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 8086867) SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8328313) SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8329174) SecurityCouncilMgmtUtilsTests:testIsInArray() (gas: 2102) -SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 415952) -SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 336423) -SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 299282) -SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35278) -SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 590700) -SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 253153) -SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 459197) -SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 677159) -SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 197425) -SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 676717) -SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7285027) -SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78113) -SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19740) -SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42427) -SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 39905) +SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 417954) +SecurityCouncilNomineeElectionGovernorTest:testCadenceWithLargeValues() (gas: 52875) +SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 338629) +SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 301488) +SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35323) +SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 593018) +SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 257849) +SecurityCouncilNomineeElectionGovernorTest:testDefaultCadence() (gas: 14927) +SecurityCouncilNomineeElectionGovernorTest:testElectionTimestampsWithDefaultCadence() (gas: 37625) +SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 461456) +SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 679418) +SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 199664) +SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 678802) +SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7657451) +SecurityCouncilNomineeElectionGovernorTest:testMultipleCadenceChanges() (gas: 238823) +SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78160) +SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19741) +SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42433) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceAfterElections() (gas: 227567) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceBeforeFirstElection() (gas: 42479) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceInvalidValue() (gas: 26010) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceOnlyOwner() (gas: 16089) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceTooSoonReverts() (gas: 148066) +SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 40001) SequencerActionsTest:testAddAndRemoveSequencer() (gas: 486652) SequencerActionsTest:testCantAddZeroAddress() (gas: 235659) SetInitialGovParamsActionTest:testL1() (gas: 259949) diff --git a/foundry.toml b/foundry.toml index 26097a46e..60ddf0d41 100644 --- a/foundry.toml +++ b/foundry.toml @@ -9,7 +9,7 @@ via_ir = false solc_version = '0.8.16' [profile.sec_council_mgmt] -optimizer_runs = 750 +optimizer_runs = 500 [fmt] number_underscore = 'thousands' diff --git a/hardhat.config.ts b/hardhat.config.ts index 7b6985b3a..85851ddda 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -19,7 +19,7 @@ const solidityProfiles = { settings: { optimizer: { enabled: true, - runs: 750 + runs: 500 }, } } diff --git a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol index 688eaac3e..193dd76f3 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol @@ -35,7 +35,7 @@ contract SecurityCouncilNomineeElectionGovernor is /// @param owner Owner of the governor (the Arbitrum DAO) /// @param quorumNumeratorValue Numerator of the quorum fraction (0.2% = 20) /// @param votingPeriod Duration of the voting period (expressed in blocks) - /// Note that the voting period + nominee vetting duration must be << than 6 months to ensure elections dont overlap + /// Note that the voting period + nominee vetting duration must be << than the set cadence (`cadenceInMonths`) to ensure elections dont overlap struct InitParams { Date firstNominationStartDate; uint256 nomineeVettingDuration; @@ -101,6 +101,23 @@ contract SecurityCouncilNomineeElectionGovernor is _disableInitializers(); } + function getProxyAdmin() internal view returns (address admin) { + // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0/contracts/proxy/TransparentUpgradeableProxy.sol#L48 + // Storage slot with the admin of the proxy contract. + // This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is + bytes32 slot = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; + assembly { + admin := sload(slot) + } + } + + function postUpgradeInit() external { + require(msg.sender == getProxyAdmin(), "NOT_FROM_ADMIN"); + if (cadenceInMonths == 0) { + cadenceInMonths = 6; + } + } + /// @notice Initializes the governor function initialize(InitParams memory params) public initializer { __Governor_init("SecurityCouncilNomineeElectionGovernor"); @@ -158,7 +175,7 @@ contract SecurityCouncilNomineeElectionGovernor is } /// @notice Creates a new nominee election proposal. - /// Can be called by anyone every 6 months. + /// Can be called by anyone every `cadenceInMonths` months. /// @return proposalId The id of the proposal function createElection() external returns (uint256 proposalId) { // require that the last member election has executed @@ -236,7 +253,7 @@ contract SecurityCouncilNomineeElectionGovernor is // this only checks against the current the current other cohort, and against the current cohort membership // in the security council, so changes to those will mean this check will be inconsistent. // this check then is only a relevant check when the elections are running as expected - one at a time, - // every 6 months. Updates to the sec council manager using methods other than replaceCohort can effect this check + // every `cadenceInMonths` months. Updates to the sec council manager using methods other than replaceCohort can effect this check // and it's expected that the entity making those updates understands this. if (securityCouncilManager.cohortIncludes(otherCohort(), signer)) { revert AccountInOtherCohort(otherCohort(), signer); @@ -270,6 +287,12 @@ contract SecurityCouncilNomineeElectionGovernor is AddressUpgradeable.functionCallWithValue(target, data, value); } + /// @notice Set the cadence for future elections + /// @param numberOfMonths The new cadence in months (must be >= 1) + function setCadence(uint256 numberOfMonths) external onlyGovernance { + _setCadence(numberOfMonths, electionCount); + } + /// @notice Allows the nomineeVetter to exclude a noncompliant nominee. /// @dev Can be called only after a nominee election proposal has "succeeded" (voting has ended) and before the nominee vetting period has ended. /// Will revert if the provided account is not a nominee (had less than the required votes). @@ -321,7 +344,7 @@ contract SecurityCouncilNomineeElectionGovernor is // this only checks against the current the current other cohort, and against the current cohort membership // in the security council, so changes to those will mean this check will be inconsistent. // this check then is only a relevant check when the elections are running as expected - one at a time, - // every 6 months. Updates to the sec council manager using methods other than replaceCohort can effect this check + // every `cadenceInMonths` months. Updates to the sec council manager using methods other than replaceCohort can effect this check // and it's expected that the entity making those updates understands this. if (securityCouncilManager.cohortIncludes(otherCohort(), account)) { revert AccountInOtherCohort(otherCohort(), account); diff --git a/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorTiming.sol b/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorTiming.sol index c8fd05662..e17de3fbd 100644 --- a/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorTiming.sol +++ b/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorTiming.sol @@ -13,15 +13,28 @@ abstract contract SecurityCouncilNomineeElectionGovernorTiming is Initializable, GovernorUpgradeable { - /// @notice First election start date + /// @notice This is the first election start date only if the first election is yet to be created Date public firstNominationStartDate; /// @notice Duration of the nominee vetting period (expressed in blocks) /// @dev This is the amount of time after voting ends that the nomineeVetter can exclude noncompliant nominees uint256 public nomineeVettingDuration; + /// @notice The cadence of elections in months + uint256 public cadenceInMonths; + + event CadenceChanged( + uint256 newCadence, + uint256 nextElectionYear, + uint256 nextElectionMonth, + uint256 nextElectionDay, + uint256 nextElectionHour + ); + error InvalidStartDate(uint256 year, uint256 month, uint256 day, uint256 hour); error StartDateTooEarly(uint256 startTime, uint256 currentTime); + error InvalidCadence(uint256 cadence); + error NextElectionTooSoon(uint256 nextElectionTimestamp, uint256 currentTimestamp); /// @notice Initialize the timing module /// @dev Checks to make sure the start date is in the future and is valid @@ -63,6 +76,7 @@ abstract contract SecurityCouncilNomineeElectionGovernorTiming is firstNominationStartDate = _firstNominationStartDate; nomineeVettingDuration = _nomineeVettingDuration; + cadenceInMonths = 6; // Default to 6 months } /// @notice Deadline for the nominee vetting period for a given `proposalId` @@ -70,13 +84,71 @@ abstract contract SecurityCouncilNomineeElectionGovernorTiming is return proposalDeadline(proposalId) + nomineeVettingDuration; } + /// @notice Set the cadence for future elections + /// @param numberOfMonths The new cadence in months (must be >= 1) + /// @param currentElectionCount The current number of elections + /// @dev Internal function to be called by the main governor contract + function _setCadence(uint256 numberOfMonths, uint256 currentElectionCount) internal { + if (numberOfMonths == 0) { + revert InvalidCadence(numberOfMonths); + } + + // If no elections have been created yet, just update the cadence + if (currentElectionCount == 0) { + cadenceInMonths = numberOfMonths; + emit CadenceChanged( + numberOfMonths, + firstNominationStartDate.year, + firstNominationStartDate.month, + firstNominationStartDate.day, + firstNominationStartDate.hour + ); + return; + } + + // Calculate what the next election timestamp should be (last + new cadence) + uint256 nextElectionTimestamp; + { + // Calculate the timestamp of the last election + uint256 lastElectionTimestamp = electionToTimestamp(currentElectionCount - 1); + + nextElectionTimestamp = DateTimeLib.addMonths(lastElectionTimestamp, numberOfMonths); + (uint256 _year, uint256 _month, uint256 _day, uint256 _hour,,) = + DateTimeLib.timestampToDateTime(nextElectionTimestamp); + + // we emit the event here to save some stack space + emit CadenceChanged(numberOfMonths, _year, _month, _day, _hour); + } + + // Ensure the next election won't be moved to the past + if (nextElectionTimestamp < block.timestamp) { + revert NextElectionTooSoon(nextElectionTimestamp, block.timestamp); + } + + // Calculate the new firstNominationStartDate that would make election at currentElectionCount + // occur at nextElectionTimestamp with the new cadence + // nextElectionTimestamp = newFirstDate + (currentElectionCount * numberOfMonths) + // So: newFirstDate = nextElectionTimestamp - (currentElectionCount * numberOfMonths) + + // Work backwards from the next election timestamp + uint256 monthsToSubtract = numberOfMonths * currentElectionCount; + uint256 offsetTimestamp = DateTimeLib.subMonths(nextElectionTimestamp, monthsToSubtract); + (uint256 year, uint256 month, uint256 day, uint256 hour,,) = + DateTimeLib.timestampToDateTime(offsetTimestamp); + + // Update the firstNominationStartDate and cadence + firstNominationStartDate = Date({year: year, month: month, day: day, hour: hour}); + cadenceInMonths = numberOfMonths; + } + /// @notice Start timestamp of an election + /// Only returns accurate timestamps for the last and upcoming elections after cadence changes /// @param electionIndex The index of the election function electionToTimestamp(uint256 electionIndex) public view returns (uint256) { // subtract one to make month 0 indexed uint256 month = firstNominationStartDate.month - 1; - month += 6 * electionIndex; + month += cadenceInMonths * electionIndex; uint256 year = firstNominationStartDate.year + month / 12; month = month % 12; @@ -98,5 +170,5 @@ abstract contract SecurityCouncilNomineeElectionGovernorTiming is * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ - uint256[45] private __gap; + uint256[44] private __gap; } diff --git a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol index c8a086195..2691c0cd5 100644 --- a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol +++ b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol @@ -870,8 +870,11 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { pure returns (uint256) { + uint256 year = months / 12; + months = months % 12; + return DateTimeLib.dateTimeToTimestamp({ - year: date.year, + year: date.year + year, month: date.month + months, day: date.day, hour: date.hour, @@ -996,4 +999,160 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { ) ); } + + function testDefaultCadence() public { + assertEq(governor.cadenceInMonths(), 6, "Default cadence should be 6 months"); + } + + function testSetCadenceBeforeFirstElection() public { + vm.prank(initParams.owner); + governor.relay( + address(governor), 0, abi.encodeWithSelector(governor.setCadence.selector, 3) + ); + + assertEq(governor.cadenceInMonths(), 3, "Cadence should be updated to 3 months"); + } + + function testSetCadenceInvalidValue() public { + vm.prank(initParams.owner); + vm.expectRevert( + abi.encodeWithSelector( + SecurityCouncilNomineeElectionGovernorTiming.InvalidCadence.selector, 0 + ) + ); + governor.relay( + address(governor), 0, abi.encodeWithSelector(governor.setCadence.selector, 0) + ); + } + + function testSetCadenceOnlyOwner() public { + address nonOwner = address(0x1234); + vm.prank(nonOwner); + vm.expectRevert("Governor: onlyGovernance"); + governor.setCadence(3); + } + + function testElectionTimestampsWithDefaultCadence() public { + uint256 secondElectionTime = governor.electionToTimestamp(1); + uint256 thirdElectionTime = governor.electionToTimestamp(2); + + // Check that elections are properly spaced + // First election: Jan 1, 2030 + // Second election: Jul 1, 2030 (6 months later) + // Third election: Jan 1, 2031 (6 months later) + + // The actual timestamps depend on the exact calendar calculation + uint256 expectedSecondTime = + _datePlusMonthsToTimestamp(initParams.firstNominationStartDate, 6); + uint256 expectedThirdTime = + _datePlusMonthsToTimestamp(initParams.firstNominationStartDate, 12); + + assertEq( + secondElectionTime, expectedSecondTime, "Second election should be 6 months after first" + ); + assertEq( + thirdElectionTime, expectedThirdTime, "Third election should be 12 months after first" + ); + } + + function testSetCadenceAfterElections() public { + // Create first election + _propose(); + + // Fast forward and create second election + vm.warp(_datePlusMonthsToTimestamp(initParams.firstNominationStartDate, 6)); + vm.prank(proposer); + governor.createElection(); + + // Now change cadence to 3 months + vm.prank(initParams.owner); + governor.relay( + address(governor), 0, abi.encodeWithSelector(governor.setCadence.selector, 3) + ); + + assertEq(governor.cadenceInMonths(), 3, "Cadence should be updated to 3 months"); + + // The next election (index 2) should be 3 months after the last one (index 1) + uint256 nextElectionTime = governor.electionToTimestamp(2); + + // Should be approximately 3 months + uint256 expectedTime = _datePlusMonthsToTimestamp( + Date({ + year: 2030, + month: 7, // January + 6 months + day: 1, + hour: 0 + }), + 3 + ); + assertEq(nextElectionTime, expectedTime, "Next election should follow new cadence"); + } + + function testSetCadenceTooSoonReverts() public { + // Create first election + _propose(); + + // Fast forward to near the end of the 6-month period + vm.warp(_datePlusMonthsToTimestamp(initParams.firstNominationStartDate, 6) - 1 days); + + // Try to set cadence to 1 month - this would make next election in the past + vm.prank(initParams.owner); + vm.expectRevert(); + governor.relay( + address(governor), 0, abi.encodeWithSelector(governor.setCadence.selector, 1) + ); + } + + function testMultipleCadenceChanges() public { + // Create first election with default 6-month cadence + _propose(); + + // Change to 4 months + vm.prank(initParams.owner); + governor.relay( + address(governor), 0, abi.encodeWithSelector(governor.setCadence.selector, 4) + ); + + // Fast forward and create second election + vm.warp(_datePlusMonthsToTimestamp(initParams.firstNominationStartDate, 4)); + vm.prank(proposer); + governor.createElection(); + + // Change to 2 months + vm.prank(initParams.owner); + governor.relay( + address(governor), 0, abi.encodeWithSelector(governor.setCadence.selector, 2) + ); + + // Verify the third election timing + uint256 thirdElectionTime = governor.electionToTimestamp(2); + + // Should be 2 months after the second election + uint256 expectedTime = _datePlusMonthsToTimestamp( + Date({ + year: 2030, + month: 5, // January + 4 months + day: 1, + hour: 0 + }), + 2 + ); + assertEq(thirdElectionTime, expectedTime, "Third election should follow newest cadence"); + } + + function testCadenceWithLargeValues() public { + vm.prank(initParams.owner); + governor.relay( + address(governor), 0, abi.encodeWithSelector(governor.setCadence.selector, 36) + ); + + uint256 secondElection = governor.electionToTimestamp(1); + + // First election: Jan 1, 2030 + // Second election: Jan 1, 2033 (36 months later) + uint256 expectedSecondTime = + _datePlusMonthsToTimestamp(initParams.firstNominationStartDate, 36); + + assertEq(secondElection, expectedSecondTime, "Elections should be 36 months apart"); + } } diff --git a/test/signatures/SecurityCouncilNomineeElectionGovernor b/test/signatures/SecurityCouncilNomineeElectionGovernor index 4e192dc98..2f3f77cab 100644 --- a/test/signatures/SecurityCouncilNomineeElectionGovernor +++ b/test/signatures/SecurityCouncilNomineeElectionGovernor @@ -14,6 +14,8 @@ |-----------------------------------------------------------------------------------------------------------------+------------| | addContender(uint256,bytes) | a8f38759 | |-----------------------------------------------------------------------------------------------------------------+------------| +| cadenceInMonths() | e182a4cd | +|-----------------------------------------------------------------------------------------------------------------+------------| | castVote(uint256,uint8) | 56781388 | |-----------------------------------------------------------------------------------------------------------------+------------| | castVoteBySig(uint256,uint8,uint8,bytes32,bytes32) | 3bccf4fd | @@ -92,6 +94,8 @@ |-----------------------------------------------------------------------------------------------------------------+------------| | owner() | 8da5cb5b | |-----------------------------------------------------------------------------------------------------------------+------------| +| postUpgradeInit() | 95fcea78 | +|-----------------------------------------------------------------------------------------------------------------+------------| | proposalDeadline(uint256) | c01f9e37 | |-----------------------------------------------------------------------------------------------------------------+------------| | proposalSnapshot(uint256) | 2d63f693 | @@ -120,6 +124,8 @@ |-----------------------------------------------------------------------------------------------------------------+------------| | securityCouncilMemberElectionGovernor() | 1b6a7673 | |-----------------------------------------------------------------------------------------------------------------+------------| +| setCadence(uint256) | 5ad525b1 | +|-----------------------------------------------------------------------------------------------------------------+------------| | setNomineeVetter(address) | ae8acb5e | |-----------------------------------------------------------------------------------------------------------------+------------| | setProposalThreshold(uint256) | ece40cc1 | diff --git a/test/storage/SecurityCouncilNomineeElectionGovernor b/test/storage/SecurityCouncilNomineeElectionGovernor index 235fb7592..95df9dcec 100644 --- a/test/storage/SecurityCouncilNomineeElectionGovernor +++ b/test/storage/SecurityCouncilNomineeElectionGovernor @@ -58,7 +58,9 @@ |---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | nomineeVettingDuration | uint256 | 558 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | |---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| -| __gap | uint256[45] | 559 | 0 | 1440 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +| cadenceInMonths | uint256 | 559 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | +|---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| +| __gap | uint256[44] | 560 | 0 | 1408 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | |---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| | usedNonces | mapping(bytes32 => bool) | 604 | 0 | 32 | src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol:SecurityCouncilNomineeElectionGovernor | |---------------------------------------+------------------------------------------------------------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------------------------------| From 049d47b966b0544078103efc946e834bb293afab Mon Sep 17 00:00:00 2001 From: gzeon Date: Wed, 13 Aug 2025 01:05:20 +0800 Subject: [PATCH 090/108] feat: SecurityCouncilUpgradeAction (#357) * feat: setCadence * test: setCadence * chore: update misc * test: 36 months * feat: CadenceChanged event * refactor: move CadenceChanged to Timing abstract contract * update optimizer runs * refactor: cut some size * refactor: equal 0 * fix: return * docs: currentElectionCount * refactor: use solady add and subMonths * chore: reduce sec_council_mgmt opt-run to 500 due to contract size * refactor: rename to SecurityCouncilUpgradeAction * feat: SecurityCouncilUpgradeAction * chore: cleanup lint warning * chore: storage * chore: 4bytes * feat: more validations --------- Co-authored-by: Henry <11198460+godzillaba@users.noreply.github.com> --- .gas-snapshot | 2 +- .../RotateMembersUpgradeAction.sol | 49 -------- .../SecurityCouncilUpgradeAction.sol | 113 ++++++++++++++++++ ...celTimelockAndRemoveMemberActionTest.t.sol | 23 +++- ...sol => SecurityCouncilUpgradeAction.t.sol} | 30 ++++- test/signatures/RotateMembersUpgradeAction | 15 --- test/signatures/SecurityCouncilUpgradeAction | 21 ++++ ...adeAction => SecurityCouncilUpgradeAction} | 0 8 files changed, 180 insertions(+), 73 deletions(-) delete mode 100644 src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol create mode 100644 src/gov-action-contracts/AIPs/SecurityCouncilMgmt/SecurityCouncilUpgradeAction.sol rename test/gov-actions/{RotateMembersUpgradeAction.t.sol => SecurityCouncilUpgradeAction.t.sol} (71%) delete mode 100644 test/signatures/RotateMembersUpgradeAction create mode 100644 test/signatures/SecurityCouncilUpgradeAction rename test/storage/{RotateMembersUpgradeAction => SecurityCouncilUpgradeAction} (100%) diff --git a/.gas-snapshot b/.gas-snapshot index 9e401fed3..73e400efb 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -117,7 +117,6 @@ OutboxActionsTest:testRemoveAllOutboxes() (gas: 693079) OutboxActionsTest:testRemoveOutboxes() (gas: 853972) ProxyUpgradeAndCallActionTest:testUpgrade() (gas: 137140) ProxyUpgradeAndCallActionTest:testUpgradeAndCall() (gas: 143087) -RotateMembersUpgradeActionTest:testAction() (gas: 8153) SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 253923) SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20770) SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 349222) @@ -221,6 +220,7 @@ SecurityCouncilNomineeElectionGovernorTest:testSetCadenceInvalidValue() (gas: 26 SecurityCouncilNomineeElectionGovernorTest:testSetCadenceOnlyOwner() (gas: 16089) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceTooSoonReverts() (gas: 148066) SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 40001) +SecurityCouncilUpgradeActionTest:testAction() (gas: 8153) SequencerActionsTest:testAddAndRemoveSequencer() (gas: 486652) SequencerActionsTest:testCantAddZeroAddress() (gas: 235659) SetInitialGovParamsActionTest:testL1() (gas: 259949) diff --git a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol deleted file mode 100644 index 9bb1df902..000000000 --- a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.16; - -import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import "../../address-registries/L2AddressRegistryInterfaces.sol"; -import "@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol"; - -/// @notice Upgrades the sec council manager to allow member rotation and sets min rotation vars -contract RotateMembersUpgradeAction { - IL2AddressRegistry public immutable l2AddressRegistry; - address public immutable secCouncilManagerImpl; - uint256 public immutable minRotationPeriod; - address public immutable minRotationPeriodSetter; - - constructor( - IL2AddressRegistry _l2AddressRegistry, - address _secCouncilManagerImpl, - uint256 _minRotationPeriod, - address _minRotationPeriodSetter - ) { - l2AddressRegistry = _l2AddressRegistry; - secCouncilManagerImpl = _secCouncilManagerImpl; - minRotationPeriod = _minRotationPeriod; - minRotationPeriodSetter = _minRotationPeriodSetter; - } - - function perform() external { - ISecurityCouncilManager secCouncilManager = l2AddressRegistry.securityCouncilManager(); - l2AddressRegistry.govProxyAdmin().upgradeAndCall( - TransparentUpgradeableProxy(payable(address(secCouncilManager))), - secCouncilManagerImpl, - abi.encodeCall( - ISecurityCouncilManager(secCouncilManagerImpl).postUpgradeInit, - (minRotationPeriod, minRotationPeriodSetter) - ) - ); - - require( - minRotationPeriod == secCouncilManager.minRotationPeriod(), - "RotateMembersUpgradeAction: Min rotation period not set" - ); - require( - IAccessControlUpgradeable(address(secCouncilManager)).hasRole( - secCouncilManager.MIN_ROTATION_PERIOD_SETTER_ROLE(), minRotationPeriodSetter - ), - "RotateMembersUpgradeAction: Min rotation period setter not set" - ); - } -} diff --git a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/SecurityCouncilUpgradeAction.sol b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/SecurityCouncilUpgradeAction.sol new file mode 100644 index 000000000..e289dffde --- /dev/null +++ b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/SecurityCouncilUpgradeAction.sol @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.16; + +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import "../../address-registries/L2AddressRegistryInterfaces.sol"; +import "@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol"; +import + "@openzeppelin/contracts-upgradeable/governance/extensions/GovernorVotesQuorumFractionUpgradeable.sol"; +import "../../../security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol"; + +/// @notice Perform the following upgrade proposed by the Arbitrum Foundation: +/// - Upgrade the sec council manager to allow member rotation and sets min rotation vars +/// - Upgrade the sec council nominee election governor to allow modifying the cadence of election +/// - Adjusting the qualification threshold of the Member Election phase from 0.2% to 0.1% +/// - Allowing existing sec council members to automatically progress from the Nominee Selection phase +/// - Updating the ArbitrumDAO Constitution to reflect these changes +contract SecurityCouncilUpgradeAction { + IL2AddressRegistry public immutable l2AddressRegistry; + address public immutable secCouncilManagerImpl; + address public immutable scNomineeElectionGovernorImpl; + uint256 public immutable minRotationPeriod; + address public immutable minRotationPeriodSetter; + uint256 public immutable cadenceInMonths; + bytes32 public immutable newConstitutionHash; + + constructor( + IL2AddressRegistry _l2AddressRegistry, + address _secCouncilManagerImpl, + address _scNomineeElectionGovernorImpl, + uint256 _minRotationPeriod, + address _minRotationPeriodSetter, + uint256 _cadenceInMonths, + bytes32 _newConstitutionHash + ) { + l2AddressRegistry = _l2AddressRegistry; + secCouncilManagerImpl = _secCouncilManagerImpl; + scNomineeElectionGovernorImpl = _scNomineeElectionGovernorImpl; + minRotationPeriod = _minRotationPeriod; + minRotationPeriodSetter = _minRotationPeriodSetter; + cadenceInMonths = _cadenceInMonths; + newConstitutionHash = _newConstitutionHash; + } + + function perform() external { + SecurityCouncilNomineeElectionGovernor scNomineeElectionGovernor = + SecurityCouncilNomineeElectionGovernor( + payable(address(l2AddressRegistry.scNomineeElectionGovernor())) + ); + require( + scNomineeElectionGovernor.electionCount() == 5, + "SecurityCouncilUpgradeAction: not expected timing" + ); + + // Upgrade the sec council manager to allow member rotation and sets min rotation vars + ISecurityCouncilManager secCouncilManager = l2AddressRegistry.securityCouncilManager(); + l2AddressRegistry.govProxyAdmin().upgradeAndCall( + TransparentUpgradeableProxy(payable(address(secCouncilManager))), + secCouncilManagerImpl, + abi.encodeCall( + ISecurityCouncilManager(secCouncilManagerImpl).postUpgradeInit, + (minRotationPeriod, minRotationPeriodSetter) + ) + ); + require( + minRotationPeriod == secCouncilManager.minRotationPeriod(), + "SecurityCouncilUpgradeAction: Min rotation period not set" + ); + require( + IAccessControlUpgradeable(address(secCouncilManager)).hasRole( + secCouncilManager.MIN_ROTATION_PERIOD_SETTER_ROLE(), minRotationPeriodSetter + ), + "SecurityCouncilUpgradeAction: Min rotation period setter not set" + ); + + // Upgrade the sec council nominee election governor to allow modifying the cadence of election + // Allowing existing sec council members to automatically progress from the Nominee Selection phase + l2AddressRegistry.govProxyAdmin().upgradeAndCall( + TransparentUpgradeableProxy(payable(address(scNomineeElectionGovernor))), + scNomineeElectionGovernorImpl, + abi.encodeCall(scNomineeElectionGovernor.postUpgradeInit, ()) + ); + + scNomineeElectionGovernor.relay( + address(scNomineeElectionGovernor), + 0, + abi.encodeCall(scNomineeElectionGovernor.setCadence, (cadenceInMonths)) + ); + require( + scNomineeElectionGovernor.cadenceInMonths() == cadenceInMonths, + "SecurityCouncilUpgradeAction: Cadence not set" + ); + + // Adjusting the qualification threshold of the Member Election phase from 0.2% to 0.1% + scNomineeElectionGovernor.relay( + address(scNomineeElectionGovernor), + 0, + abi.encodeCall(scNomineeElectionGovernor.updateQuorumNumerator, (10)) + ); + require( + scNomineeElectionGovernor.quorumNumerator() == 10, + "SecurityCouncilUpgradeAction: Quorum numerator not set" + ); + + // Updating the ArbitrumDAO Constitution to reflect these changes + IArbitrumDAOConstitution arbitrumDaoConstitution = + l2AddressRegistry.arbitrumDAOConstitution(); + arbitrumDaoConstitution.setConstitutionHash(newConstitutionHash); + require( + arbitrumDaoConstitution.constitutionHash() == newConstitutionHash, + "SecurityCouncilUpgradeAction: new constitution hash not set" + ); + } +} diff --git a/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol b/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol index 3bc65b930..11de8e816 100644 --- a/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol +++ b/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.16; import "forge-std/Test.sol"; -import "../../src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol"; +import "../../src/gov-action-contracts/AIPs/SecurityCouncilMgmt/SecurityCouncilUpgradeAction.sol"; import "../../src/gov-action-contracts/governance/CancelTimelockAndRemoveMemberAction.sol"; import "../../src/security-council-mgmt/SecurityCouncilManager.sol"; import "../../src/gov-action-contracts/address-registries/L2AddressRegistry.sol"; @@ -25,7 +25,7 @@ contract CancelTimelockAndRemoveMemberActionTest is Test { function testAction() external { if (!_isForkTest()) { - console.log("not fork test, skipping RotateMembersUpgradeActionTest"); + console.log("not fork test, skipping SecurityCouncilUpgradeActionTest"); return; } @@ -118,10 +118,25 @@ contract CancelTimelockAndRemoveMemberActionTest is Test { function ensureLatestScm(L2AddressRegistry reg) internal { address newImplementation = address(new SecurityCouncilManager()); + address newNomineeElectionGovernorImplementation = + address(new SecurityCouncilNomineeElectionGovernor()); address rotationSetter = address(1337); uint256 minRotationPeriod = 1 weeks; - RotateMembersUpgradeAction action = new RotateMembersUpgradeAction( - reg, newImplementation, minRotationPeriod, rotationSetter + uint256 cadenceInMonths = 12; + + SecurityCouncilNomineeElectionGovernor scNomineeElectionGovernor = + SecurityCouncilNomineeElectionGovernor(payable(address(reg.scNomineeElectionGovernor()))); + vm.warp(1_757_937_601); // After the 2025 Sep election + scNomineeElectionGovernor.createElection(); + + SecurityCouncilUpgradeAction action = new SecurityCouncilUpgradeAction( + reg, + newImplementation, + newNomineeElectionGovernorImplementation, + minRotationPeriod, + rotationSetter, + cadenceInMonths, + bytes32(0) ); vm.prank(council); arbOneUe.execute(address(action), abi.encodeWithSelector(action.perform.selector)); diff --git a/test/gov-actions/RotateMembersUpgradeAction.t.sol b/test/gov-actions/SecurityCouncilUpgradeAction.t.sol similarity index 71% rename from test/gov-actions/RotateMembersUpgradeAction.t.sol rename to test/gov-actions/SecurityCouncilUpgradeAction.t.sol index 6e20a26e1..56136357f 100644 --- a/test/gov-actions/RotateMembersUpgradeAction.t.sol +++ b/test/gov-actions/SecurityCouncilUpgradeAction.t.sol @@ -3,11 +3,12 @@ pragma solidity 0.8.16; import "forge-std/Test.sol"; -import "../../src/gov-action-contracts/AIPs/SecurityCouncilMgmt/RotateMembersUpgradeAction.sol"; +import "../../src/gov-action-contracts/AIPs/SecurityCouncilMgmt/SecurityCouncilUpgradeAction.sol"; import "../../src/security-council-mgmt/SecurityCouncilManager.sol"; +import "../../src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol"; import "../../src/gov-action-contracts/address-registries/L2AddressRegistry.sol"; -contract RotateMembersUpgradeActionTest is Test { +contract SecurityCouncilUpgradeActionTest is Test { SecurityCouncilManager scm = SecurityCouncilManager(0xD509E5f5aEe2A205F554f36E8a7d56094494eDFC); address oldImplementation = 0x468dA0eE5570Bdb1Dd81bFd925BAf028A93Dce64; ProxyAdmin proxyAdmin = ProxyAdmin(0xdb216562328215E010F819B5aBe947bad4ca961e); @@ -46,11 +47,25 @@ contract RotateMembersUpgradeActionTest is Test { ISecurityCouncilNomineeElectionGovernor(0x8a1cDA8dee421cD06023470608605934c16A05a0) ); + SecurityCouncilNomineeElectionGovernor scNomineeElectionGovernor = + SecurityCouncilNomineeElectionGovernor(payable(address(reg.scNomineeElectionGovernor()))); + vm.warp(1_757_937_601); // After the 2025 Sep election + scNomineeElectionGovernor.createElection(); + address newImplementation = address(new SecurityCouncilManager()); + address newNomineeElectionGovernorImplementation = + address(new SecurityCouncilNomineeElectionGovernor()); address rotationSetter = address(137); uint256 minRotationPeriod = 1 weeks; - RotateMembersUpgradeAction action = new RotateMembersUpgradeAction( - reg, newImplementation, minRotationPeriod, rotationSetter + uint256 cadenceInMonths = 12; + SecurityCouncilUpgradeAction action = new SecurityCouncilUpgradeAction( + reg, + newImplementation, + newNomineeElectionGovernorImplementation, + minRotationPeriod, + rotationSetter, + cadenceInMonths, + bytes32(0) ); vm.prank(council); arbOneUe.execute(address(action), abi.encodeWithSelector(action.perform.selector)); @@ -63,6 +78,13 @@ contract RotateMembersUpgradeActionTest is Test { "Min rotation period setter not set" ); assertEq(_getImplementation(), newImplementation, "implementation not set"); + + uint256 electionCount = scNomineeElectionGovernor.electionCount(); + assertEq( + scNomineeElectionGovernor.electionToTimestamp(electionCount), + 1_789_473_600, + "not September 15, 2026 12:00:00 PM" + ); } function _getImplementation() internal view returns (address) { diff --git a/test/signatures/RotateMembersUpgradeAction b/test/signatures/RotateMembersUpgradeAction deleted file mode 100644 index d465c78f0..000000000 --- a/test/signatures/RotateMembersUpgradeAction +++ /dev/null @@ -1,15 +0,0 @@ - -╭---------------------------+------------╮ -| Method | Identifier | -+========================================+ -| l2AddressRegistry() | 9b491216 | -|---------------------------+------------| -| minRotationPeriod() | cfc02946 | -|---------------------------+------------| -| minRotationPeriodSetter() | 7a5c8992 | -|---------------------------+------------| -| perform() | b147f40c | -|---------------------------+------------| -| secCouncilManagerImpl() | a03700cc | -╰---------------------------+------------╯ - diff --git a/test/signatures/SecurityCouncilUpgradeAction b/test/signatures/SecurityCouncilUpgradeAction new file mode 100644 index 000000000..33891359d --- /dev/null +++ b/test/signatures/SecurityCouncilUpgradeAction @@ -0,0 +1,21 @@ + +╭---------------------------------+------------╮ +| Method | Identifier | ++==============================================+ +| cadenceInMonths() | e182a4cd | +|---------------------------------+------------| +| l2AddressRegistry() | 9b491216 | +|---------------------------------+------------| +| minRotationPeriod() | cfc02946 | +|---------------------------------+------------| +| minRotationPeriodSetter() | 7a5c8992 | +|---------------------------------+------------| +| newConstitutionHash() | 8035cce0 | +|---------------------------------+------------| +| perform() | b147f40c | +|---------------------------------+------------| +| scNomineeElectionGovernorImpl() | c91461be | +|---------------------------------+------------| +| secCouncilManagerImpl() | a03700cc | +╰---------------------------------+------------╯ + diff --git a/test/storage/RotateMembersUpgradeAction b/test/storage/SecurityCouncilUpgradeAction similarity index 100% rename from test/storage/RotateMembersUpgradeAction rename to test/storage/SecurityCouncilUpgradeAction From 7c8369586bf6086352afabd11438b36c2909f0af Mon Sep 17 00:00:00 2001 From: gzeon Date: Thu, 14 Aug 2025 16:34:37 +0800 Subject: [PATCH 091/108] feat: rotateNominee (#358) * feat: setCadence * test: setCadence * chore: update misc * test: 36 months * feat: CadenceChanged event * refactor: move CadenceChanged to Timing abstract contract * update optimizer runs * refactor: cut some size * refactor: equal 0 * fix: return * docs: currentElectionCount * refactor: use solady add and subMonths * chore: reduce sec_council_mgmt opt-run to 500 due to contract size * refactor: rename to SecurityCouncilUpgradeAction * feat: SecurityCouncilUpgradeAction * chore: cleanup lint warning * chore: storage * chore: 4bytes * feat: more validations * revert: rotatingTo * feat: rotateNominee * chore: contract size reduction * refactor: use isCompliantNominee * fix: wrong sign * fix: rotationDeadline * test: rotateNominee * review fixes for "feat: rotateNominee" (#360) * misc review fixes * fix gas and sigs --------- Co-authored-by: Henry <11198460+godzillaba@users.noreply.github.com> --- .gas-snapshot | 113 ++++++++-------- foundry.toml | 2 +- hardhat.config.ts | 2 +- .../SecurityCouncilManager.sol | 50 +------- ...SecurityCouncilNomineeElectionGovernor.sol | 85 ++++++++++-- .../interfaces/ISecurityCouncilManager.sol | 19 --- .../SecurityCouncilManager.t.sol | 121 ------------------ ...curityCouncilNomineeElectionGovernor.t.sol | 94 ++++++++++++++ test/signatures/SecurityCouncilManager | 8 -- .../SecurityCouncilNomineeElectionGovernor | 6 +- test/storage/SecurityCouncilManager | 6 +- 11 files changed, 234 insertions(+), 272 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 73e400efb..59be04bce 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -27,7 +27,7 @@ ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 86859267) +E2E:testE2E() (gas: 86859495) FixedDelegateErc20WalletTest:testInit() (gas: 5822585) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) @@ -95,11 +95,11 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28571182) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28519939) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28572810) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28812928) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32400694) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32404948) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 27343716) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32402925) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32424390) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32322314) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32326589) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 27265404) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32324545) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32345900) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317059, ~: 317184) @@ -117,36 +117,34 @@ OutboxActionsTest:testRemoveAllOutboxes() (gas: 693079) OutboxActionsTest:testRemoveOutboxes() (gas: 853972) ProxyUpgradeAndCallActionTest:testUpgrade() (gas: 137140) ProxyUpgradeAndCallActionTest:testUpgradeAndCall() (gas: 143087) -SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 253923) +SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 253879) SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20770) -SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 349222) -SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 352657) +SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 349200) +SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 352635) SecurityCouncilManagerTest:testAddSC() (gas: 118742) -SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112296) -SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 148550) -SecurityCouncilManagerTest:testCohortMethods() (gas: 137958) -SecurityCouncilManagerTest:testInitialization() (gas: 206820) -SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5255512) -SecurityCouncilManagerTest:testRemoveMember() (gas: 217503) -SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 101612) -SecurityCouncilManagerTest:testRemoveMemberRotated() (gas: 423607) -SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81486) -SecurityCouncilManagerTest:testRemoveSeC() (gas: 38435) -SecurityCouncilManagerTest:testReplaceCohortRotatingTo() (gas: 963734) -SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 216337) -SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 266597) -SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 471812) -SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 479056) -SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 270188) -SecurityCouncilManagerTest:testRotateMember() (gas: 1016263) -SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 3893898) -SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65924) -SecurityCouncilManagerTest:testSetRotatingTo() (gas: 113048) -SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83230) -SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 327741) -SecurityCouncilManagerTest:testUpdateRouter() (gas: 76429) -SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112452) -SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 327845) +SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112428) +SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 136633) +SecurityCouncilManagerTest:testCohortMethods() (gas: 137890) +SecurityCouncilManagerTest:testInitialization() (gas: 206665) +SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5000887) +SecurityCouncilManagerTest:testRemoveMember() (gas: 217459) +SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 101567) +SecurityCouncilManagerTest:testRemoveMemberRotated() (gas: 423573) +SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81441) +SecurityCouncilManagerTest:testRemoveSeC() (gas: 38383) +SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 216447) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 266641) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 471806) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 479028) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 270210) +SecurityCouncilManagerTest:testRotateMember() (gas: 1015787) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 4078679) +SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65814) +SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83252) +SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 313830) +SecurityCouncilManagerTest:testUpdateRouter() (gas: 76407) +SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112474) +SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 313924) SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 247018) SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302873) SecurityCouncilMemberElectionGovernorTest:testCastBySigTwice() (gas: 266265) @@ -196,30 +194,31 @@ SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 8086867) SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8328313) SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8329174) SecurityCouncilMgmtUtilsTests:testIsInArray() (gas: 2102) -SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 417954) -SecurityCouncilNomineeElectionGovernorTest:testCadenceWithLargeValues() (gas: 52875) -SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 338629) -SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 301488) -SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35323) -SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 593018) -SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 257849) -SecurityCouncilNomineeElectionGovernorTest:testDefaultCadence() (gas: 14927) +SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 418329) +SecurityCouncilNomineeElectionGovernorTest:testCadenceWithLargeValues() (gas: 52898) +SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 338828) +SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 301643) +SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35303) +SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 593196) +SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 257942) +SecurityCouncilNomineeElectionGovernorTest:testDefaultCadence() (gas: 14950) SecurityCouncilNomineeElectionGovernorTest:testElectionTimestampsWithDefaultCadence() (gas: 37625) -SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 461456) -SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 679418) -SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 199664) -SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 678802) -SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7657451) -SecurityCouncilNomineeElectionGovernorTest:testMultipleCadenceChanges() (gas: 238823) -SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78160) -SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19741) -SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42433) -SecurityCouncilNomineeElectionGovernorTest:testSetCadenceAfterElections() (gas: 227567) -SecurityCouncilNomineeElectionGovernorTest:testSetCadenceBeforeFirstElection() (gas: 42479) -SecurityCouncilNomineeElectionGovernorTest:testSetCadenceInvalidValue() (gas: 26010) -SecurityCouncilNomineeElectionGovernorTest:testSetCadenceOnlyOwner() (gas: 16089) -SecurityCouncilNomineeElectionGovernorTest:testSetCadenceTooSoonReverts() (gas: 148066) -SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 40001) +SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 461501) +SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 679315) +SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 199863) +SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 679144) +SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7833321) +SecurityCouncilNomineeElectionGovernorTest:testMultipleCadenceChanges() (gas: 238915) +SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78159) +SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19786) +SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42411) +SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 510312) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceAfterElections() (gas: 227636) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceBeforeFirstElection() (gas: 42502) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceInvalidValue() (gas: 26056) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceOnlyOwner() (gas: 16090) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceTooSoonReverts() (gas: 148112) +SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 40024) SecurityCouncilUpgradeActionTest:testAction() (gas: 8153) SequencerActionsTest:testAddAndRemoveSequencer() (gas: 486652) SequencerActionsTest:testCantAddZeroAddress() (gas: 235659) diff --git a/foundry.toml b/foundry.toml index 60ddf0d41..b55c7065e 100644 --- a/foundry.toml +++ b/foundry.toml @@ -9,7 +9,7 @@ via_ir = false solc_version = '0.8.16' [profile.sec_council_mgmt] -optimizer_runs = 500 +optimizer_runs = 200 [fmt] number_underscore = 'thousands' diff --git a/hardhat.config.ts b/hardhat.config.ts index 85851ddda..13ac7c2cb 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -19,7 +19,7 @@ const solidityProfiles = { settings: { optimizer: { enabled: true, - runs: 500 + runs: 200 }, } } diff --git a/src/security-council-mgmt/SecurityCouncilManager.sol b/src/security-council-mgmt/SecurityCouncilManager.sol index 46b5272bf..99388123a 100644 --- a/src/security-council-mgmt/SecurityCouncilManager.sol +++ b/src/security-council-mgmt/SecurityCouncilManager.sol @@ -38,7 +38,6 @@ contract SecurityCouncilManager is event MemberRemoved(address indexed member, Cohort indexed cohort); event MemberReplaced(address indexed replacedMember, address indexed newMember, Cohort cohort); event MemberRotated(address indexed replacedAddress, address indexed newAddress, Cohort cohort); - event RotatingToSet(address indexed replacedAddress, address indexed newAddress); event SecurityCouncilAdded( address indexed securityCouncil, address indexed updateAction, @@ -91,11 +90,7 @@ contract SecurityCouncilManager is /// @inheritdoc ISecurityCouncilManager uint256 public minRotationPeriod; - /// @notice Store the address to be rotated to for new members in the future - /// @dev `rotatingTo[X] = Y` means if X is installed as a new member, Y will be installed instead - mapping(address => address) public rotatingTo; - - /// @notice Nonce used when setting rotatingTo or rotatedTo + /// @notice Nonce used when setting rotatedTo mapping(address => uint256) public rotationNonce; /// @notice The 712 name hash @@ -119,8 +114,6 @@ contract SecurityCouncilManager is ); bytes32 public constant ROTATE_MEMBER_TYPE_HASH = keccak256(bytes("rotateMember(address from, uint256 nonce)")); - bytes32 public constant SET_ROTATING_TO_TYPE_HASH = - keccak256(bytes("setRotatingTo(address from, uint256 nonce)")); constructor() { _disableInitializers(); @@ -215,20 +208,8 @@ contract SecurityCouncilManager is // delete the old cohort _cohort == Cohort.FIRST ? delete firstCohort : delete secondCohort; - address[] storage otherCohort = _cohort == Cohort.FIRST ? secondCohort : firstCohort; for (uint256 i = 0; i < _newCohort.length; i++) { - // we have to change the array so correct _newCohort can be emitted - address rotatingAddress = rotatingTo[_newCohort[i]]; - if (rotatingAddress != address(0)) { - // only replace if there is no clash - if ( - !SecurityCouncilMgmtUtils.isInArray(rotatingAddress, _newCohort) - && !SecurityCouncilMgmtUtils.isInArray(rotatingAddress, otherCohort) - ) { - _newCohort[i] = rotatingAddress; - } - } _addMemberToCohortArray(_newCohort[i], _cohort); } @@ -316,13 +297,6 @@ contract SecurityCouncilManager is ); } - /// @inheritdoc ISecurityCouncilManager - function getSetRotatingToHash(address from, uint256 nonce) public view returns (bytes32) { - return ECDSAUpgradeable.toTypedDataHash( - _domainSeparatorV4(), keccak256(abi.encode(SET_ROTATING_TO_TYPE_HASH, from, nonce)) - ); - } - /// @inheritdoc ISecurityCouncilManager function rotateMember( address newMemberAddress, @@ -407,26 +381,6 @@ contract SecurityCouncilManager is emit MemberRotated({replacedAddress: msg.sender, newAddress: newAddress, cohort: cohort}); } - /// @inheritdoc ISecurityCouncilManager - function setRotatingTo(address newMemberAddress, bytes calldata signature) external { - uint256 currentRotationNonce = rotationNonce[msg.sender]; - // we enforce that a the new address is an eoa in the same way do - // in NomineeGovernor.addContender by requiring a signature - address newAddress = ECDSAUpgradeable.recover( - getSetRotatingToHash(msg.sender, currentRotationNonce), signature - ); - // we safety check the new member address is the one that we expect to replace here - // this isn't strictly necessary but it guards against the case where the wrong sig is accidentally used - if (newAddress != newMemberAddress) { - revert InvalidNewAddress(newAddress); - } - - rotatingTo[msg.sender] = newAddress; - rotationNonce[msg.sender] = currentRotationNonce + 1; - - emit RotatingToSet({replacedAddress: msg.sender, newAddress: newAddress}); - } - function _swapMembers(address _addressToRemove, address _addressToAdd) internal returns (Cohort) @@ -659,5 +613,5 @@ contract SecurityCouncilManager is * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ - uint256[38] private __gap; + uint256[39] private __gap; } diff --git a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol index 193dd76f3..e611f3bf9 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol @@ -58,6 +58,12 @@ contract SecurityCouncilNomineeElectionGovernor is uint256 excludedNomineeCount; } + /// @notice Nominees can rotate their position to a new address. They are allowed to do this during the vetting period, but no later than `ROTATION_CUT_OFF_BLOCKS` L1 blocks before the vetting deadline. + /// Currently this is set to 3 days, assuming 12 blocks per second. + /// @dev It is known that a malicious nominee can abuse rotation to avoid vetting, + /// but the nominee vetter would always have 3 extra days after any rotation to exclude the nominee if needed. + uint256 public constant ROTATION_CUT_OFF_BLOCKS = 21600; + /// @notice Address responsible for blocking non compliant nominees address public nomineeVetter; @@ -76,6 +82,7 @@ contract SecurityCouncilNomineeElectionGovernor is event NomineeVetterChanged(address indexed oldNomineeVetter, address indexed newNomineeVetter); event ContenderAdded(uint256 indexed proposalId, address indexed contender); event NomineeExcluded(uint256 indexed proposalId, address indexed nominee); + event NomineeRotated(uint256 indexed proposalId, address indexed from, address indexed to); error OnlyNomineeVetter(); error CreateTooEarly(uint256 blockTimestamp, uint256 startTime); @@ -84,18 +91,21 @@ contract SecurityCouncilNomineeElectionGovernor is error AccountInOtherCohort(Cohort cohort, address account); error ProposalNotSucceededState(ProposalState state); error ProposalNotInVettingPeriod(uint256 blockNumber, uint256 vettingDeadline); + error ProposalNotInRotationPeriod(uint256 blockNumber, uint256 rotationDeadline); error NomineeAlreadyExcluded(address nominee); error CompliantNomineeTargetHit(uint256 nomineeCount, uint256 expectedCount); error ProposalInVettingPeriod(uint256 blockNumber, uint256 vettingDeadline); error InsufficientCompliantNomineeCount(uint256 compliantNomineeCount, uint256 expectedCount); error ProposeDisabled(); error NotNominee(address nominee); + error NotCompliantNominee(address nominee); error ProposalIdMismatch(uint256 nomineeProposalId, uint256 memberProposalId); error QuorumNumeratorTooLow(uint256 quorumNumeratorValue); error CastVoteDisabled(); error LastMemberElectionNotExecuted(uint256 prevProposalId); error InvalidSignature(); error Deprecated(string message); + error NotFromProxyAdmin(); constructor() { _disableInitializers(); @@ -112,7 +122,9 @@ contract SecurityCouncilNomineeElectionGovernor is } function postUpgradeInit() external { - require(msg.sender == getProxyAdmin(), "NOT_FROM_ADMIN"); + if (msg.sender != getProxyAdmin()) { + revert NotFromProxyAdmin(); + } if (cadenceInMonths == 0) { cadenceInMonths = 6; } @@ -250,8 +262,8 @@ contract SecurityCouncilNomineeElectionGovernor is } // check to make sure the contender is not part of the other cohort (the cohort not currently up for election) - // this only checks against the current the current other cohort, and against the current cohort membership - // in the security council, so changes to those will mean this check will be inconsistent. + // this only checks against the current cohort membership of the security council, + // so changes to those will mean this check will be inconsistent. // this check then is only a relevant check when the elections are running as expected - one at a time, // every `cadenceInMonths` months. Updates to the sec council manager using methods other than replaceCohort can effect this check // and it's expected that the entity making those updates understands this. @@ -353,6 +365,47 @@ contract SecurityCouncilNomineeElectionGovernor is _addNominee(proposalId, account); } + /// @notice Allows a nominee to rotate their position to a new address + /// @param proposalId The id of the proposal + /// @param newNomineeAddress The new address to rotate to + /// @param signature A signature from the new member address over the 712 rotateNominee hash + function rotateNominee(uint256 proposalId, address newNomineeAddress, bytes calldata signature) + external + { + ElectionInfo storage election = _elections[proposalId]; + + if (!isCompliantNominee(proposalId, msg.sender)) { + revert NotCompliantNominee(msg.sender); + } + + uint256 rotationDeadline = proposalVettingDeadline(proposalId) - ROTATION_CUT_OFF_BLOCKS; + if (block.number > rotationDeadline) { + revert ProposalNotInRotationPeriod(block.number, rotationDeadline); + } + + address signer = recoverRotateNomineeMessage(proposalId, signature, msg.sender); + if (signer != newNomineeAddress) { + revert InvalidSignature(); + } + + // check to make sure the new nominee is not part of the other cohort (the cohort not currently up for election) + // this only checks against the current the current other cohort, and against the current cohort membership + // in the security council, so changes to those will mean this check will be inconsistent. + // this check then is only a relevant check when the elections are running as expected - one at a time, + // every 6 months. Updates to the sec council manager using methods other than replaceCohort can effect this check + // and it's expected that the entity making those updates understands this. + if (securityCouncilManager.cohortIncludes(otherCohort(), newNomineeAddress)) { + revert AccountInOtherCohort(otherCohort(), newNomineeAddress); + } + + // rotation by first excluding the nominee and then adding the new nominee + election.isExcluded[msg.sender] = true; + election.excludedNomineeCount++; + _addNominee(proposalId, newNomineeAddress); + emit NomineeExcluded(proposalId, msg.sender); + emit NomineeRotated(proposalId, msg.sender, newNomineeAddress); + } + /// @dev `GovernorUpgradeable` function to execute a proposal overridden to handle nominee elections. /// Can be called by anyone via `execute` after voting and nominee vetting periods have ended. /// If the number of compliant nominees is > the target number of nominees, @@ -471,6 +524,23 @@ contract SecurityCouncilNomineeElectionGovernor is return ECDSAUpgradeable.recover(digest, signature); } + function recoverRotateNomineeMessage(uint256 proposalId, bytes calldata signature, address from) + public + view + returns (address) + { + bytes32 digest = _hashTypedDataV4( + keccak256( + abi.encode( + keccak256("RotateNomineeMessage(uint256 proposalId, address from)"), + proposalId, + from + ) + ) + ); + return ECDSAUpgradeable.recover(digest, signature); + } + /// @notice Always reverts. /// @dev `GovernorUpgradeable` function to create a proposal overridden to just revert. /// We only want proposals to be created via `createElection`. @@ -523,15 +593,6 @@ contract SecurityCouncilNomineeElectionGovernor is ); } - /// @notice Deprecated, use `addContender(uint256 proposalId, bytes calldata signature)` instead - /// @dev This function is deprecated because contenders should only be EOA's that can produce signatures. - /// If a security council member's address is not an EOA, then they may be unable to sign on all relevant chains. - function addContender(uint256) external pure { - revert Deprecated( - "addContender(uint256 proposalId) has been deprecated. Use addContender(uint256 proposalId, bytes calldata signature) instead" - ); - } - /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. diff --git a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol index 8376b8844..c5ed75f96 100644 --- a/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol +++ b/src/security-council-mgmt/interfaces/ISecurityCouncilManager.sol @@ -46,12 +46,9 @@ interface ISecurityCouncilManager { error GovernorNotReplacer(); error NewMemberIsContender(uint256 proposalId, address newMember); error NewMemberIsNominee(uint256 proposalId, address newMember); - error NewMemberIsRotating(address newMember); - error NewMemberIsRotatingTarget(address newMember); error InvalidNewAddress(address newAddress); function rotatedTo(address) external view returns (address); - function rotatingTo(address) external view returns (address); function rotationNonce(address) external view returns (uint256); /// @notice There is a minimum period between when an address can be rotated @@ -107,9 +104,6 @@ interface ISecurityCouncilManager { /// @param _member Member to remove function removeMember(address _member) external; /// @notice Replace a member in a council - equivalent to removing a member, then adding another in its place. - /// Identities of members should be different. - /// Functionality is equivalent to replaceMember, - /// though emits a different event to distinguish the security council's intent (different identities). /// @dev Initiates cross chain messages to update the individual Security Councils. /// When replacing a member, make sure that the key does not conflict with any contenders/nominees of ongoing electoins. /// @param _memberToReplace Security Council member to remove @@ -130,19 +124,6 @@ interface ISecurityCouncilManager { address memberElectionGovernor, bytes calldata signature ) external; - /// @notice Get the hash to be signed for future member rotation - /// @param from The address that will be rotated out. This is included in the hash so that other members cant use this message to rotate their address - /// @param nonce The message nonce. Must be the from address's current rotationNonce - function getSetRotatingToHash(address from, uint256 nonce) external view returns (bytes32); - /// @notice Set an address to be rotated to if the sender is ever elected as a member - /// This enables unelected members to decide where their election address will update to. When a member is elected to the council they - /// are expected to have a high level of security on their member key. Election candidates may not have set up that high level of security before - /// registering their election key, so this method allows them to set up a new key that will be actually installed as the member upon election. - /// If this future rotation causes a clash, the rotation will not be executed and the original address will be installed - /// This rotation only applies to future replaceCohort, mainly used by the member election governor - /// @param newMemberAddress The new member address to be rotated to - /// @param signature A signature from the new member address over the 712 setRotatingTo hash - function setRotatingTo(address newMemberAddress, bytes calldata signature) external; /// @notice Is the account a member of the first cohort function firstCohortIncludes(address account) external view returns (bool); /// @notice Is the account a member of the second cohort diff --git a/test/security-council-mgmt/SecurityCouncilManager.t.sol b/test/security-council-mgmt/SecurityCouncilManager.t.sol index dc3f757a5..7ff34235e 100644 --- a/test/security-council-mgmt/SecurityCouncilManager.t.sol +++ b/test/security-council-mgmt/SecurityCouncilManager.t.sol @@ -921,127 +921,6 @@ contract SecurityCouncilManagerTest is Test { scm.replaceCohort(newCohortWithADup, Cohort.SECOND); } - function testReplaceCohortRotatingTo() public { - // set a rotatingTo for a member of the first cohort - address[] memory newCohortCopy = newCohort; - address rotatingFrom = newCohortCopy[1]; - bytes32 digest = scm.getSetRotatingToHash(rotatingFrom, scm.rotationNonce(rotatingFrom)); - bytes memory signature = sign(pk1, digest); - vm.prank(rotatingFrom); - scm.setRotatingTo(memberToRotate1, signature); - - vm.startPrank(roles.cohortUpdator); - vm.recordLogs(); - scm.replaceCohort(newCohortCopy, Cohort.FIRST); - checkScheduleWasCalled(); - vm.stopPrank(); - - newCohortCopy[1] = memberToRotate1; - - assertTrue( - TestUtil.areUniqueAddressArraysEqual(newCohortCopy, scm.getFirstCohort()), - "first cohort updated" - ); - - assertTrue( - TestUtil.areUniqueAddressArraysEqual(secondCohort, scm.getSecondCohort()), - "second cohort untouched" - ); - - rotatingFrom = newCohortCopy[2]; - digest = scm.getSetRotatingToHash(rotatingFrom, scm.rotationNonce(rotatingFrom)); - signature = sign(pknc1, digest); - vm.prank(rotatingFrom); - scm.setRotatingTo(pkncAddr1, signature); - - // set rotation to a member of the incoming cohort - vm.startPrank(roles.cohortUpdator); - vm.recordLogs(); - scm.replaceCohort(newCohortCopy, Cohort.FIRST); - checkScheduleWasCalled(); - vm.stopPrank(); - - // should still just equal the newcohort copy - assertTrue( - TestUtil.areUniqueAddressArraysEqual(newCohortCopy, scm.getFirstCohort()), - "first cohort updated" - ); - assertTrue( - TestUtil.areUniqueAddressArraysEqual(secondCohort, scm.getSecondCohort()), - "second cohort untouched" - ); - - // now try rotate to a member of the other cohort - rotatingFrom = newCohortCopy[2]; - digest = scm.getSetRotatingToHash(rotatingFrom, scm.rotationNonce(rotatingFrom)); - signature = sign(pknc2, digest); - vm.prank(rotatingFrom); - scm.setRotatingTo(pkncAddr2, signature); - - // set rotation to a member of the incoming cohort - vm.startPrank(roles.cohortUpdator); - vm.recordLogs(); - scm.replaceCohort(newCohortCopy, Cohort.FIRST); - checkScheduleWasCalled(); - vm.stopPrank(); - - // should still just equal the newcohort copy - assertTrue( - TestUtil.areUniqueAddressArraysEqual(newCohortCopy, scm.getFirstCohort()), - "first cohort updated" - ); - assertTrue( - TestUtil.areUniqueAddressArraysEqual(secondCohort, scm.getSecondCohort()), - "second cohort untouched" - ); - - // put it back to how we found it - vm.startPrank(roles.cohortUpdator); - vm.recordLogs(); - scm.replaceCohort(firstCohort, Cohort.FIRST); - checkScheduleWasCalled(); - vm.stopPrank(); - } - - event RotatingToSet(address indexed replacedAddress, address indexed newAddress); - - function testSetRotatingTo() public { - address testAddr = vm.addr(97_990); - - uint256 testPk1 = 45_678; - address addr1 = vm.addr(testPk1); - uint256 testPk2 = 45_679; - address addr2 = vm.addr(testPk2); - - assertEq(scm.rotatingTo(testAddr), address(0)); - assertEq(scm.rotationNonce(testAddr), 0); - - bytes32 digest = scm.getSetRotatingToHash(testAddr, scm.rotationNonce(testAddr)); - bytes memory signature = sign(testPk1, digest); - - vm.prank(testAddr); - vm.expectRevert( - abi.encodeWithSelector(ISecurityCouncilManager.InvalidNewAddress.selector, addr1) - ); - scm.setRotatingTo(address(1), signature); - - vm.prank(testAddr); - vm.expectEmit(true, true, true, true); - emit RotatingToSet({replacedAddress: testAddr, newAddress: addr1}); - scm.setRotatingTo(addr1, signature); - assertEq(scm.rotatingTo(testAddr), addr1); - assertEq(scm.rotationNonce(testAddr), 1); - - digest = scm.getSetRotatingToHash(testAddr, scm.rotationNonce(testAddr)); - signature = sign(testPk2, digest); - vm.prank(testAddr); - vm.expectEmit(true, true, true, true); - emit RotatingToSet({replacedAddress: testAddr, newAddress: addr2}); - scm.setRotatingTo(addr2, signature); - assertEq(scm.rotatingTo(testAddr), addr2); - assertEq(scm.rotationNonce(testAddr), 2); - } - function testUpdateRouterAffordances() public { UpgradeExecRouteBuilder newRouter = UpgradeExecRouteBuilder(TestUtil.deployStubContract()); vm.prank(rando); diff --git a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol index 2691c0cd5..8ed5af784 100644 --- a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol +++ b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol @@ -36,6 +36,26 @@ contract SigUtils is Test { sig = abi.encodePacked(r, s, v); } + function signRotateNomineeMessage(uint256 proposalId, uint256 privKey, address from) + public + view + returns (bytes memory sig) + { + bytes32 digest = _hashTypedDataV4( + keccak256( + abi.encode( + keccak256("RotateNomineeMessage(uint256 proposalId, address from)"), + proposalId, + from + ) + ) + ); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign(privKey, digest); + + sig = abi.encodePacked(r, s, v); + } + function _domainSeparatorV4() internal view returns (bytes32) { return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash()); } @@ -1155,4 +1175,78 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { assertEq(secondElection, expectedSecondTime, "Elections should be 36 months apart"); } + + function testRotateNominee() public { + uint256 proposalId = _propose(); + + // create a nominee + vm.roll(governor.proposalSnapshot(proposalId)); + _addContender(proposalId, 0); + vm.roll(governor.proposalDeadline(proposalId)); + _mockGetPastVotes(_voter(0), governor.quorum(proposalId)); + _castVoteForContender(proposalId, _voter(0), _contender(0), governor.quorum(proposalId)); + + bytes memory sig = + sigUtils.signRotateNomineeMessage(proposalId, _contenderPrivKey(1), _contender(0)); + uint256 rotationDeadline = governor.proposalVettingDeadline(proposalId) - 21_600; + + // cannot rotate after the deadline + vm.roll(rotationDeadline + 1); + vm.prank(_contender(0)); + vm.expectRevert( + abi.encodeWithSelector( + SecurityCouncilNomineeElectionGovernor.ProposalNotInRotationPeriod.selector, + block.number, + rotationDeadline + ) + ); + governor.rotateNominee(proposalId, _contender(1), sig); + vm.roll(rotationDeadline); + + // cannot rotate if not a compliant nominee + vm.prank(_contender(1)); + vm.expectRevert( + abi.encodeWithSelector( + SecurityCouncilNomineeElectionGovernor.NotCompliantNominee.selector, _contender(1) + ) + ); + governor.rotateNominee(proposalId, _contender(1), sig); + + // cannot rotate with invalid signature + vm.prank(_contender(0)); + vm.expectRevert( + abi.encodeWithSelector(SecurityCouncilNomineeElectionGovernor.InvalidSignature.selector) + ); + governor.rotateNominee(proposalId, _contender(2), sig); + + // cannot rotate if in other cohort + _mockCohortIncludes(Cohort.SECOND, _contender(1), true); + vm.prank(_contender(0)); + vm.expectRevert( + abi.encodeWithSelector( + SecurityCouncilNomineeElectionGovernor.AccountInOtherCohort.selector, + Cohort.SECOND, + _contender(1) + ) + ); + governor.rotateNominee(proposalId, _contender(1), sig); + + // rotate the nominee + _mockCohortIncludes(Cohort.SECOND, _contender(1), false); + vm.prank(_contender(0)); + governor.rotateNominee(proposalId, _contender(1), sig); + + // cannot rotate again + vm.prank(_contender(0)); + vm.expectRevert( + abi.encodeWithSelector( + SecurityCouncilNomineeElectionGovernor.NotCompliantNominee.selector, _contender(0) + ) + ); + governor.rotateNominee(proposalId, _contender(1), sig); + + // make sure state is correct + assertTrue(governor.isCompliantNominee(proposalId, _contender(1))); + assertFalse(governor.isCompliantNominee(proposalId, _contender(0))); + } } diff --git a/test/signatures/SecurityCouncilManager b/test/signatures/SecurityCouncilManager index 025a874f4..9c8385eae 100644 --- a/test/signatures/SecurityCouncilManager +++ b/test/signatures/SecurityCouncilManager @@ -26,8 +26,6 @@ |-------------------------------------------------------------------------------------------------------------------------------------------------+------------| | ROTATE_MEMBER_TYPE_HASH() | aea6b1e7 | |-------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| SET_ROTATING_TO_TYPE_HASH() | ff57aaed | -|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| | VERSION_HASH() | 9e4e7318 | |-------------------------------------------------------------------------------------------------------------------------------------------------+------------| | addMember(address,uint8) | 62d0d1c3 | @@ -54,8 +52,6 @@ |-------------------------------------------------------------------------------------------------------------------------------------------------+------------| | getSecondCohort() | bdc9f17c | |-------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| getSetRotatingToHash(address,uint256) | 2bf9dbfe | -|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| | grantRole(bytes32,address) | 2f2ff15d | |-------------------------------------------------------------------------------------------------------------------------------------------------+------------| | hasRole(bytes32,address) | 91d14854 | @@ -86,8 +82,6 @@ |-------------------------------------------------------------------------------------------------------------------------------------------------+------------| | rotatedTo(address) | 86bc77a3 | |-------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| rotatingTo(address) | cd6150a4 | -|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| | rotationNonce(address) | ac823694 | |-------------------------------------------------------------------------------------------------------------------------------------------------+------------| | router() | f887ea40 | @@ -100,8 +94,6 @@ |-------------------------------------------------------------------------------------------------------------------------------------------------+------------| | setMinRotationPeriod(uint256) | d4c271b2 | |-------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| setRotatingTo(address,bytes) | 62cd078d | -|-------------------------------------------------------------------------------------------------------------------------------------------------+------------| | setUpgradeExecRouteBuilder(address) | 0e5e43d7 | |-------------------------------------------------------------------------------------------------------------------------------------------------+------------| | supportsInterface(bytes4) | 01ffc9a7 | diff --git a/test/signatures/SecurityCouncilNomineeElectionGovernor b/test/signatures/SecurityCouncilNomineeElectionGovernor index 2f3f77cab..91fbde2ab 100644 --- a/test/signatures/SecurityCouncilNomineeElectionGovernor +++ b/test/signatures/SecurityCouncilNomineeElectionGovernor @@ -10,7 +10,7 @@ |-----------------------------------------------------------------------------------------------------------------+------------| | EXTENDED_BALLOT_TYPEHASH() | 2fe3e261 | |-----------------------------------------------------------------------------------------------------------------+------------| -| addContender(uint256) | 140af012 | +| ROTATION_CUT_OFF_BLOCKS() | 6bc9d9ab | |-----------------------------------------------------------------------------------------------------------------+------------| | addContender(uint256,bytes) | a8f38759 | |-----------------------------------------------------------------------------------------------------------------+------------| @@ -116,10 +116,14 @@ |-----------------------------------------------------------------------------------------------------------------+------------| | recoverAddContenderMessage(uint256,bytes) | 5a756eaf | |-----------------------------------------------------------------------------------------------------------------+------------| +| recoverRotateNomineeMessage(uint256,bytes,address) | 307d1d14 | +|-----------------------------------------------------------------------------------------------------------------+------------| | relay(address,uint256,bytes) | c28bc2fa | |-----------------------------------------------------------------------------------------------------------------+------------| | renounceOwnership() | 715018a6 | |-----------------------------------------------------------------------------------------------------------------+------------| +| rotateNominee(uint256,address,bytes) | 5cd48043 | +|-----------------------------------------------------------------------------------------------------------------+------------| | securityCouncilManager() | 03d1ce8a | |-----------------------------------------------------------------------------------------------------------------+------------| | securityCouncilMemberElectionGovernor() | 1b6a7673 | diff --git a/test/storage/SecurityCouncilManager b/test/storage/SecurityCouncilManager index ffd9b0e5c..972049f05 100644 --- a/test/storage/SecurityCouncilManager +++ b/test/storage/SecurityCouncilManager @@ -34,10 +34,8 @@ |-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| | minRotationPeriod | uint256 | 160 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | |-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| -| rotatingTo | mapping(address => address) | 161 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| rotationNonce | mapping(address => uint256) | 161 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | |-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| -| rotationNonce | mapping(address => uint256) | 162 | 0 | 32 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | -|-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------| -| __gap | uint256[38] | 163 | 0 | 1216 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | +| __gap | uint256[39] | 162 | 0 | 1248 | src/security-council-mgmt/SecurityCouncilManager.sol:SecurityCouncilManager | ╰-------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------╯ From 2cd220c43d681e42469a567dc6817cc54363e0dc Mon Sep 17 00:00:00 2001 From: gzeon Date: Thu, 4 Sep 2025 21:51:57 +0900 Subject: [PATCH 092/108] fix: prevent duplicate members --- ...SecurityCouncilNomineeElectionGovernor.sol | 51 ++++++------------- ...neeElectionGovernorCountingUpgradeable.sol | 3 ++ 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol index e611f3bf9..e289383f2 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol @@ -62,7 +62,7 @@ contract SecurityCouncilNomineeElectionGovernor is /// Currently this is set to 3 days, assuming 12 blocks per second. /// @dev It is known that a malicious nominee can abuse rotation to avoid vetting, /// but the nominee vetter would always have 3 extra days after any rotation to exclude the nominee if needed. - uint256 public constant ROTATION_CUT_OFF_BLOCKS = 21600; + uint256 public constant ROTATION_CUT_OFF_BLOCKS = 21_600; /// @notice Address responsible for blocking non compliant nominees address public nomineeVetter; @@ -261,22 +261,13 @@ contract SecurityCouncilNomineeElectionGovernor is revert ProposalNotPending(state_); } - // check to make sure the contender is not part of the other cohort (the cohort not currently up for election) - // this only checks against the current cohort membership of the security council, - // so changes to those will mean this check will be inconsistent. - // this check then is only a relevant check when the elections are running as expected - one at a time, - // every `cadenceInMonths` months. Updates to the sec council manager using methods other than replaceCohort can effect this check - // and it's expected that the entity making those updates understands this. - if (securityCouncilManager.cohortIncludes(otherCohort(), signer)) { - revert AccountInOtherCohort(otherCohort(), signer); - } - + _validateNotInOtherCohort(signer); election.isContender[signer] = true; - emit ContenderAdded(proposalId, signer); // if the signer is part of the outgoing cohort, we automatically add them as a nominee if (securityCouncilManager.cohortIncludes(currentCohort(), signer)) { + // no need to check for duplicate nominees as we already checked _addNominee(proposalId, signer); } } @@ -342,26 +333,13 @@ contract SecurityCouncilNomineeElectionGovernor is revert ProposalNotSucceededState(state_); } - if (isNominee(proposalId, account)) { - revert NomineeAlreadyAdded(account); - } - uint256 cnCount = compliantNomineeCount(proposalId); uint256 cohortSize = securityCouncilManager.cohortSize(); if (cnCount >= cohortSize) { revert CompliantNomineeTargetHit(cnCount, cohortSize); } - // can't include nominees from the other cohort (the cohort not currently up for election) - // this only checks against the current the current other cohort, and against the current cohort membership - // in the security council, so changes to those will mean this check will be inconsistent. - // this check then is only a relevant check when the elections are running as expected - one at a time, - // every `cadenceInMonths` months. Updates to the sec council manager using methods other than replaceCohort can effect this check - // and it's expected that the entity making those updates understands this. - if (securityCouncilManager.cohortIncludes(otherCohort(), account)) { - revert AccountInOtherCohort(otherCohort(), account); - } - + _validateNotInOtherCohort(account); _addNominee(proposalId, account); } @@ -388,22 +366,25 @@ contract SecurityCouncilNomineeElectionGovernor is revert InvalidSignature(); } + // rotation by first excluding the nominee and then adding the new nominee + election.isExcluded[msg.sender] = true; + election.excludedNomineeCount++; + _validateNotInOtherCohort(newNomineeAddress); + _addNominee(proposalId, newNomineeAddress); + emit NomineeExcluded(proposalId, msg.sender); + emit NomineeRotated(proposalId, msg.sender, newNomineeAddress); + } + + function _validateNotInOtherCohort(address account) internal { // check to make sure the new nominee is not part of the other cohort (the cohort not currently up for election) // this only checks against the current the current other cohort, and against the current cohort membership // in the security council, so changes to those will mean this check will be inconsistent. // this check then is only a relevant check when the elections are running as expected - one at a time, // every 6 months. Updates to the sec council manager using methods other than replaceCohort can effect this check // and it's expected that the entity making those updates understands this. - if (securityCouncilManager.cohortIncludes(otherCohort(), newNomineeAddress)) { - revert AccountInOtherCohort(otherCohort(), newNomineeAddress); + if (securityCouncilManager.cohortIncludes(otherCohort(), account)) { + revert AccountInOtherCohort(otherCohort(), account); } - - // rotation by first excluding the nominee and then adding the new nominee - election.isExcluded[msg.sender] = true; - election.excludedNomineeCount++; - _addNominee(proposalId, newNomineeAddress); - emit NomineeExcluded(proposalId, msg.sender); - emit NomineeRotated(proposalId, msg.sender, newNomineeAddress); } /// @dev `GovernorUpgradeable` function to execute a proposal overridden to handle nominee elections. diff --git a/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorCountingUpgradeable.sol b/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorCountingUpgradeable.sol index 9cc6d7e3c..efbe43206 100644 --- a/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorCountingUpgradeable.sol +++ b/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorCountingUpgradeable.sol @@ -121,6 +121,9 @@ abstract contract SecurityCouncilNomineeElectionGovernorCountingUpgradeable is /// @dev Transitions an account to being a nominee function _addNominee(uint256 proposalId, address account) internal { + if (isNominee(proposalId, account)) { + revert NomineeAlreadyAdded(account); + } _elections[proposalId].nominees.push(account); _elections[proposalId].isNominee[account] = true; emit NewNominee(proposalId, account); From 56d9fa23f77795b76c0600b6a9f44edf80557030 Mon Sep 17 00:00:00 2001 From: gzeon Date: Thu, 4 Sep 2025 21:53:59 +0900 Subject: [PATCH 093/108] feat: _requireNotInOtherCohort --- ...SecurityCouncilNomineeElectionGovernor.sol | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol index e289383f2..8fc1f8431 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol @@ -211,6 +211,18 @@ contract SecurityCouncilNomineeElectionGovernor is electionCount++; } + function _requireNotInOtherCohort(address account) internal { + // check to make sure the new nominee is not part of the other cohort (the cohort not currently up for election) + // this only checks against the current the current other cohort, and against the current cohort membership + // in the security council, so changes to those will mean this check will be inconsistent. + // this check then is only a relevant check when the elections are running as expected - one at a time, + // every 6 months. Updates to the sec council manager using methods other than replaceCohort can effect this check + // and it's expected that the entity making those updates understands this. + if (securityCouncilManager.cohortIncludes(otherCohort(), account)) { + revert AccountInOtherCohort(otherCohort(), account); + } + } + /// @dev Revert if the previous member election has not executed. /// Ensures that there are no unexpected behaviors from multiple elections running at the same time. /// If, for some reason, the previous member election is blocked, @@ -261,7 +273,7 @@ contract SecurityCouncilNomineeElectionGovernor is revert ProposalNotPending(state_); } - _validateNotInOtherCohort(signer); + _requireNotInOtherCohort(signer); election.isContender[signer] = true; emit ContenderAdded(proposalId, signer); @@ -339,7 +351,7 @@ contract SecurityCouncilNomineeElectionGovernor is revert CompliantNomineeTargetHit(cnCount, cohortSize); } - _validateNotInOtherCohort(account); + _requireNotInOtherCohort(account); _addNominee(proposalId, account); } @@ -369,24 +381,12 @@ contract SecurityCouncilNomineeElectionGovernor is // rotation by first excluding the nominee and then adding the new nominee election.isExcluded[msg.sender] = true; election.excludedNomineeCount++; - _validateNotInOtherCohort(newNomineeAddress); + _requireNotInOtherCohort(newNomineeAddress); _addNominee(proposalId, newNomineeAddress); emit NomineeExcluded(proposalId, msg.sender); emit NomineeRotated(proposalId, msg.sender, newNomineeAddress); } - function _validateNotInOtherCohort(address account) internal { - // check to make sure the new nominee is not part of the other cohort (the cohort not currently up for election) - // this only checks against the current the current other cohort, and against the current cohort membership - // in the security council, so changes to those will mean this check will be inconsistent. - // this check then is only a relevant check when the elections are running as expected - one at a time, - // every 6 months. Updates to the sec council manager using methods other than replaceCohort can effect this check - // and it's expected that the entity making those updates understands this. - if (securityCouncilManager.cohortIncludes(otherCohort(), account)) { - revert AccountInOtherCohort(otherCohort(), account); - } - } - /// @dev `GovernorUpgradeable` function to execute a proposal overridden to handle nominee elections. /// Can be called by anyone via `execute` after voting and nominee vetting periods have ended. /// If the number of compliant nominees is > the target number of nominees, From 5a315ba92f6d12491625b86fd1deab3cdc9bcda5 Mon Sep 17 00:00:00 2001 From: gzeon Date: Thu, 4 Sep 2025 21:58:55 +0900 Subject: [PATCH 094/108] test: cannot rotate to existing nominee --- ...ecurityCouncilNomineeElectionGovernor.t.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol index 8ed5af784..672d23b02 100644 --- a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol +++ b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol @@ -1231,6 +1231,24 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { ); governor.rotateNominee(proposalId, _contender(1), sig); + // cannot rotate to existing nominee + bytes memory sig2 = + sigUtils.signRotateNomineeMessage(proposalId, _contenderPrivKey(2), _contender(0)); + vm.prank(initParams.nomineeVetter); + _mockCohortIncludes(Cohort.SECOND, _contender(2), false); + governor.includeNominee(proposalId, _contender(2)); + _mockCohortIncludes(Cohort.SECOND, _contender(2), false); + vm.prank(_contender(0)); + vm.expectRevert( + abi.encodeWithSelector( + SecurityCouncilNomineeElectionGovernorCountingUpgradeable + .NomineeAlreadyAdded + .selector, + _contender(2) + ) + ); + governor.rotateNominee(proposalId, _contender(2), sig2); + // rotate the nominee _mockCohortIncludes(Cohort.SECOND, _contender(1), false); vm.prank(_contender(0)); From f1902f5ac11a8b6e2264673e0d85828456f018eb Mon Sep 17 00:00:00 2001 From: gzeon Date: Thu, 4 Sep 2025 22:03:34 +0900 Subject: [PATCH 095/108] chore: update gas snapshot --- .gas-snapshot | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 59be04bce..a0b21b9ea 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -27,7 +27,7 @@ ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 86859495) +E2E:testE2E() (gas: 86786575) FixedDelegateErc20WalletTest:testInit() (gas: 5822585) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) @@ -95,11 +95,11 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28571182) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28519939) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28572810) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28812928) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32322314) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32326589) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 27265404) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32324545) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32345900) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32247486) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32251761) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 27190576) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32249717) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32271072) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317059, ~: 317184) @@ -138,7 +138,7 @@ SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 4 SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 479028) SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 270210) SecurityCouncilManagerTest:testRotateMember() (gas: 1015787) -SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 4078679) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 4080567) SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65814) SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83252) SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 313830) @@ -194,25 +194,25 @@ SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 8086867) SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8328313) SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8329174) SecurityCouncilMgmtUtilsTests:testIsInArray() (gas: 2102) -SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 418329) +SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 418681) SecurityCouncilNomineeElectionGovernorTest:testCadenceWithLargeValues() (gas: 52898) -SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 338828) -SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 301643) +SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 338857) +SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 301672) SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35303) -SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 593196) +SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 593835) SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 257942) SecurityCouncilNomineeElectionGovernorTest:testDefaultCadence() (gas: 14950) SecurityCouncilNomineeElectionGovernorTest:testElectionTimestampsWithDefaultCadence() (gas: 37625) -SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 461501) -SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 679315) -SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 199863) -SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 679144) -SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7833321) +SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 461806) +SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 679489) +SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 199892) +SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 678878) +SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7758495) SecurityCouncilNomineeElectionGovernorTest:testMultipleCadenceChanges() (gas: 238915) SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78159) SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19786) SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42411) -SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 510312) +SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 673577) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceAfterElections() (gas: 227636) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceBeforeFirstElection() (gas: 42502) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceInvalidValue() (gas: 26056) From 36d17e2ceb5dbcdb6c71aa2ee33681623189eb27 Mon Sep 17 00:00:00 2001 From: gzeon Date: Thu, 4 Sep 2025 23:02:24 +0900 Subject: [PATCH 096/108] fix: check new nominee address excluded --- .gas-snapshot | 16 ++++++++-------- .../SecurityCouncilNomineeElectionGovernor.sol | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index a0b21b9ea..c2c029d57 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -27,7 +27,7 @@ ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 86786575) +E2E:testE2E() (gas: 86811023) FixedDelegateErc20WalletTest:testInit() (gas: 5822585) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) @@ -95,11 +95,11 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28571182) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28519939) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28572810) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28812928) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32247486) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32251761) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 27190576) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32249717) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32271072) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32271955) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32276230) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 27215045) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32274186) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32295541) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317059, ~: 317184) @@ -207,12 +207,12 @@ SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 461806) SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 679489) SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 199892) SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 678878) -SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7758495) +SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7782964) SecurityCouncilNomineeElectionGovernorTest:testMultipleCadenceChanges() (gas: 238915) SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78159) SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19786) SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42411) -SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 673577) +SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 680405) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceAfterElections() (gas: 227636) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceBeforeFirstElection() (gas: 42502) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceInvalidValue() (gas: 26056) diff --git a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol index 8fc1f8431..92f03a0e9 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol @@ -373,6 +373,10 @@ contract SecurityCouncilNomineeElectionGovernor is revert ProposalNotInRotationPeriod(block.number, rotationDeadline); } + if (election.isExcluded[newNomineeAddress]) { + revert NomineeAlreadyExcluded(newNomineeAddress); + } + address signer = recoverRotateNomineeMessage(proposalId, signature, msg.sender); if (signer != newNomineeAddress) { revert InvalidSignature(); From 38c9efd8021aa2d0c38006c34d4ad4db77d3a740 Mon Sep 17 00:00:00 2001 From: gzeon Date: Fri, 5 Sep 2025 00:02:50 +0900 Subject: [PATCH 097/108] chore: update gas snapshot for new foundry version --- .gas-snapshot | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index c2c029d57..b610a96a1 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -14,7 +14,7 @@ ArbitrumFoundationVestingWalletTest:testOnlyOwnerCanMigrate() (gas: 16329777) ArbitrumFoundationVestingWalletTest:testOwnerCanSetBeneficiary() (gas: 16332196) ArbitrumFoundationVestingWalletTest:testProperlyInits() (gas: 16337566) ArbitrumFoundationVestingWalletTest:testRandomAddressCantSetBeneficiary() (gas: 16329676) -ArbitrumFoundationVestingWalletTest:testRelease() (gas: 16451151) +ArbitrumFoundationVestingWalletTest:testRelease() (gas: 16448651) ArbitrumVestingWalletFactoryTest:testDeploy() (gas: 4589688) ArbitrumVestingWalletFactoryTest:testOnlyOwnerCanCreateWallets() (gas: 1504286) ArbitrumVestingWalletTest:testCastVote() (gas: 16201599) @@ -27,7 +27,7 @@ ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 86811023) +E2E:testE2E() (gas: 86806023) FixedDelegateErc20WalletTest:testInit() (gas: 5822585) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) @@ -102,7 +102,7 @@ L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32274186) L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32295541) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) -OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317059, ~: 317184) +OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317090, ~: 317184) OfficeHoursActionTest:testInvalidConstructorParameters() (gas: 235740) OfficeHoursActionTest:testPerformBeforeMinimumTimestamp() (gas: 8646) OfficeHoursActionTest:testPerformDuringOfficeHours() (gas: 9140) @@ -143,7 +143,7 @@ SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65814) SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83252) SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 313830) SecurityCouncilManagerTest:testUpdateRouter() (gas: 76407) -SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 112474) +SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 109974) SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 313924) SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 247018) SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302873) @@ -160,7 +160,7 @@ SecurityCouncilMemberElectionGovernorTest:testOnlyNomineeElectionGovernorCanProp SecurityCouncilMemberElectionGovernorTest:testProperInitialization() (gas: 49388) SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32916) SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42229) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340137, ~: 339953) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 339752, ~: 339539) SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273467) SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34951) SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152898) From d2c153395f5a073199e65c0d1b97a5c1f8f95591 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Thu, 4 Sep 2025 10:45:48 -0700 Subject: [PATCH 098/108] mark _requireNotInOtherCohort as view and fix comment --- .../SecurityCouncilNomineeElectionGovernor.sol | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol index 92f03a0e9..f805ff0e6 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol @@ -211,12 +211,12 @@ contract SecurityCouncilNomineeElectionGovernor is electionCount++; } - function _requireNotInOtherCohort(address account) internal { - // check to make sure the new nominee is not part of the other cohort (the cohort not currently up for election) - // this only checks against the current the current other cohort, and against the current cohort membership - // in the security council, so changes to those will mean this check will be inconsistent. + function _requireNotInOtherCohort(address account) internal view { + // check to make sure the contender is not part of the other cohort (the cohort not currently up for election) + // this only checks against the current cohort membership of the security council, + // so changes to those will mean this check will be inconsistent. // this check then is only a relevant check when the elections are running as expected - one at a time, - // every 6 months. Updates to the sec council manager using methods other than replaceCohort can effect this check + // every `cadenceInMonths` months. Updates to the sec council manager using methods other than replaceCohort can effect this check // and it's expected that the entity making those updates understands this. if (securityCouncilManager.cohortIncludes(otherCohort(), account)) { revert AccountInOtherCohort(otherCohort(), account); @@ -275,6 +275,7 @@ contract SecurityCouncilNomineeElectionGovernor is _requireNotInOtherCohort(signer); election.isContender[signer] = true; + emit ContenderAdded(proposalId, signer); // if the signer is part of the outgoing cohort, we automatically add them as a nominee From b0858336dcc89f6f7e88d7327471c325927abf29 Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 21 Jul 2026 17:35:32 +0800 Subject: [PATCH 099/108] fix: prevent duplicate members (#361) * fix: prevent duplicate members * feat: _requireNotInOtherCohort * test: cannot rotate to existing nominee * chore: update gas snapshot * fix: check new nominee address excluded * chore: update gas snapshot for new foundry version * mark _requireNotInOtherCohort as view and fix comment --------- Co-authored-by: Henry <11198460+godzillaba@users.noreply.github.com> --- .gas-snapshot | 409 +++++++++--------- ...SecurityCouncilNomineeElectionGovernor.sol | 56 +-- ...neeElectionGovernorCountingUpgradeable.sol | 3 + ...curityCouncilNomineeElectionGovernor.t.sol | 18 + 4 files changed, 241 insertions(+), 245 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 625d6c444..2b52e7281 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -5,172 +5,150 @@ ArbitrumDAOConstitutionTest:testConstructor() (gas: 259383) ArbitrumDAOConstitutionTest:testMonOwnerCannotSetHash() (gas: 262836) ArbitrumDAOConstitutionTest:testOwnerCanSetHash() (gas: 261148) ArbitrumDAOConstitutionTest:testOwnerCanSetHashTwice() (gas: 263824) -ArbitrumFoundationVestingWalletTest:testBeneficiaryCanSetBeneficiary() (gas: 16921206) -ArbitrumFoundationVestingWalletTest:testMigrateEthToNewWalletWithSlowerVesting() (gas: 19719095) -ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithFasterVesting() (gas: 19723084) -ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithSlowerVesting() (gas: 19723029) -ArbitrumFoundationVestingWalletTest:testMigrationTargetMustBeContract() (gas: 16924455) -ArbitrumFoundationVestingWalletTest:testOnlyBeneficiaryCanRelease() (gas: 16916407) -ArbitrumFoundationVestingWalletTest:testOnlyOwnerCanMigrate() (gas: 16918774) -ArbitrumFoundationVestingWalletTest:testOwnerCanSetBeneficiary() (gas: 16921289) -ArbitrumFoundationVestingWalletTest:testProperlyInits() (gas: 16926820) -ArbitrumFoundationVestingWalletTest:testRandomAddressCantSetBeneficiary() (gas: 16918655) -ArbitrumFoundationVestingWalletTest:testRelease() (gas: 17044684) -ArbitrumVestingWalletFactoryTest:testDeploy() (gas: 4589694) -ArbitrumVestingWalletFactoryTest:testOnlyOwnerCanCreateWallets() (gas: 1504292) -ArbitrumVestingWalletTest:testCastVote() (gas: 16930552) -ArbitrumVestingWalletTest:testCastVoteFailsForNonBeneficiary() (gas: 16877248) -ArbitrumVestingWalletTest:testClaim() (gas: 16707924) -ArbitrumVestingWalletTest:testClaimFailsForNonBeneficiary() (gas: 16642711) -ArbitrumVestingWalletTest:testDelegate() (gas: 16784670) -ArbitrumVestingWalletTest:testDelegateFailsForNonBeneficiary() (gas: 16708567) -ArbitrumVestingWalletTest:testDoesDeploy() (gas: 16646098) -ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16708781) -ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16775433) -Cancel:testFuzz_CancelsPendingProposal(uint256) (runs: 256, μ: 343001, ~: 343001) -Cancel:testFuzz_RevertIf_AlreadyCanceled(uint256) (runs: 256, μ: 350297, ~: 350297) -Cancel:testFuzz_RevertIf_NotProposer(uint256,address) (runs: 256, μ: 337631, ~: 337631) -Cancel:testFuzz_RevertIf_ProposalIsActive(uint256) (runs: 256, μ: 342482, ~: 342482) -E2E:testE2E() (gas: 83338879) -Execute:testFuzz_EmitsExecuteEvent(uint256,address) (runs: 257, μ: 611339, ~: 611339) -Execute:testFuzz_ExecutesASucceededProposal(uint256) (runs: 257, μ: 611129, ~: 611129) -Execute:testFuzz_RevertIf_OperationNotReady(uint256,address) (runs: 257, μ: 599719, ~: 599719) -FixedDelegateErc20WalletTest:testInit() (gas: 5962806) -FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5956180) -FixedDelegateErc20WalletTest:testTransfer() (gas: 6121973) -FixedDelegateErc20WalletTest:testTransferNotOwner() (gas: 6084194) -InboxActionsTest:testPauseAndUpauseInbox() (gas: 370760) -L1AddressRegistryTest:testAddressRegistryAddress() (gas: 47105) -L1ArbitrumTimelockTest:testCancel() (gas: 5349713) -L1ArbitrumTimelockTest:testCancelFailsBadSender() (gas: 5394603) -L1ArbitrumTimelockTest:testDoesDeploy() (gas: 5298115) -L1ArbitrumTimelockTest:testDoesNotDeployZeroInbox() (gas: 5004008) -L1ArbitrumTimelockTest:testDoesNotDeployZeroL2Timelock() (gas: 5001978) -L1ArbitrumTimelockTest:testExecute() (gas: 5430420) -L1ArbitrumTimelockTest:testExecuteInbox() (gas: 5784952) -L1ArbitrumTimelockTest:testExecuteInboxBatch() (gas: 6087826) -L1ArbitrumTimelockTest:testExecuteInboxInvalidData() (gas: 5472154) -L1ArbitrumTimelockTest:testExecuteInboxNotEnoughVal() (gas: 5484755) -L1ArbitrumTimelockTest:testSchedule() (gas: 5382865) -L1ArbitrumTimelockTest:testScheduleFailsBadL2Timelock() (gas: 5311169) -L1ArbitrumTimelockTest:testScheduleFailsBadSender() (gas: 5306141) -L1ArbitrumTokenTest:testBridgeBurn() (gas: 3395679) -L1ArbitrumTokenTest:testBridgeBurnNotGateway() (gas: 3389683) -L1ArbitrumTokenTest:testBridgeMint() (gas: 3390882) -L1ArbitrumTokenTest:testBridgeMintNotGateway() (gas: 3341084) -L1ArbitrumTokenTest:testInit() (gas: 3356227) -L1ArbitrumTokenTest:testInitZeroGateway() (gas: 3177270) -L1ArbitrumTokenTest:testInitZeroNovaGateway() (gas: 3177337) -L1ArbitrumTokenTest:testInitZeroNovaRouter() (gas: 3177271) -L1ArbitrumTokenTest:testRegisterTokenOnL2() (gas: 4568996) -L1ArbitrumTokenTest:testRegisterTokenOnL2NotEnoughVal() (gas: 4425871) -L1GovernanceFactoryTest:testL1GovernanceFactory() (gas: 10796764) -L1GovernanceFactoryTest:testSetMinDelay() (gas: 10771242) -L1GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 10824209) -L2AddressRegistryTest:testAddressRegistryAddress() (gas: 54702) -L2ArbitrumTokenTest:testCanBurn() (gas: 4206836) -L2ArbitrumTokenTest:testCanMint2Percent() (gas: 4241646) -L2ArbitrumTokenTest:testCanMintLessThan2Percent() (gas: 4241648) -L2ArbitrumTokenTest:testCanMintTwiceWithWarp() (gas: 8470883) -L2ArbitrumTokenTest:testCanMintZero() (gas: 4221727) -L2ArbitrumTokenTest:testCanTransferAndCallContract() (gas: 4351925) -L2ArbitrumTokenTest:testCanTransferAndCallEmpty() (gas: 4237038) -L2ArbitrumTokenTest:testCannotMintMoreThan2Percent() (gas: 4210987) -L2ArbitrumTokenTest:testCannotMintNotOwner() (gas: 4208823) -L2ArbitrumTokenTest:testCannotMintTwice() (gas: 8438506) -L2ArbitrumTokenTest:testCannotMintWithoutFastForward() (gas: 4209248) -L2ArbitrumTokenTest:testCannotTransferAndCallNonReceiver() (gas: 4234323) -L2ArbitrumTokenTest:testCannotTransferAndCallReverter() (gas: 4294869) -L2ArbitrumTokenTest:testDecreaseDVPOnUndelegate() (gas: 4317040) -L2ArbitrumTokenTest:testDoesNotInitialiseZeroInitialSup() (gas: 3939579) -L2ArbitrumTokenTest:testDoesNotInitialiseZeroL1Token() (gas: 3939531) -L2ArbitrumTokenTest:testDoesNotInitialiseZeroOwner() (gas: 3939634) -L2ArbitrumTokenTest:testDvpAdjustment(uint64,int64) (runs: 256, μ: 4254235, ~: 4254851) -L2ArbitrumTokenTest:testDvpAtBlockBeforeFirstCheckpoint() (gas: 4254247) -L2ArbitrumTokenTest:testDvpDecreaseOnTransferFromDelegator() (gas: 4357412) -L2ArbitrumTokenTest:testDvpIncreaseOnTransferToDelegator() (gas: 4348789) -L2ArbitrumTokenTest:testDvpNoChangeOnSelfTransfer() (gas: 4373472) -L2ArbitrumTokenTest:testDvpNoChangeOnTransferToDelegator() (gas: 4426737) -L2ArbitrumTokenTest:testDvpNoChangeOnTransferToNonDelegator() (gas: 4232910) -L2ArbitrumTokenTest:testDvpNoRevertOnUnderflow() (gas: 4337873) -L2ArbitrumTokenTest:testIncreaseDVPOnDelegateToAnother() (gas: 4323322) -L2ArbitrumTokenTest:testIncreaseDVPOnSelfDelegate() (gas: 4323444) -L2ArbitrumTokenTest:testInitialDvpEstimate(uint64) (runs: 256, μ: 4248719, ~: 4248719) -L2ArbitrumTokenTest:testIsInitialised() (gas: 4212423) -L2ArbitrumTokenTest:testNoChangeDVPOnRedelegateToSame() (gas: 4395748) -L2ArbitrumTokenTest:testNoDoublePostUpgradeInit() (gas: 4249264) -L2ArbitrumTokenTest:testNoLogicContractInit() (gas: 2831938) -L2GovernanceFactoryTest:testContractsDeployed() (gas: 29387763) -L2GovernanceFactoryTest:testContractsInitialized() (gas: 29424888) -L2GovernanceFactoryTest:testDeploySteps() (gas: 29399416) -L2GovernanceFactoryTest:testProxyAdminOwnership() (gas: 29396773) -L2GovernanceFactoryTest:testRoles() (gas: 29419760) -L2GovernanceFactoryTest:testSanityCheckValues() (gas: 29444230) -L2GovernanceFactoryTest:testSetMinDelay() (gas: 29392769) -L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 29445646) -L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 29766026) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 29718801) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 29723152) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 24767154) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 29721032) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 29740353) -MiscTests:testCantReinit() (gas: 14345705) -MiscTests:testDVPQuorumAndClamping() (gas: 14717884) -MiscTests:testExecutorPermissions() (gas: 14383151) -MiscTests:testExecutorPermissionsFail() (gas: 14355476) -MiscTests:testMinMaxQuorumGetters() (gas: 14413247) -MiscTests:testPastCirculatingSupply() (gas: 14349820) -MiscTests:testPastCirculatingSupplyExclude() (gas: 14539332) -MiscTests:testPastCirculatingSupplyMint() (gas: 14416262) -MiscTests:testProperlyInitialized() (gas: 14343456) +ArbitrumFoundationVestingWalletTest:testBeneficiaryCanSetBeneficiary() (gas: 16332113) +ArbitrumFoundationVestingWalletTest:testMigrateEthToNewWalletWithSlowerVesting() (gas: 19243772) +ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithFasterVesting() (gas: 19247115) +ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithSlowerVesting() (gas: 19247060) +ArbitrumFoundationVestingWalletTest:testMigrationTargetMustBeContract() (gas: 16335446) +ArbitrumFoundationVestingWalletTest:testOnlyBeneficiaryCanRelease() (gas: 16327428) +ArbitrumFoundationVestingWalletTest:testOnlyOwnerCanMigrate() (gas: 16329777) +ArbitrumFoundationVestingWalletTest:testOwnerCanSetBeneficiary() (gas: 16332196) +ArbitrumFoundationVestingWalletTest:testProperlyInits() (gas: 16337566) +ArbitrumFoundationVestingWalletTest:testRandomAddressCantSetBeneficiary() (gas: 16329676) +ArbitrumFoundationVestingWalletTest:testRelease() (gas: 16448651) +ArbitrumVestingWalletFactoryTest:testDeploy() (gas: 4589688) +ArbitrumVestingWalletFactoryTest:testOnlyOwnerCanCreateWallets() (gas: 1504286) +ArbitrumVestingWalletTest:testCastVote() (gas: 16201599) +ArbitrumVestingWalletTest:testCastVoteFailsForNonBeneficiary() (gas: 16151356) +ArbitrumVestingWalletTest:testClaim() (gas: 16007783) +ArbitrumVestingWalletTest:testClaimFailsForNonBeneficiary() (gas: 15967970) +ArbitrumVestingWalletTest:testDelegate() (gas: 16081121) +ArbitrumVestingWalletTest:testDelegateFailsForNonBeneficiary() (gas: 16008450) +ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) +ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) +ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) +CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) +E2E:testE2E() (gas: 86806023) +FixedDelegateErc20WalletTest:testInit() (gas: 5822585) +FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) +FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) +FixedDelegateErc20WalletTest:testTransferNotOwner() (gas: 5897853) +InboxActionsTest:testPauseAndUpauseInbox() (gas: 370544) +L1AddressRegistryTest:testAddressRegistryAddress() (gas: 47009) +L1ArbitrumTimelockTest:testCancel() (gas: 5324647) +L1ArbitrumTimelockTest:testCancelFailsBadSender() (gas: 5369534) +L1ArbitrumTimelockTest:testDoesDeploy() (gas: 5273082) +L1ArbitrumTimelockTest:testDoesNotDeployZeroInbox() (gas: 4978966) +L1ArbitrumTimelockTest:testDoesNotDeployZeroL2Timelock() (gas: 4976936) +L1ArbitrumTimelockTest:testExecute() (gas: 5405357) +L1ArbitrumTimelockTest:testExecuteInbox() (gas: 5746383) +L1ArbitrumTimelockTest:testExecuteInboxBatch() (gas: 6056746) +L1ArbitrumTimelockTest:testExecuteInboxInvalidData() (gas: 5426404) +L1ArbitrumTimelockTest:testExecuteInboxNotEnoughVal() (gas: 5446215) +L1ArbitrumTimelockTest:testSchedule() (gas: 5357787) +L1ArbitrumTimelockTest:testScheduleFailsBadL2Timelock() (gas: 5286100) +L1ArbitrumTimelockTest:testScheduleFailsBadSender() (gas: 5281084) +L1ArbitrumTokenTest:testBridgeBurn() (gas: 3395576) +L1ArbitrumTokenTest:testBridgeBurnNotGateway() (gas: 3389616) +L1ArbitrumTokenTest:testBridgeMint() (gas: 3390803) +L1ArbitrumTokenTest:testBridgeMintNotGateway() (gas: 3341041) +L1ArbitrumTokenTest:testInit() (gas: 3355944) +L1ArbitrumTokenTest:testInitZeroGateway() (gas: 3177239) +L1ArbitrumTokenTest:testInitZeroNovaGateway() (gas: 3177306) +L1ArbitrumTokenTest:testInitZeroNovaRouter() (gas: 3177240) +L1ArbitrumTokenTest:testRegisterTokenOnL2() (gas: 4568617) +L1ArbitrumTokenTest:testRegisterTokenOnL2NotEnoughVal() (gas: 4425804) +L1GovernanceFactoryTest:testL1GovernanceFactory() (gas: 10771066) +L1GovernanceFactoryTest:testSetMinDelay() (gas: 10746048) +L1GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 10799003) +L2AddressRegistryTest:testAddressRegistryAddress() (gas: 54770) +L2ArbitrumGovernorTest:testCantReinit() (gas: 13669504) +L2ArbitrumGovernorTest:testExecutorPermissions() (gas: 13706498) +L2ArbitrumGovernorTest:testExecutorPermissionsFail() (gas: 13679150) +L2ArbitrumGovernorTest:testPastCirculatingSupply() (gas: 13673253) +L2ArbitrumGovernorTest:testPastCirculatingSupplyExclude() (gas: 13812730) +L2ArbitrumGovernorTest:testPastCirculatingSupplyMint() (gas: 13737233) +L2ArbitrumGovernorTest:testProperlyInitialized() (gas: 13664721) +L2ArbitrumTokenTest:testCanBurn() (gas: 4066835) +L2ArbitrumTokenTest:testCanMint2Percent() (gas: 4101512) +L2ArbitrumTokenTest:testCanMintLessThan2Percent() (gas: 4101514) +L2ArbitrumTokenTest:testCanMintTwiceWithWarp() (gas: 8190691) +L2ArbitrumTokenTest:testCanMintZero() (gas: 4081635) +L2ArbitrumTokenTest:testCanTransferAndCallContract() (gas: 4211883) +L2ArbitrumTokenTest:testCanTransferAndCallEmpty() (gas: 4096932) +L2ArbitrumTokenTest:testCannotMintMoreThan2Percent() (gas: 4071458) +L2ArbitrumTokenTest:testCannotMintNotOwner() (gas: 4069341) +L2ArbitrumTokenTest:testCannotMintTwice() (gas: 8158921) +L2ArbitrumTokenTest:testCannotMintWithoutFastForward() (gas: 4069700) +L2ArbitrumTokenTest:testCannotTransferAndCallNonReceiver() (gas: 4094203) +L2ArbitrumTokenTest:testCannotTransferAndCallReverter() (gas: 4154761) +L2ArbitrumTokenTest:testDoesNotInitialiseZeroInitialSup() (gas: 3800718) +L2ArbitrumTokenTest:testDoesNotInitialiseZeroL1Token() (gas: 3800726) +L2ArbitrumTokenTest:testDoesNotInitialiseZeroOwner() (gas: 3800739) +L2ArbitrumTokenTest:testIsInitialised() (gas: 4072777) +L2ArbitrumTokenTest:testNoLogicContractInit() (gas: 2693127) +L2GovernanceFactoryTest:testContractsDeployed() (gas: 28514933) +L2GovernanceFactoryTest:testContractsInitialized() (gas: 28551928) +L2GovernanceFactoryTest:testDeploySteps() (gas: 28526442) +L2GovernanceFactoryTest:testProxyAdminOwnership() (gas: 28523943) +L2GovernanceFactoryTest:testRoles() (gas: 28546930) +L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28571182) +L2GovernanceFactoryTest:testSetMinDelay() (gas: 28519939) +L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28572810) +L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28812928) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32271955) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32276230) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 27215045) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32274186) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32295541) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) -OfficeHoursActionTest:testConstructor() (gas: 9053) -OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317104, ~: 317184) -OfficeHoursActionTest:testInvalidConstructorParameters() (gas: 235758) +OfficeHoursActionTest:testConstructor() (gas: 9050) +OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317090, ~: 317184) +OfficeHoursActionTest:testInvalidConstructorParameters() (gas: 235740) OfficeHoursActionTest:testPerformBeforeMinimumTimestamp() (gas: 8646) OfficeHoursActionTest:testPerformDuringOfficeHours() (gas: 9140) OfficeHoursActionTest:testPerformFridayUTCSaturdayLocal() (gas: 304792) OfficeHoursActionTest:testPerformMondayUTCSundayLocal() (gas: 304783) OfficeHoursActionTest:testPerformOnWeekend() (gas: 9327) OfficeHoursActionTest:testPerformOutsideOfficeHours() (gas: 9537) -OutboxActionsTest:testAddOutbxesAction() (gas: 651905) -OutboxActionsTest:testCantAddEOA() (gas: 969460) -OutboxActionsTest:testCantReAddOutbox() (gas: 974878) -OutboxActionsTest:testRemoveAllOutboxes() (gas: 693873) -OutboxActionsTest:testRemoveOutboxes() (gas: 854776) -Propose:testFuzz_EmitsProposalCreatedEvent(uint256) (runs: 256, μ: 344799, ~: 344799) -Propose:testFuzz_ProposerAboveThresholdCanPropose(uint256) (runs: 256, μ: 334217, ~: 334217) -Propose:testFuzz_ProposerBelowThresholdCannotPropose(address) (runs: 256, μ: 46371, ~: 46371) -ProxyUpgradeAndCallActionTest:testUpgrade() (gas: 137146) -ProxyUpgradeAndCallActionTest:testUpgradeAndCall() (gas: 143096) -Queue:testFuzz_EmitsQueueEvent(uint256) (runs: 257, μ: 538170, ~: 538170) -Queue:testFuzz_QueuesASucceededProposal(uint256) (runs: 257, μ: 562826, ~: 562826) -Queue:testFuzz_RevertIf_ProposalIsNotSucceeded(uint256) (runs: 257, μ: 433353, ~: 433353) -SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 251726) -SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20837) -SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 344166) -SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 347534) -SecurityCouncilManagerTest:testAddSC() (gas: 118681) -SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112323) -SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 125183) -SecurityCouncilManagerTest:testCohortMethods() (gas: 137289) -SecurityCouncilManagerTest:testInitialization() (gas: 193842) -SecurityCouncilManagerTest:testRemoveMember() (gas: 214972) -SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 99314) -SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81379) -SecurityCouncilManagerTest:testRemoveSeC() (gas: 38381) -SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 209484) -SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 261463) -SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 265052) -SecurityCouncilManagerTest:testRotateMember() (gas: 261467) -SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83176) -SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 299573) -SecurityCouncilManagerTest:testUpdateRouter() (gas: 76374) -SecurityCouncilManagerTest:testUpdateRouterAffordacnes() (gas: 109981) -SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 299578) -SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 247063) -SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302942) -SecurityCouncilMemberElectionGovernorTest:testCastBySigTwice() (gas: 266328) +OutboxActionsTest:testAddOutbxesAction() (gas: 651443) +OutboxActionsTest:testCantAddEOA() (gas: 969058) +OutboxActionsTest:testCantReAddOutbox() (gas: 974434) +OutboxActionsTest:testRemoveAllOutboxes() (gas: 693079) +OutboxActionsTest:testRemoveOutboxes() (gas: 853972) +ProxyUpgradeAndCallActionTest:testUpgrade() (gas: 137140) +ProxyUpgradeAndCallActionTest:testUpgradeAndCall() (gas: 143087) +SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 253879) +SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20770) +SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 349200) +SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 352635) +SecurityCouncilManagerTest:testAddSC() (gas: 118742) +SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112428) +SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 136633) +SecurityCouncilManagerTest:testCohortMethods() (gas: 137890) +SecurityCouncilManagerTest:testInitialization() (gas: 206665) +SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5000887) +SecurityCouncilManagerTest:testRemoveMember() (gas: 217459) +SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 101567) +SecurityCouncilManagerTest:testRemoveMemberRotated() (gas: 423573) +SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81441) +SecurityCouncilManagerTest:testRemoveSeC() (gas: 38383) +SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 216447) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 266641) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 471806) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 479028) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 270210) +SecurityCouncilManagerTest:testRotateMember() (gas: 1015787) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 4080567) +SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65814) +SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83252) +SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 313830) +SecurityCouncilManagerTest:testUpdateRouter() (gas: 76407) +SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 109974) +SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 313924) +SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 247018) +SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302873) +SecurityCouncilMemberElectionGovernorTest:testCastBySigTwice() (gas: 266265) SecurityCouncilMemberElectionGovernorTest:testCastVoteReverts() (gas: 35277) SecurityCouncilMemberElectionGovernorTest:testExecute() (gas: 665669) SecurityCouncilMemberElectionGovernorTest:testForceSupport() (gas: 165397) @@ -181,58 +159,69 @@ SecurityCouncilMemberElectionGovernorTest:testNoVoteForNonCompliantNominee() (ga SecurityCouncilMemberElectionGovernorTest:testNoZeroWeightVotes() (gas: 169643) SecurityCouncilMemberElectionGovernorTest:testOnlyNomineeElectionGovernorCanPropose() (gas: 111068) SecurityCouncilMemberElectionGovernorTest:testProperInitialization() (gas: 49388) -SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32952) -SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42235) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 339674, ~: 339572) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273353) -SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34963) -SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152946) -SecurityCouncilMemberRemovalGovernorTest:testInitFails() (gas: 10244398) -SecurityCouncilMemberRemovalGovernorTest:testProposalCreationCallParamRestriction() (gas: 56250) -SecurityCouncilMemberRemovalGovernorTest:testProposalCreationCallRestriction() (gas: 49754) -SecurityCouncilMemberRemovalGovernorTest:testProposalCreationTargetLen() (gas: 35452) -SecurityCouncilMemberRemovalGovernorTest:testProposalCreationTargetRestriction() (gas: 47062) -SecurityCouncilMemberRemovalGovernorTest:testProposalCreationUnexpectedCallDataLen() (gas: 41634) -SecurityCouncilMemberRemovalGovernorTest:testProposalCreationValuesRestriction() (gas: 61959) -SecurityCouncilMemberRemovalGovernorTest:testProposalDoesExpire() (gas: 272715) -SecurityCouncilMemberRemovalGovernorTest:testProposalExpirationDeadline() (gas: 134968) -SecurityCouncilMemberRemovalGovernorTest:testRelay() (gas: 42219) -SecurityCouncilMemberRemovalGovernorTest:testSeparateSelector() (gas: 23599) -SecurityCouncilMemberRemovalGovernorTest:testSetVoteSuccessNumerator() (gas: 30103) -SecurityCouncilMemberRemovalGovernorTest:testSetVoteSuccessNumeratorAffordance() (gas: 47727) -SecurityCouncilMemberRemovalGovernorTest:testSuccessNumeratorInsufficientVotes() (gas: 358561) -SecurityCouncilMemberRemovalGovernorTest:testSuccessNumeratorSufficientVotes() (gas: 361479) -SecurityCouncilMemberRemovalGovernorTest:testSuccessfulProposalAndCantAbstain() (gas: 142792) -SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 7827528) -SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 7828366) -SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 7855341) -SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 7855363) -SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 7822494) -SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 7822494) -SecurityCouncilMemberSyncActionTest:testNonces() (gas: 8124889) -SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 7817392) -SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 7818318) -SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 7819214) -SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 7820075) -SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8065891) -SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8066751) +SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32916) +SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42229) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 339752, ~: 339539) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273467) +SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34951) +SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152898) +SecurityCouncilMemberRemovalGovernorTest:testInitFails() (gas: 10159203) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationCallParamRestriction() (gas: 56157) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationCallRestriction() (gas: 49685) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationTargetLen() (gas: 35392) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationTargetRestriction() (gas: 46987) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationUnexpectedCallDataLen() (gas: 41583) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationValuesRestriction() (gas: 61908) +SecurityCouncilMemberRemovalGovernorTest:testProposalDoesExpire() (gas: 272525) +SecurityCouncilMemberRemovalGovernorTest:testProposalExpirationDeadline() (gas: 134831) +SecurityCouncilMemberRemovalGovernorTest:testRelay() (gas: 42123) +SecurityCouncilMemberRemovalGovernorTest:testSeparateSelector() (gas: 23536) +SecurityCouncilMemberRemovalGovernorTest:testSetVoteSuccessNumerator() (gas: 30049) +SecurityCouncilMemberRemovalGovernorTest:testSetVoteSuccessNumeratorAffordance() (gas: 47631) +SecurityCouncilMemberRemovalGovernorTest:testSuccessNumeratorInsufficientVotes() (gas: 358327) +SecurityCouncilMemberRemovalGovernorTest:testSuccessNumeratorSufficientVotes() (gas: 361245) +SecurityCouncilMemberRemovalGovernorTest:testSuccessfulProposalAndCantAbstain() (gas: 142674) +SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 8094882) +SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 8095720) +SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 8121132) +SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 8121139) +SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 8085068) +SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 8085068) +SecurityCouncilMemberSyncActionTest:testNonces() (gas: 8389038) +SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 8084818) +SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 8085744) +SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 8086006) +SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 8086867) +SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8328313) +SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8329174) SecurityCouncilMgmtUtilsTests:testIsInArray() (gas: 2102) -SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 271338) -SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 334285) -SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 297042) -SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35278) -SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 584254) -SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 253465) -SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 457489) -SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 678680) -SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 194997) -SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 675910) -SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 6977267) -SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78233) -SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19791) -SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42523) -SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 40037) -SequencerActionsTest:testAddAndRemoveSequencer() (gas: 486700) +SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 418681) +SecurityCouncilNomineeElectionGovernorTest:testCadenceWithLargeValues() (gas: 52898) +SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 338857) +SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 301672) +SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35303) +SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 593835) +SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 257942) +SecurityCouncilNomineeElectionGovernorTest:testDefaultCadence() (gas: 14950) +SecurityCouncilNomineeElectionGovernorTest:testElectionTimestampsWithDefaultCadence() (gas: 37625) +SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 461806) +SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 679489) +SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 199892) +SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 678878) +SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7782964) +SecurityCouncilNomineeElectionGovernorTest:testMultipleCadenceChanges() (gas: 238915) +SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78159) +SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19786) +SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42411) +SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 680405) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceAfterElections() (gas: 227636) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceBeforeFirstElection() (gas: 42502) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceInvalidValue() (gas: 26056) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceOnlyOwner() (gas: 16090) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceTooSoonReverts() (gas: 148112) +SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 40024) +SecurityCouncilUpgradeActionTest:testAction() (gas: 8153) +SequencerActionsTest:testAddAndRemoveSequencer() (gas: 486652) SequencerActionsTest:testCantAddZeroAddress() (gas: 235659) SetInitialGovParamsActionTest:testL1() (gas: 260009) SetInitialGovParamsActionTest:testL2() (gas: 689085) diff --git a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol index e611f3bf9..f805ff0e6 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol @@ -62,7 +62,7 @@ contract SecurityCouncilNomineeElectionGovernor is /// Currently this is set to 3 days, assuming 12 blocks per second. /// @dev It is known that a malicious nominee can abuse rotation to avoid vetting, /// but the nominee vetter would always have 3 extra days after any rotation to exclude the nominee if needed. - uint256 public constant ROTATION_CUT_OFF_BLOCKS = 21600; + uint256 public constant ROTATION_CUT_OFF_BLOCKS = 21_600; /// @notice Address responsible for blocking non compliant nominees address public nomineeVetter; @@ -211,6 +211,18 @@ contract SecurityCouncilNomineeElectionGovernor is electionCount++; } + function _requireNotInOtherCohort(address account) internal view { + // check to make sure the contender is not part of the other cohort (the cohort not currently up for election) + // this only checks against the current cohort membership of the security council, + // so changes to those will mean this check will be inconsistent. + // this check then is only a relevant check when the elections are running as expected - one at a time, + // every `cadenceInMonths` months. Updates to the sec council manager using methods other than replaceCohort can effect this check + // and it's expected that the entity making those updates understands this. + if (securityCouncilManager.cohortIncludes(otherCohort(), account)) { + revert AccountInOtherCohort(otherCohort(), account); + } + } + /// @dev Revert if the previous member election has not executed. /// Ensures that there are no unexpected behaviors from multiple elections running at the same time. /// If, for some reason, the previous member election is blocked, @@ -261,22 +273,14 @@ contract SecurityCouncilNomineeElectionGovernor is revert ProposalNotPending(state_); } - // check to make sure the contender is not part of the other cohort (the cohort not currently up for election) - // this only checks against the current cohort membership of the security council, - // so changes to those will mean this check will be inconsistent. - // this check then is only a relevant check when the elections are running as expected - one at a time, - // every `cadenceInMonths` months. Updates to the sec council manager using methods other than replaceCohort can effect this check - // and it's expected that the entity making those updates understands this. - if (securityCouncilManager.cohortIncludes(otherCohort(), signer)) { - revert AccountInOtherCohort(otherCohort(), signer); - } - + _requireNotInOtherCohort(signer); election.isContender[signer] = true; emit ContenderAdded(proposalId, signer); // if the signer is part of the outgoing cohort, we automatically add them as a nominee if (securityCouncilManager.cohortIncludes(currentCohort(), signer)) { + // no need to check for duplicate nominees as we already checked _addNominee(proposalId, signer); } } @@ -342,26 +346,13 @@ contract SecurityCouncilNomineeElectionGovernor is revert ProposalNotSucceededState(state_); } - if (isNominee(proposalId, account)) { - revert NomineeAlreadyAdded(account); - } - uint256 cnCount = compliantNomineeCount(proposalId); uint256 cohortSize = securityCouncilManager.cohortSize(); if (cnCount >= cohortSize) { revert CompliantNomineeTargetHit(cnCount, cohortSize); } - // can't include nominees from the other cohort (the cohort not currently up for election) - // this only checks against the current the current other cohort, and against the current cohort membership - // in the security council, so changes to those will mean this check will be inconsistent. - // this check then is only a relevant check when the elections are running as expected - one at a time, - // every `cadenceInMonths` months. Updates to the sec council manager using methods other than replaceCohort can effect this check - // and it's expected that the entity making those updates understands this. - if (securityCouncilManager.cohortIncludes(otherCohort(), account)) { - revert AccountInOtherCohort(otherCohort(), account); - } - + _requireNotInOtherCohort(account); _addNominee(proposalId, account); } @@ -383,24 +374,19 @@ contract SecurityCouncilNomineeElectionGovernor is revert ProposalNotInRotationPeriod(block.number, rotationDeadline); } + if (election.isExcluded[newNomineeAddress]) { + revert NomineeAlreadyExcluded(newNomineeAddress); + } + address signer = recoverRotateNomineeMessage(proposalId, signature, msg.sender); if (signer != newNomineeAddress) { revert InvalidSignature(); } - // check to make sure the new nominee is not part of the other cohort (the cohort not currently up for election) - // this only checks against the current the current other cohort, and against the current cohort membership - // in the security council, so changes to those will mean this check will be inconsistent. - // this check then is only a relevant check when the elections are running as expected - one at a time, - // every 6 months. Updates to the sec council manager using methods other than replaceCohort can effect this check - // and it's expected that the entity making those updates understands this. - if (securityCouncilManager.cohortIncludes(otherCohort(), newNomineeAddress)) { - revert AccountInOtherCohort(otherCohort(), newNomineeAddress); - } - // rotation by first excluding the nominee and then adding the new nominee election.isExcluded[msg.sender] = true; election.excludedNomineeCount++; + _requireNotInOtherCohort(newNomineeAddress); _addNominee(proposalId, newNomineeAddress); emit NomineeExcluded(proposalId, msg.sender); emit NomineeRotated(proposalId, msg.sender, newNomineeAddress); diff --git a/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorCountingUpgradeable.sol b/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorCountingUpgradeable.sol index 9cc6d7e3c..efbe43206 100644 --- a/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorCountingUpgradeable.sol +++ b/src/security-council-mgmt/governors/modules/SecurityCouncilNomineeElectionGovernorCountingUpgradeable.sol @@ -121,6 +121,9 @@ abstract contract SecurityCouncilNomineeElectionGovernorCountingUpgradeable is /// @dev Transitions an account to being a nominee function _addNominee(uint256 proposalId, address account) internal { + if (isNominee(proposalId, account)) { + revert NomineeAlreadyAdded(account); + } _elections[proposalId].nominees.push(account); _elections[proposalId].isNominee[account] = true; emit NewNominee(proposalId, account); diff --git a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol index 8ed5af784..672d23b02 100644 --- a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol +++ b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol @@ -1231,6 +1231,24 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { ); governor.rotateNominee(proposalId, _contender(1), sig); + // cannot rotate to existing nominee + bytes memory sig2 = + sigUtils.signRotateNomineeMessage(proposalId, _contenderPrivKey(2), _contender(0)); + vm.prank(initParams.nomineeVetter); + _mockCohortIncludes(Cohort.SECOND, _contender(2), false); + governor.includeNominee(proposalId, _contender(2)); + _mockCohortIncludes(Cohort.SECOND, _contender(2), false); + vm.prank(_contender(0)); + vm.expectRevert( + abi.encodeWithSelector( + SecurityCouncilNomineeElectionGovernorCountingUpgradeable + .NomineeAlreadyAdded + .selector, + _contender(2) + ) + ); + governor.rotateNominee(proposalId, _contender(2), sig2); + // rotate the nominee _mockCohortIncludes(Cohort.SECOND, _contender(1), false); vm.prank(_contender(0)); From c0dfc29f8e5dcbfc22752f01d7c31aa77025dfb2 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Tue, 21 Jul 2026 11:11:26 +0100 Subject: [PATCH 100/108] Remove nominee bypass --- .gas-snapshot | 32 +++++++++---------- ...SecurityCouncilNomineeElectionGovernor.sol | 6 ---- ...curityCouncilNomineeElectionGovernor.t.sol | 29 ----------------- 3 files changed, 16 insertions(+), 51 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index b610a96a1..e0c135467 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -27,7 +27,7 @@ ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 86806023) +E2E:testE2E() (gas: 86746083) FixedDelegateErc20WalletTest:testInit() (gas: 5822585) FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) @@ -95,11 +95,11 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28571182) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28519939) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28572810) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28812928) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32271955) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32276230) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 27215045) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32274186) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32295541) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32243667) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32247942) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 27186757) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32245898) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32267253) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317090, ~: 317184) @@ -138,7 +138,7 @@ SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 4 SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 479028) SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 270210) SecurityCouncilManagerTest:testRotateMember() (gas: 1015787) -SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 4080567) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 4057607) SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65814) SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83252) SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 313830) @@ -194,25 +194,25 @@ SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 8086867) SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8328313) SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8329174) SecurityCouncilMgmtUtilsTests:testIsInArray() (gas: 2102) -SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 418681) +SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 282306) SecurityCouncilNomineeElectionGovernorTest:testCadenceWithLargeValues() (gas: 52898) -SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 338857) -SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 301672) +SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 337776) +SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 300591) SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35303) -SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 593835) +SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 590592) SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 257942) SecurityCouncilNomineeElectionGovernorTest:testDefaultCadence() (gas: 14950) SecurityCouncilNomineeElectionGovernorTest:testElectionTimestampsWithDefaultCadence() (gas: 37625) -SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 461806) +SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 460725) SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 679489) -SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 199892) -SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 678878) -SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7782964) +SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 198811) +SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 677797) +SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7754676) SecurityCouncilNomineeElectionGovernorTest:testMultipleCadenceChanges() (gas: 238915) SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78159) SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19786) SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42411) -SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 680405) +SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 679324) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceAfterElections() (gas: 227636) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceBeforeFirstElection() (gas: 42502) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceInvalidValue() (gas: 26056) diff --git a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol index f805ff0e6..0ee52b833 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol @@ -277,12 +277,6 @@ contract SecurityCouncilNomineeElectionGovernor is election.isContender[signer] = true; emit ContenderAdded(proposalId, signer); - - // if the signer is part of the outgoing cohort, we automatically add them as a nominee - if (securityCouncilManager.cohortIncludes(currentCohort(), signer)) { - // no need to check for duplicate nominees as we already checked - _addNominee(proposalId, signer); - } } /// @notice Allows the owner to change the nomineeVetter diff --git a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol index 672d23b02..128c693da 100644 --- a/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol +++ b/test/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.t.sol @@ -308,35 +308,6 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test { ) ); governor.addContender(proposalId, sig); - - // adding a member up for reelection should succeed and automatically add them as a nominee - _mockCohortIncludes(Cohort.FIRST, _contender(1), true); - _mockCohortIncludes(Cohort.SECOND, _contender(1), false); - sig = sigUtils.signAddContenderMessage(proposalId, _contenderPrivKey(1)); - governor.addContender(proposalId, sig); - - // check that it correctly mutated the state - assertTrue(governor.isContender(proposalId, _contender(1))); - assertTrue(governor.isNominee(proposalId, _contender(1))); - - // reelection member should not be able to receive votes - vm.roll(governor.proposalSnapshot(proposalId) + 1); - _mockGetPastVotes(_voter(0), governor.quorum(proposalId)); - vm.prank(_voter(0)); - vm.expectRevert( - abi.encodeWithSelector( - SecurityCouncilNomineeElectionGovernorCountingUpgradeable - .NomineeAlreadyAdded - .selector, - _contender(1) - ) - ); - governor.castVoteWithReasonAndParams({ - proposalId: proposalId, - support: 1, - reason: "", - params: abi.encode(_contender(1), 1) - }); } function testSetNomineeVetter() public { From 4936cdd76363e872c1a5fecfc93adf674f361ed8 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Tue, 21 Jul 2026 11:15:22 +0100 Subject: [PATCH 101/108] Fix merge --- .gas-snapshot | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 61dd82f02..ad15bfc84 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -96,19 +96,11 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28571182) L2GovernanceFactoryTest:testSetMinDelay() (gas: 28519939) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28572810) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28812928) -<<<<<<< HEAD L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32243667) L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32247942) L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 27186757) L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32245898) L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32267253) -======= -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32271955) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32276230) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 27215045) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32274186) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32295541) ->>>>>>> sc-rotation NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317090, ~: 317184) @@ -147,11 +139,7 @@ SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 4 SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 479028) SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 270210) SecurityCouncilManagerTest:testRotateMember() (gas: 1015787) -<<<<<<< HEAD SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 4057607) -======= -SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 4080567) ->>>>>>> sc-rotation SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65814) SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83252) SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 313830) @@ -207,7 +195,6 @@ SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 8086867) SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8328313) SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8329174) SecurityCouncilMgmtUtilsTests:testIsInArray() (gas: 2102) -<<<<<<< HEAD SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 282306) SecurityCouncilNomineeElectionGovernorTest:testCadenceWithLargeValues() (gas: 52898) SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 337776) @@ -222,31 +209,11 @@ SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 679489) SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 198811) SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 677797) SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7754676) -======= -SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 418681) -SecurityCouncilNomineeElectionGovernorTest:testCadenceWithLargeValues() (gas: 52898) -SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 338857) -SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 301672) -SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35303) -SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 593835) -SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 257942) -SecurityCouncilNomineeElectionGovernorTest:testDefaultCadence() (gas: 14950) -SecurityCouncilNomineeElectionGovernorTest:testElectionTimestampsWithDefaultCadence() (gas: 37625) -SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 461806) -SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 679489) -SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 199892) -SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 678878) -SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7782964) ->>>>>>> sc-rotation SecurityCouncilNomineeElectionGovernorTest:testMultipleCadenceChanges() (gas: 238915) SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78159) SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19786) SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42411) -<<<<<<< HEAD SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 679324) -======= -SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 680405) ->>>>>>> sc-rotation SecurityCouncilNomineeElectionGovernorTest:testSetCadenceAfterElections() (gas: 227636) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceBeforeFirstElection() (gas: 42502) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceInvalidValue() (gas: 26056) From 145098423229e341cb9b347a979a2ff5a711064b Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Tue, 21 Jul 2026 11:15:59 +0100 Subject: [PATCH 102/108] Fix merged snapshots --- .gas-snapshot | 515 ++++++++++++++++++++++++++------------------------ 1 file changed, 272 insertions(+), 243 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index ad15bfc84..89132fecf 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,276 +1,305 @@ -AIP1Point2ActionTest:testAction() (gas: 629593) +AIP1Point2ActionTest:testAction() (gas: 629637) AIPNovaFeeRoutingActionTest:testAction() (gas: 3074) ActivateDvpQuorumActionTest:testAction() (gas: 3074) ArbitrumDAOConstitutionTest:testConstructor() (gas: 259383) ArbitrumDAOConstitutionTest:testMonOwnerCannotSetHash() (gas: 262836) ArbitrumDAOConstitutionTest:testOwnerCanSetHash() (gas: 261148) ArbitrumDAOConstitutionTest:testOwnerCanSetHashTwice() (gas: 263824) -ArbitrumFoundationVestingWalletTest:testBeneficiaryCanSetBeneficiary() (gas: 16332113) -ArbitrumFoundationVestingWalletTest:testMigrateEthToNewWalletWithSlowerVesting() (gas: 19243772) -ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithFasterVesting() (gas: 19247115) -ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithSlowerVesting() (gas: 19247060) -ArbitrumFoundationVestingWalletTest:testMigrationTargetMustBeContract() (gas: 16335446) -ArbitrumFoundationVestingWalletTest:testOnlyBeneficiaryCanRelease() (gas: 16327428) -ArbitrumFoundationVestingWalletTest:testOnlyOwnerCanMigrate() (gas: 16329777) -ArbitrumFoundationVestingWalletTest:testOwnerCanSetBeneficiary() (gas: 16332196) -ArbitrumFoundationVestingWalletTest:testProperlyInits() (gas: 16337566) -ArbitrumFoundationVestingWalletTest:testRandomAddressCantSetBeneficiary() (gas: 16329676) -ArbitrumFoundationVestingWalletTest:testRelease() (gas: 16448651) -ArbitrumVestingWalletFactoryTest:testDeploy() (gas: 4589688) -ArbitrumVestingWalletFactoryTest:testOnlyOwnerCanCreateWallets() (gas: 1504286) -ArbitrumVestingWalletTest:testCastVote() (gas: 16201599) -ArbitrumVestingWalletTest:testCastVoteFailsForNonBeneficiary() (gas: 16151356) -ArbitrumVestingWalletTest:testClaim() (gas: 16007783) -ArbitrumVestingWalletTest:testClaimFailsForNonBeneficiary() (gas: 15967970) -ArbitrumVestingWalletTest:testDelegate() (gas: 16081121) -ArbitrumVestingWalletTest:testDelegateFailsForNonBeneficiary() (gas: 16008450) -ArbitrumVestingWalletTest:testDoesDeploy() (gas: 15971357) -ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16008664) -ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16074932) +ArbitrumFoundationVestingWalletTest:testBeneficiaryCanSetBeneficiary() (gas: 16921226) +ArbitrumFoundationVestingWalletTest:testMigrateEthToNewWalletWithSlowerVesting() (gas: 19719120) +ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithFasterVesting() (gas: 19723109) +ArbitrumFoundationVestingWalletTest:testMigrateTokensToNewWalletWithSlowerVesting() (gas: 19723054) +ArbitrumFoundationVestingWalletTest:testMigrationTargetMustBeContract() (gas: 16924475) +ArbitrumFoundationVestingWalletTest:testOnlyBeneficiaryCanRelease() (gas: 16916427) +ArbitrumFoundationVestingWalletTest:testOnlyOwnerCanMigrate() (gas: 16918794) +ArbitrumFoundationVestingWalletTest:testOwnerCanSetBeneficiary() (gas: 16921309) +ArbitrumFoundationVestingWalletTest:testProperlyInits() (gas: 16926840) +ArbitrumFoundationVestingWalletTest:testRandomAddressCantSetBeneficiary() (gas: 16918675) +ArbitrumFoundationVestingWalletTest:testRelease() (gas: 17044704) +ArbitrumVestingWalletFactoryTest:testDeploy() (gas: 4589694) +ArbitrumVestingWalletFactoryTest:testOnlyOwnerCanCreateWallets() (gas: 1504292) +ArbitrumVestingWalletTest:testCastVote() (gas: 16930567) +ArbitrumVestingWalletTest:testCastVoteFailsForNonBeneficiary() (gas: 16877263) +ArbitrumVestingWalletTest:testClaim() (gas: 16707939) +ArbitrumVestingWalletTest:testClaimFailsForNonBeneficiary() (gas: 16642726) +ArbitrumVestingWalletTest:testDelegate() (gas: 16784685) +ArbitrumVestingWalletTest:testDelegateFailsForNonBeneficiary() (gas: 16708582) +ArbitrumVestingWalletTest:testDoesDeploy() (gas: 16646113) +ArbitrumVestingWalletTest:testReleaseAffordance() (gas: 16708796) +ArbitrumVestingWalletTest:testVestedAmountStart() (gas: 16775448) +Cancel:testFuzz_CancelsPendingProposal(uint256) (runs: 256, μ: 343001, ~: 343001) +Cancel:testFuzz_RevertIf_AlreadyCanceled(uint256) (runs: 256, μ: 350297, ~: 350297) +Cancel:testFuzz_RevertIf_NotProposer(uint256,address) (runs: 256, μ: 337631, ~: 337631) +Cancel:testFuzz_RevertIf_ProposalIsActive(uint256) (runs: 256, μ: 342482, ~: 342482) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 86746083) -FixedDelegateErc20WalletTest:testInit() (gas: 5822585) -FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5816815) -FixedDelegateErc20WalletTest:testTransfer() (gas: 5932228) -FixedDelegateErc20WalletTest:testTransferNotOwner() (gas: 5897853) -InboxActionsTest:testPauseAndUpauseInbox() (gas: 370544) -L1AddressRegistryTest:testAddressRegistryAddress() (gas: 47009) -L1ArbitrumTimelockTest:testCancel() (gas: 5324647) -L1ArbitrumTimelockTest:testCancelFailsBadSender() (gas: 5369534) -L1ArbitrumTimelockTest:testDoesDeploy() (gas: 5273082) -L1ArbitrumTimelockTest:testDoesNotDeployZeroInbox() (gas: 4978966) -L1ArbitrumTimelockTest:testDoesNotDeployZeroL2Timelock() (gas: 4976936) -L1ArbitrumTimelockTest:testExecute() (gas: 5405357) -L1ArbitrumTimelockTest:testExecuteInbox() (gas: 5746383) -L1ArbitrumTimelockTest:testExecuteInboxBatch() (gas: 6056746) -L1ArbitrumTimelockTest:testExecuteInboxInvalidData() (gas: 5426404) -L1ArbitrumTimelockTest:testExecuteInboxNotEnoughVal() (gas: 5446215) -L1ArbitrumTimelockTest:testSchedule() (gas: 5357787) -L1ArbitrumTimelockTest:testScheduleFailsBadL2Timelock() (gas: 5286100) -L1ArbitrumTimelockTest:testScheduleFailsBadSender() (gas: 5281084) -L1ArbitrumTokenTest:testBridgeBurn() (gas: 3395576) -L1ArbitrumTokenTest:testBridgeBurnNotGateway() (gas: 3389616) -L1ArbitrumTokenTest:testBridgeMint() (gas: 3390803) -L1ArbitrumTokenTest:testBridgeMintNotGateway() (gas: 3341041) -L1ArbitrumTokenTest:testInit() (gas: 3355944) -L1ArbitrumTokenTest:testInitZeroGateway() (gas: 3177239) -L1ArbitrumTokenTest:testInitZeroNovaGateway() (gas: 3177306) -L1ArbitrumTokenTest:testInitZeroNovaRouter() (gas: 3177240) -L1ArbitrumTokenTest:testRegisterTokenOnL2() (gas: 4568617) -L1ArbitrumTokenTest:testRegisterTokenOnL2NotEnoughVal() (gas: 4425804) -L1GovernanceFactoryTest:testL1GovernanceFactory() (gas: 10771066) -L1GovernanceFactoryTest:testSetMinDelay() (gas: 10746048) -L1GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 10799003) -L2AddressRegistryTest:testAddressRegistryAddress() (gas: 54770) -L2ArbitrumGovernorTest:testCantReinit() (gas: 13669504) -L2ArbitrumGovernorTest:testExecutorPermissions() (gas: 13706498) -L2ArbitrumGovernorTest:testExecutorPermissionsFail() (gas: 13679150) -L2ArbitrumGovernorTest:testPastCirculatingSupply() (gas: 13673253) -L2ArbitrumGovernorTest:testPastCirculatingSupplyExclude() (gas: 13812730) -L2ArbitrumGovernorTest:testPastCirculatingSupplyMint() (gas: 13737233) -L2ArbitrumGovernorTest:testProperlyInitialized() (gas: 13664721) -L2ArbitrumTokenTest:testCanBurn() (gas: 4066835) -L2ArbitrumTokenTest:testCanMint2Percent() (gas: 4101512) -L2ArbitrumTokenTest:testCanMintLessThan2Percent() (gas: 4101514) -L2ArbitrumTokenTest:testCanMintTwiceWithWarp() (gas: 8190691) -L2ArbitrumTokenTest:testCanMintZero() (gas: 4081635) -L2ArbitrumTokenTest:testCanTransferAndCallContract() (gas: 4211883) -L2ArbitrumTokenTest:testCanTransferAndCallEmpty() (gas: 4096932) -L2ArbitrumTokenTest:testCannotMintMoreThan2Percent() (gas: 4071458) -L2ArbitrumTokenTest:testCannotMintNotOwner() (gas: 4069341) -L2ArbitrumTokenTest:testCannotMintTwice() (gas: 8158921) -L2ArbitrumTokenTest:testCannotMintWithoutFastForward() (gas: 4069700) -L2ArbitrumTokenTest:testCannotTransferAndCallNonReceiver() (gas: 4094203) -L2ArbitrumTokenTest:testCannotTransferAndCallReverter() (gas: 4154761) -L2ArbitrumTokenTest:testDoesNotInitialiseZeroInitialSup() (gas: 3800718) -L2ArbitrumTokenTest:testDoesNotInitialiseZeroL1Token() (gas: 3800726) -L2ArbitrumTokenTest:testDoesNotInitialiseZeroOwner() (gas: 3800739) -L2ArbitrumTokenTest:testIsInitialised() (gas: 4072777) -L2ArbitrumTokenTest:testNoLogicContractInit() (gas: 2693127) -L2GovernanceFactoryTest:testContractsDeployed() (gas: 28514933) -L2GovernanceFactoryTest:testContractsInitialized() (gas: 28551928) -L2GovernanceFactoryTest:testDeploySteps() (gas: 28526442) -L2GovernanceFactoryTest:testProxyAdminOwnership() (gas: 28523943) -L2GovernanceFactoryTest:testRoles() (gas: 28546930) -L2GovernanceFactoryTest:testSanityCheckValues() (gas: 28571182) -L2GovernanceFactoryTest:testSetMinDelay() (gas: 28519939) -L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 28572810) -L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 28812928) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 32243667) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 32247942) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 27186757) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 32245898) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 32267253) +E2E:testE2E() (gas: 85120517) +Execute:testFuzz_EmitsExecuteEvent(uint256,address) (runs: 256, μ: 611319, ~: 611339) +Execute:testFuzz_ExecutesASucceededProposal(uint256) (runs: 256, μ: 611129, ~: 611129) +Execute:testFuzz_RevertIf_OperationNotReady(uint256,address) (runs: 256, μ: 599719, ~: 599719) +FixedDelegateErc20WalletTest:testInit() (gas: 5962816) +FixedDelegateErc20WalletTest:testInitZeroToken() (gas: 5956190) +FixedDelegateErc20WalletTest:testTransfer() (gas: 6121983) +FixedDelegateErc20WalletTest:testTransferNotOwner() (gas: 6084204) +InboxActionsTest:testPauseAndUpauseInbox() (gas: 370760) +L1AddressRegistryTest:testAddressRegistryAddress() (gas: 47105) +L1ArbitrumTimelockTest:testCancel() (gas: 5349718) +L1ArbitrumTimelockTest:testCancelFailsBadSender() (gas: 5394608) +L1ArbitrumTimelockTest:testDoesDeploy() (gas: 5298120) +L1ArbitrumTimelockTest:testDoesNotDeployZeroInbox() (gas: 5004013) +L1ArbitrumTimelockTest:testDoesNotDeployZeroL2Timelock() (gas: 5001983) +L1ArbitrumTimelockTest:testExecute() (gas: 5430425) +L1ArbitrumTimelockTest:testExecuteInbox() (gas: 5784957) +L1ArbitrumTimelockTest:testExecuteInboxBatch() (gas: 6087831) +L1ArbitrumTimelockTest:testExecuteInboxInvalidData() (gas: 5472159) +L1ArbitrumTimelockTest:testExecuteInboxNotEnoughVal() (gas: 5484760) +L1ArbitrumTimelockTest:testSchedule() (gas: 5382870) +L1ArbitrumTimelockTest:testScheduleFailsBadL2Timelock() (gas: 5311174) +L1ArbitrumTimelockTest:testScheduleFailsBadSender() (gas: 5306146) +L1ArbitrumTokenTest:testBridgeBurn() (gas: 3395684) +L1ArbitrumTokenTest:testBridgeBurnNotGateway() (gas: 3389688) +L1ArbitrumTokenTest:testBridgeMint() (gas: 3390887) +L1ArbitrumTokenTest:testBridgeMintNotGateway() (gas: 3341089) +L1ArbitrumTokenTest:testInit() (gas: 3356232) +L1ArbitrumTokenTest:testInitZeroGateway() (gas: 3177275) +L1ArbitrumTokenTest:testInitZeroNovaGateway() (gas: 3177342) +L1ArbitrumTokenTest:testInitZeroNovaRouter() (gas: 3177276) +L1ArbitrumTokenTest:testRegisterTokenOnL2() (gas: 4569001) +L1ArbitrumTokenTest:testRegisterTokenOnL2NotEnoughVal() (gas: 4425876) +L1GovernanceFactoryTest:testL1GovernanceFactory() (gas: 10796764) +L1GovernanceFactoryTest:testSetMinDelay() (gas: 10771242) +L1GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 10824209) +L2AddressRegistryTest:testAddressRegistryAddress() (gas: 54814) +L2ArbitrumTokenTest:testCanBurn() (gas: 4206836) +L2ArbitrumTokenTest:testCanMint2Percent() (gas: 4241646) +L2ArbitrumTokenTest:testCanMintLessThan2Percent() (gas: 4241648) +L2ArbitrumTokenTest:testCanMintTwiceWithWarp() (gas: 8470883) +L2ArbitrumTokenTest:testCanMintZero() (gas: 4221727) +L2ArbitrumTokenTest:testCanTransferAndCallContract() (gas: 4351925) +L2ArbitrumTokenTest:testCanTransferAndCallEmpty() (gas: 4237038) +L2ArbitrumTokenTest:testCannotMintMoreThan2Percent() (gas: 4210987) +L2ArbitrumTokenTest:testCannotMintNotOwner() (gas: 4208823) +L2ArbitrumTokenTest:testCannotMintTwice() (gas: 8438506) +L2ArbitrumTokenTest:testCannotMintWithoutFastForward() (gas: 4209248) +L2ArbitrumTokenTest:testCannotTransferAndCallNonReceiver() (gas: 4234323) +L2ArbitrumTokenTest:testCannotTransferAndCallReverter() (gas: 4294869) +L2ArbitrumTokenTest:testDecreaseDVPOnUndelegate() (gas: 4317040) +L2ArbitrumTokenTest:testDoesNotInitialiseZeroInitialSup() (gas: 3939579) +L2ArbitrumTokenTest:testDoesNotInitialiseZeroL1Token() (gas: 3939531) +L2ArbitrumTokenTest:testDoesNotInitialiseZeroOwner() (gas: 3939634) +L2ArbitrumTokenTest:testDvpAdjustment(uint64,int64) (runs: 256, μ: 4252589, ~: 4254851) +L2ArbitrumTokenTest:testDvpAtBlockBeforeFirstCheckpoint() (gas: 4254247) +L2ArbitrumTokenTest:testDvpDecreaseOnTransferFromDelegator() (gas: 4357412) +L2ArbitrumTokenTest:testDvpIncreaseOnTransferToDelegator() (gas: 4348789) +L2ArbitrumTokenTest:testDvpNoChangeOnSelfTransfer() (gas: 4373472) +L2ArbitrumTokenTest:testDvpNoChangeOnTransferToDelegator() (gas: 4426737) +L2ArbitrumTokenTest:testDvpNoChangeOnTransferToNonDelegator() (gas: 4232910) +L2ArbitrumTokenTest:testDvpNoRevertOnUnderflow() (gas: 4337873) +L2ArbitrumTokenTest:testIncreaseDVPOnDelegateToAnother() (gas: 4323322) +L2ArbitrumTokenTest:testIncreaseDVPOnSelfDelegate() (gas: 4323444) +L2ArbitrumTokenTest:testInitialDvpEstimate(uint64) (runs: 256, μ: 4248719, ~: 4248719) +L2ArbitrumTokenTest:testIsInitialised() (gas: 4212423) +L2ArbitrumTokenTest:testNoChangeDVPOnRedelegateToSame() (gas: 4395748) +L2ArbitrumTokenTest:testNoDoublePostUpgradeInit() (gas: 4249264) +L2ArbitrumTokenTest:testNoLogicContractInit() (gas: 2831938) +L2GovernanceFactoryTest:testContractsDeployed() (gas: 29387763) +L2GovernanceFactoryTest:testContractsInitialized() (gas: 29424888) +L2GovernanceFactoryTest:testDeploySteps() (gas: 29399416) +L2GovernanceFactoryTest:testProxyAdminOwnership() (gas: 29396773) +L2GovernanceFactoryTest:testRoles() (gas: 29419760) +L2GovernanceFactoryTest:testSanityCheckValues() (gas: 29444230) +L2GovernanceFactoryTest:testSetMinDelay() (gas: 29392769) +L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 29445646) +L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 29766026) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31312784) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31317179) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26290952) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31315015) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31336382) +MiscTests:testCantReinit() (gas: 14345720) +MiscTests:testDVPQuorumAndClamping() (gas: 14717899) +MiscTests:testExecutorPermissions() (gas: 14383166) +MiscTests:testExecutorPermissionsFail() (gas: 14355491) +MiscTests:testMinMaxQuorumGetters() (gas: 14413262) +MiscTests:testPastCirculatingSupply() (gas: 14349835) +MiscTests:testPastCirculatingSupplyExclude() (gas: 14539347) +MiscTests:testPastCirculatingSupplyMint() (gas: 14416277) +MiscTests:testProperlyInitialized() (gas: 14343471) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) -OfficeHoursActionTest:testConstructor() (gas: 9050) -OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317090, ~: 317184) -OfficeHoursActionTest:testInvalidConstructorParameters() (gas: 235740) +OfficeHoursActionTest:testConstructor() (gas: 9053) +OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317098, ~: 317184) +OfficeHoursActionTest:testInvalidConstructorParameters() (gas: 235758) OfficeHoursActionTest:testPerformBeforeMinimumTimestamp() (gas: 8646) OfficeHoursActionTest:testPerformDuringOfficeHours() (gas: 9140) OfficeHoursActionTest:testPerformFridayUTCSaturdayLocal() (gas: 304792) OfficeHoursActionTest:testPerformMondayUTCSundayLocal() (gas: 304783) OfficeHoursActionTest:testPerformOnWeekend() (gas: 9327) OfficeHoursActionTest:testPerformOutsideOfficeHours() (gas: 9537) -OutboxActionsTest:testAddOutbxesAction() (gas: 651443) -OutboxActionsTest:testCantAddEOA() (gas: 969058) -OutboxActionsTest:testCantReAddOutbox() (gas: 974434) -OutboxActionsTest:testRemoveAllOutboxes() (gas: 693079) -OutboxActionsTest:testRemoveOutboxes() (gas: 853972) -ProxyUpgradeAndCallActionTest:testUpgrade() (gas: 137140) -ProxyUpgradeAndCallActionTest:testUpgradeAndCall() (gas: 143087) -SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 253879) +OutboxActionsTest:testAddOutbxesAction() (gas: 651905) +OutboxActionsTest:testCantAddEOA() (gas: 969460) +OutboxActionsTest:testCantReAddOutbox() (gas: 974878) +OutboxActionsTest:testRemoveAllOutboxes() (gas: 693873) +OutboxActionsTest:testRemoveOutboxes() (gas: 854776) +Propose:testFuzz_EmitsProposalCreatedEvent(uint256) (runs: 256, μ: 344799, ~: 344799) +Propose:testFuzz_ProposerAboveThresholdCanPropose(uint256) (runs: 256, μ: 334217, ~: 334217) +Propose:testFuzz_ProposerBelowThresholdCannotPropose(address) (runs: 256, μ: 46371, ~: 46371) +ProxyUpgradeAndCallActionTest:testUpgrade() (gas: 137146) +ProxyUpgradeAndCallActionTest:testUpgradeAndCall() (gas: 143096) +Queue:testFuzz_EmitsQueueEvent(uint256) (runs: 256, μ: 538170, ~: 538170) +Queue:testFuzz_QueuesASucceededProposal(uint256) (runs: 256, μ: 562826, ~: 562826) +Queue:testFuzz_RevertIf_ProposalIsNotSucceeded(uint256) (runs: 256, μ: 433353, ~: 433353) +SecurityCouncilManagerTest:testAddMemberAffordances() (gas: 254008) SecurityCouncilManagerTest:testAddMemberSpecialAddresses() (gas: 20770) -SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 349200) -SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 352635) +SecurityCouncilManagerTest:testAddMemberToFirstCohort() (gas: 349341) +SecurityCouncilManagerTest:testAddMemberToSecondCohort() (gas: 352791) SecurityCouncilManagerTest:testAddSC() (gas: 118742) -SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112428) -SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 136633) -SecurityCouncilManagerTest:testCohortMethods() (gas: 137890) -SecurityCouncilManagerTest:testInitialization() (gas: 206665) -SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 5000887) -SecurityCouncilManagerTest:testRemoveMember() (gas: 217459) -SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 101567) -SecurityCouncilManagerTest:testRemoveMemberRotated() (gas: 423573) -SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81441) +SecurityCouncilManagerTest:testAddSCAffordances() (gas: 112449) +SecurityCouncilManagerTest:testCantUpdateCohortWithADup() (gas: 136636) +SecurityCouncilManagerTest:testCohortMethods() (gas: 137950) +SecurityCouncilManagerTest:testInitialization() (gas: 206767) +SecurityCouncilManagerTest:testPostUpgradeInit() (gas: 4958794) +SecurityCouncilManagerTest:testRemoveMember() (gas: 217537) +SecurityCouncilManagerTest:testRemoveMemberAffordances() (gas: 101588) +SecurityCouncilManagerTest:testRemoveMemberRotated() (gas: 423744) +SecurityCouncilManagerTest:testRemoveSCAffordances() (gas: 81462) SecurityCouncilManagerTest:testRemoveSeC() (gas: 38383) -SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 216447) -SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 266641) -SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 471806) -SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 479028) -SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 270210) -SecurityCouncilManagerTest:testRotateMember() (gas: 1015787) -SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 4057607) -SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65814) -SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83252) -SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 313830) +SecurityCouncilManagerTest:testReplaceMemberAffordances() (gas: 216513) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohort() (gas: 266719) +SecurityCouncilManagerTest:testReplaceMemberInFirstCohortAfterRotation() (gas: 472001) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohort() (gas: 479223) +SecurityCouncilManagerTest:testReplaceMemberInSecondCohortAfterRotation() (gas: 270288) +SecurityCouncilManagerTest:testRotateMember() (gas: 1016270) +SecurityCouncilManagerTest:testRotateMemberNotContender() (gas: 4106808) +SecurityCouncilManagerTest:testSetMinRotationPeriod() (gas: 65820) +SecurityCouncilManagerTest:testUpdateCohortAffordances() (gas: 83279) +SecurityCouncilManagerTest:testUpdateFirstCohort() (gas: 313896) SecurityCouncilManagerTest:testUpdateRouter() (gas: 76407) -SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 109974) -SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 313924) -SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 247018) -SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302873) -SecurityCouncilMemberElectionGovernorTest:testCastBySigTwice() (gas: 266265) +SecurityCouncilManagerTest:testUpdateRouterAffordances() (gas: 109980) +SecurityCouncilManagerTest:testUpdateSecondCohort() (gas: 313990) +SecurityCouncilMemberElectionGovernorTest:testCannotUseMoreVotesThanAvailable() (gas: 247084) +SecurityCouncilMemberElectionGovernorTest:testCastBySig() (gas: 302963) +SecurityCouncilMemberElectionGovernorTest:testCastBySigTwice() (gas: 266349) SecurityCouncilMemberElectionGovernorTest:testCastVoteReverts() (gas: 35277) -SecurityCouncilMemberElectionGovernorTest:testExecute() (gas: 665669) -SecurityCouncilMemberElectionGovernorTest:testForceSupport() (gas: 165397) +SecurityCouncilMemberElectionGovernorTest:testExecute() (gas: 666230) +SecurityCouncilMemberElectionGovernorTest:testForceSupport() (gas: 165418) SecurityCouncilMemberElectionGovernorTest:testInitReverts() (gas: 4868350) -SecurityCouncilMemberElectionGovernorTest:testInvalidParams() (gas: 165369) -SecurityCouncilMemberElectionGovernorTest:testMiscVotesViews() (gas: 227999) -SecurityCouncilMemberElectionGovernorTest:testNoVoteForNonCompliantNominee() (gas: 123578) -SecurityCouncilMemberElectionGovernorTest:testNoZeroWeightVotes() (gas: 169643) +SecurityCouncilMemberElectionGovernorTest:testInvalidParams() (gas: 165390) +SecurityCouncilMemberElectionGovernorTest:testMiscVotesViews() (gas: 228020) +SecurityCouncilMemberElectionGovernorTest:testNoVoteForNonCompliantNominee() (gas: 123599) +SecurityCouncilMemberElectionGovernorTest:testNoZeroWeightVotes() (gas: 169664) SecurityCouncilMemberElectionGovernorTest:testOnlyNomineeElectionGovernorCanPropose() (gas: 111068) SecurityCouncilMemberElectionGovernorTest:testProperInitialization() (gas: 49388) -SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32916) -SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42229) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 339752, ~: 339539) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273467) -SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34951) -SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152898) -SecurityCouncilMemberRemovalGovernorTest:testInitFails() (gas: 10159203) -SecurityCouncilMemberRemovalGovernorTest:testProposalCreationCallParamRestriction() (gas: 56157) -SecurityCouncilMemberRemovalGovernorTest:testProposalCreationCallRestriction() (gas: 49685) -SecurityCouncilMemberRemovalGovernorTest:testProposalCreationTargetLen() (gas: 35392) -SecurityCouncilMemberRemovalGovernorTest:testProposalCreationTargetRestriction() (gas: 46987) -SecurityCouncilMemberRemovalGovernorTest:testProposalCreationUnexpectedCallDataLen() (gas: 41583) -SecurityCouncilMemberRemovalGovernorTest:testProposalCreationValuesRestriction() (gas: 61908) -SecurityCouncilMemberRemovalGovernorTest:testProposalDoesExpire() (gas: 272525) -SecurityCouncilMemberRemovalGovernorTest:testProposalExpirationDeadline() (gas: 134831) -SecurityCouncilMemberRemovalGovernorTest:testRelay() (gas: 42123) -SecurityCouncilMemberRemovalGovernorTest:testSeparateSelector() (gas: 23536) -SecurityCouncilMemberRemovalGovernorTest:testSetVoteSuccessNumerator() (gas: 30049) -SecurityCouncilMemberRemovalGovernorTest:testSetVoteSuccessNumeratorAffordance() (gas: 47631) -SecurityCouncilMemberRemovalGovernorTest:testSuccessNumeratorInsufficientVotes() (gas: 358327) -SecurityCouncilMemberRemovalGovernorTest:testSuccessNumeratorSufficientVotes() (gas: 361245) -SecurityCouncilMemberRemovalGovernorTest:testSuccessfulProposalAndCantAbstain() (gas: 142674) -SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 8094882) -SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 8095720) -SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 8121132) -SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 8121139) -SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 8085068) -SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 8085068) -SecurityCouncilMemberSyncActionTest:testNonces() (gas: 8389038) -SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 8084818) -SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 8085744) -SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 8086006) -SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 8086867) -SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8328313) -SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8329174) +SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32952) +SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42235) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 339907, ~: 339738) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273485) +SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34963) +SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152946) +SecurityCouncilMemberRemovalGovernorTest:testInitFails() (gas: 10244408) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationCallParamRestriction() (gas: 56250) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationCallRestriction() (gas: 49754) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationTargetLen() (gas: 35452) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationTargetRestriction() (gas: 47062) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationUnexpectedCallDataLen() (gas: 41634) +SecurityCouncilMemberRemovalGovernorTest:testProposalCreationValuesRestriction() (gas: 61959) +SecurityCouncilMemberRemovalGovernorTest:testProposalDoesExpire() (gas: 272715) +SecurityCouncilMemberRemovalGovernorTest:testProposalExpirationDeadline() (gas: 134968) +SecurityCouncilMemberRemovalGovernorTest:testRelay() (gas: 42219) +SecurityCouncilMemberRemovalGovernorTest:testSeparateSelector() (gas: 23599) +SecurityCouncilMemberRemovalGovernorTest:testSetVoteSuccessNumerator() (gas: 30103) +SecurityCouncilMemberRemovalGovernorTest:testSetVoteSuccessNumeratorAffordance() (gas: 47727) +SecurityCouncilMemberRemovalGovernorTest:testSuccessNumeratorInsufficientVotes() (gas: 358561) +SecurityCouncilMemberRemovalGovernorTest:testSuccessNumeratorSufficientVotes() (gas: 361479) +SecurityCouncilMemberRemovalGovernorTest:testSuccessfulProposalAndCantAbstain() (gas: 142792) +SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 7828184) +SecurityCouncilMemberSyncActionTest:testAddOne() (gas: 7829022) +SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 7855346) +SecurityCouncilMemberSyncActionTest:testCantDropBelowThreshhold() (gas: 7855368) +SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 7822499) +SecurityCouncilMemberSyncActionTest:testGetPrevOwner() (gas: 7822499) +SecurityCouncilMemberSyncActionTest:testNonces() (gas: 8128149) +SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 7818048) +SecurityCouncilMemberSyncActionTest:testNoopUpdate() (gas: 7818974) +SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 7819812) +SecurityCouncilMemberSyncActionTest:testRemoveOne() (gas: 7820673) +SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8066547) +SecurityCouncilMemberSyncActionTest:testUpdateCohort() (gas: 8067407) SecurityCouncilMgmtUtilsTests:testIsInArray() (gas: 2102) -SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 282306) -SecurityCouncilNomineeElectionGovernorTest:testCadenceWithLargeValues() (gas: 52898) -SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 337776) -SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 300591) +SecurityCouncilNomineeElectionGovernorTest:testAddContender() (gas: 282987) +SecurityCouncilNomineeElectionGovernorTest:testCadenceWithLargeValues() (gas: 52961) +SecurityCouncilNomineeElectionGovernorTest:testCastBySig() (gas: 338352) +SecurityCouncilNomineeElectionGovernorTest:testCastBySigTwice() (gas: 301062) SecurityCouncilNomineeElectionGovernorTest:testCastVoteReverts() (gas: 35303) -SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 590592) -SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 257942) +SecurityCouncilNomineeElectionGovernorTest:testCountVote() (gas: 592371) +SecurityCouncilNomineeElectionGovernorTest:testCreateElection() (gas: 258275) SecurityCouncilNomineeElectionGovernorTest:testDefaultCadence() (gas: 14950) -SecurityCouncilNomineeElectionGovernorTest:testElectionTimestampsWithDefaultCadence() (gas: 37625) -SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 460725) -SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 679489) -SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 198811) -SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 677797) -SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7754676) -SecurityCouncilNomineeElectionGovernorTest:testMultipleCadenceChanges() (gas: 238915) -SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78159) -SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19786) -SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42411) -SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 679324) -SecurityCouncilNomineeElectionGovernorTest:testSetCadenceAfterElections() (gas: 227636) -SecurityCouncilNomineeElectionGovernorTest:testSetCadenceBeforeFirstElection() (gas: 42502) -SecurityCouncilNomineeElectionGovernorTest:testSetCadenceInvalidValue() (gas: 26056) -SecurityCouncilNomineeElectionGovernorTest:testSetCadenceOnlyOwner() (gas: 16090) -SecurityCouncilNomineeElectionGovernorTest:testSetCadenceTooSoonReverts() (gas: 148112) -SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 40024) -SecurityCouncilUpgradeActionTest:testAction() (gas: 8153) -SequencerActionsTest:testAddAndRemoveSequencer() (gas: 486652) +SecurityCouncilNomineeElectionGovernorTest:testElectionTimestampsWithDefaultCadence() (gas: 37631) +SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 461718) +SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 680974) +SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 199102) +SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 679693) +SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7414812) +SecurityCouncilNomineeElectionGovernorTest:testMultipleCadenceChanges() (gas: 239269) +SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78279) +SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19837) +SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42501) +SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 681064) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceAfterElections() (gas: 227915) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceBeforeFirstElection() (gas: 42562) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceInvalidValue() (gas: 26149) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceOnlyOwner() (gas: 16096) +SecurityCouncilNomineeElectionGovernorTest:testSetCadenceTooSoonReverts() (gas: 148292) +SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 40150) +SecurityCouncilUpgradeActionTest:testAction() (gas: 8159) +SequencerActionsTest:testAddAndRemoveSequencer() (gas: 486700) SequencerActionsTest:testCantAddZeroAddress() (gas: 235659) SetInitialGovParamsActionTest:testL1() (gas: 260009) -SetInitialGovParamsActionTest:testL2() (gas: 689085) +SetInitialGovParamsActionTest:testL2() (gas: 689152) SetSequencerInboxMaxTimeVariationActionTest:testSetMaxTimeVariation() (gas: 310404) SwitchManagerRolesActionTest:testAction() (gas: 6319) -TokenDistributorTest:testClaim() (gas: 5876433) -TokenDistributorTest:testClaimAndDelegate() (gas: 5987949) -TokenDistributorTest:testClaimAndDelegateFailsForExpired() (gas: 5881922) -TokenDistributorTest:testClaimAndDelegateFailsForWrongSender() (gas: 5937905) -TokenDistributorTest:testClaimAndDelegateFailsWrongNonce() (gas: 5937906) -TokenDistributorTest:testClaimFailsAfterEnd() (gas: 5812336) -TokenDistributorTest:testClaimFailsBeforeStart() (gas: 5811825) -TokenDistributorTest:testClaimFailsForFalseTransfer() (gas: 5794547) -TokenDistributorTest:testClaimFailsForTwice() (gas: 5875187) -TokenDistributorTest:testClaimFailsForUnknown() (gas: 5814412) -TokenDistributorTest:testClaimStartAfterClaimEnd() (gas: 4274189) -TokenDistributorTest:testDoesDeploy() (gas: 5401698) -TokenDistributorTest:testDoesDeployAndDeposit() (gas: 5512878) -TokenDistributorTest:testOldClaimStart() (gas: 4274752) -TokenDistributorTest:testSetRecipients() (gas: 5810222) -TokenDistributorTest:testSetRecipientsFailsNotEnoughDeposit() (gas: 5777102) -TokenDistributorTest:testSetRecipientsFailsNotOwner() (gas: 5528624) -TokenDistributorTest:testSetRecipientsFailsWhenAddingTwice() (gas: 5821288) -TokenDistributorTest:testSetRecipientsFailsWrongAmountCount() (gas: 5530088) -TokenDistributorTest:testSetRecipientsFailsWrongRecipientCount() (gas: 5530317) -TokenDistributorTest:testSetRecipientsTwice() (gas: 6499843) -TokenDistributorTest:testSetSweepReceiver() (gas: 5814545) -TokenDistributorTest:testSetSweepReceiverFailsNullAddress() (gas: 5812176) -TokenDistributorTest:testSetSweepReceiverFailsOwner() (gas: 5813131) -TokenDistributorTest:testSweep() (gas: 5885702) -TokenDistributorTest:testSweepAfterClaim() (gas: 5949073) -TokenDistributorTest:testSweepFailsBeforeClaimPeriodEnd() (gas: 5811892) -TokenDistributorTest:testSweepFailsForFailedTransfer() (gas: 5815633) -TokenDistributorTest:testSweepFailsTwice() (gas: 5885510) -TokenDistributorTest:testWithdraw() (gas: 5852909) -TokenDistributorTest:testWithdrawFailsNotOwner() (gas: 5852931) -TokenDistributorTest:testWithdrawFailsTransfer() (gas: 5814112) -TokenDistributorTest:testZeroDelegateTo() (gas: 4272084) -TokenDistributorTest:testZeroOwner() (gas: 4271997) -TokenDistributorTest:testZeroReceiver() (gas: 4272026) +TokenDistributorTest:testClaim() (gas: 5876438) +TokenDistributorTest:testClaimAndDelegate() (gas: 5987954) +TokenDistributorTest:testClaimAndDelegateFailsForExpired() (gas: 5881927) +TokenDistributorTest:testClaimAndDelegateFailsForWrongSender() (gas: 5937910) +TokenDistributorTest:testClaimAndDelegateFailsWrongNonce() (gas: 5937911) +TokenDistributorTest:testClaimFailsAfterEnd() (gas: 5812341) +TokenDistributorTest:testClaimFailsBeforeStart() (gas: 5811830) +TokenDistributorTest:testClaimFailsForFalseTransfer() (gas: 5794552) +TokenDistributorTest:testClaimFailsForTwice() (gas: 5875192) +TokenDistributorTest:testClaimFailsForUnknown() (gas: 5814417) +TokenDistributorTest:testClaimStartAfterClaimEnd() (gas: 4274194) +TokenDistributorTest:testDoesDeploy() (gas: 5401703) +TokenDistributorTest:testDoesDeployAndDeposit() (gas: 5512883) +TokenDistributorTest:testOldClaimStart() (gas: 4274757) +TokenDistributorTest:testSetRecipients() (gas: 5810227) +TokenDistributorTest:testSetRecipientsFailsNotEnoughDeposit() (gas: 5777107) +TokenDistributorTest:testSetRecipientsFailsNotOwner() (gas: 5528629) +TokenDistributorTest:testSetRecipientsFailsWhenAddingTwice() (gas: 5821293) +TokenDistributorTest:testSetRecipientsFailsWrongAmountCount() (gas: 5530093) +TokenDistributorTest:testSetRecipientsFailsWrongRecipientCount() (gas: 5530322) +TokenDistributorTest:testSetRecipientsTwice() (gas: 6499848) +TokenDistributorTest:testSetSweepReceiver() (gas: 5814550) +TokenDistributorTest:testSetSweepReceiverFailsNullAddress() (gas: 5812181) +TokenDistributorTest:testSetSweepReceiverFailsOwner() (gas: 5813136) +TokenDistributorTest:testSweep() (gas: 5885707) +TokenDistributorTest:testSweepAfterClaim() (gas: 5949078) +TokenDistributorTest:testSweepFailsBeforeClaimPeriodEnd() (gas: 5811897) +TokenDistributorTest:testSweepFailsForFailedTransfer() (gas: 5815638) +TokenDistributorTest:testSweepFailsTwice() (gas: 5885515) +TokenDistributorTest:testWithdraw() (gas: 5852914) +TokenDistributorTest:testWithdrawFailsNotOwner() (gas: 5852936) +TokenDistributorTest:testWithdrawFailsTransfer() (gas: 5814117) +TokenDistributorTest:testZeroDelegateTo() (gas: 4272089) +TokenDistributorTest:testZeroOwner() (gas: 4272002) +TokenDistributorTest:testZeroReceiver() (gas: 4272031) TokenDistributorTest:testZeroToken() (gas: 71812) -TopNomineesGasTest:testTopNomineesGas() (gas: 4533086) +TopNomineesGasTest:testTopNomineesGas() (gas: 4537586) UpgradeExecRouteBuilderTest:testAIP1Point2() (gas: 1408809) UpgradeExecRouteBuilderTest:testActionType() (gas: 1718332) UpgradeExecRouteBuilderTest:testRouteBuilderErrors() (gas: 1238856) -UpgradeExecutorTest:testAdminCanChangeExecutor() (gas: 2677248) -UpgradeExecutorTest:testCantExecuteEOA() (gas: 2533144) -UpgradeExecutorTest:testExecute() (gas: 2771532) -UpgradeExecutorTest:testExecuteFailsForAdmin() (gas: 2757061) -UpgradeExecutorTest:testExecuteFailsForNobody() (gas: 2759302) -UpgradeExecutorTest:testInit() (gas: 2520920) -UpgradeExecutorTest:testInitFailsZeroAdmin() (gas: 2381696) +UpgradeExecutorTest:testAdminCanChangeExecutor() (gas: 2677253) +UpgradeExecutorTest:testCantExecuteEOA() (gas: 2533149) +UpgradeExecutorTest:testExecute() (gas: 2771537) +UpgradeExecutorTest:testExecuteFailsForAdmin() (gas: 2757066) +UpgradeExecutorTest:testExecuteFailsForNobody() (gas: 2759307) +UpgradeExecutorTest:testInit() (gas: 2520925) +UpgradeExecutorTest:testInitFailsZeroAdmin() (gas: 2381701) \ No newline at end of file From 99df3a53dc8fac86465f27596bde7195eea356d7 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Wed, 22 Jul 2026 14:27:24 +0100 Subject: [PATCH 103/108] Update expected election counter and comments --- .../AIPs/SecurityCouncilMgmt/SecurityCouncilUpgradeAction.sol | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/SecurityCouncilUpgradeAction.sol b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/SecurityCouncilUpgradeAction.sol index e289dffde..e49da924d 100644 --- a/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/SecurityCouncilUpgradeAction.sol +++ b/src/gov-action-contracts/AIPs/SecurityCouncilMgmt/SecurityCouncilUpgradeAction.sol @@ -12,7 +12,6 @@ import "../../../security-council-mgmt/governors/SecurityCouncilNomineeElectionG /// - Upgrade the sec council manager to allow member rotation and sets min rotation vars /// - Upgrade the sec council nominee election governor to allow modifying the cadence of election /// - Adjusting the qualification threshold of the Member Election phase from 0.2% to 0.1% -/// - Allowing existing sec council members to automatically progress from the Nominee Selection phase /// - Updating the ArbitrumDAO Constitution to reflect these changes contract SecurityCouncilUpgradeAction { IL2AddressRegistry public immutable l2AddressRegistry; @@ -47,7 +46,7 @@ contract SecurityCouncilUpgradeAction { payable(address(l2AddressRegistry.scNomineeElectionGovernor())) ); require( - scNomineeElectionGovernor.electionCount() == 5, + scNomineeElectionGovernor.electionCount() == 6, "SecurityCouncilUpgradeAction: not expected timing" ); @@ -73,7 +72,6 @@ contract SecurityCouncilUpgradeAction { ); // Upgrade the sec council nominee election governor to allow modifying the cadence of election - // Allowing existing sec council members to automatically progress from the Nominee Selection phase l2AddressRegistry.govProxyAdmin().upgradeAndCall( TransparentUpgradeableProxy(payable(address(scNomineeElectionGovernor))), scNomineeElectionGovernorImpl, From 2b2d60548499713da45461ac9842f83224ede23e Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Wed, 22 Jul 2026 15:45:03 +0100 Subject: [PATCH 104/108] Fix tests --- .../CancelTimelockAndRemoveMemberActionTest.t.sol | 13 ++++++++----- test/gov-actions/SecurityCouncilUpgradeAction.t.sol | 6 ++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol b/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol index 11de8e816..eb513922f 100644 --- a/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol +++ b/test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol @@ -117,6 +117,14 @@ contract CancelTimelockAndRemoveMemberActionTest is Test { } function ensureLatestScm(L2AddressRegistry reg) internal { + ISecurityCouncilManager scm = reg.securityCouncilManager(); + if ( + proxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(scm)))) + != oldImplementation + ) { + return; // already upgraded on-chain + } + address newImplementation = address(new SecurityCouncilManager()); address newNomineeElectionGovernorImplementation = address(new SecurityCouncilNomineeElectionGovernor()); @@ -124,11 +132,6 @@ contract CancelTimelockAndRemoveMemberActionTest is Test { uint256 minRotationPeriod = 1 weeks; uint256 cadenceInMonths = 12; - SecurityCouncilNomineeElectionGovernor scNomineeElectionGovernor = - SecurityCouncilNomineeElectionGovernor(payable(address(reg.scNomineeElectionGovernor()))); - vm.warp(1_757_937_601); // After the 2025 Sep election - scNomineeElectionGovernor.createElection(); - SecurityCouncilUpgradeAction action = new SecurityCouncilUpgradeAction( reg, newImplementation, diff --git a/test/gov-actions/SecurityCouncilUpgradeAction.t.sol b/test/gov-actions/SecurityCouncilUpgradeAction.t.sol index 56136357f..48455b333 100644 --- a/test/gov-actions/SecurityCouncilUpgradeAction.t.sol +++ b/test/gov-actions/SecurityCouncilUpgradeAction.t.sol @@ -49,8 +49,6 @@ contract SecurityCouncilUpgradeActionTest is Test { SecurityCouncilNomineeElectionGovernor scNomineeElectionGovernor = SecurityCouncilNomineeElectionGovernor(payable(address(reg.scNomineeElectionGovernor()))); - vm.warp(1_757_937_601); // After the 2025 Sep election - scNomineeElectionGovernor.createElection(); address newImplementation = address(new SecurityCouncilManager()); address newNomineeElectionGovernorImplementation = @@ -82,8 +80,8 @@ contract SecurityCouncilUpgradeActionTest is Test { uint256 electionCount = scNomineeElectionGovernor.electionCount(); assertEq( scNomineeElectionGovernor.electionToTimestamp(electionCount), - 1_789_473_600, - "not September 15, 2026 12:00:00 PM" + 1_805_112_000, + "not March 15, 2027 12:00:00 PM" ); } From 6807ab47a23410daaa8d97fc4d32955ae382cad3 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Fri, 24 Jul 2026 09:05:17 +0100 Subject: [PATCH 105/108] Add payload --- .../proposals/sec-council-upgrade-rotation/data.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 scripts/proposals/sec-council-upgrade-rotation/data.json diff --git a/scripts/proposals/sec-council-upgrade-rotation/data.json b/scripts/proposals/sec-council-upgrade-rotation/data.json new file mode 100644 index 000000000..6ab1976f0 --- /dev/null +++ b/scripts/proposals/sec-council-upgrade-rotation/data.json @@ -0,0 +1,12 @@ +{ + "actionChainIds": [ + 42161 + ], + "actionAddresses": [ + "0xf762678D8cdF6dCa02270F411059Ba4e08b510e2" + ], + "arbSysSendTxToL1Args": { + "l1Timelock": "0xE6841D92B0C345144506576eC13ECf5103aC7f49", + "calldata": "0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000090ca02e4af2e6a9ee8a985dede904f499404224e68c7258b1ff981333dc770bd000000000000000000000000000000000000000000000000000000000003f4800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001800000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f000000000000000000000000cf57572261c7c2bcf21ffd220ea7d1a27d40a82700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000f762678d8cdf6dca02270f411059ba4e08b510e200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } +} \ No newline at end of file From 3529990ba87dcc2429353d408703f64c6b01bddb Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Fri, 24 Jul 2026 16:25:03 +0100 Subject: [PATCH 106/108] Fix nominee rotation --- .../SecurityCouncilNomineeElectionGovernor.sol | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol index 0ee52b833..dfbc90106 100644 --- a/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol +++ b/src/security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol @@ -93,6 +93,8 @@ contract SecurityCouncilNomineeElectionGovernor is error ProposalNotInVettingPeriod(uint256 blockNumber, uint256 vettingDeadline); error ProposalNotInRotationPeriod(uint256 blockNumber, uint256 rotationDeadline); error NomineeAlreadyExcluded(address nominee); + error OnlyContenderNomineeCanRotate(); + error NewNomineeIsContender(address newNominee); error CompliantNomineeTargetHit(uint256 nomineeCount, uint256 expectedCount); error ProposalInVettingPeriod(uint256 blockNumber, uint256 vettingDeadline); error InsufficientCompliantNomineeCount(uint256 compliantNomineeCount, uint256 expectedCount); @@ -377,6 +379,14 @@ contract SecurityCouncilNomineeElectionGovernor is revert InvalidSignature(); } + if (!isContender(proposalId, msg.sender)) { + revert OnlyContenderNomineeCanRotate(); + } + + if (isContender(proposalId, newNomineeAddress)) { + revert NewNomineeIsContender(newNomineeAddress); + } + // rotation by first excluding the nominee and then adding the new nominee election.isExcluded[msg.sender] = true; election.excludedNomineeCount++; From 1b44cb71888b8cc1b703f04aaf658c84c9f1fe03 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Fri, 24 Jul 2026 16:48:00 +0100 Subject: [PATCH 107/108] Add new proposal data --- scripts/proposals/sec-council-upgrade-rotation/data.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/proposals/sec-council-upgrade-rotation/data.json b/scripts/proposals/sec-council-upgrade-rotation/data.json index 6ab1976f0..638211af6 100644 --- a/scripts/proposals/sec-council-upgrade-rotation/data.json +++ b/scripts/proposals/sec-council-upgrade-rotation/data.json @@ -3,10 +3,10 @@ 42161 ], "actionAddresses": [ - "0xf762678D8cdF6dCa02270F411059Ba4e08b510e2" + "0xeF98Fc7A7F08De47Ed01f3F11f07319c22106445" ], "arbSysSendTxToL1Args": { "l1Timelock": "0xE6841D92B0C345144506576eC13ECf5103aC7f49", - "calldata": "0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000090ca02e4af2e6a9ee8a985dede904f499404224e68c7258b1ff981333dc770bd000000000000000000000000000000000000000000000000000000000003f4800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001800000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f000000000000000000000000cf57572261c7c2bcf21ffd220ea7d1a27d40a82700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000f762678d8cdf6dca02270f411059ba4e08b510e200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + "calldata": "0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000d078d01ffb5a3a5eac98137cbe898b2f21c1114069936d04a90b74ee9806e3f5000000000000000000000000000000000000000000000000000000000003f4800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001800000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f000000000000000000000000cf57572261c7c2bcf21ffd220ea7d1a27d40a82700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000ef98fc7a7f08de47ed01f3f11f07319c2210644500000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" } } \ No newline at end of file From 67bf2a4a8affe34eaedde9a9c6a114bafad25dc6 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Fri, 24 Jul 2026 16:55:21 +0100 Subject: [PATCH 108/108] Fix gas snapshot --- .gas-snapshot | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 89132fecf..15ea6c386 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -32,7 +32,7 @@ Cancel:testFuzz_RevertIf_AlreadyCanceled(uint256) (runs: 256, μ: 350297, ~: 350 Cancel:testFuzz_RevertIf_NotProposer(uint256,address) (runs: 256, μ: 337631, ~: 337631) Cancel:testFuzz_RevertIf_ProposalIsActive(uint256) (runs: 256, μ: 342482, ~: 342482) CancelTimelockAndRemoveMemberActionTest:testAction() (gas: 8159) -E2E:testE2E() (gas: 85120517) +E2E:testE2E() (gas: 85158392) Execute:testFuzz_EmitsExecuteEvent(uint256,address) (runs: 256, μ: 611319, ~: 611339) Execute:testFuzz_ExecutesASucceededProposal(uint256) (runs: 256, μ: 611129, ~: 611129) Execute:testFuzz_RevertIf_OperationNotReady(uint256,address) (runs: 256, μ: 599719, ~: 599719) @@ -110,11 +110,11 @@ L2GovernanceFactoryTest:testSanityCheckValues() (gas: 29444230) L2GovernanceFactoryTest:testSetMinDelay() (gas: 29392769) L2GovernanceFactoryTest:testSetMinDelayRevertsForCoreAddress() (gas: 29445646) L2GovernanceFactoryTest:testUpgraderCanCancel() (gas: 29766026) -L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31312784) -L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31317179) -L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26290952) -L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31315015) -L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31336382) +L2SecurityCouncilMgmtFactoryTest:testMemberElectionGovDeployment() (gas: 31350700) +L2SecurityCouncilMgmtFactoryTest:testNomineeElectionGovDeployment() (gas: 31355095) +L2SecurityCouncilMgmtFactoryTest:testOnlyOwnerCanDeploy() (gas: 26328868) +L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 31352931) +L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 31374298) MiscTests:testCantReinit() (gas: 14345720) MiscTests:testDVPQuorumAndClamping() (gas: 14717899) MiscTests:testExecutorPermissions() (gas: 14383166) @@ -237,12 +237,12 @@ SecurityCouncilNomineeElectionGovernorTest:testExcludeNominee() (gas: 461718) SecurityCouncilNomineeElectionGovernorTest:testExecute() (gas: 680974) SecurityCouncilNomineeElectionGovernorTest:testForceSupport() (gas: 199102) SecurityCouncilNomineeElectionGovernorTest:testIncludeNominee() (gas: 679693) -SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7414812) +SecurityCouncilNomineeElectionGovernorTest:testInvalidInit() (gas: 7452727) SecurityCouncilNomineeElectionGovernorTest:testMultipleCadenceChanges() (gas: 239269) SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 78279) SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19837) SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42501) -SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 681064) +SecurityCouncilNomineeElectionGovernorTest:testRotateNominee() (gas: 688690) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceAfterElections() (gas: 227915) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceBeforeFirstElection() (gas: 42562) SecurityCouncilNomineeElectionGovernorTest:testSetCadenceInvalidValue() (gas: 26149)