applyHarness.patch 20 KB

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