GovernorProposalThresholdHarness.sol 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import "../../contracts/governance/extensions/GovernorProposalThreshold.sol";
  2. contract GovernorProposalThresholdHarness is GovernorProposalThreshold {
  3. mapping(uint256 => uint256) _quorum;
  4. function quorum(uint256 blockNumber) public view override virtual returns (uint256) {
  5. return _quorum[blockNumber];
  6. }
  7. mapping (address => mapping (uint256 => uint256)) _getVotes;
  8. function getVotes(address account, uint256 blockNumber) public view override virtual returns (uint256) {
  9. return _getVotes[account][blockNumber];
  10. }
  11. mapping (uint256 => bool) __quoromReached;
  12. function _quorumReached(uint256 proposalId) public view override virtual returns (bool) {
  13. return __quoromReached[proposalId];
  14. }
  15. mapping (uint256 => bool) __voteSucceeded;
  16. function _voteSucceeded(uint256 proposalId) public view override virtual returns (bool) {
  17. return __voteSucceeded[proposalId];
  18. }
  19. //string _COUNTING_MODE;
  20. function COUNTING_MODE() public pure override virtual returns (string memory) {
  21. return "dummy";
  22. }
  23. mapping(uint256 => mapping(address => bool)) _hasVoted;
  24. function hasVoted(uint256 proposalId, address account) public view override virtual returns (bool) {
  25. return _hasVoted[proposalId][account];
  26. }
  27. uint256 _votingDelay;
  28. function votingDelay() public view override virtual returns (uint256) {
  29. return _votingDelay;
  30. }
  31. uint256 _votingPeriod;
  32. function votingPeriod() public view override virtual returns (uint256) {
  33. return _votingPeriod;
  34. }
  35. function _countVote(
  36. uint256 proposalId,
  37. address account,
  38. uint8 support,
  39. uint256 weight
  40. ) internal override virtual {
  41. // havoc something
  42. }
  43. uint256 _proposalThreshold;
  44. function proposalThreshold() public view override virtual returns (uint256) {
  45. return _proposalThreshold;
  46. }
  47. constructor(string memory name) Governor(name) {}
  48. }