Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/contracts-bedrock/snapshots/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
},
"src/governance/ProposalValidator.sol:ProposalValidator": {
"initCodeHash": "0x44d71e84d08aeb7abc82993a0293f646952d83e439e95427d2c432568f95524e",
"sourceCodeHash": "0xd7d94a765bec0d80cac4bce4e62270a27a830b103dd554d7a4be540a49f8f4d5"
"sourceCodeHash": "0xc4c4954f4b59c6c0bf0acfc3ac6616866fb3d246bab6e295ee9b113ac903860d"
},
"src/legacy/DeployerWhitelist.sol:DeployerWhitelist": {
"initCodeHash": "0x53099379ed48b87f027d55712dbdd1da7d7099925426eb0531da9c0012e02c29",
Expand Down
20 changes: 19 additions & 1 deletion packages/contracts-bedrock/src/governance/ProposalValidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ contract ProposalValidator is OwnableUpgradeable, ReinitializableBase, ISemver {
}

/// @notice Struct for storing explicit data for each proposal type.
/// @param requiredApprovals The number of approvals each proposal type requires in order to be able to move for voting.
/// @param requiredApprovals The number of approvals each proposal type requires in order to be able to move for
/// voting.
/// @param proposalTypeConfigurator The voting module each proposal type must use.
struct ProposalTypeData {
uint256 requiredApprovals;
Expand Down Expand Up @@ -466,6 +467,23 @@ contract ProposalValidator is OwnableUpgradeable, ReinitializableBase, ISemver {
return keccak256(abi.encode(_targets, _values, _calldatas, _description));
}

/// @notice Calculate `proposalId` hashing similarly to `hashProposal` but based on `module` and `proposalData`.
/// @param _module The address of the voting module to use for this proposal.
/// @param _proposalData The proposal data to pass to the voting module.
/// @param _descriptionHash The hash of the proposal description.
/// @return The hash of the proposal.
function _hashProposalWithModule(
address _module,
bytes memory _proposalData,
bytes32 _descriptionHash
)
internal
view
returns (bytes32)
{
return keccak256(abi.encode(address(this), _module, _proposalData, _descriptionHash));
}

/// @notice Private function to set the minimum voting power and emit event.
/// @param _minimumVotingPower The new minimum voting power threshold.
function _setMinimumVotingPower(uint256 _minimumVotingPower) private {
Expand Down