Update Prettier Solidity (#3898)

pull/3788/head
Francisco 3 months ago committed by GitHub
parent 4072e853fe
commit b709eae01d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .prettierrc
  2. 1
      CHANGELOG.md
  3. 2
      contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol
  4. 6
      contracts/finance/VestingWallet.sol
  5. 27
      contracts/governance/Governor.sol
  6. 20
      contracts/governance/TimelockController.sol
  7. 17
      contracts/governance/compatibility/GovernorCompatibilityBravo.sol
  8. 8
      contracts/governance/compatibility/IGovernorCompatibilityBravo.sol
  9. 13
      contracts/governance/extensions/GovernorCountingSimple.sol
  10. 6
      contracts/governance/extensions/GovernorSettings.sol
  11. 2
      contracts/governance/extensions/GovernorTimelockControl.sol
  12. 9
      contracts/governance/utils/IVotes.sol
  13. 12
      contracts/governance/utils/Votes.sol
  14. 25
      contracts/interfaces/IERC1363.sol
  15. 6
      contracts/interfaces/IERC1363Spender.sol
  16. 8
      contracts/interfaces/IERC2981.sol
  17. 12
      contracts/interfaces/IERC4626.sol
  18. 9
      contracts/metatx/MinimalForwarder.sol
  19. 6
      contracts/mocks/AddressImpl.sol
  20. 30
      contracts/mocks/CheckpointsMock.sol
  21. 6
      contracts/mocks/ClonesMock.sol
  22. 6
      contracts/mocks/ContextMock.sol
  23. 6
      contracts/mocks/Create2Impl.sol
  24. 6
      contracts/mocks/DummyImplementation.sol
  25. 13
      contracts/mocks/ECDSAMock.sol
  26. 7
      contracts/mocks/EIP712External.sol
  27. 7
      contracts/mocks/ERC1155BurnableMock.sol
  28. 26
      contracts/mocks/ERC1155Mock.sol
  29. 7
      contracts/mocks/ERC1155ReceiverMock.sol
  30. 6
      contracts/mocks/ERC20CappedMock.sol
  31. 6
      contracts/mocks/ERC20DecimalsMock.sol
  32. 12
      contracts/mocks/ERC20Mock.sol
  33. 2
      contracts/mocks/ERC3156FlashBorrowerMock.sol
  34. 32
      contracts/mocks/ERC4626Mock.sol
  35. 6
      contracts/mocks/ERC721BurnableMock.sol
  36. 10
      contracts/mocks/ERC721ConsecutiveEnumerableMock.sol
  37. 6
      contracts/mocks/ERC721EnumerableMock.sol
  38. 6
      contracts/mocks/ERC721Mock.sol
  39. 6
      contracts/mocks/ERC721PausableMock.sol
  40. 6
      contracts/mocks/ERC721RoyaltyMock.sol
  41. 6
      contracts/mocks/ERC721URIStorageMock.sol
  42. 20
      contracts/mocks/ERC777Mock.sol
  43. 13
      contracts/mocks/ERC777SenderRecipientMock.sol
  44. 27
      contracts/mocks/GovernorCompatibilityBravoMock.sol
  45. 9
      contracts/mocks/GovernorPreventLateQuorumMock.sol
  46. 27
      contracts/mocks/GovernorTimelockCompoundMock.sol
  47. 18
      contracts/mocks/GovernorTimelockControlMock.sol
  48. 7
      contracts/mocks/MathMock.sol
  49. 12
      contracts/mocks/MerkleProofWrapper.sol
  50. 7
      contracts/mocks/MultipleInheritanceInitializableMocks.sol
  51. 18
      contracts/mocks/SafeERC20Helper.sol
  52. 18
      contracts/mocks/SafeMathMock.sol
  53. 6
      contracts/mocks/SignatureCheckerMock.sol
  54. 6
      contracts/mocks/UUPS/UUPSLegacy.sol
  55. 12
      contracts/mocks/crosschain/bridges.sol
  56. 28
      contracts/mocks/wizard/MyGovernor1.sol
  57. 28
      contracts/mocks/wizard/MyGovernor2.sol
  58. 37
      contracts/mocks/wizard/MyGovernor3.sol
  59. 9
      contracts/proxy/Clones.sol
  60. 18
      contracts/proxy/ERC1967/ERC1967Upgrade.sol
  61. 6
      contracts/proxy/transparent/TransparentUpgradeableProxy.sol
  62. 36
      contracts/token/ERC1155/ERC1155.sol
  63. 16
      contracts/token/ERC1155/IERC1155.sol
  64. 12
      contracts/token/ERC1155/extensions/ERC1155Burnable.sol
  65. 24
      contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol
  66. 36
      contracts/token/ERC20/ERC20.sol
  67. 6
      contracts/token/ERC20/IERC20.sol
  68. 6
      contracts/token/ERC20/extensions/ERC20Pausable.sol
  69. 6
      contracts/token/ERC20/extensions/ERC20Snapshot.sol
  70. 12
      contracts/token/ERC20/extensions/ERC20Votes.sol
  71. 19
      contracts/token/ERC20/extensions/ERC4626.sol
  72. 7
      contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol
  73. 31
      contracts/token/ERC20/utils/SafeERC20.sol
  74. 6
      contracts/token/ERC20/utils/TokenTimelock.sol
  75. 53
      contracts/token/ERC721/ERC721.sol
  76. 19
      contracts/token/ERC721/IERC721.sol
  77. 16
      contracts/token/ERC721/presets/ERC721PresetMinterPauserAutoId.sol
  78. 7
      contracts/token/ERC721/utils/ERC721Holder.sol
  79. 51
      contracts/token/ERC777/ERC777.sol
  80. 13
      contracts/token/ERC777/IERC777.sol
  81. 6
      contracts/token/common/ERC2981.sol
  82. 6
      contracts/utils/Address.sol
  83. 80
      contracts/utils/Checkpoints.sol
  84. 12
      contracts/utils/Create2.sol
  85. 26
      contracts/utils/cryptography/ECDSA.sol
  86. 12
      contracts/utils/cryptography/MerkleProof.sol
  87. 6
      contracts/utils/cryptography/SignatureChecker.sol
  88. 9
      contracts/utils/introspection/ERC165Checker.sol
  89. 11
      contracts/utils/introspection/ERC1820Implementer.sol
  90. 6
      contracts/utils/introspection/IERC1820Registry.sol
  91. 41
      contracts/utils/math/Math.sol
  92. 18
      contracts/utils/math/SafeMath.sol
  93. 6
      contracts/utils/structs/BitMaps.sol
  94. 36
      contracts/utils/structs/EnumerableMap.sol
  95. 14
      contracts/vendor/amb/IAMB.sol
  96. 9
      contracts/vendor/arbitrum/IArbSys.sol
  97. 9
      contracts/vendor/arbitrum/IBridge.sol
  98. 6
      contracts/vendor/arbitrum/IOutbox.sol
  99. 6
      contracts/vendor/optimism/ICrossDomainMessenger.sol
  100. 6
      contracts/vendor/polygon/IFxMessageProcessor.sol
  101. Some files were not shown because too many files have changed in this diff Show More

@ -6,8 +6,7 @@
"files": "*.sol",
"options": {
"singleQuote": false,
"printWidth": 120,
"explicitTypes": "always"
"printWidth": 120
}
}
]

