Use explicit imports (#4399)

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: ernestognw <ernestognw@gmail.com>
pull/4378/head^2
Francisco 2 years ago committed by GitHub
parent d6a8b2ccd7
commit 874c2d3c02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      .changeset/orange-apes-draw.md
  2. 3
      .solhint.json
  3. 2
      README.md
  4. 8
      contracts/access/AccessControl.sol
  5. 9
      contracts/access/AccessControlDefaultAdminRules.sol
  6. 6
      contracts/access/AccessControlEnumerable.sol
  7. 2
      contracts/access/IAccessControlDefaultAdminRules.sol
  8. 2
      contracts/access/IAccessControlEnumerable.sol
  9. 2
      contracts/access/Ownable.sol
  10. 2
      contracts/access/Ownable2Step.sol
  11. 7
      contracts/finance/VestingWallet.sol
  12. 20
      contracts/governance/Governor.sol
  13. 4
      contracts/governance/IGovernor.sol
  14. 9
      contracts/governance/TimelockController.sol
  15. 8
      contracts/governance/compatibility/GovernorCompatibilityBravo.sol
  16. 2
      contracts/governance/compatibility/IGovernorCompatibilityBravo.sol
  17. 2
      contracts/governance/extensions/GovernorCountingSimple.sol
  18. 4
      contracts/governance/extensions/GovernorPreventLateQuorum.sol
  19. 2
      contracts/governance/extensions/GovernorSettings.sol
  20. 10
      contracts/governance/extensions/GovernorTimelockCompound.sol
  21. 7
      contracts/governance/extensions/GovernorTimelockControl.sol
  22. 6
      contracts/governance/extensions/GovernorVotes.sol
  23. 6
      contracts/governance/extensions/GovernorVotesQuorumFraction.sol
  24. 2
      contracts/governance/extensions/IGovernorTimelock.sol
  25. 12
      contracts/governance/utils/Votes.sol
  26. 2
      contracts/interfaces/IERC1155.sol
  27. 2
      contracts/interfaces/IERC1155MetadataURI.sol
  28. 2
      contracts/interfaces/IERC1155Receiver.sol
  29. 4
      contracts/interfaces/IERC1363.sol
  30. 2
      contracts/interfaces/IERC165.sol
  31. 2
      contracts/interfaces/IERC20.sol
  32. 2
      contracts/interfaces/IERC20Metadata.sol
  33. 2
      contracts/interfaces/IERC2612.sol
  34. 2
      contracts/interfaces/IERC2981.sol
  35. 4
      contracts/interfaces/IERC3156.sol
  36. 2
      contracts/interfaces/IERC3156FlashLender.sol
  37. 4
      contracts/interfaces/IERC4626.sol
  38. 4
      contracts/interfaces/IERC4906.sol
  39. 4
      contracts/interfaces/IERC5805.sol
  40. 2
      contracts/interfaces/IERC721.sol
  41. 2
      contracts/interfaces/IERC721Enumerable.sol
  42. 2
      contracts/interfaces/IERC721Metadata.sol
  43. 2
      contracts/interfaces/IERC721Receiver.sol
  44. 2
      contracts/metatx/ERC2771Context.sol
  45. 8
      contracts/metatx/ERC2771Forwarder.sol
  46. 2
      contracts/mocks/AddressFnPointersMock.sol
  47. 2
      contracts/mocks/ArraysMock.sol
  48. 2
      contracts/mocks/ContextMock.sol
  49. 3
      contracts/mocks/DummyImplementation.sol
  50. 4
      contracts/mocks/EIP712Verifier.sol
  51. 6
      contracts/mocks/ERC1271WalletMock.sol
  52. 2
      contracts/mocks/ERC165/ERC165InterfacesSupported.sol
  53. 2
      contracts/mocks/ERC165/ERC165ReturnBomb.sol
  54. 5
      contracts/mocks/ERC2771ContextMock.sol
  55. 6
      contracts/mocks/ERC3156FlashBorrowerMock.sol
  56. 2
      contracts/mocks/InitializableMock.sol
  57. 2
      contracts/mocks/MulticallTest.sol
  58. 2
      contracts/mocks/MultipleInheritanceInitializableMocks.sol
  59. 2
      contracts/mocks/PausableMock.sol
  60. 2
      contracts/mocks/ReentrancyAttack.sol
  61. 4
      contracts/mocks/ReentrancyMock.sol
  62. 2
      contracts/mocks/RegressionImplementation.sol
  63. 2
      contracts/mocks/SingleInheritanceInitializableMocks.sol
  64. 2
      contracts/mocks/StorageSlotMock.sol
  65. 2
      contracts/mocks/TimelockReentrant.sol
  66. 2
      contracts/mocks/VotesMock.sol
  67. 5
      contracts/mocks/docs/ERC4626Fees.sol
  68. 13
      contracts/mocks/docs/governance/MyGovernor.sol
  69. 7
      contracts/mocks/docs/governance/MyToken.sol
  70. 7
      contracts/mocks/docs/governance/MyTokenTimestampBased.sol
  71. 9
      contracts/mocks/docs/governance/MyTokenWrapped.sol
  72. 10
      contracts/mocks/governance/GovernorCompatibilityBravoMock.sol
  73. 7
      contracts/mocks/governance/GovernorMock.sol
  74. 9
      contracts/mocks/governance/GovernorPreventLateQuorumMock.sol
  75. 9
      contracts/mocks/governance/GovernorTimelockCompoundMock.sol
  76. 9
      contracts/mocks/governance/GovernorTimelockControlMock.sol
  77. 4
      contracts/mocks/governance/GovernorVoteMock.sol
  78. 5
      contracts/mocks/governance/GovernorWithParamsMock.sol
  79. 3
      contracts/mocks/proxy/UUPSUpgradeableMock.sol
  80. 4
      contracts/mocks/token/ERC1155ReceiverMock.sol
  81. 2
      contracts/mocks/token/ERC20ApprovalMock.sol
  82. 2
      contracts/mocks/token/ERC20DecimalsMock.sol
  83. 2
      contracts/mocks/token/ERC20FlashMintMock.sol
  84. 2
      contracts/mocks/token/ERC20ForceApproveMock.sol
  85. 2
      contracts/mocks/token/ERC20Mock.sol
  86. 4
      contracts/mocks/token/ERC20MulticallMock.sol
  87. 2
      contracts/mocks/token/ERC20NoReturnMock.sol
  88. 4
      contracts/mocks/token/ERC20PermitNoRevertMock.sol
  89. 4
      contracts/mocks/token/ERC20Reentrant.sol
  90. 2
      contracts/mocks/token/ERC20ReturnFalseMock.sol
  91. 10
      contracts/mocks/token/ERC20VotesLegacyMock.sol
  92. 2
      contracts/mocks/token/ERC4626LimitsMock.sol
  93. 3
      contracts/mocks/token/ERC4626Mock.sol
  94. 2
      contracts/mocks/token/ERC4626OffsetMock.sol
  95. 2
      contracts/mocks/token/ERC4646FeesMock.sol
  96. 5
      contracts/mocks/token/ERC721ConsecutiveEnumerableMock.sol
  97. 8
      contracts/mocks/token/ERC721ConsecutiveMock.sol
  98. 2
      contracts/mocks/token/ERC721ReceiverMock.sol
  99. 2
      contracts/mocks/token/ERC721URIStorageMock.sol
  100. 5
      contracts/mocks/token/VotesTimestamp.sol
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': major
---
Switched to using explicit Solidity import statements. Some previously available symbols may now have to be separately imported.

@ -9,6 +9,7 @@
"modifier-name-mixedcase": "error",
"private-vars-leading-underscore": "error",
"var-name-mixedcase": "error",
"imports-on-top": "error"
"imports-on-top": "error",
"no-global-import": "error"
}
}

