IGovernorCompatibilityBravo.sol 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../IGovernor.sol";
  4. /**
  5. * @dev Interface extension that adds missing functions to the {Governor} core to provide `GovernorBravo` compatibility.
  6. *
  7. * _Available since v4.3._
  8. */
  9. interface IGovernorCompatibilityBravo is IGovernor {
  10. /**
  11. * @dev Proposal structure from Compound Governor Bravo. Not actually used by the compatibility layer, as
  12. * {{proposal}} returns a very different structure.
  13. */
  14. struct Proposal {
  15. uint256 id;
  16. address proposer;
  17. uint256 eta;
  18. address[] targets;
  19. uint256[] values;
  20. string[] signatures;
  21. bytes[] calldatas;
  22. uint256 startBlock;
  23. uint256 endBlock;
  24. uint256 forVotes;
  25. uint256 againstVotes;
  26. uint256 abstainVotes;
  27. bool canceled;
  28. bool executed;
  29. mapping(address => Receipt) receipts;
  30. }
  31. /**
  32. * @dev Receipt structure from Compound Governor Bravo
  33. */
  34. struct Receipt {
  35. bool hasVoted;
  36. uint8 support;
  37. uint96 votes;
  38. }
  39. /**
  40. * @dev Part of the Governor Bravo's interface.
  41. */
  42. function quorumVotes() external view returns (uint256);
  43. /**
  44. * @dev Part of the Governor Bravo's interface: _"The official record of all proposals ever proposed"_.
  45. */
  46. function proposals(uint256)
  47. external
  48. view
  49. returns (
  50. uint256 id,
  51. address proposer,
  52. uint256 eta,
  53. uint256 startBlock,
  54. uint256 endBlock,
  55. uint256 forVotes,
  56. uint256 againstVotes,
  57. uint256 abstainVotes,
  58. bool canceled,
  59. bool executed
  60. );
  61. /**
  62. * @dev Part of the Governor Bravo's interface: _"Function used to propose a new proposal"_.
  63. */
  64. function propose(
  65. address[] memory targets,
  66. uint256[] memory values,
  67. string[] memory signatures,
  68. bytes[] memory calldatas,
  69. string memory description
  70. ) external returns (uint256);
  71. /**
  72. * @dev Part of the Governor Bravo's interface: _"Queues a proposal of state succeeded"_.
  73. */
  74. function queue(uint256 proposalId) external;
  75. /**
  76. * @dev Part of the Governor Bravo's interface: _"Executes a queued proposal if eta has passed"_.
  77. */
  78. function execute(uint256 proposalId) external payable;
  79. /**
  80. * @dev Part of the Governor Bravo's interface: _"Gets actions of a proposal"_.
  81. */
  82. function getActions(uint256 proposalId)
  83. external
  84. view
  85. returns (
  86. address[] memory targets,
  87. uint256[] memory values,
  88. string[] memory signatures,
  89. bytes[] memory calldatas
  90. );
  91. /**
  92. * @dev Part of the Governor Bravo's interface: _"Gets the receipt for a voter on a given proposal"_.
  93. */
  94. function getReceipt(uint256 proposalId, address voter) external view returns (Receipt memory);
  95. /**
  96. * @dev Part of the Governor Bravo's interface: _"The number of votes required in order for a voter to become a proposer"_.
  97. */
  98. function proposalThreshold() external view returns (uint256);
  99. }