GovernorSequentialProposalIdMock.sol 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.20;
  3. import {Governor} from "../../governance/Governor.sol";
  4. import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
  5. import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";
  6. import {GovernorVotesQuorumFraction} from "../../governance/extensions/GovernorVotesQuorumFraction.sol";
  7. import {GovernorSequentialProposalId} from "../../governance/extensions/GovernorSequentialProposalId.sol";
  8. abstract contract GovernorSequentialProposalIdMock is
  9. GovernorSettings,
  10. GovernorVotesQuorumFraction,
  11. GovernorCountingSimple,
  12. GovernorSequentialProposalId
  13. {
  14. function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
  15. return super.proposalThreshold();
  16. }
  17. function getProposalId(
  18. address[] memory targets,
  19. uint256[] memory values,
  20. bytes[] memory calldatas,
  21. bytes32 descriptionHash
  22. ) public view virtual override(Governor, GovernorSequentialProposalId) returns (uint256) {
  23. return super.getProposalId(targets, values, calldatas, descriptionHash);
  24. }
  25. function _propose(
  26. address[] memory targets,
  27. uint256[] memory values,
  28. bytes[] memory calldatas,
  29. string memory description,
  30. address proposer
  31. ) internal virtual override(Governor, GovernorSequentialProposalId) returns (uint256 proposalId) {
  32. return super._propose(targets, values, calldatas, description, proposer);
  33. }
  34. }