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));