GovernorCompMock.sol 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../governance/extensions/GovernorCountingSimple.sol";
  4. import "../governance/extensions/GovernorVotesComp.sol";
  5. contract GovernorCompMock is GovernorVotesComp, GovernorCountingSimple {
  6. constructor(string memory name_, ERC20VotesComp token_) Governor(name_) GovernorVotesComp(token_) {}
  7. function quorum(uint256) public pure override returns (uint256) {
  8. return 0;
  9. }
  10. function votingDelay() public pure override returns (uint256) {
  11. return 4;
  12. }
  13. function votingPeriod() public pure override returns (uint256) {
  14. return 16;
  15. }
  16. function cancel(
  17. address[] memory targets,
  18. uint256[] memory values,
  19. bytes[] memory calldatas,
  20. bytes32 salt
  21. ) public returns (uint256 proposalId) {
  22. return _cancel(targets, values, calldatas, salt);
  23. }
  24. function getVotes(address account, uint256 blockNumber)
  25. public
  26. view
  27. virtual
  28. override(IGovernor, GovernorVotesComp)
  29. returns (uint256)
  30. {
  31. return super.getVotes(account, blockNumber);
  32. }
  33. }