applyHarness.patch 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. diff -ruN .gitignore .gitignore
  2. --- .gitignore 1969-12-31 19:00:00.000000000 -0500
  3. +++ .gitignore 2021-12-01 10:05:19.757088138 -0500
  4. @@ -0,0 +1,2 @@
  5. +*
  6. +!.gitignore
  7. diff -ruN governance/compatibility/GovernorCompatibilityBravo.sol governance/compatibility/GovernorCompatibilityBravo.sol
  8. --- governance/compatibility/GovernorCompatibilityBravo.sol 2021-12-01 10:02:39.909936316 -0500
  9. +++ governance/compatibility/GovernorCompatibilityBravo.sol 2021-12-01 10:00:48.002627620 -0500
  10. @@ -245,7 +245,7 @@
  11. /**
  12. * @dev See {Governor-_quorumReached}. In this module, only forVotes count toward the quorum.
  13. */
  14. - function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {
  15. + function _quorumReached(uint256 proposalId) public view virtual override returns (bool) { // HARNESS: changed to public from internal
  16. ProposalDetails storage details = _proposalDetails[proposalId];
  17. return quorum(proposalSnapshot(proposalId)) < details.forVotes;
  18. }
  19. @@ -253,7 +253,7 @@
  20. /**
  21. * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be scritly over the againstVotes.
  22. */
  23. - function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {
  24. + function _voteSucceeded(uint256 proposalId) public view virtual override returns (bool) { // HARNESS: changed to public from internal
  25. ProposalDetails storage details = _proposalDetails[proposalId];
  26. return details.forVotes > details.againstVotes;
  27. }
  28. diff -ruN governance/extensions/GovernorCountingSimple.sol governance/extensions/GovernorCountingSimple.sol
  29. --- governance/extensions/GovernorCountingSimple.sol 2021-12-01 10:02:39.909936316 -0500
  30. +++ governance/extensions/GovernorCountingSimple.sol 2021-12-01 10:00:48.002627620 -0500
  31. @@ -64,7 +64,7 @@
  32. /**
  33. * @dev See {Governor-_quorumReached}.
  34. */
  35. - function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {
  36. + function _quorumReached(uint256 proposalId) public view virtual override returns (bool) {
  37. ProposalVote storage proposalvote = _proposalVotes[proposalId];
  38. return quorum(proposalSnapshot(proposalId)) <= proposalvote.forVotes + proposalvote.abstainVotes;
  39. @@ -73,7 +73,7 @@
  40. /**
  41. * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.
  42. */
  43. - function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {
  44. + function _voteSucceeded(uint256 proposalId) public view virtual override returns (bool) {
  45. ProposalVote storage proposalvote = _proposalVotes[proposalId];
  46. return proposalvote.forVotes > proposalvote.againstVotes;
  47. diff -ruN governance/extensions/GovernorTimelockControl.sol governance/extensions/GovernorTimelockControl.sol
  48. --- governance/extensions/GovernorTimelockControl.sol 2021-12-01 10:02:39.909936316 -0500
  49. +++ governance/extensions/GovernorTimelockControl.sol 2021-12-01 10:00:48.002627620 -0500
  50. @@ -109,7 +109,7 @@
  51. bytes[] memory calldatas,
  52. bytes32 descriptionHash
  53. ) internal virtual override {
  54. - _timelock.executeBatch{value: msg.value}(targets, values, calldatas, 0, descriptionHash);
  55. + _timelock.executeBatch{value: msg.value}(targets, values, calldatas, 0, descriptionHash);
  56. }
  57. /**
  58. diff -ruN governance/Governor.sol governance/Governor.sol
  59. --- governance/Governor.sol 2021-12-01 10:02:39.909936316 -0500
  60. +++ governance/Governor.sol 2021-12-01 10:00:48.002627620 -0500
  61. @@ -38,8 +38,8 @@
  62. string private _name;
  63. - mapping(uint256 => ProposalCore) private _proposals;
  64. -
  65. + mapping(uint256 => ProposalCore) public _proposals;
  66. +
  67. /**
  68. * @dev Restrict access to governor executing address. Some module might override the _executor function to make
  69. * sure this modifier is consistant with the execution model.
  70. @@ -154,12 +154,12 @@
  71. /**
  72. * @dev Amount of votes already cast passes the threshold limit.
  73. */
  74. - function _quorumReached(uint256 proposalId) internal view virtual returns (bool);
  75. + function _quorumReached(uint256 proposalId) public view virtual returns (bool); // HARNESS: changed to public from internal
  76. /**
  77. * @dev Is the proposal successful or not.
  78. */
  79. - function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool);
  80. + function _voteSucceeded(uint256 proposalId) public view virtual returns (bool); // HARNESS: changed to public from internal
  81. /**
  82. * @dev Register a vote with a given support and voting weight.
  83. @@ -320,7 +320,7 @@
  84. v,
  85. r,
  86. s
  87. - );
  88. + ); // mention that we assume that hashing works correctly
  89. return _castVote(proposalId, voter, support, "");
  90. }
  91. diff -ruN governance/TimelockController.sol governance/TimelockController.sol
  92. --- governance/TimelockController.sol 2021-12-01 10:02:39.909936316 -0500
  93. +++ governance/TimelockController.sol 2021-12-01 10:00:48.002627620 -0500
  94. @@ -299,6 +299,7 @@
  95. _call(id, i, targets[i], values[i], datas[i]);
  96. }
  97. _afterCall(id);
  98. + // ASSUME THAT THERE IS NO REENTRANCY IN WIZARDHARNESS1
  99. }
  100. /**
  101. diff -ruN token/ERC20/extensions/ERC20Votes.sol token/ERC20/extensions/ERC20Votes.sol
  102. --- token/ERC20/extensions/ERC20Votes.sol 2021-12-01 10:02:39.909936316 -0500
  103. +++ token/ERC20/extensions/ERC20Votes.sol 2021-12-01 10:00:48.018627515 -0500
  104. @@ -84,7 +84,7 @@
  105. *
  106. * - `blockNumber` must have been already mined
  107. */
  108. - function getPastVotes(address account, uint256 blockNumber) public view returns (uint256) {
  109. + function getPastVotes(address account, uint256 blockNumber) public view virtual returns (uint256) {
  110. require(blockNumber < block.number, "ERC20Votes: block not yet mined");
  111. return _checkpointsLookup(_checkpoints[account], blockNumber);
  112. }