applyHarness.patch 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. diff -ruN access/AccessControl.sol access/AccessControl.sol
  2. --- access/AccessControl.sol 2022-09-27 10:26:58.548890299 +0200
  3. +++ access/AccessControl.sol 2022-09-27 17:51:32.011301116 +0200
  4. @@ -93,7 +93,7 @@
  5. *
  6. * _Available since v4.6._
  7. */
  8. - function _checkRole(bytes32 role) internal view virtual {
  9. + function _checkRole(bytes32 role) public view virtual { // HARNESS: internal -> public
  10. _checkRole(role, _msgSender());
  11. }
  12. diff -ruN governance/extensions/GovernorCountingSimple.sol governance/extensions/GovernorCountingSimple.sol
  13. --- governance/extensions/GovernorCountingSimple.sol 2022-09-27 10:26:58.548890299 +0200
  14. +++ governance/extensions/GovernorCountingSimple.sol 2022-09-27 17:51:32.011301116 +0200
  15. @@ -27,7 +27,7 @@
  16. mapping(address => bool) hasVoted;
  17. }
  18. - mapping(uint256 => ProposalVote) private _proposalVotes;
  19. + mapping(uint256 => ProposalVote) internal _proposalVotes; // HARNESS: private -> internal
  20. /**
  21. * @dev See {IGovernor-COUNTING_MODE}.
  22. diff -ruN governance/extensions/GovernorPreventLateQuorum.sol governance/extensions/GovernorPreventLateQuorum.sol
  23. --- governance/extensions/GovernorPreventLateQuorum.sol 2022-08-31 13:44:36.377724869 +0200
  24. +++ governance/extensions/GovernorPreventLateQuorum.sol 2022-09-27 17:51:32.011301116 +0200
  25. @@ -21,8 +21,8 @@
  26. using SafeCast for uint256;
  27. using Timers for Timers.BlockNumber;
  28. - uint64 private _voteExtension;
  29. - mapping(uint256 => Timers.BlockNumber) private _extendedDeadlines;
  30. + uint64 internal _voteExtension; // HARNESS: private -> internal
  31. + mapping(uint256 => Timers.BlockNumber) internal _extendedDeadlines; // HARNESS: private -> internal
  32. /// @dev Emitted when a proposal deadline is pushed back due to reaching quorum late in its voting period.
  33. event ProposalExtended(uint256 indexed proposalId, uint64 extendedDeadline);
  34. diff -ruN governance/Governor.sol governance/Governor.sol
  35. --- governance/Governor.sol 2022-09-29 10:07:27.126075551 +0200
  36. +++ governance/Governor.sol 2022-09-27 17:51:32.014634743 +0200
  37. @@ -44,7 +44,7 @@
  38. string private _name;
  39. - mapping(uint256 => ProposalCore) private _proposals;
  40. + mapping(uint256 => ProposalCore) internal _proposals; // HARNESS: private -> internal
  41. // This queue keeps track of the governor operating on itself. Calls to functions protected by the
  42. // {onlyGovernance} modifier needs to be whitelisted in this queue. Whitelisting is set in {_beforeExecute},
  43. diff -ruN governance/TimelockController.sol governance/TimelockController.sol
  44. --- governance/TimelockController.sol 2022-09-29 10:07:27.126075551 +0200
  45. +++ governance/TimelockController.sol 2022-09-27 17:51:32.014634743 +0200
  46. @@ -28,10 +28,10 @@
  47. bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE");
  48. bytes32 public constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE");
  49. bytes32 public constant CANCELLER_ROLE = keccak256("CANCELLER_ROLE");
  50. - uint256 internal constant _DONE_TIMESTAMP = uint256(1);
  51. + uint256 public constant _DONE_TIMESTAMP = uint256(1); // HARNESS: internal -> public
  52. mapping(bytes32 => uint256) private _timestamps;
  53. - uint256 private _minDelay;
  54. + uint256 public _minDelay; // HARNESS: private -> public
  55. /**
  56. * @dev Emitted when a call is scheduled as part of operation `id`.
  57. diff -ruN governance/utils/Votes.sol governance/utils/Votes.sol
  58. --- governance/utils/Votes.sol 2022-09-27 10:26:58.548890299 +0200
  59. +++ governance/utils/Votes.sol 2022-09-27 17:51:32.014634743 +0200
  60. @@ -35,7 +35,25 @@
  61. bytes32 private constant _DELEGATION_TYPEHASH =
  62. keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
  63. - mapping(address => address) private _delegation;
  64. + // HARNESS : Hooks cannot access any information from Checkpoints yet, so I am also updating votes and fromBlock in this struct
  65. + struct Ckpt {
  66. + uint32 fromBlock;
  67. + uint224 votes;
  68. + }
  69. + mapping(address => Ckpt) public _checkpoints;
  70. +
  71. + // HARNESSED getters
  72. + function numCheckpoints(address account) public view returns (uint32) {
  73. + return SafeCast.toUint32(_delegateCheckpoints[account]._checkpoints.length);
  74. + }
  75. + function ckptFromBlock(address account, uint32 pos) public view returns (uint32) {
  76. + return _delegateCheckpoints[account]._checkpoints[pos]._blockNumber;
  77. + }
  78. + function ckptVotes(address account, uint32 pos) public view returns (uint224) {
  79. + return _delegateCheckpoints[account]._checkpoints[pos]._value;
  80. + }
  81. +
  82. + mapping(address => address) public _delegation; // HARNESS: private -> public
  83. mapping(address => Checkpoints.History) private _delegateCheckpoints;
  84. Checkpoints.History private _totalCheckpoints;
  85. @@ -124,7 +142,7 @@
  86. *
  87. * Emits events {DelegateChanged} and {DelegateVotesChanged}.
  88. */
  89. - function _delegate(address account, address delegatee) internal virtual {
  90. + function _delegate(address account, address delegatee) public virtual { // HARNESS: internal -> public
  91. address oldDelegate = delegates(account);
  92. _delegation[account] = delegatee;
  93. @@ -142,10 +160,10 @@
  94. uint256 amount
  95. ) internal virtual {
  96. if (from == address(0)) {
  97. - _totalCheckpoints.push(_add, amount);
  98. + _totalCheckpoints.push(_totalCheckpoints.latest() + amount); // Harnessed to remove function pointers
  99. }
  100. if (to == address(0)) {
  101. - _totalCheckpoints.push(_subtract, amount);
  102. + _totalCheckpoints.push(_totalCheckpoints.latest() - amount); // Harnessed to remove function pointers
  103. }
  104. _moveDelegateVotes(delegates(from), delegates(to), amount);
  105. }
  106. @@ -160,11 +178,13 @@
  107. ) private {
  108. if (from != to && amount > 0) {
  109. if (from != address(0)) {
  110. - (uint256 oldValue, uint256 newValue) = _delegateCheckpoints[from].push(_subtract, amount);
  111. + (uint256 oldValue, uint256 newValue) = _delegateCheckpoints[from].push(_delegateCheckpoints[from].latest() - amount); // Harnessed to remove function pointers
  112. + _checkpoints[from] = Ckpt({fromBlock: SafeCast.toUint32(block.number), votes: SafeCast.toUint224(newValue)}); // HARNESS
  113. emit DelegateVotesChanged(from, oldValue, newValue);
  114. }
  115. if (to != address(0)) {
  116. - (uint256 oldValue, uint256 newValue) = _delegateCheckpoints[to].push(_add, amount);
  117. + (uint256 oldValue, uint256 newValue) = _delegateCheckpoints[to].push(_delegateCheckpoints[to].latest() + amount); // Harnessed to remove function pointers
  118. + _checkpoints[to] = Ckpt({fromBlock: SafeCast.toUint32(block.number), votes: SafeCast.toUint224(newValue)}); // HARNESS
  119. emit DelegateVotesChanged(to, oldValue, newValue);
  120. }
  121. }
  122. @@ -207,5 +227,5 @@
  123. /**
  124. * @dev Must return the voting units held by an account.
  125. */
  126. - function _getVotingUnits(address) internal view virtual returns (uint256);
  127. + function _getVotingUnits(address) public virtual returns (uint256); // HARNESS: internal -> public
  128. }
  129. diff -ruN mocks/SafeERC20Helper.sol mocks/SafeERC20Helper.sol
  130. --- mocks/SafeERC20Helper.sol 2022-09-26 19:10:21.166619395 +0200
  131. +++ mocks/SafeERC20Helper.sol 2022-09-27 17:51:32.014634743 +0200
  132. @@ -4,7 +4,6 @@
  133. import "../utils/Context.sol";
  134. import "../token/ERC20/IERC20.sol";
  135. -import "../token/ERC20/extensions/draft-ERC20Permit.sol";
  136. import "../token/ERC20/utils/SafeERC20.sol";
  137. contract ERC20ReturnFalseMock is Context {
  138. @@ -106,42 +105,43 @@
  139. }
  140. }
  141. -contract ERC20PermitNoRevertMock is
  142. - ERC20("ERC20PermitNoRevertMock", "ERC20PermitNoRevertMock"),
  143. - ERC20Permit("ERC20PermitNoRevertMock")
  144. -{
  145. - function getChainId() external view returns (uint256) {
  146. - return block.chainid;
  147. - }
  148. -
  149. - function permitThatMayRevert(
  150. - address owner,
  151. - address spender,
  152. - uint256 value,
  153. - uint256 deadline,
  154. - uint8 v,
  155. - bytes32 r,
  156. - bytes32 s
  157. - ) public {
  158. - super.permit(owner, spender, value, deadline, v, r, s);
  159. - }
  160. -
  161. - function permit(
  162. - address owner,
  163. - address spender,
  164. - uint256 value,
  165. - uint256 deadline,
  166. - uint8 v,
  167. - bytes32 r,
  168. - bytes32 s
  169. - ) public override {
  170. - try this.permitThatMayRevert(owner, spender, value, deadline, v, r, s) {
  171. - // do nothing
  172. - } catch {
  173. - // do nothing
  174. - }
  175. - }
  176. -}
  177. +// Harness remove ?
  178. +// contract ERC20PermitNoRevertMock is
  179. +// ERC20("ERC20PermitNoRevertMock", "ERC20PermitNoRevertMock"),
  180. +// ERC20Permit("ERC20PermitNoRevertMock")
  181. +// {
  182. +// function getChainId() external view returns (uint256) {
  183. +// return block.chainid;
  184. +// }
  185. +
  186. +// function permitThatMayRevert(
  187. +// address owner,
  188. +// address spender,
  189. +// uint256 value,
  190. +// uint256 deadline,
  191. +// uint8 v,
  192. +// bytes32 r,
  193. +// bytes32 s
  194. +// ) public {
  195. +// super.permit(owner, spender, value, deadline, v, r, s);
  196. +// }
  197. +
  198. +// function permit(
  199. +// address owner,
  200. +// address spender,
  201. +// uint256 value,
  202. +// uint256 deadline,
  203. +// uint8 v,
  204. +// bytes32 r,
  205. +// bytes32 s
  206. +// ) public override {
  207. +// try this.permitThatMayRevert(owner, spender, value, deadline, v, r, s) {
  208. +// // do nothing
  209. +// } catch {
  210. +// // do nothing
  211. +// }
  212. +// }
  213. +// }
  214. contract SafeERC20Wrapper is Context {
  215. using SafeERC20 for IERC20;
  216. diff -ruN proxy/utils/Initializable.sol proxy/utils/Initializable.sol
  217. --- proxy/utils/Initializable.sol 2022-09-29 10:07:27.126075551 +0200
  218. +++ proxy/utils/Initializable.sol 2022-09-27 17:51:32.014634743 +0200
  219. @@ -59,12 +59,12 @@
  220. * @dev Indicates that the contract has been initialized.
  221. * @custom:oz-retyped-from bool
  222. */
  223. - uint8 private _initialized;
  224. + uint8 internal _initialized; // HARNESS: private -> internal
  225. /**
  226. * @dev Indicates that the contract is in the process of being initialized.
  227. */
  228. - bool private _initializing;
  229. + bool internal _initializing; // HARNESS: private -> internal
  230. /**
  231. * @dev Triggered when the contract has been initialized or reinitialized.
  232. diff -ruN token/ERC1155/ERC1155.sol token/ERC1155/ERC1155.sol
  233. --- token/ERC1155/ERC1155.sol 2022-09-27 10:26:58.548890299 +0200
  234. +++ token/ERC1155/ERC1155.sol 2022-09-27 17:51:32.014634743 +0200
  235. @@ -21,7 +21,7 @@
  236. using Address for address;
  237. // Mapping from token ID to account balances
  238. - mapping(uint256 => mapping(address => uint256)) private _balances;
  239. + mapping(uint256 => mapping(address => uint256)) internal _balances; // HARNESS: private -> internal
  240. // Mapping from account to operator approvals
  241. mapping(address => mapping(address => bool)) private _operatorApprovals;
  242. @@ -471,7 +471,7 @@
  243. uint256 id,
  244. uint256 amount,
  245. bytes memory data
  246. - ) private {
  247. + ) public { // HARNESS: private -> public
  248. if (to.isContract()) {
  249. try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
  250. if (response != IERC1155Receiver.onERC1155Received.selector) {
  251. @@ -492,7 +492,7 @@
  252. uint256[] memory ids,
  253. uint256[] memory amounts,
  254. bytes memory data
  255. - ) private {
  256. + ) public { // HARNESS: private -> public
  257. if (to.isContract()) {
  258. try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
  259. bytes4 response
  260. diff -ruN token/ERC20/ERC20.sol token/ERC20/ERC20.sol
  261. --- token/ERC20/ERC20.sol 2022-09-27 10:26:58.548890299 +0200
  262. +++ token/ERC20/ERC20.sol 2022-09-29 10:09:07.479688477 +0200
  263. @@ -256,7 +256,7 @@
  264. *
  265. * - `account` cannot be the zero address.
  266. */
  267. - function _mint(address account, uint256 amount) internal virtual {
  268. + function _mint(address account, uint256 amount) public virtual { // HARNESS: internal -> public
  269. require(account != address(0), "ERC20: mint to the zero address");
  270. _beforeTokenTransfer(address(0), account, amount);
  271. @@ -282,7 +282,7 @@
  272. * - `account` cannot be the zero address.
  273. * - `account` must have at least `amount` tokens.
  274. */
  275. - function _burn(address account, uint256 amount) internal virtual {
  276. + function _burn(address account, uint256 amount) public virtual { // HARNESS: internal -> public
  277. require(account != address(0), "ERC20: burn from the zero address");
  278. _beforeTokenTransfer(account, address(0), amount);
  279. diff -ruN token/ERC20/extensions/ERC20Capped.sol token/ERC20/extensions/ERC20Capped.sol
  280. --- token/ERC20/extensions/ERC20Capped.sol 2022-08-31 13:44:36.381058287 +0200
  281. +++ token/ERC20/extensions/ERC20Capped.sol 2022-09-29 10:09:41.376517581 +0200
  282. @@ -30,7 +30,7 @@
  283. /**
  284. * @dev See {ERC20-_mint}.
  285. */
  286. - function _mint(address account, uint256 amount) internal virtual override {
  287. + function _mint(address account, uint256 amount) public virtual override { // HARNESS: internal -> public
  288. require(ERC20.totalSupply() + amount <= cap(), "ERC20Capped: cap exceeded");
  289. super._mint(account, amount);
  290. }
  291. diff -ruN token/ERC20/extensions/ERC20FlashMint.sol token/ERC20/extensions/ERC20FlashMint.sol
  292. --- token/ERC20/extensions/ERC20FlashMint.sol 2022-09-29 10:07:27.126075551 +0200
  293. +++ token/ERC20/extensions/ERC20FlashMint.sol 2022-09-27 17:51:32.014634743 +0200
  294. @@ -51,9 +51,11 @@
  295. // silence warning about unused variable without the addition of bytecode.
  296. token;
  297. amount;
  298. - return 0;
  299. + return fee; // HARNESS: made "return" nonzero
  300. }
  301. + uint256 public fee; // HARNESS: added it to simulate random fee amount
  302. +
  303. /**
  304. * @dev Returns the receiver address of the flash fee. By default this
  305. * implementation returns the address(0) which means the fee amount will be burnt.
  306. diff -ruN token/ERC20/extensions/ERC20Votes.sol token/ERC20/extensions/ERC20Votes.sol
  307. --- token/ERC20/extensions/ERC20Votes.sol 2022-09-27 10:26:58.548890299 +0200
  308. +++ token/ERC20/extensions/ERC20Votes.sol 2022-09-29 10:09:45.489874234 +0200
  309. @@ -33,8 +33,8 @@
  310. bytes32 private constant _DELEGATION_TYPEHASH =
  311. keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
  312. - mapping(address => address) private _delegates;
  313. - mapping(address => Checkpoint[]) private _checkpoints;
  314. + mapping(address => address) public _delegates; // HARNESS: private -> public
  315. + mapping(address => Checkpoint[]) public _checkpoints; // HARNESS: private -> public
  316. Checkpoint[] private _totalSupplyCheckpoints;
  317. /**
  318. @@ -165,27 +165,27 @@
  319. /**
  320. * @dev Maximum token supply. Defaults to `type(uint224).max` (2^224^ - 1).
  321. */
  322. - function _maxSupply() internal view virtual returns (uint224) {
  323. + function _maxSupply() public view virtual returns (uint224) { // HARNESS: internal -> public
  324. return type(uint224).max;
  325. }
  326. /**
  327. * @dev Snapshots the totalSupply after it has been increased.
  328. */
  329. - function _mint(address account, uint256 amount) internal virtual override {
  330. + function _mint(address account, uint256 amount) public virtual override { // HARNESS: internal -> public
  331. super._mint(account, amount);
  332. require(totalSupply() <= _maxSupply(), "ERC20Votes: total supply risks overflowing votes");
  333. - _writeCheckpoint(_totalSupplyCheckpoints, _add, amount);
  334. + _writeCheckpointAdd(_totalSupplyCheckpoints, amount); // HARNESS: new version without pointer
  335. }
  336. /**
  337. * @dev Snapshots the totalSupply after it has been decreased.
  338. */
  339. - function _burn(address account, uint256 amount) internal virtual override {
  340. + function _burn(address account, uint256 amount) public virtual override { // HARNESS: internal -> public (to comply with the ERC20 harness)
  341. super._burn(account, amount);
  342. - _writeCheckpoint(_totalSupplyCheckpoints, _subtract, amount);
  343. + _writeCheckpointSub(_totalSupplyCheckpoints, amount); // HARNESS: new version without pointer
  344. }
  345. /**
  346. @@ -208,7 +208,7 @@
  347. *
  348. * Emits events {DelegateChanged} and {DelegateVotesChanged}.
  349. */
  350. - function _delegate(address delegator, address delegatee) internal virtual {
  351. + function _delegate(address delegator, address delegatee) public virtual { // HARNESS: internal -> public
  352. address currentDelegate = delegates(delegator);
  353. uint256 delegatorBalance = balanceOf(delegator);
  354. _delegates[delegator] = delegatee;
  355. @@ -225,12 +225,13 @@
  356. ) private {
  357. if (src != dst && amount > 0) {
  358. if (src != address(0)) {
  359. - (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[src], _subtract, amount);
  360. + (uint256 oldWeight, uint256 newWeight) = _writeCheckpointSub(_checkpoints[src], amount); // HARNESS: new version without pointer
  361. +
  362. emit DelegateVotesChanged(src, oldWeight, newWeight);
  363. }
  364. if (dst != address(0)) {
  365. - (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[dst], _add, amount);
  366. + (uint256 oldWeight, uint256 newWeight) = _writeCheckpointAdd(_checkpoints[dst], amount); // HARNESS: new version without pointer
  367. emit DelegateVotesChanged(dst, oldWeight, newWeight);
  368. }
  369. }
  370. @@ -255,6 +256,55 @@
  371. }
  372. }
  373. + // HARNESS: split _writeCheckpoint() to two functions as a workaround for function pointers that cannot be managed by the tool
  374. + function _writeCheckpointAdd(
  375. + Checkpoint[] storage ckpts,
  376. + uint256 delta
  377. + ) private returns (uint256 oldWeight, uint256 newWeight) {
  378. + uint256 pos = ckpts.length;
  379. + oldWeight = pos == 0 ? 0 : ckpts[pos - 1].votes;
  380. + newWeight = _add(oldWeight, delta);
  381. +
  382. + if (pos > 0 && ckpts[pos - 1].fromBlock == block.number) {
  383. + ckpts[pos - 1].votes = SafeCast.toUint224(newWeight);
  384. + } else {
  385. + ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(block.number), votes: SafeCast.toUint224(newWeight)}));
  386. + }
  387. + }
  388. +
  389. + function _writeCheckpointSub(
  390. + Checkpoint[] storage ckpts,
  391. + uint256 delta
  392. + ) private returns (uint256 oldWeight, uint256 newWeight) {
  393. + uint256 pos = ckpts.length;
  394. + oldWeight = pos == 0 ? 0 : ckpts[pos - 1].votes;
  395. + newWeight = _subtract(oldWeight, delta);
  396. +
  397. + if (pos > 0 && ckpts[pos - 1].fromBlock == block.number) {
  398. + ckpts[pos - 1].votes = SafeCast.toUint224(newWeight);
  399. + } else {
  400. + ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(block.number), votes: SafeCast.toUint224(newWeight)}));
  401. + }
  402. + }
  403. +
  404. + // backup of original function
  405. + //
  406. + // function _writeCheckpoint(
  407. + // Checkpoint[] storage ckpts,
  408. + // function(uint256, uint256) view returns (uint256) op,
  409. + // uint256 delta
  410. + // ) private returns (uint256 oldWeight, uint256 newWeight) {
  411. + // uint256 pos = ckpts.length;
  412. + // oldWeight = pos == 0 ? 0 : ckpts[pos - 1].votes;
  413. + // newWeight = op(oldWeight, delta);
  414. + //
  415. + // if (pos > 0 && ckpts[pos - 1].fromBlock == block.number) {
  416. + // ckpts[pos - 1].votes = SafeCast.toUint224(newWeight);
  417. + // } else {
  418. + // ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(block.number), votes: SafeCast.toUint224(newWeight)}));
  419. + // }
  420. + // }
  421. +
  422. function _add(uint256 a, uint256 b) private pure returns (uint256) {
  423. return a + b;
  424. }
  425. diff -ruN token/ERC20/extensions/ERC20Wrapper.sol token/ERC20/extensions/ERC20Wrapper.sol
  426. --- token/ERC20/extensions/ERC20Wrapper.sol 2022-08-31 13:44:36.381058287 +0200
  427. +++ token/ERC20/extensions/ERC20Wrapper.sol 2022-09-28 11:25:39.319711517 +0200
  428. @@ -55,7 +55,7 @@
  429. * @dev Mint wrapped token to cover any underlyingTokens that would have been transferred by mistake. Internal
  430. * function that can be exposed with access control if desired.
  431. */
  432. - function _recover(address account) internal virtual returns (uint256) {
  433. + function _recover(address account) public virtual returns (uint256) { // HARNESS: internal -> public
  434. uint256 value = underlying.balanceOf(address(this)) - totalSupply();
  435. _mint(account, value);
  436. return value;
  437. diff -ruN token/ERC721/extensions/draft-ERC721Votes.sol token/ERC721/extensions/draft-ERC721Votes.sol
  438. --- token/ERC721/extensions/draft-ERC721Votes.sol 2022-09-29 10:07:27.126075551 +0200
  439. +++ token/ERC721/extensions/draft-ERC721Votes.sol 2022-09-27 17:51:32.014634743 +0200
  440. @@ -49,7 +49,7 @@
  441. /**
  442. * @dev Returns the balance of `account`.
  443. */
  444. - function _getVotingUnits(address account) internal view virtual override returns (uint256) {
  445. + function _getVotingUnits(address account) public view virtual override returns (uint256) { // HARNESS: internal -> public
  446. return balanceOf(account);
  447. }
  448. }