GovernorMock.sol 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../governance/extensions/GovernorProposalThreshold.sol";
  4. import "../governance/extensions/GovernorSettings.sol";
  5. import "../governance/extensions/GovernorCountingSimple.sol";
  6. import "../governance/extensions/GovernorVotesQuorumFraction.sol";
  7. contract GovernorMock is
  8. GovernorProposalThreshold,
  9. GovernorSettings,
  10. GovernorVotesQuorumFraction,
  11. GovernorCountingSimple
  12. {
  13. constructor(
  14. string memory name_,
  15. IVotes token_,
  16. uint256 votingDelay_,
  17. uint256 votingPeriod_,
  18. uint256 quorumNumerator_
  19. )
  20. Governor(name_)
  21. GovernorSettings(votingDelay_, votingPeriod_, 0)
  22. GovernorVotes(token_)
  23. GovernorVotesQuorumFraction(quorumNumerator_)
  24. {}
  25. function cancel(
  26. address[] memory targets,
  27. uint256[] memory values,
  28. bytes[] memory calldatas,
  29. bytes32 salt
  30. ) public returns (uint256 proposalId) {
  31. return _cancel(targets, values, calldatas, salt);
  32. }
  33. function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
  34. return super.proposalThreshold();
  35. }
  36. function propose(
  37. address[] memory targets,
  38. uint256[] memory values,
  39. bytes[] memory calldatas,
  40. string memory description
  41. ) public virtual override(Governor, GovernorProposalThreshold) returns (uint256) {
  42. return super.propose(targets, values, calldatas, description);
  43. }
  44. }