@ -2,6 +2,7 @@
## Unreleased
* Reformatted codebase with latest version of Prettier Solidity. ([#3898](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3898))
* `ReentrancyGuard`: Add a `_reentrancyGuardEntered` function to expose the guard status. ([#3714](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3714))
* `ERC20Votes`: optimize by using unchecked arithmetic. ([#3748](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3748))
* `Initializable`: optimize `_disableInitializers` by using `!=` instead of `<`. ([#3787](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3787))

@ -59,7 +59,7 @@ abstract contract CrossChainEnabledPolygonChild is IFxMessageProcessor, CrossCha
* then security could be compromised.
*/
function processMessageFromRoot(
uint256, /* stateId */
uint256 /* stateId */,
address rootMessageSender,
bytes calldata data
) external override nonReentrant {

@ -29,11 +29,7 @@ contract VestingWallet is Context {
/**
* @dev Set the beneficiary, start timestamp and vesting duration of the vesting wallet.
*/
constructor(
address beneficiaryAddress,
uint64 startTimestamp,
uint64 durationSeconds
) payable {
constructor(address beneficiaryAddress, uint64 startTimestamp, uint64 durationSeconds) payable {
require(beneficiaryAddress != address(0), "VestingWallet: beneficiary is zero address");
_beneficiary = beneficiaryAddress;
_start = startTimestamp;

@ -314,7 +314,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive
* @dev Internal execution mechanism. Can be overridden to implement different execution mechanism
*/
function _execute(
uint256, /* proposalId */
uint256 /* proposalId */,
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
@ -331,9 +331,9 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive
* @dev Hook before execution is triggered.
*/
function _beforeExecute(
uint256, /* proposalId */
uint256 /* proposalId */,
address[] memory targets,
uint256[] memory, /* values */
uint256[] memory /* values */,
bytes[] memory calldatas,
bytes32 /*descriptionHash*/
) internal virtual {
@ -350,10 +350,10 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive
* @dev Hook after execution is triggered.
*/
function _afterExecute(
uint256, /* proposalId */
address[] memory, /* targets */
uint256[] memory, /* values */
bytes[] memory, /* calldatas */
uint256 /* proposalId */,
address[] memory /* targets */,
uint256[] memory /* values */,
bytes[] memory /* calldatas */,
bytes32 /*descriptionHash*/
) internal virtual {
if (_executor() != address(this)) {
@ -540,11 +540,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive
* in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.
* Note that if the executor is simply the governor itself, use of `relay` is redundant.
*/
function relay(
address target,
uint256 value,
bytes calldata data
) external payable virtual onlyGovernance {
function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {
(bool success, bytes memory returndata) = target.call{value: value}(data);
Address.verifyCallResult(success, returndata, "Governor: relay reverted without message");
}
@ -560,12 +556,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive
/**
* @dev See {IERC721Receiver-onERC721Received}.
*/
function onERC721Received(
address,
address,
uint256,
bytes memory
) public virtual override returns (bytes4) {
function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {
return this.onERC721Received.selector;
}

@ -74,12 +74,7 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver
* administration through timelocked proposals. Previous versions of this contract would assign
* this admin to the deployer automatically and should be renounced as well.
*/
constructor(
uint256 minDelay,
address[] memory proposers,
address[] memory executors,
address admin
) {
constructor(uint256 minDelay, address[] memory proposers, address[] memory executors, address admin) {
_setRoleAdmin(TIMELOCK_ADMIN_ROLE, TIMELOCK_ADMIN_ROLE);
_setRoleAdmin(PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE);
_setRoleAdmin(EXECUTOR_ROLE, TIMELOCK_ADMIN_ROLE);
@ -342,11 +337,7 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver
/**
* @dev Execute an operation's call.
*/
function _execute(
address target,
uint256 value,
bytes calldata data
) internal virtual {
function _execute(address target, uint256 value, bytes calldata data) internal virtual {
(bool success, ) = target.call{value: value}(data);
require(success, "TimelockController: underlying transaction reverted");
}
@ -386,12 +377,7 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver
/**
* @dev See {IERC721Receiver-onERC721Received}.
*/
function onERC721Received(
address,
address,
uint256,
bytes memory
) public virtual override returns (bytes4) {
function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {
return this.onERC721Received.selector;
}

@ -118,11 +118,10 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp
/**
* @dev Encodes calldatas with optional function signature.
*/
function _encodeCalldata(string[] memory signatures, bytes[] memory calldatas)
private
pure
returns (bytes[] memory)
{
function _encodeCalldata(
string[] memory signatures,
bytes[] memory calldatas
) private pure returns (bytes[] memory) {
bytes[] memory fullcalldatas = new bytes[](calldatas.length);
for (uint256 i = 0; i < signatures.length; ++i) {
@ -163,7 +162,9 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp
/**
* @dev See {IGovernorCompatibilityBravo-proposals}.
*/
function proposals(uint256 proposalId)
function proposals(
uint256 proposalId
)
public
view
virtual
@ -200,7 +201,9 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp
/**
* @dev See {IGovernorCompatibilityBravo-getActions}.
*/
function getActions(uint256 proposalId)
function getActions(
uint256 proposalId
)
public
view
virtual

@ -50,7 +50,9 @@ abstract contract IGovernorCompatibilityBravo is IGovernor {
/**
* @dev Part of the Governor Bravo's interface: _"The official record of all proposals ever proposed"_.
*/
function proposals(uint256)
function proposals(
uint256
)
public
view
virtual
@ -96,7 +98,9 @@ abstract contract IGovernorCompatibilityBravo is IGovernor {
/**
* @dev Part of the Governor Bravo's interface: _"Gets actions of a proposal"_.
*/
function getActions(uint256 proposalId)
function getActions(
uint256 proposalId
)
public
view
virtual

@ -47,16 +47,9 @@ abstract contract GovernorCountingSimple is Governor {
/**
* @dev Accessor to the internal vote counts.
*/
function proposalVotes(uint256 proposalId)
public
view
virtual
returns (
uint256 againstVotes,
uint256 forVotes,
uint256 abstainVotes
)
{
function proposalVotes(
uint256 proposalId
) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {
ProposalVote storage proposalVote = _proposalVotes[proposalId];
return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);
}

@ -22,11 +22,7 @@ abstract contract GovernorSettings is Governor {
/**
* @dev Initialize the governance parameters.
*/
constructor(
uint256 initialVotingDelay,
uint256 initialVotingPeriod,
uint256 initialProposalThreshold
) {
constructor(uint256 initialVotingDelay, uint256 initialVotingPeriod, uint256 initialProposalThreshold) {
_setVotingDelay(initialVotingDelay);
_setVotingPeriod(initialVotingPeriod);
_setProposalThreshold(initialProposalThreshold);

@ -110,7 +110,7 @@ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor {
* @dev Overridden execute function that run the already queued proposal through the timelock.
*/
function _execute(
uint256, /* proposalId */
uint256 /* proposalId */,
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,

@ -50,12 +50,5 @@ interface IVotes {
/**
* @dev Delegates votes from signer to `delegatee`.
*/
function delegateBySig(
address delegatee,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) external;
function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;
}

@ -136,11 +136,7 @@ abstract contract Votes is IVotes, Context, EIP712 {
* @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`
* should be zero. Total supply of voting units will be adjusted with mints and burns.
*/
function _transferVotingUnits(
address from,
address to,
uint256 amount
) internal virtual {
function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {
if (from == address(0)) {
_totalCheckpoints.push(_add, amount);
}
@ -153,11 +149,7 @@ abstract contract Votes is IVotes, Context, EIP712 {
/**
* @dev Moves delegated votes from one delegate to another.
*/
function _moveDelegateVotes(
address from,
address to,
uint256 amount
) private {
function _moveDelegateVotes(address from, address to, uint256 amount) private {
if (from != to && amount > 0) {
if (from != address(0)) {
(uint256 oldValue, uint256 newValue) = _delegateCheckpoints[from].push(_subtract, amount);

@ -38,11 +38,7 @@ interface IERC1363 is IERC165, IERC20 {
* @param data bytes Additional data with no specified format, sent in call to `to`
* @return true unless throwing
*/
function transferAndCall(
address to,
uint256 value,
bytes memory data
) external returns (bool);
function transferAndCall(address to, uint256 value, bytes memory data) external returns (bool);
/**
* @dev Transfer tokens from one address to another and then call `onTransferReceived` on receiver
@ -51,11 +47,7 @@ interface IERC1363 is IERC165, IERC20 {
* @param value uint256 The amount of tokens to be transferred
* @return true unless throwing
*/
function transferFromAndCall(
address from,
address to,
uint256 value
) external returns (bool);
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Transfer tokens from one address to another and then call `onTransferReceived` on receiver
@ -65,12 +57,7 @@ interface IERC1363 is IERC165, IERC20 {
* @param data bytes Additional data with no specified format, sent in call to `to`
* @return true unless throwing
*/
function transferFromAndCall(
address from,
address to,
uint256 value,
bytes memory data
) external returns (bool);
function transferFromAndCall(address from, address to, uint256 value, bytes memory data) external returns (bool);
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender
@ -87,9 +74,5 @@ interface IERC1363 is IERC165, IERC20 {
* @param value uint256 The amount of tokens to be spent
* @param data bytes Additional data with no specified format, sent in call to `spender`
*/
function approveAndCall(
address spender,
uint256 value,
bytes memory data
) external returns (bool);
function approveAndCall(address spender, uint256 value, bytes memory data) external returns (bool);
}

@ -22,9 +22,5 @@ interface IERC1363Spender {
* @return `bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))`
* unless throwing
*/
function onApprovalReceived(
address owner,
uint256 value,
bytes memory data
) external returns (bytes4);
function onApprovalReceived(address owner, uint256 value, bytes memory data) external returns (bytes4);
}

@ -18,8 +18,8 @@ interface IERC2981 is IERC165 {
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
function royaltyInfo(
uint256 tokenId,
uint256 salePrice
) external view returns (address receiver, uint256 royaltyAmount);
}

@ -187,11 +187,7 @@ interface IERC4626 is IERC20, IERC20Metadata {
* Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
* Those methods should be performed separately.
*/
function withdraw(
uint256 assets,
address receiver,
address owner
) external returns (uint256 shares);
function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);
/**
* @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,
@ -232,9 +228,5 @@ interface IERC4626 is IERC20, IERC20Metadata {
* NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
* Those methods should be performed separately.
*/
function redeem(
uint256 shares,
address receiver,
address owner
) external returns (uint256 assets);
function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);
}

@ -44,11 +44,10 @@ contract MinimalForwarder is EIP712 {
return _nonces[req.from] == req.nonce && signer == req.from;
}
function execute(ForwardRequest calldata req, bytes calldata signature)
public
payable
returns (bool, bytes memory)
{
function execute(
ForwardRequest calldata req,
bytes calldata signature
) public payable returns (bool, bytes memory) {
require(verify(req, signature), "MinimalForwarder: signature does not match request");
_nonces[req.from] = req.nonce + 1;

@ -22,11 +22,7 @@ contract AddressImpl {
emit CallReturnValue(abi.decode(returnData, (string)));
}
function functionCallWithValue(
address target,
bytes calldata data,
uint256 value
) external payable {
function functionCallWithValue(address target, bytes calldata data, uint256 value) external payable {
bytes memory returnData = Address.functionCallWithValue(target, data, value);
emit CallReturnValue(abi.decode(returnData, (string)));
}

@ -14,15 +14,7 @@ contract CheckpointsMock {
return _totalCheckpoints.latest();
}
function latestCheckpoint()
public
view
returns (
bool,
uint256,
uint256
)
{
function latestCheckpoint() public view returns (bool, uint256, uint256) {
return _totalCheckpoints.latestCheckpoint();
}
@ -52,15 +44,7 @@ contract Checkpoints224Mock {
return _totalCheckpoints.latest();
}
function latestCheckpoint()
public
view
returns (
bool,
uint32,
uint224
)
{
function latestCheckpoint() public view returns (bool, uint32, uint224) {
return _totalCheckpoints.latestCheckpoint();
}
@ -90,15 +74,7 @@ contract Checkpoints160Mock {
return _totalCheckpoints.latest();
}
function latestCheckpoint()
public
view
returns (
bool,
uint96,
uint160
)
{
function latestCheckpoint() public view returns (bool, uint96, uint160) {
return _totalCheckpoints.latestCheckpoint();
}

@ -15,11 +15,7 @@ contract ClonesMock {
_initAndEmit(implementation.clone(), initdata);
}
function cloneDeterministic(
address implementation,
bytes32 salt,
bytes calldata initdata
) public payable {
function cloneDeterministic(address implementation, bytes32 salt, bytes calldata initdata) public payable {
_initAndEmit(implementation.cloneDeterministic(salt), initdata);
}

@ -23,11 +23,7 @@ contract ContextMockCaller {
context.msgSender();
}
function callData(
ContextMock context,
uint256 integerValue,
string memory stringValue
) public {
function callData(ContextMock context, uint256 integerValue, string memory stringValue) public {
context.msgData(integerValue, stringValue);
}
}

@ -6,11 +6,7 @@ import "../utils/Create2.sol";
import "../utils/introspection/ERC1820Implementer.sol";
contract Create2Impl {
function deploy(
uint256 value,
bytes32 salt,
bytes memory code
) public {
function deploy(uint256 value, bytes32 salt, bytes memory code) public {
Create2.deploy(value, salt, code);
}

@ -27,11 +27,7 @@ contract DummyImplementation {
value = _value;
}
function initialize(
uint256 _value,
string memory _text,
uint256[] memory _values
) public {
function initialize(uint256 _value, string memory _text, uint256[] memory _values) public {
value = _value;
text = _text;
values = _values;

@ -13,21 +13,12 @@ contract ECDSAMock {
}
// solhint-disable-next-line func-name-mixedcase
function recover_v_r_s(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) public pure returns (address) {
function recover_v_r_s(bytes32 hash, uint8 v, bytes32 r, bytes32 s) public pure returns (address) {
return hash.recover(v, r, s);
}
// solhint-disable-next-line func-name-mixedcase
function recover_r_vs(
bytes32 hash,
bytes32 r,
bytes32 vs
) public pure returns (address) {
function recover_r_vs(bytes32 hash, bytes32 r, bytes32 vs) public pure returns (address) {
return hash.recover(r, vs);
}

@ -12,12 +12,7 @@ contract EIP712External is EIP712 {
return _domainSeparatorV4();
}
function verify(
bytes memory signature,
address signer,
address mailTo,
string memory mailContents
) external view {
function verify(bytes memory signature, address signer, address mailTo, string memory mailContents) external view {
bytes32 digest = _hashTypedDataV4(
keccak256(abi.encode(keccak256("Mail(address to,string contents)"), mailTo, keccak256(bytes(mailContents))))
);

@ -7,12 +7,7 @@ import "../token/ERC1155/extensions/ERC1155Burnable.sol";
contract ERC1155BurnableMock is ERC1155Burnable {
constructor(string memory uri) ERC1155(uri) {}
function mint(
address to,
uint256 id,
uint256 value,
bytes memory data
) public {
function mint(address to, uint256 id, uint256 value, bytes memory data) public {
_mint(to, id, value, data);
}
}

@ -15,37 +15,19 @@ contract ERC1155Mock is ERC1155 {
_setURI(newuri);
}
function mint(
address to,
uint256 id,
uint256 value,
bytes memory data
) public {
function mint(address to, uint256 id, uint256 value, bytes memory data) public {
_mint(to, id, value, data);
}
function mintBatch(
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) public {
function mintBatch(address to, uint256[] memory ids, uint256[] memory values, bytes memory data) public {
_mintBatch(to, ids, values, data);
}
function burn(
address owner,
uint256 id,
uint256 value
) public {
function burn(address owner, uint256 id, uint256 value) public {
_burn(owner, id, value);
}
function burnBatch(
address owner,
uint256[] memory ids,
uint256[] memory values
) public {
function burnBatch(address owner, uint256[] memory ids, uint256[] memory values) public {
_burnBatch(owner, ids, values);
}
}

@ -14,12 +14,7 @@ contract ERC1155ReceiverMock is ERC165, IERC1155Receiver {
event Received(address operator, address from, uint256 id, uint256 value, bytes data, uint256 gas);
event BatchReceived(address operator, address from, uint256[] ids, uint256[] values, bytes data, uint256 gas);
constructor(
bytes4 recRetval,
bool recReverts,
bytes4 batRetval,
bool batReverts
) {
constructor(bytes4 recRetval, bool recReverts, bytes4 batRetval, bool batReverts) {
_recRetval = recRetval;
_recReverts = recReverts;
_batRetval = batRetval;

@ -5,11 +5,7 @@ pragma solidity ^0.8.0;
import "../token/ERC20/extensions/ERC20Capped.sol";
contract ERC20CappedMock is ERC20Capped {
constructor(
string memory name,
string memory symbol,
uint256 cap
) ERC20(name, symbol) ERC20Capped(cap) {}
constructor(string memory name, string memory symbol, uint256 cap) ERC20(name, symbol) ERC20Capped(cap) {}
function mint(address to, uint256 tokenId) public {
_mint(to, tokenId);

@ -7,11 +7,7 @@ import "../token/ERC20/ERC20.sol";
contract ERC20DecimalsMock is ERC20 {
uint8 private immutable _decimals;
constructor(
string memory name_,
string memory symbol_,
uint8 decimals_
) ERC20(name_, symbol_) {
constructor(string memory name_, string memory symbol_, uint8 decimals_) ERC20(name_, symbol_) {
_decimals = decimals_;
}

@ -23,19 +23,11 @@ contract ERC20Mock is ERC20 {
_burn(account, amount);
}
function transferInternal(
address from,
address to,
uint256 value
) public {
function transferInternal(address from, address to, uint256 value) public {
_transfer(from, to, value);
}
function approveInternal(
address owner,
address spender,
uint256 value
) public {
function approveInternal(address owner, address spender, uint256 value) public {
_approve(owner, spender, value);
}
}

@ -28,7 +28,7 @@ contract ERC3156FlashBorrowerMock is IERC3156FlashBorrower {
}
function onFlashLoan(
address, /*initiator*/
address /*initiator*/,
address token,
uint256 amount,
uint256 fee,

@ -5,11 +5,7 @@ pragma solidity ^0.8.0;
import "../token/ERC20/extensions/ERC4626.sol";
contract ERC4626Mock is ERC4626 {
constructor(
IERC20Metadata asset,
string memory name,
string memory symbol
) ERC20(name, symbol) ERC4626(asset) {}
constructor(IERC20Metadata asset, string memory name, string memory symbol) ERC20(name, symbol) ERC4626(asset) {}
function mockMint(address account, uint256 amount) public {
_mint(account, amount);
@ -38,23 +34,17 @@ contract ERC4626DecimalMock is ERC4626Mock {
return _decimals;
}
function _initialConvertToShares(uint256 assets, Math.Rounding rounding)
internal
view
virtual
override
returns (uint256 shares)
{
return assets.mulDiv(10**decimals(), 10**super.decimals(), rounding);
function _initialConvertToShares(
uint256 assets,
Math.Rounding rounding
) internal view virtual override returns (uint256 shares) {
return assets.mulDiv(10 ** decimals(), 10 ** super.decimals(), rounding);
}
function _initialConvertToAssets(uint256 shares, Math.Rounding rounding)
internal
view
virtual
override
returns (uint256 assets)
{
return shares.mulDiv(10**super.decimals(), 10**decimals(), rounding);
function _initialConvertToAssets(
uint256 shares,
Math.Rounding rounding
) internal view virtual override returns (uint256 assets) {
return shares.mulDiv(10 ** super.decimals(), 10 ** decimals(), rounding);
}
}

@ -19,11 +19,7 @@ contract ERC721BurnableMock is ERC721Burnable {
_safeMint(to, tokenId);
}
function safeMint(
address to,
uint256 tokenId,
bytes memory _data
) public {
function safeMint(address to, uint256 tokenId, bytes memory _data) public {
_safeMint(to, tokenId, _data);
}
}

@ -17,13 +17,9 @@ contract ERC721ConsecutiveEnumerableMock is ERC721Consecutive, ERC721Enumerable
}
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721, ERC721Enumerable)
returns (bool)
{
function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC721, ERC721Enumerable) returns (bool) {
return super.supportsInterface(interfaceId);
}

@ -37,11 +37,7 @@ contract ERC721EnumerableMock is ERC721Enumerable {
_safeMint(to, tokenId);
}
function safeMint(
address to,
uint256 tokenId,
bytes memory _data
) public {
function safeMint(address to, uint256 tokenId, bytes memory _data) public {
_safeMint(to, tokenId, _data);
}

@ -27,11 +27,7 @@ contract ERC721Mock is ERC721 {
_safeMint(to, tokenId);
}
function safeMint(
address to,
uint256 tokenId,
bytes memory _data
) public {
function safeMint(address to, uint256 tokenId, bytes memory _data) public {
_safeMint(to, tokenId, _data);
}

@ -31,11 +31,7 @@ contract ERC721PausableMock is ERC721Pausable {
_safeMint(to, tokenId);
}
function safeMint(
address to,
uint256 tokenId,
bytes memory _data
) public {
function safeMint(address to, uint256 tokenId, bytes memory _data) public {
_safeMint(to, tokenId, _data);
}

@ -7,11 +7,7 @@ import "../token/ERC721/extensions/ERC721Royalty.sol";
contract ERC721RoyaltyMock is ERC721Royalty {
constructor(string memory name, string memory symbol) ERC721(name, symbol) {}
function setTokenRoyalty(
uint256 tokenId,
address recipient,
uint96 fraction
) public {
function setTokenRoyalty(uint256 tokenId, address recipient, uint96 fraction) public {
_setTokenRoyalty(tokenId, recipient, fraction);
}

@ -41,11 +41,7 @@ contract ERC721URIStorageMock is ERC721URIStorage {
_safeMint(to, tokenId);
}
function safeMint(
address to,
uint256 tokenId,
bytes memory _data
) public {
function safeMint(address to, uint256 tokenId, bytes memory _data) public {
_safeMint(to, tokenId, _data);
}

@ -18,12 +18,7 @@ contract ERC777Mock is Context, ERC777 {
_mint(initialHolder, initialBalance, "", "");
}
function mintInternal(
address to,
uint256 amount,
bytes memory userData,
bytes memory operatorData
) public {
function mintInternal(address to, uint256 amount, bytes memory userData, bytes memory operatorData) public {
_mint(to, amount, userData, operatorData);
}
@ -37,20 +32,11 @@ contract ERC777Mock is Context, ERC777 {
_mint(to, amount, userData, operatorData, requireReceptionAck);
}
function approveInternal(
address holder,
address spender,
uint256 value
) public {
function approveInternal(address holder, address spender, uint256 value) public {
_approve(holder, spender, value);
}
function _beforeTokenTransfer(
address,
address,
address,
uint256
) internal override {
function _beforeTokenTransfer(address, address, address, uint256) internal override {
emit BeforeTokenTransfer();
}
}

@ -141,21 +141,12 @@ contract ERC777SenderRecipientMock is Context, IERC777Sender, IERC777Recipient,
_shouldRevertReceive = shouldRevert;
}
function send(
IERC777 token,
address to,
uint256 amount,
bytes memory data
) public {
function send(IERC777 token, address to, uint256 amount, bytes memory data) public {
// This is 777's send function, not the Solidity send function
token.send(to, amount, data); // solhint-disable-line check-send-result
}
function burn(
IERC777 token,
uint256 amount,
bytes memory data
) public {
function burn(IERC777 token, uint256 amount, bytes memory data) public {
token.burn(amount, data);
}
}

@ -27,12 +27,9 @@ contract GovernorCompatibilityBravoMock is
GovernorVotesComp(token_)
{}
function supportsInterface(bytes4 interfaceId)
public
view
override(IERC165, Governor, GovernorTimelockCompound)
returns (bool)
{
function supportsInterface(
bytes4 interfaceId
) public view override(IERC165, Governor, GovernorTimelockCompound) returns (bool) {
return super.supportsInterface(interfaceId);
}
@ -40,21 +37,15 @@ contract GovernorCompatibilityBravoMock is
return 0;
}
function state(uint256 proposalId)
public
view
override(IGovernor, Governor, GovernorTimelockCompound)
returns (ProposalState)
{
function state(
uint256 proposalId
) public view override(IGovernor, Governor, GovernorTimelockCompound) returns (ProposalState) {
return super.state(proposalId);
}
function proposalEta(uint256 proposalId)
public
view
override(IGovernorTimelock, GovernorTimelockCompound)
returns (uint256)
{
function proposalEta(
uint256 proposalId
) public view override(IGovernorTimelock, GovernorTimelockCompound) returns (uint256) {
return super.proposalEta(proposalId);
}

@ -35,12 +35,9 @@ contract GovernorPreventLateQuorumMock is
return _quorum;
}
function proposalDeadline(uint256 proposalId)
public
view
override(Governor, GovernorPreventLateQuorum)
returns (uint256)
{
function proposalDeadline(
uint256 proposalId
) public view override(Governor, GovernorPreventLateQuorum) returns (uint256) {
return super.proposalDeadline(proposalId);
}

@ -28,21 +28,15 @@ contract GovernorTimelockCompoundMock is
GovernorVotesQuorumFraction(quorumNumerator_)
{}
function supportsInterface(bytes4 interfaceId)
public
view
override(Governor, GovernorTimelockCompound)
returns (bool)
{
function supportsInterface(
bytes4 interfaceId
) public view override(Governor, GovernorTimelockCompound) returns (bool) {
return super.supportsInterface(interfaceId);
}
function quorum(uint256 blockNumber)
public
view
override(IGovernor, GovernorVotesQuorumFraction)
returns (uint256)
{
function quorum(
uint256 blockNumber
) public view override(IGovernor, GovernorVotesQuorumFraction) returns (uint256) {
return super.quorum(blockNumber);
}
@ -58,12 +52,9 @@ contract GovernorTimelockCompoundMock is
/**
* Overriding nightmare
*/
function state(uint256 proposalId)
public
view
override(Governor, GovernorTimelockCompound)
returns (ProposalState)
{
function state(
uint256 proposalId
) public view override(Governor, GovernorTimelockCompound) returns (ProposalState) {
return super.state(proposalId);
}

@ -28,21 +28,15 @@ contract GovernorTimelockControlMock is
GovernorVotesQuorumFraction(quorumNumerator_)
{}
function supportsInterface(bytes4 interfaceId)
public
view
override(Governor, GovernorTimelockControl)
returns (bool)
{
function supportsInterface(
bytes4 interfaceId
) public view override(Governor, GovernorTimelockControl) returns (bool) {
return super.supportsInterface(interfaceId);
}
function quorum(uint256 blockNumber)
public
view
override(IGovernor, GovernorVotesQuorumFraction)
returns (uint256)
{
function quorum(
uint256 blockNumber
) public view override(IGovernor, GovernorVotesQuorumFraction) returns (uint256) {
return super.quorum(blockNumber);
}

@ -21,12 +21,7 @@ contract MathMock {
return Math.ceilDiv(a, b);
}
function mulDiv(
uint256 a,
uint256 b,
uint256 denominator,
Math.Rounding direction
) public pure returns (uint256) {
function mulDiv(uint256 a, uint256 b, uint256 denominator, Math.Rounding direction) public pure returns (uint256) {
return Math.mulDiv(a, b, denominator, direction);
}