From 46484789337979fa24bb68ad3d538824a9342cdd Mon Sep 17 00:00:00 2001 From: OneTony Date: Mon, 7 Jul 2025 11:02:06 +0300 Subject: [PATCH 1/3] fix: voting window to use timestamp --- .../governance/IProposalValidator.sol | 10 +-- .../src/governance/ProposalValidator.sol | 51 +++++------ .../test/governance/ProposalValidator.t.sol | 86 +++++++++---------- 3 files changed, 75 insertions(+), 72 deletions(-) diff --git a/packages/contracts-bedrock/interfaces/governance/IProposalValidator.sol b/packages/contracts-bedrock/interfaces/governance/IProposalValidator.sol index 2ba27a28d83fe..1693007ce3a0e 100644 --- a/packages/contracts-bedrock/interfaces/governance/IProposalValidator.sol +++ b/packages/contracts-bedrock/interfaces/governance/IProposalValidator.sol @@ -51,7 +51,7 @@ interface IProposalValidator is ISemver { event VotingCycleDataSet( uint256 cycleNumber, - uint256 startBlock, + uint256 startingTimestamp, uint256 duration, uint256 votingCycleDistributionLimit ); @@ -88,7 +88,7 @@ interface IProposalValidator is ISemver { } struct VotingCycleData { - uint256 startingBlock; + uint256 startingTimestamp; uint256 duration; uint256 votingCycleDistributionLimit; uint256 movedToVoteTokenCount; @@ -154,7 +154,7 @@ interface IProposalValidator is ISemver { function setVotingCycleData( uint256 _cycleNumber, - uint256 _startBlock, + uint256 _startingTimestamp, uint256 _duration, uint256 _votingCycleDistributionLimit ) external; @@ -170,7 +170,7 @@ interface IProposalValidator is ISemver { address _owner, IProposalTypesConfigurator _proposalTypesConfigurator, uint256 _cycleNumber, - uint256 _startBlock, + uint256 _startingTimestamp, uint256 _duration, uint256 _votingCycleDistributionLimit, uint256 _distributionThreshold, @@ -203,7 +203,7 @@ interface IProposalValidator is ISemver { function proposalTypesData(ProposalType) external view returns (uint256 requiredApprovals, uint8 proposalVotingModule); function votingCycles(uint256) external view returns ( - uint256 startingBlock, + uint256 startingTimestamp, uint256 duration, uint256 votingCycleDistributionLimit, uint256 movedToVoteTokenCount diff --git a/packages/contracts-bedrock/src/governance/ProposalValidator.sol b/packages/contracts-bedrock/src/governance/ProposalValidator.sol index a9559e32ba6ac..1aa237ef4bec7 100644 --- a/packages/contracts-bedrock/src/governance/ProposalValidator.sol +++ b/packages/contracts-bedrock/src/governance/ProposalValidator.sol @@ -119,11 +119,11 @@ contract ProposalValidator is OwnableUpgradeable, ReinitializableBase, ISemver { /// @notice Emitted when the voting cycle data is set. /// @param cycleNumber The number of the voting cycle. - /// @param startBlock The block number of the starting block of the voting cycle. + /// @param startingTimestamp The starting timestamp of the voting cycle. /// @param duration The duration of the voting cycle. /// @param votingCycleDistributionLimit The max amount of tokens that can be distributed during the voting cycle. event VotingCycleDataSet( - uint256 cycleNumber, uint256 startBlock, uint256 duration, uint256 votingCycleDistributionLimit + uint256 cycleNumber, uint256 startingTimestamp, uint256 duration, uint256 votingCycleDistributionLimit ); /// @notice Emitted when the distribution threshold is set. @@ -171,12 +171,13 @@ contract ProposalValidator is OwnableUpgradeable, ReinitializableBase, ISemver { } /// @notice Struct for storing voting cycle data. - /// @param startingBlock The block number of the starting block of the voting cycle. - /// @param duration The duration of the voting cycle. + /// @param startingTimestamp The starting timestamp of the voting cycle. + /// @param duration The duration of the voting cycle. Should be 1 day which is the end of Week 2 and start of Week 3 + /// of the voting cycle. /// @param votingCycleDistributionLimit The max amount of tokens that can be distributed in a proposal. /// @param movedToVoteTokenCount The total amount of tokens to possibly be distributed in the voting cycle. struct VotingCycleData { - uint256 startingBlock; + uint256 startingTimestamp; uint256 duration; uint256 votingCycleDistributionLimit; uint256 movedToVoteTokenCount; @@ -273,7 +274,7 @@ contract ProposalValidator is OwnableUpgradeable, ReinitializableBase, ISemver { /// @param _owner The address that will own the contract. /// @param _proposalTypesConfigurator The proposal types configurator contract address. /// @param _cycleNumber The number of the current voting cycle. - /// @param _startBlock The block number of the starting block of the voting cycle. + /// @param _startingTimestamp The starting timestamp of the voting cycle. /// @param _duration The duration of the voting cycle. /// @param _votingCycleDistributionLimit The max amount of tokens that can be distributed during the voting cycle. /// @param _distributionThreshold The max amount of tokens that can be distributed in a proposal. @@ -283,7 +284,7 @@ contract ProposalValidator is OwnableUpgradeable, ReinitializableBase, ISemver { address _owner, IProposalTypesConfigurator _proposalTypesConfigurator, uint256 _cycleNumber, - uint256 _startBlock, + uint256 _startingTimestamp, uint256 _duration, uint256 _votingCycleDistributionLimit, uint256 _distributionThreshold, @@ -298,7 +299,7 @@ contract ProposalValidator is OwnableUpgradeable, ReinitializableBase, ISemver { } proposalTypesConfigurator = _proposalTypesConfigurator; - _setVotingCycleData(_cycleNumber, _startBlock, _duration, _votingCycleDistributionLimit); + _setVotingCycleData(_cycleNumber, _startingTimestamp, _duration, _votingCycleDistributionLimit); _setDistributionThreshold(_distributionThreshold); for (uint256 i = 0; i < _proposalTypes.length; i++) { @@ -712,10 +713,9 @@ contract ProposalValidator is OwnableUpgradeable, ReinitializableBase, ISemver { // Check if the voting cycle is valid VotingCycleData memory votingCycleData = votingCycles[proposal.votingCycle]; - // TODO: is + duration correct? if ( - votingCycleData.startingBlock > block.number - || votingCycleData.startingBlock + votingCycleData.duration < block.number + votingCycleData.startingTimestamp > block.timestamp + || votingCycleData.startingTimestamp + votingCycleData.duration < block.timestamp ) { revert ProposalValidator_InvalidVotingCycle(); } @@ -805,10 +805,9 @@ contract ProposalValidator is OwnableUpgradeable, ReinitializableBase, ISemver { // Check if proposal can be moved to vote VotingCycleData memory votingCycleData = votingCycles[proposal.votingCycle]; - // TODO: is + duration correct? if ( - votingCycleData.startingBlock > block.number - || votingCycleData.startingBlock + votingCycleData.duration < block.number + votingCycleData.startingTimestamp > block.timestamp + || votingCycleData.startingTimestamp + votingCycleData.duration < block.timestamp ) { revert ProposalValidator_InvalidVotingCycle(); } @@ -837,19 +836,21 @@ contract ProposalValidator is OwnableUpgradeable, ReinitializableBase, ISemver { /// @notice Sets the data of a voting cycle. /// @param _cycleNumber The number of the voting cycle to set. - /// @param _startBlock The block number of the starting block of the voting cycle. - /// @param _duration The duration of the voting cycle. + /// @param _startingTimestamp The starting timestamp of the voting cycle. + /// @param _duration The duration of the voting cycle. Should be 1 day which is the end of Week 2 and start of Week + /// 3 + /// of the voting cycle. /// @param _votingCycleDistributionLimit The max amount of tokens that can be distributed during the voting cycle. function setVotingCycleData( uint256 _cycleNumber, - uint256 _startBlock, + uint256 _startingTimestamp, uint256 _duration, uint256 _votingCycleDistributionLimit ) external onlyOwner { - _setVotingCycleData(_cycleNumber, _startBlock, _duration, _votingCycleDistributionLimit); + _setVotingCycleData(_cycleNumber, _startingTimestamp, _duration, _votingCycleDistributionLimit); } /// @notice Sets the max amount of tokens that can be distributed in a proposal. @@ -1021,28 +1022,30 @@ contract ProposalValidator is OwnableUpgradeable, ReinitializableBase, ISemver { /// @notice Private function to set the voting cycle data and emit event. /// @param _cycleNumber The number of the voting cycle to set. - /// @param _startBlock The block number of the starting block of the voting cycle. - /// @param _duration The duration of the voting cycle. + /// @param _startingTimestamp The starting timestamp of the voting cycle. + /// @param _duration The duration of the voting cycle. Should be 1 day which is the end of Week 2 and start of Week + /// 3 + /// of the voting cycle. /// @param _votingCycleDistributionLimit The max amount of tokens that can be distributed during the voting cycle. function _setVotingCycleData( uint256 _cycleNumber, - uint256 _startBlock, + uint256 _startingTimestamp, uint256 _duration, uint256 _votingCycleDistributionLimit ) private { - if (votingCycles[_cycleNumber].startingBlock != 0) { + if (votingCycles[_cycleNumber].startingTimestamp != 0) { revert ProposalValidator_VotingCycleAlreadySet(); } votingCycles[_cycleNumber] = VotingCycleData({ - startingBlock: _startBlock, + startingTimestamp: _startingTimestamp, duration: _duration, votingCycleDistributionLimit: _votingCycleDistributionLimit, movedToVoteTokenCount: 0 }); - emit VotingCycleDataSet(_cycleNumber, _startBlock, _duration, _votingCycleDistributionLimit); + emit VotingCycleDataSet(_cycleNumber, _startingTimestamp, _duration, _votingCycleDistributionLimit); } /// @notice Private function to set the distribution threshold and emit event. diff --git a/packages/contracts-bedrock/test/governance/ProposalValidator.t.sol b/packages/contracts-bedrock/test/governance/ProposalValidator.t.sol index fd369cf994c75..874fd3272409a 100644 --- a/packages/contracts-bedrock/test/governance/ProposalValidator.t.sol +++ b/packages/contracts-bedrock/test/governance/ProposalValidator.t.sol @@ -120,8 +120,8 @@ contract ProposalValidator_Init is CommonTest { using stdStorage for StdStorage; uint256 public constant CYCLE_NUMBER = 1; - uint256 public constant START_BLOCK = 1000000; - uint256 public constant DURATION = 100; + uint256 public constant START_TIMESTAMP = 1000000; + uint256 public constant DURATION = 1 days; uint256 public constant DISTRIBUTION_LIMIT = 20000 ether; uint256 public constant DISTRIBUTION_THRESHOLD = 10000 ether; uint256 public constant PROPOSAL_REQUIRED_APPROVALS = 1; @@ -155,7 +155,7 @@ contract ProposalValidator_Init is CommonTest { event ProposalMovedToVote(bytes32 indexed proposalHash, address indexed executor); event MinimumVotingPowerSet(uint256 newMinimumVotingPower); event VotingCycleDataSet( - uint256 cycleNumber, uint256 startBlock, uint256 duration, uint256 votingCycleDistributionLimit + uint256 cycleNumber, uint256 startingTimestamp, uint256 duration, uint256 votingCycleDistributionLimit ); event DistributionThresholdSet(uint256 newDistributionThreshold); event ProposalTypeDataSet( @@ -242,19 +242,18 @@ contract ProposalValidator_Init is CommonTest { /// @notice Helper to create minimal valid arrays for funding proposal error tests - function _createMinimalFundingArrays() + function _createMinimalFundingArrays(uint256 _length) internal - pure returns (string[] memory descriptions_, address[] memory recipients_, uint256[] memory amounts_) { - descriptions_ = new string[](1); - descriptions_[0] = "Option A"; - - recipients_ = new address[](1); - recipients_[0] = address(0x1); - - amounts_ = new uint256[](1); - amounts_[0] = 100 ether; + descriptions_ = new string[](_length); + recipients_ = new address[](_length); + amounts_ = new uint256[](_length); + for (uint256 i = 0; i < _length; i++) { + descriptions_[i] = string.concat("Option ", vm.toString(i + 1)); + recipients_[i] = makeAddr(string.concat("recipient", vm.toString(i + 1))); + amounts_[i] = 100 ether * (i + 1); + } } function _getProposalTypesAndData() @@ -516,7 +515,7 @@ contract ProposalValidator_Init is CommonTest { owner, proposalTypesConfigurator, CYCLE_NUMBER, - START_BLOCK, + START_TIMESTAMP, DURATION, DISTRIBUTION_LIMIT, DISTRIBUTION_THRESHOLD, @@ -599,7 +598,7 @@ contract ProposalValidator_Init is CommonTest { /// @title ProposalValidator_Version_Test /// @notice Tests for the version function contract ProposalValidator_Version_Test is ProposalValidator_Init { - function test_version_succeeds() public { + function test_version_succeeds() public view { string memory versionString = validator.version(); assertEq(versionString, "1.0.0-beta.1"); } @@ -634,7 +633,7 @@ contract ProposalValidator_Initialize_Test is ProposalValidator_Init { owner, proposalTypesConfigurator, CYCLE_NUMBER, - START_BLOCK, + START_TIMESTAMP, DURATION, DISTRIBUTION_LIMIT, DISTRIBUTION_THRESHOLD, @@ -649,9 +648,9 @@ contract ProposalValidator_Initialize_Test is ProposalValidator_Init { assertEq(validator.owner(), owner); // Verify voting cycle data - (uint256 startBlock, uint256 duration, uint256 distributionLimit, uint256 movedToVoteTokenCount) = + (uint256 startingTimestamp, uint256 duration, uint256 distributionLimit, uint256 movedToVoteTokenCount) = validator.votingCycles(CYCLE_NUMBER); - assertEq(startBlock, START_BLOCK); + assertEq(startingTimestamp, START_TIMESTAMP); assertEq(duration, DURATION); assertEq(distributionLimit, DISTRIBUTION_LIMIT); assertEq(movedToVoteTokenCount, 0); @@ -706,7 +705,7 @@ contract ProposalValidator_Initialize_Test is ProposalValidator_Init { owner, proposalTypesConfigurator, CYCLE_NUMBER, - START_BLOCK, + START_TIMESTAMP, DURATION, DISTRIBUTION_LIMIT, DISTRIBUTION_THRESHOLD, @@ -1386,7 +1385,7 @@ contract ProposalValidator_SubmitFundingProposal_Test is ProposalValidator_Init // Start with minimal arrays and extend based on option count (string[] memory descriptions, address[] memory recipients, uint256[] memory amounts) = - _createMinimalFundingArrays(); + _createMinimalFundingArrays(optionCount); for (uint256 i = 0; i < optionCount; i++) { descriptions[i] = descriptions[0]; @@ -1460,7 +1459,7 @@ contract ProposalValidator_SubmitFundingProposal_TestFail is ProposalValidator_I ProposalValidator.ProposalType proposalType = ProposalValidator.ProposalType(proposalTypeValue); (string[] memory descriptions, address[] memory recipients, uint256[] memory amounts) = - _createMinimalFundingArrays(); + _createMinimalFundingArrays(1); vm.expectRevert(ProposalValidator.ProposalValidator_InvalidFundingProposalType.selector); vm.prank(user); @@ -1586,7 +1585,7 @@ contract ProposalValidator_SubmitFundingProposal_TestFail is ProposalValidator_I // Create arrays with excessive amount (string[] memory descriptions, address[] memory recipients, uint256[] memory amounts) = - _createMinimalFundingArrays(); + _createMinimalFundingArrays(1); amounts[0] = excessAmount; vm.expectRevert(ProposalValidator.ProposalValidator_ExceedsDistributionThreshold.selector); @@ -1602,7 +1601,7 @@ contract ProposalValidator_SubmitFundingProposal_TestFail is ProposalValidator_I ProposalValidator.ProposalType proposalType = ProposalValidator.ProposalType(proposalTypeValue); (string[] memory descriptions, address[] memory recipients, uint256[] memory amounts) = - _createMinimalFundingArrays(); + _createMinimalFundingArrays(1); // Calculate expected proposal hash bytes memory votingModuleData = @@ -1642,7 +1641,7 @@ contract ProposalValidator_SubmitFundingProposal_TestFail is ProposalValidator_I ProposalValidator.ProposalType proposalType = ProposalValidator.ProposalType(proposalTypeValue); (string[] memory descriptions, address[] memory recipients, uint256[] memory amounts) = - _createMinimalFundingArrays(); + _createMinimalFundingArrays(1); // Calculate expected proposal hash bytes memory votingModuleData = @@ -1921,7 +1920,7 @@ contract ProposalValidator_ApproveProposal_TestFail is ProposalValidator_Init { /// @title ProposalValidator_CanApproveProposal_Test /// @notice Tests for the canApproveProposal function contract ProposalValidator_CanApproveProposal_Test is ProposalValidator_Init { - function test_canApproveProposal_returnTrue_succeeds() public { + function test_canApproveProposal_returnTrue_succeeds() public view { // Attestation already created in setUp bool canApprove = validator.canApproveProposal(topDelegateAttestation_A, topDelegate_A); assertTrue(canApprove); @@ -2111,7 +2110,7 @@ contract ProposalValidator_MoveToVoteCouncilMemberElectionsProposal_Test is Prop emit ProposalMovedToVote(expectedHash, approvedProposer); // Move to vote - vm.roll(START_BLOCK + 1); + vm.warp(START_TIMESTAMP + 1); vm.prank(approvedProposer); validator.moveToVoteCouncilMemberElectionsProposal(criteriaValue, optionsDescriptions, proposalDescription); @@ -2192,7 +2191,7 @@ contract ProposalValidator_MoveToVoteCouncilMemberElectionsProposal_TestFail is _mockProposalTypesConfiguratorCall(APPROVAL_VOTING_MODULE_ID); vm.expectRevert(IProposalValidator.ProposalValidator_InvalidVotingCycle.selector); - vm.roll(block.number + DURATION + 1); + vm.warp(START_TIMESTAMP + DURATION + 1); vm.prank(approvedProposer); validator.moveToVoteCouncilMemberElectionsProposal(criteriaValue, optionsDescriptions, proposalDescription); } @@ -2214,7 +2213,7 @@ contract ProposalValidator_MoveToVoteCouncilMemberElectionsProposal_TestFail is ); vm.expectRevert(IProposalValidator.ProposalValidator_ProposalIdMismatch.selector); - vm.roll(START_BLOCK + 1); + vm.warp(START_TIMESTAMP + 1); vm.prank(approvedProposer); validator.moveToVoteCouncilMemberElectionsProposal(criteriaValue, optionsDescriptions, proposalDescription); } @@ -2294,7 +2293,7 @@ contract ProposalValidator_MoveToVoteFundingProposal_Test is ProposalValidator_I emit ProposalMovedToVote(expectedGovernanceFundHash, approvedProposer); // Move to vote - vm.roll(START_BLOCK + 1); + vm.warp(START_TIMESTAMP + 1); vm.prank(approvedProposer); validator.moveToVoteFundingProposal( criteriaValue, @@ -2334,7 +2333,7 @@ contract ProposalValidator_MoveToVoteFundingProposal_Test is ProposalValidator_I emit ProposalMovedToVote(expectedCouncilBudgetHash, approvedProposer); // Move to vote - vm.roll(START_BLOCK + 1); + vm.warp(START_TIMESTAMP + 1); vm.prank(approvedProposer); validator.moveToVoteFundingProposal( criteriaValue, @@ -2364,7 +2363,7 @@ contract ProposalValidator_MoveToVoteFundingProposal_TestFail is ProposalValidat function setUp() public override { super.setUp(); - (optionsDescriptions, optionsRecipients, optionsAmounts) = _createMinimalFundingArrays(); + (optionsDescriptions, optionsRecipients, optionsAmounts) = _createMinimalFundingArrays(1); (governanceFundExpectedHash, governanceFundVotingModuleData) = _createFundingProposalForMoveToVote( approvedProposer, criteriaValue, @@ -2546,7 +2545,7 @@ contract ProposalValidator_MoveToVoteFundingProposal_TestFail is ProposalValidat _mockProposalTypesConfiguratorCall(APPROVAL_VOTING_MODULE_ID); vm.expectRevert(IProposalValidator.ProposalValidator_InvalidVotingCycle.selector); - vm.roll(START_BLOCK + DURATION + 1); + vm.warp(START_TIMESTAMP + DURATION + 1); vm.prank(approvedProposer); validator.moveToVoteFundingProposal( criteriaValue, optionsDescriptions, optionsRecipients, optionsAmounts, proposalDescription, proposalType @@ -2622,7 +2621,7 @@ contract ProposalValidator_MoveToVoteFundingProposal_TestFail is ProposalValidat vm.expectRevert(IProposalValidator.ProposalValidator_ExceedsDistributionThreshold.selector); vm.prank(approvedProposer); - vm.roll(START_BLOCK + 1); + vm.warp(START_TIMESTAMP + 1); validator.moveToVoteFundingProposal( criteriaValue, _optionsDescriptions, _optionsRecipients, _optionsAmounts, proposalDescription, proposalType ); @@ -2664,7 +2663,7 @@ contract ProposalValidator_MoveToVoteFundingProposal_TestFail is ProposalValidat ); vm.expectRevert(IProposalValidator.ProposalValidator_ProposalIdMismatch.selector); - vm.roll(START_BLOCK + 1); + vm.warp(START_TIMESTAMP + 1); vm.prank(approvedProposer); validator.moveToVoteFundingProposal( criteriaValue, optionsDescriptions, optionsRecipients, optionsAmounts, proposalDescription, proposalType @@ -2677,7 +2676,7 @@ contract ProposalValidator_MoveToVoteFundingProposal_TestFail is ProposalValidat contract ProposalValidator_Setters_Test is ProposalValidator_Init { function testFuzz_setVotingCycleData_succeeds( uint256 cycleNumber, - uint256 startBlock, + uint256 startingTimestamp, uint256 duration, uint256 distributionLimit ) @@ -2687,19 +2686,19 @@ contract ProposalValidator_Setters_Test is ProposalValidator_Init { // Expect the VotingCycleDataSet event to be emitted vm.expectEmit(address(validator)); - emit VotingCycleDataSet(cycleNumber, startBlock, duration, distributionLimit); + emit VotingCycleDataSet(cycleNumber, startingTimestamp, duration, distributionLimit); vm.prank(owner); - validator.setVotingCycleData(cycleNumber, startBlock, duration, distributionLimit); + validator.setVotingCycleData(cycleNumber, startingTimestamp, duration, distributionLimit); ( - uint256 actualStartBlock, + uint256 actualStartingTimestamp, uint256 actualDuration, uint256 actualDistributionLimit, uint256 actualMovedToVoteTokenCount ) = validator.votingCycles(cycleNumber); - assertEq(actualStartBlock, startBlock); + assertEq(actualStartingTimestamp, startingTimestamp); assertEq(actualDuration, duration); assertEq(actualDistributionLimit, distributionLimit); assertEq(actualMovedToVoteTokenCount, 0); @@ -2708,7 +2707,7 @@ contract ProposalValidator_Setters_Test is ProposalValidator_Init { function testFuzz_setVotingCycleData_notOwner_reverts( address caller, uint256 cycleNumber, - uint256 startBlock, + uint256 startingTimestamp, uint256 duration, uint256 distributionLimit ) @@ -2718,11 +2717,11 @@ contract ProposalValidator_Setters_Test is ProposalValidator_Init { vm.prank(caller); vm.expectRevert("Ownable: caller is not the owner"); - validator.setVotingCycleData(cycleNumber, startBlock, duration, distributionLimit); + validator.setVotingCycleData(cycleNumber, startingTimestamp, duration, distributionLimit); } function testFuzz_setVotingCycleData_votingCycleAlreadySet_reverts( - uint256 startBlock, + uint256 startingTimestamp, uint256 duration, uint256 distributionLimit ) @@ -2730,7 +2729,7 @@ contract ProposalValidator_Setters_Test is ProposalValidator_Init { { vm.expectRevert(ProposalValidator.ProposalValidator_VotingCycleAlreadySet.selector); vm.prank(owner); - validator.setVotingCycleData(CYCLE_NUMBER, startBlock, duration, distributionLimit); + validator.setVotingCycleData(CYCLE_NUMBER, startingTimestamp, duration, distributionLimit); } function testFuzz_setDistributionThreshold_succeeds(uint256 newDistributionThreshold) public { @@ -2801,6 +2800,7 @@ contract ProposalValidator_HashProposalWithModule_Test is ProposalValidator_Init bytes32 descriptionHash ) public + view { bytes32 hash = validator.hashProposalWithModule(module, proposalData, descriptionHash); bytes32 expectedHash = From 6202de49daaadf62f959d324fa84d12db68baa61 Mon Sep 17 00:00:00 2001 From: OneTony Date: Mon, 7 Jul 2025 11:13:56 +0300 Subject: [PATCH 2/3] fix: pre-pr --- .../snapshots/abi/ProposalValidator.json | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/contracts-bedrock/snapshots/abi/ProposalValidator.json b/packages/contracts-bedrock/snapshots/abi/ProposalValidator.json index 4af4cf80adfb7..40ba0366dd0a4 100644 --- a/packages/contracts-bedrock/snapshots/abi/ProposalValidator.json +++ b/packages/contracts-bedrock/snapshots/abi/ProposalValidator.json @@ -177,7 +177,7 @@ }, { "internalType": "uint256", - "name": "_startBlock", + "name": "_startingTimestamp", "type": "uint256" }, { @@ -429,7 +429,7 @@ }, { "internalType": "uint256", - "name": "_startBlock", + "name": "_startingTimestamp", "type": "uint256" }, { @@ -613,7 +613,7 @@ "outputs": [ { "internalType": "uint256", - "name": "startingBlock", + "name": "startingTimestamp", "type": "uint256" }, { @@ -805,7 +805,7 @@ { "indexed": false, "internalType": "uint256", - "name": "startBlock", + "name": "startingTimestamp", "type": "uint256" }, { @@ -869,6 +869,16 @@ "name": "ProposalValidator_InvalidOptionsLength", "type": "error" }, + { + "inputs": [], + "name": "ProposalValidator_InvalidProposal", + "type": "error" + }, + { + "inputs": [], + "name": "ProposalValidator_InvalidProposer", + "type": "error" + }, { "inputs": [], "name": "ProposalValidator_InvalidUpgradeProposalType", From 67a33c1e3fb560b3260b906eca6f89230953580f Mon Sep 17 00:00:00 2001 From: OneTony Date: Mon, 7 Jul 2025 11:25:17 +0300 Subject: [PATCH 3/3] fix: improve test --- .../contracts-bedrock/test/governance/ProposalValidator.t.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/contracts-bedrock/test/governance/ProposalValidator.t.sol b/packages/contracts-bedrock/test/governance/ProposalValidator.t.sol index 874fd3272409a..6971a1de14bd4 100644 --- a/packages/contracts-bedrock/test/governance/ProposalValidator.t.sol +++ b/packages/contracts-bedrock/test/governance/ProposalValidator.t.sol @@ -1387,9 +1387,8 @@ contract ProposalValidator_SubmitFundingProposal_Test is ProposalValidator_Init (string[] memory descriptions, address[] memory recipients, uint256[] memory amounts) = _createMinimalFundingArrays(optionCount); + // fuzz the amounts for (uint256 i = 0; i < optionCount; i++) { - descriptions[i] = descriptions[0]; - recipients[i] = recipients[0]; amounts[i] = amount; }