@ -48,7 +48,7 @@ Once installed, you can use the contracts in the library by importing them:
```solidity
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract MyCollectible is ERC721 {
constructor() ERC721("MyCollectible", "MCO") {

@ -3,10 +3,10 @@
pragma solidity ^0.8.19;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {Strings} from "../utils/Strings.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access

@ -3,10 +3,11 @@
pragma solidity ^0.8.19;
import "./AccessControl.sol";
import "./IAccessControlDefaultAdminRules.sol";
import "../utils/math/SafeCast.sol";
import "../interfaces/IERC5313.sol";
import {AccessControl, IAccessControl} from "./AccessControl.sol";
import {IAccessControlDefaultAdminRules} from "./IAccessControlDefaultAdminRules.sol";
import {SafeCast} from "../utils/math/SafeCast.sol";
import {Math} from "../utils/math/Math.sol";
import {IERC5313} from "../interfaces/IERC5313.sol";
/**
* @dev Extension of {AccessControl} that allows specifying special rules to manage

@ -3,9 +3,9 @@
pragma solidity ^0.8.19;
import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";
import {IAccessControlEnumerable} from "./IAccessControlEnumerable.sol";
import {AccessControl} from "./AccessControl.sol";
import {EnumerableSet} from "../utils/structs/EnumerableSet.sol";
/**
* @dev Extension of {AccessControl} that allows enumerating the members of each role.

@ -3,7 +3,7 @@
pragma solidity ^0.8.19;
import "./IAccessControl.sol";
import {IAccessControl} from "./IAccessControl.sol";
/**
* @dev External interface of AccessControlDefaultAdminRules declared to support ERC165 detection.

@ -3,7 +3,7 @@
pragma solidity ^0.8.19;
import "./IAccessControl.sol";
import {IAccessControl} from "./IAccessControl.sol";
/**
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.

@ -3,7 +3,7 @@
pragma solidity ^0.8.19;
import "../utils/Context.sol";
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where

@ -3,7 +3,7 @@
pragma solidity ^0.8.19;
import "./Ownable.sol";
import {Ownable} from "./Ownable.sol";
/**
* @dev Contract module which provides access control mechanism, where

@ -2,9 +2,10 @@
// OpenZeppelin Contracts (last updated v4.9.0) (finance/VestingWallet.sol)
pragma solidity ^0.8.19;
import "../token/ERC20/utils/SafeERC20.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";
import {IERC20} from "../token/ERC20/IERC20.sol";
import {SafeERC20} from "../token/ERC20/utils/SafeERC20.sol";
import {Address} from "../utils/Address.sol";
import {Context} from "../utils/Context.sol";
/**
* @title VestingWallet

@ -3,16 +3,16 @@
pragma solidity ^0.8.19;
import "../token/ERC721/IERC721Receiver.sol";
import "../token/ERC1155/IERC1155Receiver.sol";
import "../utils/cryptography/ECDSA.sol";
import "../utils/cryptography/EIP712.sol";
import "../utils/introspection/ERC165.sol";
import "../utils/math/SafeCast.sol";
import "../utils/structs/DoubleEndedQueue.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";
import "./IGovernor.sol";
import {IERC721Receiver} from "../token/ERC721/IERC721Receiver.sol";
import {IERC1155Receiver} from "../token/ERC1155/IERC1155Receiver.sol";
import {ECDSA} from "../utils/cryptography/ECDSA.sol";
import {EIP712} from "../utils/cryptography/EIP712.sol";
import {IERC165, ERC165} from "../utils/introspection/ERC165.sol";
import {SafeCast} from "../utils/math/SafeCast.sol";
import {DoubleEndedQueue} from "../utils/structs/DoubleEndedQueue.sol";
import {Address} from "../utils/Address.sol";
import {Context} from "../utils/Context.sol";
import {IGovernor, IERC6372} from "./IGovernor.sol";
/**
* @dev Core of the governance system, designed to be extended though various modules.

@ -3,8 +3,8 @@
pragma solidity ^0.8.19;
import "../interfaces/IERC165.sol";
import "../interfaces/IERC6372.sol";
import {IERC165} from "../interfaces/IERC165.sol";
import {IERC6372} from "../interfaces/IERC6372.sol";
/**
* @dev Interface of the {Governor} core.

@ -3,10 +3,11 @@
pragma solidity ^0.8.19;
import "../access/AccessControl.sol";
import "../token/ERC721/utils/ERC721Holder.sol";
import "../token/ERC1155/utils/ERC1155Holder.sol";
import "../utils/Address.sol";
import {AccessControl} from "../access/AccessControl.sol";
import {ERC721Holder} from "../token/ERC721/utils/ERC721Holder.sol";
import {ERC1155Holder} from "../token/ERC1155/utils/ERC1155Holder.sol";
import {ERC1155Receiver} from "../token/ERC1155/utils/ERC1155Receiver.sol";
import {Address} from "../utils/Address.sol";
/**
* @dev Contract module which acts as a timelocked controller. When set as the

@ -3,10 +3,10 @@
pragma solidity ^0.8.19;
import "../../utils/math/SafeCast.sol";
import "../extensions/IGovernorTimelock.sol";
import "../Governor.sol";
import "./IGovernorCompatibilityBravo.sol";
import {SafeCast} from "../../utils/math/SafeCast.sol";
import {IGovernorTimelock} from "../extensions/IGovernorTimelock.sol";
import {IGovernor, Governor} from "../Governor.sol";
import {IGovernorCompatibilityBravo} from "./IGovernorCompatibilityBravo.sol";
/**
* @dev Compatibility layer that implements GovernorBravo compatibility on top of {Governor}.

@ -3,7 +3,7 @@
pragma solidity ^0.8.19;
import "../IGovernor.sol";
import {IGovernor} from "../IGovernor.sol";
/**
* @dev Interface extension that adds missing functions to the {Governor} core to provide `GovernorBravo` compatibility.

@ -3,7 +3,7 @@
pragma solidity ^0.8.19;
import "../Governor.sol";
import {Governor} from "../Governor.sol";
/**
* @dev Extension of {Governor} for simple, 3 options, vote counting.

@ -3,8 +3,8 @@
pragma solidity ^0.8.19;
import "../Governor.sol";
import "../../utils/math/Math.sol";
import {Governor} from "../Governor.sol";
import {Math} from "../../utils/math/Math.sol";
/**
* @dev A module that ensures there is a minimum voting period after quorum is reached. This prevents a large voter from

@ -3,7 +3,7 @@
pragma solidity ^0.8.19;
import "../Governor.sol";
import {Governor} from "../Governor.sol";
/**
* @dev Extension of {Governor} for settings updatable through governance.

@ -3,10 +3,12 @@
pragma solidity ^0.8.19;
import "./IGovernorTimelock.sol";
import "../Governor.sol";
import "../../utils/math/SafeCast.sol";
import "../../vendor/compound/ICompoundTimelock.sol";
import {IGovernorTimelock} from "./IGovernorTimelock.sol";
import {IGovernor, Governor} from "../Governor.sol";
import {SafeCast} from "../../utils/math/SafeCast.sol";
import {ICompoundTimelock} from "../../vendor/compound/ICompoundTimelock.sol";
import {IERC165} from "../../interfaces/IERC165.sol";
import {Address} from "../../utils/Address.sol";
/**
* @dev Extension of {Governor} that binds the execution process to a Compound Timelock. This adds a delay, enforced by

@ -3,9 +3,10 @@
pragma solidity ^0.8.19;
import "./IGovernorTimelock.sol";
import "../Governor.sol";
import "../TimelockController.sol";
import {IGovernorTimelock} from "./IGovernorTimelock.sol";
import {IGovernor, Governor} from "../Governor.sol";
import {TimelockController} from "../TimelockController.sol";
import {IERC165} from "../../interfaces/IERC165.sol";
/**
* @dev Extension of {Governor} that binds the execution process to an instance of {TimelockController}. This adds a

@ -3,8 +3,10 @@
pragma solidity ^0.8.19;
import "../Governor.sol";
import "../../interfaces/IERC5805.sol";
import {Governor} from "../Governor.sol";
import {IVotes} from "../utils/IVotes.sol";
import {IERC5805} from "../../interfaces/IERC5805.sol";
import {SafeCast} from "../../utils/math/SafeCast.sol";
/**
* @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes} token.

@ -3,9 +3,9 @@
pragma solidity ^0.8.19;
import "./GovernorVotes.sol";
import "../../utils/math/SafeCast.sol";
import "../../utils/structs/Checkpoints.sol";
import {GovernorVotes} from "./GovernorVotes.sol";
import {SafeCast} from "../../utils/math/SafeCast.sol";
import {Checkpoints} from "../../utils/structs/Checkpoints.sol";
/**
* @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a

@ -3,7 +3,7 @@
pragma solidity ^0.8.19;
import "../IGovernor.sol";
import {IGovernor} from "../IGovernor.sol";
/**
* @dev Extension of the {IGovernor} for timelock supporting modules.

@ -2,11 +2,13 @@
// OpenZeppelin Contracts (last updated v4.9.0) (governance/utils/Votes.sol)
pragma solidity ^0.8.19;
import "../../interfaces/IERC5805.sol";
import "../../utils/Context.sol";
import "../../utils/Nonces.sol";
import "../../utils/cryptography/EIP712.sol";
import "../../utils/structs/Checkpoints.sol";
import {IERC5805} from "../../interfaces/IERC5805.sol";
import {Context} from "../../utils/Context.sol";
import {Nonces} from "../../utils/Nonces.sol";
import {EIP712} from "../../utils/cryptography/EIP712.sol";
import {Checkpoints} from "../../utils/structs/Checkpoints.sol";
import {SafeCast} from "../../utils/math/SafeCast.sol";
import {ECDSA} from "../../utils/cryptography/ECDSA.sol";
/**
* @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be

@ -3,4 +3,4 @@
pragma solidity ^0.8.19;
import "../token/ERC1155/IERC1155.sol";
import {IERC1155} from "../token/ERC1155/IERC1155.sol";

@ -3,4 +3,4 @@
pragma solidity ^0.8.19;
import "../token/ERC1155/extensions/IERC1155MetadataURI.sol";
import {IERC1155MetadataURI} from "../token/ERC1155/extensions/IERC1155MetadataURI.sol";

@ -3,4 +3,4 @@
pragma solidity ^0.8.19;
import "../token/ERC1155/IERC1155Receiver.sol";
import {IERC1155Receiver} from "../token/ERC1155/IERC1155Receiver.sol";

@ -3,8 +3,8 @@
pragma solidity ^0.8.19;
import "./IERC20.sol";
import "./IERC165.sol";
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @dev Interface of an ERC1363 compliant contract, as defined in the

@ -3,4 +3,4 @@
pragma solidity ^0.8.19;
import "../utils/introspection/IERC165.sol";
import {IERC165} from "../utils/introspection/IERC165.sol";

@ -3,4 +3,4 @@
pragma solidity ^0.8.19;
import "../token/ERC20/IERC20.sol";
import {IERC20} from "../token/ERC20/IERC20.sol";

@ -3,4 +3,4 @@
pragma solidity ^0.8.19;
import "../token/ERC20/extensions/IERC20Metadata.sol";
import {IERC20Metadata} from "../token/ERC20/extensions/IERC20Metadata.sol";

@ -3,6 +3,6 @@
pragma solidity ^0.8.19;
import "../token/ERC20/extensions/IERC20Permit.sol";
import {IERC20Permit} from "../token/ERC20/extensions/IERC20Permit.sol";
interface IERC2612 is IERC20Permit {}

@ -3,7 +3,7 @@
pragma solidity ^0.8.19;
import "../utils/introspection/IERC165.sol";
import {IERC165} from "../utils/introspection/IERC165.sol";
/**
* @dev Interface for the NFT Royalty Standard.

@ -3,5 +3,5 @@
pragma solidity ^0.8.19;
import "./IERC3156FlashBorrower.sol";
import "./IERC3156FlashLender.sol";
import {IERC3156FlashBorrower} from "./IERC3156FlashBorrower.sol";
import {IERC3156FlashLender} from "./IERC3156FlashLender.sol";

@ -3,7 +3,7 @@
pragma solidity ^0.8.19;
import "./IERC3156FlashBorrower.sol";
import {IERC3156FlashBorrower} from "./IERC3156FlashBorrower.sol";
/**
* @dev Interface of the ERC3156 FlashLender, as defined in

@ -3,8 +3,8 @@
pragma solidity ^0.8.19;
import "../token/ERC20/IERC20.sol";
import "../token/ERC20/extensions/IERC20Metadata.sol";
import {IERC20} from "../token/ERC20/IERC20.sol";
import {IERC20Metadata} from "../token/ERC20/extensions/IERC20Metadata.sol";
/**
* @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in

@ -3,8 +3,8 @@
pragma solidity ^0.8.19;
import "./IERC165.sol";
import "./IERC721.sol";
import {IERC165} from "./IERC165.sol";
import {IERC721} from "./IERC721.sol";
/// @title EIP-721 Metadata Update Extension
interface IERC4906 is IERC165, IERC721 {

@ -3,7 +3,7 @@
pragma solidity ^0.8.19;
import "../governance/utils/IVotes.sol";
import "./IERC6372.sol";
import {IVotes} from "../governance/utils/IVotes.sol";
import {IERC6372} from "./IERC6372.sol";
interface IERC5805 is IERC6372, IVotes {}

@ -3,4 +3,4 @@
pragma solidity ^0.8.19;
import "../token/ERC721/IERC721.sol";
import {IERC721} from "../token/ERC721/IERC721.sol";

@ -3,4 +3,4 @@
pragma solidity ^0.8.19;
import "../token/ERC721/extensions/IERC721Enumerable.sol";
import {IERC721Enumerable} from "../token/ERC721/extensions/IERC721Enumerable.sol";

@ -3,4 +3,4 @@
pragma solidity ^0.8.19;
import "../token/ERC721/extensions/IERC721Metadata.sol";
import {IERC721Metadata} from "../token/ERC721/extensions/IERC721Metadata.sol";

@ -3,4 +3,4 @@
pragma solidity ^0.8.19;
import "../token/ERC721/IERC721Receiver.sol";
import {IERC721Receiver} from "../token/ERC721/IERC721Receiver.sol";

@ -3,7 +3,7 @@
pragma solidity ^0.8.19;
import "../utils/Context.sol";
import {Context} from "../utils/Context.sol";
/**
* @dev Context variant with ERC2771 support.

@ -3,10 +3,10 @@
pragma solidity ^0.8.19;
import "../utils/cryptography/ECDSA.sol";
import "../utils/cryptography/EIP712.sol";
import "../utils/Nonces.sol";
import "../utils/Address.sol";
import {ECDSA} from "../utils/cryptography/ECDSA.sol";
import {EIP712} from "../utils/cryptography/EIP712.sol";
import {Nonces} from "../utils/Nonces.sol";
import {Address} from "../utils/Address.sol";
/**
* @dev A forwarder compatible with ERC2771 contracts. See {ERC2771Context}.

@ -2,7 +2,7 @@
pragma solidity ^0.8.0;
import "../utils/Address.sol";
import {Address} from "../utils/Address.sol";
/**
* @dev A mock to expose `Address`'s functions with function pointers.

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../utils/Arrays.sol";
import {Arrays} from "../utils/Arrays.sol";
contract Uint256ArraysMock {
using Arrays for uint256[];

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../utils/Context.sol";
import {Context} from "../utils/Context.sol";
contract ContextMock is Context {
event Sender(address sender);

@ -2,7 +2,8 @@
pragma solidity ^0.8.19;
import "../proxy/ERC1967/ERC1967Utils.sol";
import {ERC1967Utils} from "../proxy/ERC1967/ERC1967Utils.sol";
import {StorageSlot} from "../utils/StorageSlot.sol";
abstract contract Impl {
function version() public pure virtual returns (string memory);

@ -2,8 +2,8 @@
pragma solidity ^0.8.19;
import "../utils/cryptography/ECDSA.sol";
import "../utils/cryptography/EIP712.sol";
import {ECDSA} from "../utils/cryptography/ECDSA.sol";
import {EIP712} from "../utils/cryptography/EIP712.sol";
abstract contract EIP712Verifier is EIP712 {
function verify(bytes memory signature, address signer, address mailTo, string memory mailContents) external view {

@ -2,9 +2,9 @@
pragma solidity ^0.8.19;
import "../access/Ownable.sol";
import "../interfaces/IERC1271.sol";
import "../utils/cryptography/ECDSA.sol";
import {Ownable} from "../access/Ownable.sol";
import {IERC1271} from "../interfaces/IERC1271.sol";
import {ECDSA} from "../utils/cryptography/ECDSA.sol";
contract ERC1271WalletMock is Ownable, IERC1271 {
constructor(address originalOwner) Ownable(originalOwner) {}

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../../utils/introspection/IERC165.sol";
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* https://eips.ethereum.org/EIPS/eip-214#specification

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../../utils/introspection/IERC165.sol";
import {IERC165} from "../../utils/introspection/IERC165.sol";
contract ERC165ReturnBombMock is IERC165 {
function supportsInterface(bytes4 interfaceId) public pure override returns (bool) {

@ -2,8 +2,9 @@
pragma solidity ^0.8.19;
import "./ContextMock.sol";
import "../metatx/ERC2771Context.sol";
import {ContextMock} from "./ContextMock.sol";
import {Context} from "../utils/Context.sol";
import {ERC2771Context} from "../metatx/ERC2771Context.sol";
// By inheriting from ERC2771Context, Context's internal functions are overridden automatically
contract ERC2771ContextMock is ContextMock, ERC2771Context {

@ -2,9 +2,9 @@
pragma solidity ^0.8.19;
import "../token/ERC20/IERC20.sol";
import "../interfaces/IERC3156.sol";
import "../utils/Address.sol";
import {IERC20} from "../token/ERC20/IERC20.sol";
import {IERC3156FlashBorrower} from "../interfaces/IERC3156.sol";
import {Address} from "../utils/Address.sol";
/**
* @dev WARNING: this IERC3156FlashBorrower mock implementation is for testing purposes ONLY.

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../proxy/utils/Initializable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @title InitializableMock

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "./token/ERC20MulticallMock.sol";
import {ERC20MulticallMock} from "./token/ERC20MulticallMock.sol";
contract MulticallTest {
function checkReturnValues(

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../proxy/utils/Initializable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
// Sample contracts showing upgradeability with multiple inheritance.
// Child contract inherits from Father and Mother contracts, and Father extends from Gramps.

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../security/Pausable.sol";
import {Pausable} from "../security/Pausable.sol";
contract PausableMock is Pausable {
bool public drasticMeasureTaken;

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../utils/Context.sol";
import {Context} from "../utils/Context.sol";
contract ReentrancyAttack is Context {
function callSender(bytes calldata data) public {

@ -2,8 +2,8 @@
pragma solidity ^0.8.19;
import "../security/ReentrancyGuard.sol";
import "./ReentrancyAttack.sol";
import {ReentrancyGuard} from "../security/ReentrancyGuard.sol";
import {ReentrancyAttack} from "./ReentrancyAttack.sol";
contract ReentrancyMock is ReentrancyGuard {
uint256 public counter;

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../proxy/utils/Initializable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
contract Implementation1 is Initializable {
uint256 internal _value;

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../proxy/utils/Initializable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @title MigratableMockV1

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../utils/StorageSlot.sol";
import {StorageSlot} from "../utils/StorageSlot.sol";
contract StorageSlotMock {
using StorageSlot for *;

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "../utils/Address.sol";
import {Address} from "../utils/Address.sol";
contract TimelockReentrant {
address private _reenterTarget;

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../governance/utils/Votes.sol";
import {Votes} from "../governance/utils/Votes.sol";
abstract contract VotesMock is Votes {
mapping(address => uint256) private _votingUnits;

@ -2,7 +2,10 @@
pragma solidity ^0.8.19;
import "../../token/ERC20/extensions/ERC4626.sol";
import {IERC20} from "../../token/ERC20/IERC20.sol";
import {ERC4626} from "../../token/ERC20/extensions/ERC4626.sol";
import {SafeERC20} from "../../token/ERC20/utils/SafeERC20.sol";
import {Math} from "../../utils/math/Math.sol";
abstract contract ERC4626Fees is ERC4626 {
using Math for uint256;

@ -1,11 +1,14 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "../../../governance/Governor.sol";
import "../../../governance/compatibility/GovernorCompatibilityBravo.sol";
import "../../../governance/extensions/GovernorVotes.sol";
import "../../../governance/extensions/GovernorVotesQuorumFraction.sol";
import "../../../governance/extensions/GovernorTimelockControl.sol";
import {IGovernor, Governor} from "../../../governance/Governor.sol";
import {GovernorCompatibilityBravo} from "../../../governance/compatibility/GovernorCompatibilityBravo.sol";
import {GovernorVotes} from "../../../governance/extensions/GovernorVotes.sol";
import {GovernorVotesQuorumFraction} from "../../../governance/extensions/GovernorVotesQuorumFraction.sol";
import {GovernorTimelockControl} from "../../../governance/extensions/GovernorTimelockControl.sol";
import {TimelockController} from "../../../governance/TimelockController.sol";
import {IVotes} from "../../../governance/utils/IVotes.sol";
import {IERC165} from "../../../interfaces/IERC165.sol";
contract MyGovernor is
Governor,

@ -1,9 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "../../../token/ERC20/ERC20.sol";
import "../../../token/ERC20/extensions/ERC20Permit.sol";
import "../../../token/ERC20/extensions/ERC20Votes.sol";
import {ERC20} from "../../../token/ERC20/ERC20.sol";
import {ERC20Permit} from "../../../token/ERC20/extensions/ERC20Permit.sol";
import {ERC20Votes} from "../../../token/ERC20/extensions/ERC20Votes.sol";
import {Nonces} from "../../../utils/Nonces.sol";
contract MyToken is ERC20, ERC20Permit, ERC20Votes {
constructor() ERC20("MyToken", "MTK") ERC20Permit("MyToken") {}

@ -1,9 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "../../../token/ERC20/ERC20.sol";
import "../../../token/ERC20/extensions/ERC20Permit.sol";
import "../../../token/ERC20/extensions/ERC20Votes.sol";
import {ERC20} from "../../../token/ERC20/ERC20.sol";
import {ERC20Permit} from "../../../token/ERC20/extensions/ERC20Permit.sol";
import {ERC20Votes} from "../../../token/ERC20/extensions/ERC20Votes.sol";
import {Nonces} from "../../../utils/Nonces.sol";
contract MyTokenTimestampBased is ERC20, ERC20Permit, ERC20Votes {
constructor() ERC20("MyTokenTimestampBased", "MTK") ERC20Permit("MyTokenTimestampBased") {}

@ -1,10 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "../../../token/ERC20/ERC20.sol";
import "../../../token/ERC20/extensions/ERC20Permit.sol";
import "../../../token/ERC20/extensions/ERC20Votes.sol";
import "../../../token/ERC20/extensions/ERC20Wrapper.sol";
import {IERC20, ERC20} from "../../../token/ERC20/ERC20.sol";
import {ERC20Permit} from "../../../token/ERC20/extensions/ERC20Permit.sol";
import {ERC20Votes} from "../../../token/ERC20/extensions/ERC20Votes.sol";
import {ERC20Wrapper} from "../../../token/ERC20/extensions/ERC20Wrapper.sol";
import {Nonces} from "../../../utils/Nonces.sol";
contract MyTokenWrapped is ERC20, ERC20Permit, ERC20Votes, ERC20Wrapper {
constructor(

@ -2,10 +2,12 @@
pragma solidity ^0.8.19;
import "../../governance/compatibility/GovernorCompatibilityBravo.sol";
import "../../governance/extensions/GovernorTimelockCompound.sol";
import "../../governance/extensions/GovernorSettings.sol";
import "../../governance/extensions/GovernorVotes.sol";
import {IGovernor, Governor} from "../../governance/Governor.sol";
import {GovernorCompatibilityBravo} from "../../governance/compatibility/GovernorCompatibilityBravo.sol";
import {IGovernorTimelock, GovernorTimelockCompound} from "../../governance/extensions/GovernorTimelockCompound.sol";
import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
import {GovernorVotes} from "../../governance/extensions/GovernorVotes.sol";
import {IERC165} from "../../interfaces/IERC165.sol";
abstract contract GovernorCompatibilityBravoMock is
GovernorCompatibilityBravo,

@ -2,9 +2,10 @@
pragma solidity ^0.8.19;
import "../../governance/extensions/GovernorSettings.sol";
import "../../governance/extensions/GovernorCountingSimple.sol";
import "../../governance/extensions/GovernorVotesQuorumFraction.sol";
import {Governor} from "../../governance/Governor.sol";
import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";
import {GovernorVotesQuorumFraction} from "../../governance/extensions/GovernorVotesQuorumFraction.sol";
abstract contract GovernorMock is GovernorSettings, GovernorVotesQuorumFraction, GovernorCountingSimple {
function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {

@ -2,10 +2,11 @@
pragma solidity ^0.8.19;
import "../../governance/extensions/GovernorPreventLateQuorum.sol";
import "../../governance/extensions/GovernorSettings.sol";
import "../../governance/extensions/GovernorCountingSimple.sol";
import "../../governance/extensions/GovernorVotes.sol";
import {Governor} from "../../governance/Governor.sol";
import {GovernorPreventLateQuorum} from "../../governance/extensions/GovernorPreventLateQuorum.sol";
import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";
import {GovernorVotes} from "../../governance/extensions/GovernorVotes.sol";
abstract contract GovernorPreventLateQuorumMock is
GovernorSettings,

@ -2,10 +2,11 @@
pragma solidity ^0.8.19;
import "../../governance/extensions/GovernorTimelockCompound.sol";
import "../../governance/extensions/GovernorSettings.sol";
import "../../governance/extensions/GovernorCountingSimple.sol";
import "../../governance/extensions/GovernorVotesQuorumFraction.sol";
import {IGovernor, Governor} from "../../governance/Governor.sol";
import {GovernorTimelockCompound} from "../../governance/extensions/GovernorTimelockCompound.sol";
import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";
import {GovernorVotesQuorumFraction} from "../../governance/extensions/GovernorVotesQuorumFraction.sol";
abstract contract GovernorTimelockCompoundMock is
GovernorSettings,

@ -2,10 +2,11 @@
pragma solidity ^0.8.19;
import "../../governance/extensions/GovernorTimelockControl.sol";
import "../../governance/extensions/GovernorSettings.sol";
import "../../governance/extensions/GovernorCountingSimple.sol";
import "../../governance/extensions/GovernorVotesQuorumFraction.sol";
import {IGovernor, Governor} from "../../governance/Governor.sol";
import {GovernorTimelockControl} from "../../governance/extensions/GovernorTimelockControl.sol";
import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";
import {GovernorVotesQuorumFraction} from "../../governance/extensions/GovernorVotesQuorumFraction.sol";
abstract contract GovernorTimelockControlMock is
GovernorSettings,

@ -2,8 +2,8 @@
pragma solidity ^0.8.19;
import "../../governance/extensions/GovernorCountingSimple.sol";
import "../../governance/extensions/GovernorVotes.sol";
import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";
import {GovernorVotes} from "../../governance/extensions/GovernorVotes.sol";
abstract contract GovernorVoteMocks is GovernorVotes, GovernorCountingSimple {
function quorum(uint256) public pure override returns (uint256) {

@ -2,8 +2,9 @@
pragma solidity ^0.8.19;
import "../../governance/extensions/GovernorCountingSimple.sol";
import "../../governance/extensions/GovernorVotes.sol";
import {Governor} from "../../governance/Governor.sol";
import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";
import {GovernorVotes} from "../../governance/extensions/GovernorVotes.sol";
abstract contract GovernorWithParamsMock is GovernorVotes, GovernorCountingSimple {
event CountParams(uint256 uintParam, string strParam);

@ -2,7 +2,8 @@
pragma solidity ^0.8.19;
import "../../proxy/utils/UUPSUpgradeable.sol";
import {UUPSUpgradeable} from "../../proxy/utils/UUPSUpgradeable.sol";
import {ERC1967Utils} from "../../proxy/ERC1967/ERC1967Utils.sol";
contract NonUpgradeableMock {
uint256 internal _counter;

@ -2,8 +2,8 @@
pragma solidity ^0.8.19;
import "../../token/ERC1155/IERC1155Receiver.sol";
import "../../utils/introspection/ERC165.sol";
import {IERC1155Receiver} from "../../token/ERC1155/IERC1155Receiver.sol";
import {ERC165} from "../../utils/introspection/ERC165.sol";
contract ERC1155ReceiverMock is ERC165, IERC1155Receiver {
enum RevertType {

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "../../token/ERC20/ERC20.sol";
import {ERC20} from "../../token/ERC20/ERC20.sol";
abstract contract ERC20ApprovalMock is ERC20 {
function _approve(address owner, address spender, uint256 amount, bool) internal virtual override {

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../../token/ERC20/ERC20.sol";
import {ERC20} from "../../token/ERC20/ERC20.sol";
abstract contract ERC20DecimalsMock is ERC20 {
uint8 private immutable _decimals;

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../../token/ERC20/extensions/ERC20FlashMint.sol";
import {ERC20FlashMint} from "../../token/ERC20/extensions/ERC20FlashMint.sol";
abstract contract ERC20FlashMintMock is ERC20FlashMint {
uint256 _flashFeeAmount;

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../../token/ERC20/ERC20.sol";
import {ERC20} from "../../token/ERC20/ERC20.sol";
// contract that replicate USDT (0xdac17f958d2ee523a2206206994597c13d831ec7) approval beavior
abstract contract ERC20ForceApproveMock is ERC20 {

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "../../token/ERC20/ERC20.sol";
import {ERC20} from "../../token/ERC20/ERC20.sol";
contract ERC20Mock is ERC20 {
constructor() ERC20("ERC20Mock", "E20M") {}

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../../token/ERC20/ERC20.sol";
import "../../utils/Multicall.sol";
import {ERC20} from "../../token/ERC20/ERC20.sol";
import {Multicall} from "../../utils/Multicall.sol";
abstract contract ERC20MulticallMock is ERC20, Multicall {}

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../../token/ERC20/ERC20.sol";
import {ERC20} from "../../token/ERC20/ERC20.sol";
abstract contract ERC20NoReturnMock is ERC20 {
function transfer(address to, uint256 amount) public override returns (bool) {

@ -2,8 +2,8 @@
pragma solidity ^0.8.19;
import "../../token/ERC20/ERC20.sol";
import "../../token/ERC20/extensions/ERC20Permit.sol";
import {ERC20} from "../../token/ERC20/ERC20.sol";
import {ERC20Permit} from "../../token/ERC20/extensions/ERC20Permit.sol";
abstract contract ERC20PermitNoRevertMock is ERC20Permit {
function permitThatMayRevert(

@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "../../token/ERC20/ERC20.sol";
import "../../utils/Address.sol";
import {ERC20} from "../../token/ERC20/ERC20.sol";
import {Address} from "../../utils/Address.sol";
contract ERC20Reentrant is ERC20("TEST", "TST") {
enum Type {

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../../token/ERC20/ERC20.sol";
import {ERC20} from "../../token/ERC20/ERC20.sol";
abstract contract ERC20ReturnFalseMock is ERC20 {
function transfer(address, uint256) public pure override returns (bool) {

@ -2,11 +2,11 @@
pragma solidity ^0.8.19;
import "../../token/ERC20/extensions/ERC20Permit.sol";
import "../../utils/math/Math.sol";
import "../../governance/utils/IVotes.sol";
import "../../utils/math/SafeCast.sol";
import "../../utils/cryptography/ECDSA.sol";
import {ERC20Permit} from "../../token/ERC20/extensions/ERC20Permit.sol";
import {Math} from "../../utils/math/Math.sol";
import {IVotes} from "../../governance/utils/IVotes.sol";
import {SafeCast} from "../../utils/math/SafeCast.sol";
import {ECDSA} from "../../utils/cryptography/ECDSA.sol";
/**
* @dev Copied from the master branch at commit 86de1e8b6c3fa6b4efa4a5435869d2521be0f5f5

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../../token/ERC20/extensions/ERC4626.sol";
import {ERC4626} from "../../token/ERC20/extensions/ERC4626.sol";
abstract contract ERC4626LimitsMock is ERC4626 {
uint256 _maxDeposit;

@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "../../token/ERC20/extensions/ERC4626.sol";
import {IERC20, ERC20} from "../../token/ERC20/ERC20.sol";
import {ERC4626} from "../../token/ERC20/extensions/ERC4626.sol";
contract ERC4626Mock is ERC4626 {
constructor(address underlying) ERC20("ERC4626Mock", "E4626M") ERC4626(IERC20(underlying)) {}

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../../token/ERC20/extensions/ERC4626.sol";
import {ERC4626} from "../../token/ERC20/extensions/ERC4626.sol";
abstract contract ERC4626OffsetMock is ERC4626 {
uint8 private immutable _offset;

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../docs/ERC4626Fees.sol";
import {ERC4626Fees} from "../docs/ERC4626Fees.sol";
abstract contract ERC4626FeesMock is ERC4626Fees {
uint256 private immutable _entryFeeBasePointValue;

@ -2,8 +2,9 @@
pragma solidity ^0.8.19;
import "../../token/ERC721/extensions/ERC721Consecutive.sol";
import "../../token/ERC721/extensions/ERC721Enumerable.sol";
import {ERC721} from "../../token/ERC721/ERC721.sol";
import {ERC721Consecutive} from "../../token/ERC721/extensions/ERC721Consecutive.sol";
import {ERC721Enumerable} from "../../token/ERC721/extensions/ERC721Enumerable.sol";
contract ERC721ConsecutiveEnumerableMock is ERC721Consecutive, ERC721Enumerable {
constructor(

@ -2,9 +2,11 @@
pragma solidity ^0.8.19;
import "../../token/ERC721/extensions/ERC721Consecutive.sol";
import "../../token/ERC721/extensions/ERC721Pausable.sol";
import "../../token/ERC721/extensions/ERC721Votes.sol";
import {ERC721} from "../../token/ERC721/ERC721.sol";
import {ERC721Consecutive} from "../../token/ERC721/extensions/ERC721Consecutive.sol";
import {ERC721Pausable} from "../../token/ERC721/extensions/ERC721Pausable.sol";
import {ERC721Votes} from "../../token/ERC721/extensions/ERC721Votes.sol";
import {EIP712} from "../../utils/cryptography/EIP712.sol";
/**
* @title ERC721ConsecutiveMock

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../../token/ERC721/IERC721Receiver.sol";
import {IERC721Receiver} from "../../token/ERC721/IERC721Receiver.sol";
contract ERC721ReceiverMock is IERC721Receiver {
enum RevertType {

@ -2,7 +2,7 @@
pragma solidity ^0.8.19;
import "../../token/ERC721/extensions/ERC721URIStorage.sol";
import {ERC721URIStorage} from "../../token/ERC721/extensions/ERC721URIStorage.sol";
abstract contract ERC721URIStorageMock is ERC721URIStorage {
string private _baseTokenURI;

@ -2,8 +2,9 @@
pragma solidity ^0.8.19;
import "../../token/ERC20/extensions/ERC20Votes.sol";
import "../../token/ERC721/extensions/ERC721Votes.sol";
import {ERC20Votes} from "../../token/ERC20/extensions/ERC20Votes.sol";
import {ERC721Votes} from "../../token/ERC721/extensions/ERC721Votes.sol";
import {SafeCast} from "../../utils/math/SafeCast.sol";
abstract contract ERC20VotesTimestampMock is ERC20Votes {
function clock() public view virtual override returns (uint48) {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save