From fd861a93ffbde8ffb5d7bac9221a104833bfa848 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 28 Jun 2023 19:03:23 -0300 Subject: [PATCH 01/11] Use explicit imports --- contracts/access/AccessControl.sol | 8 ++++---- .../access/AccessControlDefaultAdminRules.sol | 9 +++++---- contracts/access/AccessControlEnumerable.sol | 6 +++--- .../IAccessControlDefaultAdminRules.sol | 2 +- contracts/access/IAccessControlEnumerable.sol | 2 +- contracts/access/Ownable.sol | 2 +- contracts/access/Ownable2Step.sol | 2 +- contracts/finance/VestingWallet.sol | 7 ++++--- contracts/governance/Governor.sol | 20 +++++++++---------- contracts/governance/IGovernor.sol | 4 ++-- contracts/governance/TimelockController.sol | 9 +++++---- .../GovernorCompatibilityBravo.sol | 8 ++++---- .../IGovernorCompatibilityBravo.sol | 2 +- .../extensions/GovernorCountingSimple.sol | 2 +- .../extensions/GovernorPreventLateQuorum.sol | 4 ++-- .../extensions/GovernorSettings.sol | 2 +- .../extensions/GovernorTimelockCompound.sol | 10 ++++++---- .../extensions/GovernorTimelockControl.sol | 7 ++++--- .../governance/extensions/GovernorVotes.sol | 6 ++++-- .../GovernorVotesQuorumFraction.sol | 6 +++--- .../extensions/IGovernorTimelock.sol | 2 +- contracts/governance/utils/Votes.sol | 12 ++++++----- contracts/interfaces/IERC1155.sol | 2 +- contracts/interfaces/IERC1155MetadataURI.sol | 2 +- contracts/interfaces/IERC1155Receiver.sol | 2 +- contracts/interfaces/IERC1363.sol | 4 ++-- contracts/interfaces/IERC165.sol | 2 +- contracts/interfaces/IERC20.sol | 2 +- contracts/interfaces/IERC20Metadata.sol | 2 +- contracts/interfaces/IERC2612.sol | 2 +- contracts/interfaces/IERC2981.sol | 2 +- contracts/interfaces/IERC3156.sol | 4 ++-- contracts/interfaces/IERC3156FlashLender.sol | 2 +- contracts/interfaces/IERC4626.sol | 4 ++-- contracts/interfaces/IERC4906.sol | 4 ++-- contracts/interfaces/IERC5805.sol | 4 ++-- contracts/interfaces/IERC721.sol | 2 +- contracts/interfaces/IERC721Enumerable.sol | 2 +- contracts/interfaces/IERC721Metadata.sol | 2 +- contracts/interfaces/IERC721Receiver.sol | 2 +- contracts/metatx/ERC2771Context.sol | 2 +- contracts/metatx/MinimalForwarder.sol | 4 ++-- contracts/mocks/AddressFnPointersMock.sol | 2 +- contracts/mocks/ArraysMock.sol | 2 +- contracts/mocks/ContextMock.sol | 2 +- contracts/mocks/DummyImplementation.sol | 3 ++- contracts/mocks/EIP712Verifier.sol | 4 ++-- contracts/mocks/ERC1271WalletMock.sol | 6 +++--- .../ERC165/ERC165InterfacesSupported.sol | 2 +- contracts/mocks/ERC165/ERC165ReturnBomb.sol | 2 +- contracts/mocks/ERC2771ContextMock.sol | 5 +++-- contracts/mocks/ERC3156FlashBorrowerMock.sol | 6 +++--- contracts/mocks/InitializableMock.sol | 2 +- contracts/mocks/MulticallTest.sol | 2 +- .../MultipleInheritanceInitializableMocks.sol | 2 +- contracts/mocks/PausableMock.sol | 2 +- contracts/mocks/ReentrancyAttack.sol | 2 +- contracts/mocks/ReentrancyMock.sol | 4 ++-- contracts/mocks/RegressionImplementation.sol | 2 +- .../SingleInheritanceInitializableMocks.sol | 2 +- contracts/mocks/StorageSlotMock.sol | 2 +- contracts/mocks/TimelockReentrant.sol | 2 +- contracts/mocks/VotesMock.sol | 2 +- contracts/mocks/docs/ERC4626Fees.sol | 5 ++++- .../mocks/docs/governance/MyGovernor.sol | 13 +++++++----- contracts/mocks/docs/governance/MyToken.sol | 7 ++++--- .../docs/governance/MyTokenTimestampBased.sol | 7 ++++--- .../mocks/docs/governance/MyTokenWrapped.sol | 9 +++++---- .../GovernorCompatibilityBravoMock.sol | 10 ++++++---- contracts/mocks/governance/GovernorMock.sol | 7 ++++--- .../GovernorPreventLateQuorumMock.sol | 9 +++++---- .../GovernorTimelockCompoundMock.sol | 9 +++++---- .../GovernorTimelockControlMock.sol | 9 +++++---- .../mocks/governance/GovernorVoteMock.sol | 4 ++-- .../governance/GovernorWithParamsMock.sol | 5 +++-- contracts/mocks/proxy/UUPSUpgradeableMock.sol | 3 ++- contracts/mocks/token/ERC1155ReceiverMock.sol | 4 ++-- contracts/mocks/token/ERC20ApprovalMock.sol | 2 +- contracts/mocks/token/ERC20DecimalsMock.sol | 2 +- contracts/mocks/token/ERC20FlashMintMock.sol | 2 +- .../mocks/token/ERC20ForceApproveMock.sol | 2 +- contracts/mocks/token/ERC20Mock.sol | 2 +- contracts/mocks/token/ERC20MulticallMock.sol | 4 ++-- contracts/mocks/token/ERC20NoReturnMock.sol | 2 +- .../mocks/token/ERC20PermitNoRevertMock.sol | 4 ++-- contracts/mocks/token/ERC20Reentrant.sol | 4 ++-- .../mocks/token/ERC20ReturnFalseMock.sol | 2 +- .../mocks/token/ERC20VotesLegacyMock.sol | 10 +++++----- contracts/mocks/token/ERC4626LimitsMock.sol | 2 +- contracts/mocks/token/ERC4626Mock.sol | 3 ++- contracts/mocks/token/ERC4626OffsetMock.sol | 2 +- contracts/mocks/token/ERC4646FeesMock.sol | 2 +- .../token/ERC721ConsecutiveEnumerableMock.sol | 5 +++-- .../mocks/token/ERC721ConsecutiveMock.sol | 8 +++++--- contracts/mocks/token/ERC721ReceiverMock.sol | 2 +- .../mocks/token/ERC721URIStorageMock.sol | 2 +- contracts/mocks/token/VotesTimestamp.sol | 5 +++-- contracts/proxy/ERC1967/ERC1967Proxy.sol | 4 ++-- contracts/proxy/ERC1967/ERC1967Utils.sol | 6 +++--- contracts/proxy/beacon/BeaconProxy.sol | 6 +++--- contracts/proxy/beacon/UpgradeableBeacon.sol | 4 ++-- contracts/proxy/transparent/ProxyAdmin.sol | 4 ++-- .../TransparentUpgradeableProxy.sol | 5 +++-- contracts/proxy/utils/Initializable.sol | 2 +- contracts/proxy/utils/UUPSUpgradeable.sol | 4 ++-- contracts/security/Pausable.sol | 2 +- contracts/token/ERC1155/ERC1155.sol | 14 ++++++------- contracts/token/ERC1155/IERC1155.sol | 2 +- contracts/token/ERC1155/IERC1155Receiver.sol | 2 +- .../ERC1155/extensions/ERC1155Burnable.sol | 2 +- .../ERC1155/extensions/ERC1155Pausable.sol | 4 ++-- .../ERC1155/extensions/ERC1155Supply.sol | 2 +- .../ERC1155/extensions/ERC1155URIStorage.sol | 4 ++-- .../extensions/IERC1155MetadataURI.sol | 2 +- .../token/ERC1155/utils/ERC1155Holder.sol | 2 +- .../token/ERC1155/utils/ERC1155Receiver.sol | 4 ++-- contracts/token/ERC20/ERC20.sol | 8 ++++---- .../token/ERC20/extensions/ERC20Burnable.sol | 4 ++-- .../token/ERC20/extensions/ERC20Capped.sol | 2 +- .../token/ERC20/extensions/ERC20FlashMint.sol | 6 +++--- .../token/ERC20/extensions/ERC20Pausable.sol | 4 ++-- .../token/ERC20/extensions/ERC20Permit.sol | 10 +++++----- .../token/ERC20/extensions/ERC20Votes.sol | 7 ++++--- .../token/ERC20/extensions/ERC20Wrapper.sol | 4 ++-- contracts/token/ERC20/extensions/ERC4626.sol | 8 ++++---- .../token/ERC20/extensions/IERC20Metadata.sol | 2 +- contracts/token/ERC20/utils/SafeERC20.sol | 6 +++--- contracts/token/ERC721/ERC721.sol | 14 ++++++------- contracts/token/ERC721/IERC721.sol | 2 +- .../ERC721/extensions/ERC721Burnable.sol | 4 ++-- .../ERC721/extensions/ERC721Consecutive.sol | 8 ++++---- .../ERC721/extensions/ERC721Enumerable.sol | 5 +++-- .../ERC721/extensions/ERC721Pausable.sol | 4 ++-- .../token/ERC721/extensions/ERC721Royalty.sol | 6 +++--- .../ERC721/extensions/ERC721URIStorage.sol | 6 ++++-- .../token/ERC721/extensions/ERC721Votes.sol | 4 ++-- .../token/ERC721/extensions/ERC721Wrapper.sol | 3 ++- .../ERC721/extensions/IERC721Enumerable.sol | 2 +- .../ERC721/extensions/IERC721Metadata.sol | 2 +- contracts/token/ERC721/utils/ERC721Holder.sol | 2 +- contracts/token/common/ERC2981.sol | 4 ++-- contracts/utils/Arrays.sol | 4 ++-- contracts/utils/Multicall.sol | 2 +- contracts/utils/ShortStrings.sol | 2 +- contracts/utils/Strings.sol | 4 ++-- contracts/utils/cryptography/ECDSA.sol | 2 +- contracts/utils/cryptography/EIP712.sol | 6 +++--- .../utils/cryptography/SignatureChecker.sol | 4 ++-- contracts/utils/introspection/ERC165.sol | 2 +- .../utils/introspection/ERC165Checker.sol | 2 +- contracts/utils/structs/Checkpoints.sol | 4 ++-- contracts/utils/structs/DoubleEndedQueue.sol | 2 +- contracts/utils/structs/EnumerableMap.sol | 2 +- test/governance/Governor.t.sol | 6 +++--- .../ERC721/extensions/ERC721Consecutive.t.sol | 4 ++-- test/utils/ShortStrings.t.sol | 4 ++-- test/utils/math/Math.t.sol | 4 ++-- test/utils/structs/Checkpoints.t.sol | 6 +++--- 158 files changed, 356 insertions(+), 316 deletions(-) diff --git a/contracts/access/AccessControl.sol b/contracts/access/AccessControl.sol index 12dc770b308..8465fefbdf3 100644 --- a/contracts/access/AccessControl.sol +++ b/contracts/access/AccessControl.sol @@ -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 diff --git a/contracts/access/AccessControlDefaultAdminRules.sol b/contracts/access/AccessControlDefaultAdminRules.sol index e27eaf3db2a..ebc40a5bfc7 100644 --- a/contracts/access/AccessControlDefaultAdminRules.sol +++ b/contracts/access/AccessControlDefaultAdminRules.sol @@ -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 diff --git a/contracts/access/AccessControlEnumerable.sol b/contracts/access/AccessControlEnumerable.sol index 297d345361a..6f160e4e8ce 100644 --- a/contracts/access/AccessControlEnumerable.sol +++ b/contracts/access/AccessControlEnumerable.sol @@ -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. diff --git a/contracts/access/IAccessControlDefaultAdminRules.sol b/contracts/access/IAccessControlDefaultAdminRules.sol index fbecfe1207b..5e61f965d36 100644 --- a/contracts/access/IAccessControlDefaultAdminRules.sol +++ b/contracts/access/IAccessControlDefaultAdminRules.sol @@ -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. diff --git a/contracts/access/IAccessControlEnumerable.sol b/contracts/access/IAccessControlEnumerable.sol index 240c61157ab..1bd88a4f4de 100644 --- a/contracts/access/IAccessControlEnumerable.sol +++ b/contracts/access/IAccessControlEnumerable.sol @@ -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. diff --git a/contracts/access/Ownable.sol b/contracts/access/Ownable.sol index 627226cf715..ca09e035054 100644 --- a/contracts/access/Ownable.sol +++ b/contracts/access/Ownable.sol @@ -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 diff --git a/contracts/access/Ownable2Step.sol b/contracts/access/Ownable2Step.sol index f76eb2bba60..3cbab179881 100644 --- a/contracts/access/Ownable2Step.sol +++ b/contracts/access/Ownable2Step.sol @@ -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 diff --git a/contracts/finance/VestingWallet.sol b/contracts/finance/VestingWallet.sol index ebdf0a330aa..f776a7ca468 100644 --- a/contracts/finance/VestingWallet.sol +++ b/contracts/finance/VestingWallet.sol @@ -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 diff --git a/contracts/governance/Governor.sol b/contracts/governance/Governor.sol index bae5d62e642..d0ace4f0363 100644 --- a/contracts/governance/Governor.sol +++ b/contracts/governance/Governor.sol @@ -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. diff --git a/contracts/governance/IGovernor.sol b/contracts/governance/IGovernor.sol index 0adde679558..2eeedd313e7 100644 --- a/contracts/governance/IGovernor.sol +++ b/contracts/governance/IGovernor.sol @@ -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. diff --git a/contracts/governance/TimelockController.sol b/contracts/governance/TimelockController.sol index a25cd7b4a77..45d8642e8e6 100644 --- a/contracts/governance/TimelockController.sol +++ b/contracts/governance/TimelockController.sol @@ -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 diff --git a/contracts/governance/compatibility/GovernorCompatibilityBravo.sol b/contracts/governance/compatibility/GovernorCompatibilityBravo.sol index 8d6d9ccb43a..445f71be042 100644 --- a/contracts/governance/compatibility/GovernorCompatibilityBravo.sol +++ b/contracts/governance/compatibility/GovernorCompatibilityBravo.sol @@ -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}. diff --git a/contracts/governance/compatibility/IGovernorCompatibilityBravo.sol b/contracts/governance/compatibility/IGovernorCompatibilityBravo.sol index 197936ab930..4bd59307746 100644 --- a/contracts/governance/compatibility/IGovernorCompatibilityBravo.sol +++ b/contracts/governance/compatibility/IGovernorCompatibilityBravo.sol @@ -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. diff --git a/contracts/governance/extensions/GovernorCountingSimple.sol b/contracts/governance/extensions/GovernorCountingSimple.sol index 315f4ad45d3..8934995defe 100644 --- a/contracts/governance/extensions/GovernorCountingSimple.sol +++ b/contracts/governance/extensions/GovernorCountingSimple.sol @@ -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. diff --git a/contracts/governance/extensions/GovernorPreventLateQuorum.sol b/contracts/governance/extensions/GovernorPreventLateQuorum.sol index 3e730174e5b..3e034acad0b 100644 --- a/contracts/governance/extensions/GovernorPreventLateQuorum.sol +++ b/contracts/governance/extensions/GovernorPreventLateQuorum.sol @@ -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 diff --git a/contracts/governance/extensions/GovernorSettings.sol b/contracts/governance/extensions/GovernorSettings.sol index 6168689add9..5d98fbf34b3 100644 --- a/contracts/governance/extensions/GovernorSettings.sol +++ b/contracts/governance/extensions/GovernorSettings.sol @@ -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. diff --git a/contracts/governance/extensions/GovernorTimelockCompound.sol b/contracts/governance/extensions/GovernorTimelockCompound.sol index ed4d916a661..cd61d1ff89f 100644 --- a/contracts/governance/extensions/GovernorTimelockCompound.sol +++ b/contracts/governance/extensions/GovernorTimelockCompound.sol @@ -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 diff --git a/contracts/governance/extensions/GovernorTimelockControl.sol b/contracts/governance/extensions/GovernorTimelockControl.sol index fadbcc70152..fefe3155537 100644 --- a/contracts/governance/extensions/GovernorTimelockControl.sol +++ b/contracts/governance/extensions/GovernorTimelockControl.sol @@ -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 diff --git a/contracts/governance/extensions/GovernorVotes.sol b/contracts/governance/extensions/GovernorVotes.sol index 5d8318f4684..bb14d7fdef5 100644 --- a/contracts/governance/extensions/GovernorVotes.sol +++ b/contracts/governance/extensions/GovernorVotes.sol @@ -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. diff --git a/contracts/governance/extensions/GovernorVotesQuorumFraction.sol b/contracts/governance/extensions/GovernorVotesQuorumFraction.sol index 0094fecd67b..bb1c7d2eabf 100644 --- a/contracts/governance/extensions/GovernorVotesQuorumFraction.sol +++ b/contracts/governance/extensions/GovernorVotesQuorumFraction.sol @@ -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 diff --git a/contracts/governance/extensions/IGovernorTimelock.sol b/contracts/governance/extensions/IGovernorTimelock.sol index c5142948132..00254853a1e 100644 --- a/contracts/governance/extensions/IGovernorTimelock.sol +++ b/contracts/governance/extensions/IGovernorTimelock.sol @@ -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. diff --git a/contracts/governance/utils/Votes.sol b/contracts/governance/utils/Votes.sol index 09eb4e22c63..c0ff69e626c 100644 --- a/contracts/governance/utils/Votes.sol +++ b/contracts/governance/utils/Votes.sol @@ -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 diff --git a/contracts/interfaces/IERC1155.sol b/contracts/interfaces/IERC1155.sol index 8f7527f9182..6c9ef7f6cf0 100644 --- a/contracts/interfaces/IERC1155.sol +++ b/contracts/interfaces/IERC1155.sol @@ -3,4 +3,4 @@ pragma solidity ^0.8.19; -import "../token/ERC1155/IERC1155.sol"; +import {IERC1155} from "../token/ERC1155/IERC1155.sol"; diff --git a/contracts/interfaces/IERC1155MetadataURI.sol b/contracts/interfaces/IERC1155MetadataURI.sol index 61b36c2e863..7c202be4892 100644 --- a/contracts/interfaces/IERC1155MetadataURI.sol +++ b/contracts/interfaces/IERC1155MetadataURI.sol @@ -3,4 +3,4 @@ pragma solidity ^0.8.19; -import "../token/ERC1155/extensions/IERC1155MetadataURI.sol"; +import {IERC1155MetadataURI} from "../token/ERC1155/extensions/IERC1155MetadataURI.sol"; diff --git a/contracts/interfaces/IERC1155Receiver.sol b/contracts/interfaces/IERC1155Receiver.sol index b5cd186b7de..c67ed38bdf1 100644 --- a/contracts/interfaces/IERC1155Receiver.sol +++ b/contracts/interfaces/IERC1155Receiver.sol @@ -3,4 +3,4 @@ pragma solidity ^0.8.19; -import "../token/ERC1155/IERC1155Receiver.sol"; +import {IERC1155Receiver} from "../token/ERC1155/IERC1155Receiver.sol"; diff --git a/contracts/interfaces/IERC1363.sol b/contracts/interfaces/IERC1363.sol index 95c5b89929b..2bbba32b604 100644 --- a/contracts/interfaces/IERC1363.sol +++ b/contracts/interfaces/IERC1363.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 diff --git a/contracts/interfaces/IERC165.sol b/contracts/interfaces/IERC165.sol index f4d90264c26..3ac6e69dd55 100644 --- a/contracts/interfaces/IERC165.sol +++ b/contracts/interfaces/IERC165.sol @@ -3,4 +3,4 @@ pragma solidity ^0.8.19; -import "../utils/introspection/IERC165.sol"; +import {IERC165} from "../utils/introspection/IERC165.sol"; diff --git a/contracts/interfaces/IERC20.sol b/contracts/interfaces/IERC20.sol index dd559e98044..3ff66048065 100644 --- a/contracts/interfaces/IERC20.sol +++ b/contracts/interfaces/IERC20.sol @@ -3,4 +3,4 @@ pragma solidity ^0.8.19; -import "../token/ERC20/IERC20.sol"; +import {IERC20} from "../token/ERC20/IERC20.sol"; diff --git a/contracts/interfaces/IERC20Metadata.sol b/contracts/interfaces/IERC20Metadata.sol index 061fd4a2f5c..edb680446e3 100644 --- a/contracts/interfaces/IERC20Metadata.sol +++ b/contracts/interfaces/IERC20Metadata.sol @@ -3,4 +3,4 @@ pragma solidity ^0.8.19; -import "../token/ERC20/extensions/IERC20Metadata.sol"; +import {IERC20Metadata} from "../token/ERC20/extensions/IERC20Metadata.sol"; diff --git a/contracts/interfaces/IERC2612.sol b/contracts/interfaces/IERC2612.sol index 582eea81d5e..3a1b35266c6 100644 --- a/contracts/interfaces/IERC2612.sol +++ b/contracts/interfaces/IERC2612.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 {} diff --git a/contracts/interfaces/IERC2981.sol b/contracts/interfaces/IERC2981.sol index 1b14767821b..ba0f98c99c4 100644 --- a/contracts/interfaces/IERC2981.sol +++ b/contracts/interfaces/IERC2981.sol @@ -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. diff --git a/contracts/interfaces/IERC3156.sol b/contracts/interfaces/IERC3156.sol index 280b25be127..6bd56088b9a 100644 --- a/contracts/interfaces/IERC3156.sol +++ b/contracts/interfaces/IERC3156.sol @@ -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"; diff --git a/contracts/interfaces/IERC3156FlashLender.sol b/contracts/interfaces/IERC3156FlashLender.sol index 89a486fdb05..e5dd9c523a7 100644 --- a/contracts/interfaces/IERC3156FlashLender.sol +++ b/contracts/interfaces/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 diff --git a/contracts/interfaces/IERC4626.sol b/contracts/interfaces/IERC4626.sol index 946de915598..27735f6b94f 100644 --- a/contracts/interfaces/IERC4626.sol +++ b/contracts/interfaces/IERC4626.sol @@ -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 diff --git a/contracts/interfaces/IERC4906.sol b/contracts/interfaces/IERC4906.sol index 96e709228f1..fecdb0c52d9 100644 --- a/contracts/interfaces/IERC4906.sol +++ b/contracts/interfaces/IERC4906.sol @@ -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 { diff --git a/contracts/interfaces/IERC5805.sol b/contracts/interfaces/IERC5805.sol index 3c0a3a6c6cb..6eb89919fec 100644 --- a/contracts/interfaces/IERC5805.sol +++ b/contracts/interfaces/IERC5805.sol @@ -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 {} diff --git a/contracts/interfaces/IERC721.sol b/contracts/interfaces/IERC721.sol index e840f28c78b..f086ab6fb8b 100644 --- a/contracts/interfaces/IERC721.sol +++ b/contracts/interfaces/IERC721.sol @@ -3,4 +3,4 @@ pragma solidity ^0.8.19; -import "../token/ERC721/IERC721.sol"; +import {IERC721} from "../token/ERC721/IERC721.sol"; diff --git a/contracts/interfaces/IERC721Enumerable.sol b/contracts/interfaces/IERC721Enumerable.sol index fafda599863..e5ce68d9920 100644 --- a/contracts/interfaces/IERC721Enumerable.sol +++ b/contracts/interfaces/IERC721Enumerable.sol @@ -3,4 +3,4 @@ pragma solidity ^0.8.19; -import "../token/ERC721/extensions/IERC721Enumerable.sol"; +import {IERC721Enumerable} from "../token/ERC721/extensions/IERC721Enumerable.sol"; diff --git a/contracts/interfaces/IERC721Metadata.sol b/contracts/interfaces/IERC721Metadata.sol index f14433e8d42..5b2ad5687e4 100644 --- a/contracts/interfaces/IERC721Metadata.sol +++ b/contracts/interfaces/IERC721Metadata.sol @@ -3,4 +3,4 @@ pragma solidity ^0.8.19; -import "../token/ERC721/extensions/IERC721Metadata.sol"; +import {IERC721Metadata} from "../token/ERC721/extensions/IERC721Metadata.sol"; diff --git a/contracts/interfaces/IERC721Receiver.sol b/contracts/interfaces/IERC721Receiver.sol index 9e62fa7343d..6ee3d3d8082 100644 --- a/contracts/interfaces/IERC721Receiver.sol +++ b/contracts/interfaces/IERC721Receiver.sol @@ -3,4 +3,4 @@ pragma solidity ^0.8.19; -import "../token/ERC721/IERC721Receiver.sol"; +import {IERC721Receiver} from "../token/ERC721/IERC721Receiver.sol"; diff --git a/contracts/metatx/ERC2771Context.sol b/contracts/metatx/ERC2771Context.sol index e02ffcc1936..35de9f7ba73 100644 --- a/contracts/metatx/ERC2771Context.sol +++ b/contracts/metatx/ERC2771Context.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. diff --git a/contracts/metatx/MinimalForwarder.sol b/contracts/metatx/MinimalForwarder.sol index b5267aa108b..a29414b7172 100644 --- a/contracts/metatx/MinimalForwarder.sol +++ b/contracts/metatx/MinimalForwarder.sol @@ -3,8 +3,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"; /** * @dev Simple minimal forwarder to be used together with an ERC2771 compatible contract. See {ERC2771Context}. diff --git a/contracts/mocks/AddressFnPointersMock.sol b/contracts/mocks/AddressFnPointersMock.sol index c696b3ec1d7..9d16a5263d5 100644 --- a/contracts/mocks/AddressFnPointersMock.sol +++ b/contracts/mocks/AddressFnPointersMock.sol @@ -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. diff --git a/contracts/mocks/ArraysMock.sol b/contracts/mocks/ArraysMock.sol index b341edc622d..7c049b7dfec 100644 --- a/contracts/mocks/ArraysMock.sol +++ b/contracts/mocks/ArraysMock.sol @@ -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[]; diff --git a/contracts/mocks/ContextMock.sol b/contracts/mocks/ContextMock.sol index 2e7751d0e73..fd105aa9142 100644 --- a/contracts/mocks/ContextMock.sol +++ b/contracts/mocks/ContextMock.sol @@ -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); diff --git a/contracts/mocks/DummyImplementation.sol b/contracts/mocks/DummyImplementation.sol index 71761a75561..4d3254602eb 100644 --- a/contracts/mocks/DummyImplementation.sol +++ b/contracts/mocks/DummyImplementation.sol @@ -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); diff --git a/contracts/mocks/EIP712Verifier.sol b/contracts/mocks/EIP712Verifier.sol index ea28162baf5..91a1150f680 100644 --- a/contracts/mocks/EIP712Verifier.sol +++ b/contracts/mocks/EIP712Verifier.sol @@ -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 { diff --git a/contracts/mocks/ERC1271WalletMock.sol b/contracts/mocks/ERC1271WalletMock.sol index 2bc39063630..e142fe73e1e 100644 --- a/contracts/mocks/ERC1271WalletMock.sol +++ b/contracts/mocks/ERC1271WalletMock.sol @@ -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) {} diff --git a/contracts/mocks/ERC165/ERC165InterfacesSupported.sol b/contracts/mocks/ERC165/ERC165InterfacesSupported.sol index d21d7c2d05f..c9a1df485c8 100644 --- a/contracts/mocks/ERC165/ERC165InterfacesSupported.sol +++ b/contracts/mocks/ERC165/ERC165InterfacesSupported.sol @@ -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 diff --git a/contracts/mocks/ERC165/ERC165ReturnBomb.sol b/contracts/mocks/ERC165/ERC165ReturnBomb.sol index d2a64151f8a..99f4685cfef 100644 --- a/contracts/mocks/ERC165/ERC165ReturnBomb.sol +++ b/contracts/mocks/ERC165/ERC165ReturnBomb.sol @@ -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) { diff --git a/contracts/mocks/ERC2771ContextMock.sol b/contracts/mocks/ERC2771ContextMock.sol index 8c2cb43fd88..3cdc211d8cf 100644 --- a/contracts/mocks/ERC2771ContextMock.sol +++ b/contracts/mocks/ERC2771ContextMock.sol @@ -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 { diff --git a/contracts/mocks/ERC3156FlashBorrowerMock.sol b/contracts/mocks/ERC3156FlashBorrowerMock.sol index abf836606f5..c426a7ef70e 100644 --- a/contracts/mocks/ERC3156FlashBorrowerMock.sol +++ b/contracts/mocks/ERC3156FlashBorrowerMock.sol @@ -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. diff --git a/contracts/mocks/InitializableMock.sol b/contracts/mocks/InitializableMock.sol index 513aac05290..155aaefb799 100644 --- a/contracts/mocks/InitializableMock.sol +++ b/contracts/mocks/InitializableMock.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.19; -import "../proxy/utils/Initializable.sol"; +import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @title InitializableMock diff --git a/contracts/mocks/MulticallTest.sol b/contracts/mocks/MulticallTest.sol index cf89c58df1b..89a18b3c962 100644 --- a/contracts/mocks/MulticallTest.sol +++ b/contracts/mocks/MulticallTest.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.19; -import "./token/ERC20MulticallMock.sol"; +import {ERC20MulticallMock} from "./token/ERC20MulticallMock.sol"; contract MulticallTest { function checkReturnValues( diff --git a/contracts/mocks/MultipleInheritanceInitializableMocks.sol b/contracts/mocks/MultipleInheritanceInitializableMocks.sol index cb62942cecb..d5982f0e3cc 100644 --- a/contracts/mocks/MultipleInheritanceInitializableMocks.sol +++ b/contracts/mocks/MultipleInheritanceInitializableMocks.sol @@ -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. diff --git a/contracts/mocks/PausableMock.sol b/contracts/mocks/PausableMock.sol index 85d45a3af91..56bd4f45f0a 100644 --- a/contracts/mocks/PausableMock.sol +++ b/contracts/mocks/PausableMock.sol @@ -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; diff --git a/contracts/mocks/ReentrancyAttack.sol b/contracts/mocks/ReentrancyAttack.sol index df292430133..d0ba74c31a8 100644 --- a/contracts/mocks/ReentrancyAttack.sol +++ b/contracts/mocks/ReentrancyAttack.sol @@ -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 { diff --git a/contracts/mocks/ReentrancyMock.sol b/contracts/mocks/ReentrancyMock.sol index 053e53d779e..1754c1557ec 100644 --- a/contracts/mocks/ReentrancyMock.sol +++ b/contracts/mocks/ReentrancyMock.sol @@ -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; diff --git a/contracts/mocks/RegressionImplementation.sol b/contracts/mocks/RegressionImplementation.sol index f258bbc0ed6..bfcf52c44d9 100644 --- a/contracts/mocks/RegressionImplementation.sol +++ b/contracts/mocks/RegressionImplementation.sol @@ -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; diff --git a/contracts/mocks/SingleInheritanceInitializableMocks.sol b/contracts/mocks/SingleInheritanceInitializableMocks.sol index 2b5fad4eb55..d755826d98a 100644 --- a/contracts/mocks/SingleInheritanceInitializableMocks.sol +++ b/contracts/mocks/SingleInheritanceInitializableMocks.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.19; -import "../proxy/utils/Initializable.sol"; +import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @title MigratableMockV1 diff --git a/contracts/mocks/StorageSlotMock.sol b/contracts/mocks/StorageSlotMock.sol index 62dd23d6a74..7bbd7b23235 100644 --- a/contracts/mocks/StorageSlotMock.sol +++ b/contracts/mocks/StorageSlotMock.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.19; -import "../utils/StorageSlot.sol"; +import {StorageSlot} from "../utils/StorageSlot.sol"; contract StorageSlotMock { using StorageSlot for *; diff --git a/contracts/mocks/TimelockReentrant.sol b/contracts/mocks/TimelockReentrant.sol index 803a2b0371f..de55a87f363 100644 --- a/contracts/mocks/TimelockReentrant.sol +++ b/contracts/mocks/TimelockReentrant.sol @@ -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; diff --git a/contracts/mocks/VotesMock.sol b/contracts/mocks/VotesMock.sol index 697d3344869..0bac0087c48 100644 --- a/contracts/mocks/VotesMock.sol +++ b/contracts/mocks/VotesMock.sol @@ -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; diff --git a/contracts/mocks/docs/ERC4626Fees.sol b/contracts/mocks/docs/ERC4626Fees.sol index 703e4245a47..c82279a605c 100644 --- a/contracts/mocks/docs/ERC4626Fees.sol +++ b/contracts/mocks/docs/ERC4626Fees.sol @@ -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; diff --git a/contracts/mocks/docs/governance/MyGovernor.sol b/contracts/mocks/docs/governance/MyGovernor.sol index 095523b3d59..f788f04a6b4 100644 --- a/contracts/mocks/docs/governance/MyGovernor.sol +++ b/contracts/mocks/docs/governance/MyGovernor.sol @@ -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, diff --git a/contracts/mocks/docs/governance/MyToken.sol b/contracts/mocks/docs/governance/MyToken.sol index f7707ff9d71..7a700212b35 100644 --- a/contracts/mocks/docs/governance/MyToken.sol +++ b/contracts/mocks/docs/governance/MyToken.sol @@ -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") {} diff --git a/contracts/mocks/docs/governance/MyTokenTimestampBased.sol b/contracts/mocks/docs/governance/MyTokenTimestampBased.sol index 1c688c250e0..100d10f5148 100644 --- a/contracts/mocks/docs/governance/MyTokenTimestampBased.sol +++ b/contracts/mocks/docs/governance/MyTokenTimestampBased.sol @@ -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") {} diff --git a/contracts/mocks/docs/governance/MyTokenWrapped.sol b/contracts/mocks/docs/governance/MyTokenWrapped.sol index 6637dccc3bf..94182187a2f 100644 --- a/contracts/mocks/docs/governance/MyTokenWrapped.sol +++ b/contracts/mocks/docs/governance/MyTokenWrapped.sol @@ -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( diff --git a/contracts/mocks/governance/GovernorCompatibilityBravoMock.sol b/contracts/mocks/governance/GovernorCompatibilityBravoMock.sol index 6e14a357d5b..516dd8ff251 100644 --- a/contracts/mocks/governance/GovernorCompatibilityBravoMock.sol +++ b/contracts/mocks/governance/GovernorCompatibilityBravoMock.sol @@ -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, diff --git a/contracts/mocks/governance/GovernorMock.sol b/contracts/mocks/governance/GovernorMock.sol index 9104c3f320c..64024b2ce22 100644 --- a/contracts/mocks/governance/GovernorMock.sol +++ b/contracts/mocks/governance/GovernorMock.sol @@ -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) { diff --git a/contracts/mocks/governance/GovernorPreventLateQuorumMock.sol b/contracts/mocks/governance/GovernorPreventLateQuorumMock.sol index 4c1b408e68e..785e5df5ccb 100644 --- a/contracts/mocks/governance/GovernorPreventLateQuorumMock.sol +++ b/contracts/mocks/governance/GovernorPreventLateQuorumMock.sol @@ -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, diff --git a/contracts/mocks/governance/GovernorTimelockCompoundMock.sol b/contracts/mocks/governance/GovernorTimelockCompoundMock.sol index 134d6613301..102dffae8e2 100644 --- a/contracts/mocks/governance/GovernorTimelockCompoundMock.sol +++ b/contracts/mocks/governance/GovernorTimelockCompoundMock.sol @@ -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, diff --git a/contracts/mocks/governance/GovernorTimelockControlMock.sol b/contracts/mocks/governance/GovernorTimelockControlMock.sol index 28376835a98..5c83acd6458 100644 --- a/contracts/mocks/governance/GovernorTimelockControlMock.sol +++ b/contracts/mocks/governance/GovernorTimelockControlMock.sol @@ -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, diff --git a/contracts/mocks/governance/GovernorVoteMock.sol b/contracts/mocks/governance/GovernorVoteMock.sol index 1d0722ecfa1..ecb80a4fb15 100644 --- a/contracts/mocks/governance/GovernorVoteMock.sol +++ b/contracts/mocks/governance/GovernorVoteMock.sol @@ -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) { diff --git a/contracts/mocks/governance/GovernorWithParamsMock.sol b/contracts/mocks/governance/GovernorWithParamsMock.sol index f8de837102f..f67bd4b716f 100644 --- a/contracts/mocks/governance/GovernorWithParamsMock.sol +++ b/contracts/mocks/governance/GovernorWithParamsMock.sol @@ -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); diff --git a/contracts/mocks/proxy/UUPSUpgradeableMock.sol b/contracts/mocks/proxy/UUPSUpgradeableMock.sol index 77744998b61..4333e63e8fe 100644 --- a/contracts/mocks/proxy/UUPSUpgradeableMock.sol +++ b/contracts/mocks/proxy/UUPSUpgradeableMock.sol @@ -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; diff --git a/contracts/mocks/token/ERC1155ReceiverMock.sol b/contracts/mocks/token/ERC1155ReceiverMock.sol index a5d7233cfd5..b0261733326 100644 --- a/contracts/mocks/token/ERC1155ReceiverMock.sol +++ b/contracts/mocks/token/ERC1155ReceiverMock.sol @@ -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 { diff --git a/contracts/mocks/token/ERC20ApprovalMock.sol b/contracts/mocks/token/ERC20ApprovalMock.sol index da8f51e1ecc..3caa7d0d2d0 100644 --- a/contracts/mocks/token/ERC20ApprovalMock.sol +++ b/contracts/mocks/token/ERC20ApprovalMock.sol @@ -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 { diff --git a/contracts/mocks/token/ERC20DecimalsMock.sol b/contracts/mocks/token/ERC20DecimalsMock.sol index 5699d31d20c..3ecc77f4eba 100644 --- a/contracts/mocks/token/ERC20DecimalsMock.sol +++ b/contracts/mocks/token/ERC20DecimalsMock.sol @@ -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; diff --git a/contracts/mocks/token/ERC20FlashMintMock.sol b/contracts/mocks/token/ERC20FlashMintMock.sol index 05c4db57dec..1831f53bd88 100644 --- a/contracts/mocks/token/ERC20FlashMintMock.sol +++ b/contracts/mocks/token/ERC20FlashMintMock.sol @@ -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; diff --git a/contracts/mocks/token/ERC20ForceApproveMock.sol b/contracts/mocks/token/ERC20ForceApproveMock.sol index 42b417f4188..f6f71a7e828 100644 --- a/contracts/mocks/token/ERC20ForceApproveMock.sol +++ b/contracts/mocks/token/ERC20ForceApproveMock.sol @@ -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 { diff --git a/contracts/mocks/token/ERC20Mock.sol b/contracts/mocks/token/ERC20Mock.sol index 5fb134f60dd..cd5f9d44425 100644 --- a/contracts/mocks/token/ERC20Mock.sol +++ b/contracts/mocks/token/ERC20Mock.sol @@ -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") {} diff --git a/contracts/mocks/token/ERC20MulticallMock.sol b/contracts/mocks/token/ERC20MulticallMock.sol index b8259a75ae2..87aaf89235e 100644 --- a/contracts/mocks/token/ERC20MulticallMock.sol +++ b/contracts/mocks/token/ERC20MulticallMock.sol @@ -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 {} diff --git a/contracts/mocks/token/ERC20NoReturnMock.sol b/contracts/mocks/token/ERC20NoReturnMock.sol index 7d597ad894d..e7f234cff9d 100644 --- a/contracts/mocks/token/ERC20NoReturnMock.sol +++ b/contracts/mocks/token/ERC20NoReturnMock.sol @@ -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) { diff --git a/contracts/mocks/token/ERC20PermitNoRevertMock.sol b/contracts/mocks/token/ERC20PermitNoRevertMock.sol index 510176cf50f..23395d75d46 100644 --- a/contracts/mocks/token/ERC20PermitNoRevertMock.sol +++ b/contracts/mocks/token/ERC20PermitNoRevertMock.sol @@ -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( diff --git a/contracts/mocks/token/ERC20Reentrant.sol b/contracts/mocks/token/ERC20Reentrant.sol index 00ba7426087..063e9f3d56e 100644 --- a/contracts/mocks/token/ERC20Reentrant.sol +++ b/contracts/mocks/token/ERC20Reentrant.sol @@ -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 { diff --git a/contracts/mocks/token/ERC20ReturnFalseMock.sol b/contracts/mocks/token/ERC20ReturnFalseMock.sol index 763a120e9b4..e8014b87b22 100644 --- a/contracts/mocks/token/ERC20ReturnFalseMock.sol +++ b/contracts/mocks/token/ERC20ReturnFalseMock.sol @@ -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) { diff --git a/contracts/mocks/token/ERC20VotesLegacyMock.sol b/contracts/mocks/token/ERC20VotesLegacyMock.sol index 88ba8423616..6a207851085 100644 --- a/contracts/mocks/token/ERC20VotesLegacyMock.sol +++ b/contracts/mocks/token/ERC20VotesLegacyMock.sol @@ -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 diff --git a/contracts/mocks/token/ERC4626LimitsMock.sol b/contracts/mocks/token/ERC4626LimitsMock.sol index a47826bb864..fe5d724c8e3 100644 --- a/contracts/mocks/token/ERC4626LimitsMock.sol +++ b/contracts/mocks/token/ERC4626LimitsMock.sol @@ -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; diff --git a/contracts/mocks/token/ERC4626Mock.sol b/contracts/mocks/token/ERC4626Mock.sol index 3713e07918c..151606ca54e 100644 --- a/contracts/mocks/token/ERC4626Mock.sol +++ b/contracts/mocks/token/ERC4626Mock.sol @@ -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)) {} diff --git a/contracts/mocks/token/ERC4626OffsetMock.sol b/contracts/mocks/token/ERC4626OffsetMock.sol index b3c31cdd28a..b1dac7d5d2d 100644 --- a/contracts/mocks/token/ERC4626OffsetMock.sol +++ b/contracts/mocks/token/ERC4626OffsetMock.sol @@ -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; diff --git a/contracts/mocks/token/ERC4646FeesMock.sol b/contracts/mocks/token/ERC4646FeesMock.sol index 4c6c3c66258..f8fde293c50 100644 --- a/contracts/mocks/token/ERC4646FeesMock.sol +++ b/contracts/mocks/token/ERC4646FeesMock.sol @@ -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; diff --git a/contracts/mocks/token/ERC721ConsecutiveEnumerableMock.sol b/contracts/mocks/token/ERC721ConsecutiveEnumerableMock.sol index a2ee8199a0f..081b8d99dee 100644 --- a/contracts/mocks/token/ERC721ConsecutiveEnumerableMock.sol +++ b/contracts/mocks/token/ERC721ConsecutiveEnumerableMock.sol @@ -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( diff --git a/contracts/mocks/token/ERC721ConsecutiveMock.sol b/contracts/mocks/token/ERC721ConsecutiveMock.sol index 4aae388e094..166959e922b 100644 --- a/contracts/mocks/token/ERC721ConsecutiveMock.sol +++ b/contracts/mocks/token/ERC721ConsecutiveMock.sol @@ -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 diff --git a/contracts/mocks/token/ERC721ReceiverMock.sol b/contracts/mocks/token/ERC721ReceiverMock.sol index 41661317464..f1c842e491a 100644 --- a/contracts/mocks/token/ERC721ReceiverMock.sol +++ b/contracts/mocks/token/ERC721ReceiverMock.sol @@ -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 { diff --git a/contracts/mocks/token/ERC721URIStorageMock.sol b/contracts/mocks/token/ERC721URIStorageMock.sol index 1808e47f736..569a1c0f4f4 100644 --- a/contracts/mocks/token/ERC721URIStorageMock.sol +++ b/contracts/mocks/token/ERC721URIStorageMock.sol @@ -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; diff --git a/contracts/mocks/token/VotesTimestamp.sol b/contracts/mocks/token/VotesTimestamp.sol index 7e3d8ca6d17..b54dbda9752 100644 --- a/contracts/mocks/token/VotesTimestamp.sol +++ b/contracts/mocks/token/VotesTimestamp.sol @@ -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) { diff --git a/contracts/proxy/ERC1967/ERC1967Proxy.sol b/contracts/proxy/ERC1967/ERC1967Proxy.sol index 5a752f13d8b..e7c90c70691 100644 --- a/contracts/proxy/ERC1967/ERC1967Proxy.sol +++ b/contracts/proxy/ERC1967/ERC1967Proxy.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "../Proxy.sol"; -import "./ERC1967Utils.sol"; +import {Proxy} from "../Proxy.sol"; +import {ERC1967Utils} from "./ERC1967Utils.sol"; /** * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an diff --git a/contracts/proxy/ERC1967/ERC1967Utils.sol b/contracts/proxy/ERC1967/ERC1967Utils.sol index c244982bf31..843fa658449 100644 --- a/contracts/proxy/ERC1967/ERC1967Utils.sol +++ b/contracts/proxy/ERC1967/ERC1967Utils.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.20; -import "../beacon/IBeacon.sol"; -import "../../utils/Address.sol"; -import "../../utils/StorageSlot.sol"; +import {IBeacon} from "../beacon/IBeacon.sol"; +import {Address} from "../../utils/Address.sol"; +import {StorageSlot} from "../../utils/StorageSlot.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for diff --git a/contracts/proxy/beacon/BeaconProxy.sol b/contracts/proxy/beacon/BeaconProxy.sol index dc6b5c90b67..57883b692b2 100644 --- a/contracts/proxy/beacon/BeaconProxy.sol +++ b/contracts/proxy/beacon/BeaconProxy.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.19; -import "./IBeacon.sol"; -import "../Proxy.sol"; -import "../ERC1967/ERC1967Utils.sol"; +import {IBeacon} from "./IBeacon.sol"; +import {Proxy} from "../Proxy.sol"; +import {ERC1967Utils} from "../ERC1967/ERC1967Utils.sol"; /** * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. diff --git a/contracts/proxy/beacon/UpgradeableBeacon.sol b/contracts/proxy/beacon/UpgradeableBeacon.sol index c5e64ea5958..0c72ddf6367 100644 --- a/contracts/proxy/beacon/UpgradeableBeacon.sol +++ b/contracts/proxy/beacon/UpgradeableBeacon.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "./IBeacon.sol"; -import "../../access/Ownable.sol"; +import {IBeacon} from "./IBeacon.sol"; +import {Ownable} from "../../access/Ownable.sol"; /** * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their diff --git a/contracts/proxy/transparent/ProxyAdmin.sol b/contracts/proxy/transparent/ProxyAdmin.sol index e8578a58561..344c942f242 100644 --- a/contracts/proxy/transparent/ProxyAdmin.sol +++ b/contracts/proxy/transparent/ProxyAdmin.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "./TransparentUpgradeableProxy.sol"; -import "../../access/Ownable.sol"; +import {ITransparentUpgradeableProxy, TransparentUpgradeableProxy} from "./TransparentUpgradeableProxy.sol"; +import {Ownable} from "../../access/Ownable.sol"; /** * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an diff --git a/contracts/proxy/transparent/TransparentUpgradeableProxy.sol b/contracts/proxy/transparent/TransparentUpgradeableProxy.sol index 71ce665d0c1..3d6e11f38a3 100644 --- a/contracts/proxy/transparent/TransparentUpgradeableProxy.sol +++ b/contracts/proxy/transparent/TransparentUpgradeableProxy.sol @@ -3,8 +3,9 @@ pragma solidity ^0.8.19; -import "../ERC1967/ERC1967Proxy.sol"; -import "../../interfaces/IERC1967.sol"; +import {ERC1967Utils} from "../ERC1967/ERC1967Utils.sol"; +import {ERC1967Proxy} from "../ERC1967/ERC1967Proxy.sol"; +import {IERC1967} from "../../interfaces/IERC1967.sol"; /** * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy} diff --git a/contracts/proxy/utils/Initializable.sol b/contracts/proxy/utils/Initializable.sol index 3ae5e4a6575..86e99531bec 100644 --- a/contracts/proxy/utils/Initializable.sol +++ b/contracts/proxy/utils/Initializable.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../../utils/Address.sol"; +import {Address} from "../../utils/Address.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed diff --git a/contracts/proxy/utils/UUPSUpgradeable.sol b/contracts/proxy/utils/UUPSUpgradeable.sol index 07de178bc4c..7d1515bbb7c 100644 --- a/contracts/proxy/utils/UUPSUpgradeable.sol +++ b/contracts/proxy/utils/UUPSUpgradeable.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "../../interfaces/draft-IERC1822.sol"; -import "../ERC1967/ERC1967Utils.sol"; +import {IERC1822Proxiable} from "../../interfaces/draft-IERC1822.sol"; +import {ERC1967Utils} from "../ERC1967/ERC1967Utils.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an diff --git a/contracts/security/Pausable.sol b/contracts/security/Pausable.sol index dc0afa66339..7a54b251121 100644 --- a/contracts/security/Pausable.sol +++ b/contracts/security/Pausable.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../utils/Context.sol"; +import {Context} from "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop diff --git a/contracts/token/ERC1155/ERC1155.sol b/contracts/token/ERC1155/ERC1155.sol index e4bd74826e6..9d70714fa4a 100644 --- a/contracts/token/ERC1155/ERC1155.sol +++ b/contracts/token/ERC1155/ERC1155.sol @@ -3,13 +3,13 @@ pragma solidity ^0.8.19; -import "./IERC1155.sol"; -import "./IERC1155Receiver.sol"; -import "./extensions/IERC1155MetadataURI.sol"; -import "../../utils/Context.sol"; -import "../../utils/introspection/ERC165.sol"; -import "../../utils/Arrays.sol"; -import "../../interfaces/draft-IERC6093.sol"; +import {IERC1155} from "./IERC1155.sol"; +import {IERC1155Receiver} from "./IERC1155Receiver.sol"; +import {IERC1155MetadataURI} from "./extensions/IERC1155MetadataURI.sol"; +import {Context} from "../../utils/Context.sol"; +import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; +import {Arrays} from "../../utils/Arrays.sol"; +import {IERC1155Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of the basic standard multi-token. diff --git a/contracts/token/ERC1155/IERC1155.sol b/contracts/token/ERC1155/IERC1155.sol index 16b2b71a3fa..c450eec2fd6 100644 --- a/contracts/token/ERC1155/IERC1155.sol +++ b/contracts/token/ERC1155/IERC1155.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../../utils/introspection/IERC165.sol"; +import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the diff --git a/contracts/token/ERC1155/IERC1155Receiver.sol b/contracts/token/ERC1155/IERC1155Receiver.sol index a272f61b0c4..04ef783f185 100644 --- a/contracts/token/ERC1155/IERC1155Receiver.sol +++ b/contracts/token/ERC1155/IERC1155Receiver.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../../utils/introspection/IERC165.sol"; +import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ diff --git a/contracts/token/ERC1155/extensions/ERC1155Burnable.sol b/contracts/token/ERC1155/extensions/ERC1155Burnable.sol index d7bee05d924..5ebfcf6c408 100644 --- a/contracts/token/ERC1155/extensions/ERC1155Burnable.sol +++ b/contracts/token/ERC1155/extensions/ERC1155Burnable.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../ERC1155.sol"; +import {ERC1155} from "../ERC1155.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their diff --git a/contracts/token/ERC1155/extensions/ERC1155Pausable.sol b/contracts/token/ERC1155/extensions/ERC1155Pausable.sol index f8357062c28..05aa8a780cd 100644 --- a/contracts/token/ERC1155/extensions/ERC1155Pausable.sol +++ b/contracts/token/ERC1155/extensions/ERC1155Pausable.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "../ERC1155.sol"; -import "../../../security/Pausable.sol"; +import {ERC1155} from "../ERC1155.sol"; +import {Pausable} from "../../../security/Pausable.sol"; /** * @dev ERC1155 token with pausable token transfers, minting and burning. diff --git a/contracts/token/ERC1155/extensions/ERC1155Supply.sol b/contracts/token/ERC1155/extensions/ERC1155Supply.sol index f32fbb74bb7..eefa0ebf7d4 100644 --- a/contracts/token/ERC1155/extensions/ERC1155Supply.sol +++ b/contracts/token/ERC1155/extensions/ERC1155Supply.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../ERC1155.sol"; +import {ERC1155} from "../ERC1155.sol"; /** * @dev Extension of ERC1155 that adds tracking of total supply per id. diff --git a/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol b/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol index 79782a42b4e..303b452b8db 100644 --- a/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol +++ b/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "../../../utils/Strings.sol"; -import "../ERC1155.sol"; +import {Strings} from "../../../utils/Strings.sol"; +import {ERC1155} from "../ERC1155.sol"; /** * @dev ERC1155 token with storage based token URI management. diff --git a/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol b/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol index 2c998995e87..88462ef87e5 100644 --- a/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol +++ b/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../IERC1155.sol"; +import {IERC1155} from "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined diff --git a/contracts/token/ERC1155/utils/ERC1155Holder.sol b/contracts/token/ERC1155/utils/ERC1155Holder.sol index d24a1a53a03..87c42b02f0a 100644 --- a/contracts/token/ERC1155/utils/ERC1155Holder.sol +++ b/contracts/token/ERC1155/utils/ERC1155Holder.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "./ERC1155Receiver.sol"; +import {ERC1155Receiver} from "./ERC1155Receiver.sol"; /** * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens. diff --git a/contracts/token/ERC1155/utils/ERC1155Receiver.sol b/contracts/token/ERC1155/utils/ERC1155Receiver.sol index 6fb21491f40..cf948ced711 100644 --- a/contracts/token/ERC1155/utils/ERC1155Receiver.sol +++ b/contracts/token/ERC1155/utils/ERC1155Receiver.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "../IERC1155Receiver.sol"; -import "../../../utils/introspection/ERC165.sol"; +import {IERC1155Receiver} from "../IERC1155Receiver.sol"; +import {IERC165, ERC165} from "../../../utils/introspection/ERC165.sol"; /** * @dev _Available since v3.1._ diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index 5ddebf22b25..d43880da6cc 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -3,10 +3,10 @@ pragma solidity ^0.8.19; -import "./IERC20.sol"; -import "./extensions/IERC20Metadata.sol"; -import "../../utils/Context.sol"; -import "../../interfaces/draft-IERC6093.sol"; +import {IERC20} from "./IERC20.sol"; +import {IERC20Metadata} from "./extensions/IERC20Metadata.sol"; +import {Context} from "../../utils/Context.sol"; +import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of the {IERC20} interface. diff --git a/contracts/token/ERC20/extensions/ERC20Burnable.sol b/contracts/token/ERC20/extensions/ERC20Burnable.sol index cae186b64a8..2a6d28963af 100644 --- a/contracts/token/ERC20/extensions/ERC20Burnable.sol +++ b/contracts/token/ERC20/extensions/ERC20Burnable.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "../ERC20.sol"; -import "../../../utils/Context.sol"; +import {ERC20} from "../ERC20.sol"; +import {Context} from "../../../utils/Context.sol"; /** * @dev Extension of {ERC20} that allows token holders to destroy both their own diff --git a/contracts/token/ERC20/extensions/ERC20Capped.sol b/contracts/token/ERC20/extensions/ERC20Capped.sol index 41e9ce5cf90..98ec71443f0 100644 --- a/contracts/token/ERC20/extensions/ERC20Capped.sol +++ b/contracts/token/ERC20/extensions/ERC20Capped.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../ERC20.sol"; +import {ERC20} from "../ERC20.sol"; /** * @dev Extension of {ERC20} that adds a cap to the supply of tokens. diff --git a/contracts/token/ERC20/extensions/ERC20FlashMint.sol b/contracts/token/ERC20/extensions/ERC20FlashMint.sol index 09c20baccb2..b63c75f71c0 100644 --- a/contracts/token/ERC20/extensions/ERC20FlashMint.sol +++ b/contracts/token/ERC20/extensions/ERC20FlashMint.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.19; -import "../../../interfaces/IERC3156FlashBorrower.sol"; -import "../../../interfaces/IERC3156FlashLender.sol"; -import "../ERC20.sol"; +import {IERC3156FlashBorrower} from "../../../interfaces/IERC3156FlashBorrower.sol"; +import {IERC3156FlashLender} from "../../../interfaces/IERC3156FlashLender.sol"; +import {ERC20} from "../ERC20.sol"; /** * @dev Implementation of the ERC3156 Flash loans extension, as defined in diff --git a/contracts/token/ERC20/extensions/ERC20Pausable.sol b/contracts/token/ERC20/extensions/ERC20Pausable.sol index 5ef50f9c6b0..59f451639db 100644 --- a/contracts/token/ERC20/extensions/ERC20Pausable.sol +++ b/contracts/token/ERC20/extensions/ERC20Pausable.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "../ERC20.sol"; -import "../../../security/Pausable.sol"; +import {ERC20} from "../ERC20.sol"; +import {Pausable} from "../../../security/Pausable.sol"; /** * @dev ERC20 token with pausable token transfers, minting and burning. diff --git a/contracts/token/ERC20/extensions/ERC20Permit.sol b/contracts/token/ERC20/extensions/ERC20Permit.sol index 4378eb7c132..8778f4baf16 100644 --- a/contracts/token/ERC20/extensions/ERC20Permit.sol +++ b/contracts/token/ERC20/extensions/ERC20Permit.sol @@ -3,11 +3,11 @@ pragma solidity ^0.8.19; -import "./IERC20Permit.sol"; -import "../ERC20.sol"; -import "../../../utils/cryptography/ECDSA.sol"; -import "../../../utils/cryptography/EIP712.sol"; -import "../../../utils/Nonces.sol"; +import {IERC20Permit} from "./IERC20Permit.sol"; +import {ERC20} from "../ERC20.sol"; +import {ECDSA} from "../../../utils/cryptography/ECDSA.sol"; +import {EIP712} from "../../../utils/cryptography/EIP712.sol"; +import {Nonces} from "../../../utils/Nonces.sol"; /** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in diff --git a/contracts/token/ERC20/extensions/ERC20Votes.sol b/contracts/token/ERC20/extensions/ERC20Votes.sol index 98f798efee1..db5f71241d3 100644 --- a/contracts/token/ERC20/extensions/ERC20Votes.sol +++ b/contracts/token/ERC20/extensions/ERC20Votes.sol @@ -3,9 +3,10 @@ pragma solidity ^0.8.19; -import "../ERC20.sol"; -import "../../../governance/utils/Votes.sol"; -import "../../../utils/math/SafeCast.sol"; +import {ERC20} from "../ERC20.sol"; +import {Votes} from "../../../governance/utils/Votes.sol"; +import {SafeCast} from "../../../utils/math/SafeCast.sol"; +import {Checkpoints} from "../../../utils/structs/Checkpoints.sol"; /** * @dev Extension of ERC20 to support Compound-like voting and delegation. This version is more generic than Compound's, diff --git a/contracts/token/ERC20/extensions/ERC20Wrapper.sol b/contracts/token/ERC20/extensions/ERC20Wrapper.sol index 389965e9c10..2cbff622324 100644 --- a/contracts/token/ERC20/extensions/ERC20Wrapper.sol +++ b/contracts/token/ERC20/extensions/ERC20Wrapper.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "../ERC20.sol"; -import "../utils/SafeERC20.sol"; +import {IERC20, IERC20Metadata, ERC20} from "../ERC20.sol"; +import {SafeERC20} from "../utils/SafeERC20.sol"; /** * @dev Extension of the ERC20 token contract to support token wrapping. diff --git a/contracts/token/ERC20/extensions/ERC4626.sol b/contracts/token/ERC20/extensions/ERC4626.sol index 9ea6789f774..cb5e03da83a 100644 --- a/contracts/token/ERC20/extensions/ERC4626.sol +++ b/contracts/token/ERC20/extensions/ERC4626.sol @@ -3,10 +3,10 @@ pragma solidity ^0.8.19; -import "../ERC20.sol"; -import "../utils/SafeERC20.sol"; -import "../../../interfaces/IERC4626.sol"; -import "../../../utils/math/Math.sol"; +import {IERC20, IERC20Metadata, ERC20} from "../ERC20.sol"; +import {SafeERC20} from "../utils/SafeERC20.sol"; +import {IERC4626} from "../../../interfaces/IERC4626.sol"; +import {Math} from "../../../utils/math/Math.sol"; /** * @dev Implementation of the ERC4626 "Tokenized Vault Standard" as defined in diff --git a/contracts/token/ERC20/extensions/IERC20Metadata.sol b/contracts/token/ERC20/extensions/IERC20Metadata.sol index 1cf7e0b2edf..bdfe811458b 100644 --- a/contracts/token/ERC20/extensions/IERC20Metadata.sol +++ b/contracts/token/ERC20/extensions/IERC20Metadata.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../IERC20.sol"; +import {IERC20} from "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. diff --git a/contracts/token/ERC20/utils/SafeERC20.sol b/contracts/token/ERC20/utils/SafeERC20.sol index 599307e7f73..0ec21573bdf 100644 --- a/contracts/token/ERC20/utils/SafeERC20.sol +++ b/contracts/token/ERC20/utils/SafeERC20.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.19; -import "../IERC20.sol"; -import "../extensions/IERC20Permit.sol"; -import "../../../utils/Address.sol"; +import {IERC20} from "../IERC20.sol"; +import {IERC20Permit} from "../extensions/IERC20Permit.sol"; +import {Address} from "../../../utils/Address.sol"; /** * @title SafeERC20 diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index 21ed95813a6..4232c616eb7 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -3,13 +3,13 @@ pragma solidity ^0.8.19; -import "./IERC721.sol"; -import "./IERC721Receiver.sol"; -import "./extensions/IERC721Metadata.sol"; -import "../../utils/Context.sol"; -import "../../utils/Strings.sol"; -import "../../utils/introspection/ERC165.sol"; -import "../../interfaces/draft-IERC6093.sol"; +import {IERC721} from "./IERC721.sol"; +import {IERC721Receiver} from "./IERC721Receiver.sol"; +import {IERC721Metadata} from "./extensions/IERC721Metadata.sol"; +import {Context} from "../../utils/Context.sol"; +import {Strings} from "../../utils/Strings.sol"; +import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; +import {IERC721Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including diff --git a/contracts/token/ERC721/IERC721.sol b/contracts/token/ERC721/IERC721.sol index ba4c108ef55..3b2db67cb97 100644 --- a/contracts/token/ERC721/IERC721.sol +++ b/contracts/token/ERC721/IERC721.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../../utils/introspection/IERC165.sol"; +import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. diff --git a/contracts/token/ERC721/extensions/ERC721Burnable.sol b/contracts/token/ERC721/extensions/ERC721Burnable.sol index 217f039cad6..607265328ec 100644 --- a/contracts/token/ERC721/extensions/ERC721Burnable.sol +++ b/contracts/token/ERC721/extensions/ERC721Burnable.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "../ERC721.sol"; -import "../../../utils/Context.sol"; +import {ERC721} from "../ERC721.sol"; +import {Context} from "../../../utils/Context.sol"; /** * @title ERC721 Burnable Token diff --git a/contracts/token/ERC721/extensions/ERC721Consecutive.sol b/contracts/token/ERC721/extensions/ERC721Consecutive.sol index f1308cdab1a..e25edfcd907 100644 --- a/contracts/token/ERC721/extensions/ERC721Consecutive.sol +++ b/contracts/token/ERC721/extensions/ERC721Consecutive.sol @@ -3,10 +3,10 @@ pragma solidity ^0.8.19; -import "../ERC721.sol"; -import "../../../interfaces/IERC2309.sol"; -import "../../../utils/structs/BitMaps.sol"; -import "../../../utils/structs/Checkpoints.sol"; +import {ERC721} from "../ERC721.sol"; +import {IERC2309} from "../../../interfaces/IERC2309.sol"; +import {BitMaps} from "../../../utils/structs/BitMaps.sol"; +import {Checkpoints} from "../../../utils/structs/Checkpoints.sol"; /** * @dev Implementation of the ERC2309 "Consecutive Transfer Extension" as defined in diff --git a/contracts/token/ERC721/extensions/ERC721Enumerable.sol b/contracts/token/ERC721/extensions/ERC721Enumerable.sol index 18e2ba5d626..2e33123b6cf 100644 --- a/contracts/token/ERC721/extensions/ERC721Enumerable.sol +++ b/contracts/token/ERC721/extensions/ERC721Enumerable.sol @@ -3,8 +3,9 @@ pragma solidity ^0.8.19; -import "../ERC721.sol"; -import "./IERC721Enumerable.sol"; +import {ERC721} from "../ERC721.sol"; +import {IERC721Enumerable} from "./IERC721Enumerable.sol"; +import {IERC165} from "../../../utils/introspection/ERC165.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds enumerability diff --git a/contracts/token/ERC721/extensions/ERC721Pausable.sol b/contracts/token/ERC721/extensions/ERC721Pausable.sol index a9472c5dc84..a4effc549de 100644 --- a/contracts/token/ERC721/extensions/ERC721Pausable.sol +++ b/contracts/token/ERC721/extensions/ERC721Pausable.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "../ERC721.sol"; -import "../../../security/Pausable.sol"; +import {ERC721} from "../ERC721.sol"; +import {Pausable} from "../../../security/Pausable.sol"; /** * @dev ERC721 token with pausable token transfers, minting and burning. diff --git a/contracts/token/ERC721/extensions/ERC721Royalty.sol b/contracts/token/ERC721/extensions/ERC721Royalty.sol index 7d6ef6c04e7..b4518dc2482 100644 --- a/contracts/token/ERC721/extensions/ERC721Royalty.sol +++ b/contracts/token/ERC721/extensions/ERC721Royalty.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.19; -import "../ERC721.sol"; -import "../../common/ERC2981.sol"; -import "../../../utils/introspection/ERC165.sol"; +import {ERC721} from "../ERC721.sol"; +import {ERC2981} from "../../common/ERC2981.sol"; +import {ERC165} from "../../../utils/introspection/ERC165.sol"; /** * @dev Extension of ERC721 with the ERC2981 NFT Royalty Standard, a standardized way to retrieve royalty payment diff --git a/contracts/token/ERC721/extensions/ERC721URIStorage.sol b/contracts/token/ERC721/extensions/ERC721URIStorage.sol index ae625fc2890..737d28e27f2 100644 --- a/contracts/token/ERC721/extensions/ERC721URIStorage.sol +++ b/contracts/token/ERC721/extensions/ERC721URIStorage.sol @@ -3,8 +3,10 @@ pragma solidity ^0.8.19; -import "../ERC721.sol"; -import "../../../interfaces/IERC4906.sol"; +import {ERC721} from "../ERC721.sol"; +import {Strings} from "../../../utils/Strings.sol"; +import {IERC4906} from "../../../interfaces/IERC4906.sol"; +import {IERC165} from "../../../interfaces/IERC165.sol"; /** * @dev ERC721 token with storage based token URI management. diff --git a/contracts/token/ERC721/extensions/ERC721Votes.sol b/contracts/token/ERC721/extensions/ERC721Votes.sol index 89b2e073cee..1e694e4c728 100644 --- a/contracts/token/ERC721/extensions/ERC721Votes.sol +++ b/contracts/token/ERC721/extensions/ERC721Votes.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "../ERC721.sol"; -import "../../../governance/utils/Votes.sol"; +import {ERC721} from "../ERC721.sol"; +import {Votes} from "../../../governance/utils/Votes.sol"; /** * @dev Extension of ERC721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts diff --git a/contracts/token/ERC721/extensions/ERC721Wrapper.sol b/contracts/token/ERC721/extensions/ERC721Wrapper.sol index 47a42c1f004..b8c396c3e34 100644 --- a/contracts/token/ERC721/extensions/ERC721Wrapper.sol +++ b/contracts/token/ERC721/extensions/ERC721Wrapper.sol @@ -3,7 +3,8 @@ pragma solidity ^0.8.19; -import "../ERC721.sol"; +import {IERC721, ERC721} from "../ERC721.sol"; +import {IERC721Receiver} from "../IERC721Receiver.sol"; /** * @dev Extension of the ERC721 token contract to support token wrapping. diff --git a/contracts/token/ERC721/extensions/IERC721Enumerable.sol b/contracts/token/ERC721/extensions/IERC721Enumerable.sol index d5fe6330c06..75b04581f7a 100644 --- a/contracts/token/ERC721/extensions/IERC721Enumerable.sol +++ b/contracts/token/ERC721/extensions/IERC721Enumerable.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../IERC721.sol"; +import {IERC721} from "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension diff --git a/contracts/token/ERC721/extensions/IERC721Metadata.sol b/contracts/token/ERC721/extensions/IERC721Metadata.sol index 0b085812c59..3d2846231b4 100644 --- a/contracts/token/ERC721/extensions/IERC721Metadata.sol +++ b/contracts/token/ERC721/extensions/IERC721Metadata.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../IERC721.sol"; +import {IERC721} from "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension diff --git a/contracts/token/ERC721/utils/ERC721Holder.sol b/contracts/token/ERC721/utils/ERC721Holder.sol index a3ee8b5f0ca..e1fad1e2380 100644 --- a/contracts/token/ERC721/utils/ERC721Holder.sol +++ b/contracts/token/ERC721/utils/ERC721Holder.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../IERC721Receiver.sol"; +import {IERC721Receiver} from "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. diff --git a/contracts/token/common/ERC2981.sol b/contracts/token/common/ERC2981.sol index 21869ee255b..b9183e34e54 100644 --- a/contracts/token/common/ERC2981.sol +++ b/contracts/token/common/ERC2981.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "../../interfaces/IERC2981.sol"; -import "../../utils/introspection/ERC165.sol"; +import {IERC2981} from "../../interfaces/IERC2981.sol"; +import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. diff --git a/contracts/utils/Arrays.sol b/contracts/utils/Arrays.sol index f4ef45645a8..7dbc86fdd52 100644 --- a/contracts/utils/Arrays.sol +++ b/contracts/utils/Arrays.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "./StorageSlot.sol"; -import "./math/Math.sol"; +import {StorageSlot} from "./StorageSlot.sol"; +import {Math} from "./math/Math.sol"; /** * @dev Collection of functions related to array types. diff --git a/contracts/utils/Multicall.sol b/contracts/utils/Multicall.sol index 8e0ef81958c..fed9844c420 100644 --- a/contracts/utils/Multicall.sol +++ b/contracts/utils/Multicall.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "./Address.sol"; +import {Address} from "./Address.sol"; /** * @dev Provides a function to batch together multiple calls in a single external call. diff --git a/contracts/utils/ShortStrings.sol b/contracts/utils/ShortStrings.sol index a6cb1e620cf..f90ccd77abd 100644 --- a/contracts/utils/ShortStrings.sol +++ b/contracts/utils/ShortStrings.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "./StorageSlot.sol"; +import {StorageSlot} from "./StorageSlot.sol"; // | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | // | length | 0x BB | diff --git a/contracts/utils/Strings.sol b/contracts/utils/Strings.sol index afbf463d1a4..fd8d6622931 100644 --- a/contracts/utils/Strings.sol +++ b/contracts/utils/Strings.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "./math/Math.sol"; -import "./math/SignedMath.sol"; +import {Math} from "./math/Math.sol"; +import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. diff --git a/contracts/utils/cryptography/ECDSA.sol b/contracts/utils/cryptography/ECDSA.sol index b8f1affee7a..5e67a75915f 100644 --- a/contracts/utils/cryptography/ECDSA.sol +++ b/contracts/utils/cryptography/ECDSA.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "../Strings.sol"; +import {Strings} from "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. diff --git a/contracts/utils/cryptography/EIP712.sol b/contracts/utils/cryptography/EIP712.sol index 2628014f12c..711aaba8fdf 100644 --- a/contracts/utils/cryptography/EIP712.sol +++ b/contracts/utils/cryptography/EIP712.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.19; -import "./ECDSA.sol"; -import "../ShortStrings.sol"; -import "../../interfaces/IERC5267.sol"; +import {ECDSA} from "./ECDSA.sol"; +import {ShortStrings, ShortString} from "../ShortStrings.sol"; +import {IERC5267} from "../../interfaces/IERC5267.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. diff --git a/contracts/utils/cryptography/SignatureChecker.sol b/contracts/utils/cryptography/SignatureChecker.sol index 25fdee5b31f..dfc512b397b 100644 --- a/contracts/utils/cryptography/SignatureChecker.sol +++ b/contracts/utils/cryptography/SignatureChecker.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.19; -import "./ECDSA.sol"; -import "../../interfaces/IERC1271.sol"; +import {ECDSA} from "./ECDSA.sol"; +import {IERC1271} from "../../interfaces/IERC1271.sol"; /** * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA diff --git a/contracts/utils/introspection/ERC165.sol b/contracts/utils/introspection/ERC165.sol index 111913007ea..56fe1b80a0f 100644 --- a/contracts/utils/introspection/ERC165.sol +++ b/contracts/utils/introspection/ERC165.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "./IERC165.sol"; +import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. diff --git a/contracts/utils/introspection/ERC165Checker.sol b/contracts/utils/introspection/ERC165Checker.sol index c27b2f17de0..d614c675581 100644 --- a/contracts/utils/introspection/ERC165Checker.sol +++ b/contracts/utils/introspection/ERC165Checker.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; -import "./IERC165.sol"; +import {IERC165} from "./IERC165.sol"; /** * @dev Library used to query support of an interface declared via {IERC165}. diff --git a/contracts/utils/structs/Checkpoints.sol b/contracts/utils/structs/Checkpoints.sol index 7608d787ec3..47ad91bbfe3 100644 --- a/contracts/utils/structs/Checkpoints.sol +++ b/contracts/utils/structs/Checkpoints.sol @@ -4,8 +4,8 @@ pragma solidity ^0.8.19; -import "../math/Math.sol"; -import "../math/SafeCast.sol"; +import {Math} from "../math/Math.sol"; +import {SafeCast} from "../math/SafeCast.sol"; /** * @dev This library defines the `History` struct, for checkpointing values as they change at different points in diff --git a/contracts/utils/structs/DoubleEndedQueue.sol b/contracts/utils/structs/DoubleEndedQueue.sol index 69db700407e..5183bad8c64 100644 --- a/contracts/utils/structs/DoubleEndedQueue.sol +++ b/contracts/utils/structs/DoubleEndedQueue.sol @@ -2,7 +2,7 @@ // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/DoubleEndedQueue.sol) pragma solidity ^0.8.19; -import "../math/SafeCast.sol"; +import {SafeCast} from "../math/SafeCast.sol"; /** * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of diff --git a/contracts/utils/structs/EnumerableMap.sol b/contracts/utils/structs/EnumerableMap.sol index a474e82b3e0..c0ad9a2c9ff 100644 --- a/contracts/utils/structs/EnumerableMap.sol +++ b/contracts/utils/structs/EnumerableMap.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.19; -import "./EnumerableSet.sol"; +import {EnumerableSet} from "./EnumerableSet.sol"; /** * @dev Library for managing an enumerable variant of Solidity's diff --git a/test/governance/Governor.t.sol b/test/governance/Governor.t.sol index 43c4c5ddd9e..1732fa2f910 100644 --- a/test/governance/Governor.t.sol +++ b/test/governance/Governor.t.sol @@ -2,9 +2,9 @@ pragma solidity ^0.8.19; -import "forge-std/Test.sol"; -import "../../contracts/utils/Strings.sol"; -import "../../contracts/governance/Governor.sol"; +import {Test} from "forge-std/Test.sol"; +import {Strings} from "../../contracts/utils/Strings.sol"; +import {Governor} from "../../contracts/governance/Governor.sol"; contract GovernorInternalTest is Test, Governor { constructor() Governor("") {} diff --git a/test/token/ERC721/extensions/ERC721Consecutive.t.sol b/test/token/ERC721/extensions/ERC721Consecutive.t.sol index 896a5ef5719..11c38302290 100644 --- a/test/token/ERC721/extensions/ERC721Consecutive.t.sol +++ b/test/token/ERC721/extensions/ERC721Consecutive.t.sol @@ -4,8 +4,8 @@ pragma solidity ^0.8.19; // solhint-disable func-name-mixedcase -import "../../../../contracts/token/ERC721/extensions/ERC721Consecutive.sol"; -import "forge-std/Test.sol"; +import {ERC721Consecutive} from "../../../../contracts/token/ERC721/extensions/ERC721Consecutive.sol"; +import {Test} from "forge-std/Test.sol"; function toSingleton(address account) pure returns (address[] memory) { address[] memory accounts = new address[](1); diff --git a/test/utils/ShortStrings.t.sol b/test/utils/ShortStrings.t.sol index b70793bd7ae..42782ea2cc9 100644 --- a/test/utils/ShortStrings.t.sol +++ b/test/utils/ShortStrings.t.sol @@ -2,9 +2,9 @@ pragma solidity ^0.8.19; -import "forge-std/Test.sol"; +import {Test} from "forge-std/Test.sol"; -import "../../contracts/utils/ShortStrings.sol"; +import {ShortStrings} from "../../contracts/utils/ShortStrings.sol"; contract ShortStringsTest is Test { string _fallback; diff --git a/test/utils/math/Math.t.sol b/test/utils/math/Math.t.sol index 61f558e0e0e..5a6be476f3e 100644 --- a/test/utils/math/Math.t.sol +++ b/test/utils/math/Math.t.sol @@ -2,9 +2,9 @@ pragma solidity ^0.8.19; -import "forge-std/Test.sol"; +import {Test} from "forge-std/Test.sol"; -import "../../../contracts/utils/math/Math.sol"; +import {Math} from "../../../contracts/utils/math/Math.sol"; contract MathTest is Test { // CEILDIV diff --git a/test/utils/structs/Checkpoints.t.sol b/test/utils/structs/Checkpoints.t.sol index 1fb6dcb4ede..bbc3092265f 100644 --- a/test/utils/structs/Checkpoints.t.sol +++ b/test/utils/structs/Checkpoints.t.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.19; -import "forge-std/Test.sol"; -import "../../../contracts/utils/math/SafeCast.sol"; -import "../../../contracts/utils/structs/Checkpoints.sol"; +import {Test} from "forge-std/Test.sol"; +import {SafeCast} from "../../../contracts/utils/math/SafeCast.sol"; +import {Checkpoints} from "../../../contracts/utils/structs/Checkpoints.sol"; contract CheckpointsTrace224Test is Test { using Checkpoints for Checkpoints.Trace224; From 5e583bf3df6d47c7aa956aae7a73c29b326008f4 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 29 Jun 2023 00:27:39 -0300 Subject: [PATCH 02/11] add changeset --- .changeset/orange-apes-draw.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/orange-apes-draw.md diff --git a/.changeset/orange-apes-draw.md b/.changeset/orange-apes-draw.md new file mode 100644 index 00000000000..5f2b7d92890 --- /dev/null +++ b/.changeset/orange-apes-draw.md @@ -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. From 05b74c648a5eb6955b24db90ca3037f8a3c3cbad Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 29 Jun 2023 00:27:57 -0300 Subject: [PATCH 03/11] update hardhat-exposed --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index d4cb52694fe..a8561194198 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "glob": "^8.0.3", "graphlib": "^2.1.8", "hardhat": "^2.9.1", - "hardhat-exposed": "^0.3.3", + "hardhat-exposed": "^0.3.11", "hardhat-gas-reporter": "^1.0.4", "hardhat-ignore-warnings": "^0.2.0", "keccak256": "^1.0.2", @@ -7477,9 +7477,9 @@ } }, "node_modules/hardhat-exposed": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/hardhat-exposed/-/hardhat-exposed-0.3.6.tgz", - "integrity": "sha512-jb03M+GolhEfjDYJyPkGJzcAs1/eZrVufMADXQDwng2iuUJD1zgzM3k1oq2YQihRxguQDsLE1nuHIn6N8o5GmQ==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/hardhat-exposed/-/hardhat-exposed-0.3.11.tgz", + "integrity": "sha512-2Gwdfx1YpSWUX80kuq0zM1tNqDJoTBCd5Q5oXKPxz6STSy1TiDyDb1miUr4Dwc/Dp2lzWzM+fZjpUrMe5O08Hw==", "dev": true, "dependencies": { "micromatch": "^4.0.4", @@ -21420,9 +21420,9 @@ } }, "hardhat-exposed": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/hardhat-exposed/-/hardhat-exposed-0.3.6.tgz", - "integrity": "sha512-jb03M+GolhEfjDYJyPkGJzcAs1/eZrVufMADXQDwng2iuUJD1zgzM3k1oq2YQihRxguQDsLE1nuHIn6N8o5GmQ==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/hardhat-exposed/-/hardhat-exposed-0.3.11.tgz", + "integrity": "sha512-2Gwdfx1YpSWUX80kuq0zM1tNqDJoTBCd5Q5oXKPxz6STSy1TiDyDb1miUr4Dwc/Dp2lzWzM+fZjpUrMe5O08Hw==", "dev": true, "requires": { "micromatch": "^4.0.4", diff --git a/package.json b/package.json index 37e8f871012..9eae67320c0 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "glob": "^8.0.3", "graphlib": "^2.1.8", "hardhat": "^2.9.1", - "hardhat-exposed": "^0.3.3", + "hardhat-exposed": "^0.3.11", "hardhat-gas-reporter": "^1.0.4", "hardhat-ignore-warnings": "^0.2.0", "keccak256": "^1.0.2", From 5fd4bdf0ef044f3800eb1ea6ac97c604b36d9217 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 29 Jun 2023 00:34:27 -0300 Subject: [PATCH 04/11] update patch --- scripts/upgradeable/upgradeable.patch | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/upgradeable/upgradeable.patch b/scripts/upgradeable/upgradeable.patch index ecd0a3711d7..34d56642c7f 100644 --- a/scripts/upgradeable/upgradeable.patch +++ b/scripts/upgradeable/upgradeable.patch @@ -106,10 +106,10 @@ index 9d1c405b..c264e29c 100644 } ``` diff --git a/contracts/finance/VestingWallet.sol b/contracts/finance/VestingWallet.sol -index ebdf0a33..8888803e 100644 +index f776a7ca..d7a7e0b0 100644 --- a/contracts/finance/VestingWallet.sol +++ b/contracts/finance/VestingWallet.sol -@@ -18,6 +18,8 @@ import "../utils/Context.sol"; +@@ -19,6 +19,8 @@ import {Context} from "../utils/Context.sol"; * * By setting the duration to 0, one can configure this contract to behave like an asset timelock that hold tokens for * a beneficiary until a specified time. @@ -119,10 +119,10 @@ index ebdf0a33..8888803e 100644 contract VestingWallet is Context { event EtherReleased(uint256 amount); diff --git a/contracts/governance/extensions/GovernorVotes.sol b/contracts/governance/extensions/GovernorVotes.sol -index 5d8318f4..ef3cde55 100644 +index bb14d7fd..0785ebbd 100644 --- a/contracts/governance/extensions/GovernorVotes.sol +++ b/contracts/governance/extensions/GovernorVotes.sol -@@ -10,6 +10,8 @@ import "../../interfaces/IERC5805.sol"; +@@ -12,6 +12,8 @@ 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. * * _Available since v4.3._ @@ -152,10 +152,10 @@ index df141192..1cf90ad1 100644 "keywords": [ "solidity", diff --git a/contracts/token/ERC20/extensions/ERC20Capped.sol b/contracts/token/ERC20/extensions/ERC20Capped.sol -index 41e9ce5c..1d910dfa 100644 +index 98ec7144..4992115b 100644 --- a/contracts/token/ERC20/extensions/ERC20Capped.sol +++ b/contracts/token/ERC20/extensions/ERC20Capped.sol -@@ -7,6 +7,8 @@ import "../ERC20.sol"; +@@ -7,6 +7,8 @@ import {ERC20} from "../ERC20.sol"; /** * @dev Extension of {ERC20} that adds a cap to the supply of tokens. @@ -165,10 +165,10 @@ index 41e9ce5c..1d910dfa 100644 abstract contract ERC20Capped is ERC20 { uint256 private immutable _cap; diff --git a/contracts/token/ERC20/extensions/ERC20Permit.sol b/contracts/token/ERC20/extensions/ERC20Permit.sol -index 4378eb7c..1da9e731 100644 +index 8778f4ba..825d4e16 100644 --- a/contracts/token/ERC20/extensions/ERC20Permit.sol +++ b/contracts/token/ERC20/extensions/ERC20Permit.sol -@@ -18,6 +18,8 @@ import "../../../utils/Nonces.sol"; +@@ -18,6 +18,8 @@ import {Nonces} from "../../../utils/Nonces.sol"; * need to send a transaction, and thus is not required to hold Ether at all. * * _Available since v3.4._ @@ -178,10 +178,10 @@ index 4378eb7c..1da9e731 100644 abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712, Nonces { // solhint-disable-next-line var-name-mixedcase diff --git a/contracts/token/ERC20/extensions/ERC20Wrapper.sol b/contracts/token/ERC20/extensions/ERC20Wrapper.sol -index 389965e9..66436b14 100644 +index 2cbff622..97f43d7a 100644 --- a/contracts/token/ERC20/extensions/ERC20Wrapper.sol +++ b/contracts/token/ERC20/extensions/ERC20Wrapper.sol -@@ -14,6 +14,8 @@ import "../utils/SafeERC20.sol"; +@@ -14,6 +14,8 @@ import {SafeERC20} from "../utils/SafeERC20.sol"; * wrapping of an existing "basic" ERC20 into a governance token. * * _Available since v4.2._ @@ -191,18 +191,18 @@ index 389965e9..66436b14 100644 abstract contract ERC20Wrapper is ERC20 { IERC20 private immutable _underlying; diff --git a/contracts/utils/cryptography/EIP712.sol b/contracts/utils/cryptography/EIP712.sol -index 2628014f..7d5193c8 100644 +index 711aaba8..4848badd 100644 --- a/contracts/utils/cryptography/EIP712.sol +++ b/contracts/utils/cryptography/EIP712.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.19; - import "./ECDSA.sol"; --import "../ShortStrings.sol"; - import "../../interfaces/IERC5267.sol"; + import {ECDSA} from "./ECDSA.sol"; +-import {ShortStrings, ShortString} from "../ShortStrings.sol"; + import {IERC5267} from "../../interfaces/IERC5267.sol"; /** -@@ -30,27 +29,19 @@ import "../../interfaces/IERC5267.sol"; +@@ -30,27 +29,19 @@ import {IERC5267} from "../../interfaces/IERC5267.sol"; * * _Available since v3.4._ * @@ -361,7 +361,7 @@ index 2628014f..7d5193c8 100644 } } diff --git a/package.json b/package.json -index 37e8f871..d098669f 100644 +index 9eae6732..b3a56366 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ From 7940c6825084f70e57c1ab46b7aa5f278b9d35ad Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 29 Jun 2023 00:36:36 -0300 Subject: [PATCH 05/11] fix foundry tests --- test/token/ERC721/extensions/ERC721Consecutive.t.sol | 3 ++- test/utils/ShortStrings.t.sol | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/token/ERC721/extensions/ERC721Consecutive.t.sol b/test/token/ERC721/extensions/ERC721Consecutive.t.sol index 11c38302290..617b17a4669 100644 --- a/test/token/ERC721/extensions/ERC721Consecutive.t.sol +++ b/test/token/ERC721/extensions/ERC721Consecutive.t.sol @@ -4,8 +4,9 @@ pragma solidity ^0.8.19; // solhint-disable func-name-mixedcase +import {ERC721} from "../../../../contracts/token/ERC721/ERC721.sol"; import {ERC721Consecutive} from "../../../../contracts/token/ERC721/extensions/ERC721Consecutive.sol"; -import {Test} from "forge-std/Test.sol"; +import {Test, StdUtils} from "forge-std/Test.sol"; function toSingleton(address account) pure returns (address[] memory) { address[] memory accounts = new address[](1); diff --git a/test/utils/ShortStrings.t.sol b/test/utils/ShortStrings.t.sol index 42782ea2cc9..c6aa5355b8a 100644 --- a/test/utils/ShortStrings.t.sol +++ b/test/utils/ShortStrings.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.19; import {Test} from "forge-std/Test.sol"; -import {ShortStrings} from "../../contracts/utils/ShortStrings.sol"; +import {ShortStrings, ShortString} from "../../contracts/utils/ShortStrings.sol"; contract ShortStringsTest is Test { string _fallback; From 15799c11a5cf0b23cc64f8b5615494abdb791aa2 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 29 Jun 2023 14:47:11 +0200 Subject: [PATCH 06/11] fix procedural generation --- scripts/generate/templates/Checkpoints.js | 6 +++--- scripts/generate/templates/Checkpoints.t.js | 6 +++--- scripts/generate/templates/EnumerableMap.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/generate/templates/Checkpoints.js b/scripts/generate/templates/Checkpoints.js index d28134ce726..d5ab745a037 100644 --- a/scripts/generate/templates/Checkpoints.js +++ b/scripts/generate/templates/Checkpoints.js @@ -5,8 +5,8 @@ const { OPTS } = require('./Checkpoints.opts.js'); const header = `\ pragma solidity ^0.8.19; -import "../math/Math.sol"; -import "../math/SafeCast.sol"; +import {Math} from "../math/Math.sol"; +import {SafeCast} from "../math/SafeCast.sol"; /** * @dev This library defines the \`History\` struct, for checkpointing values as they change at different points in @@ -21,7 +21,7 @@ import "../math/SafeCast.sol"; const errors = `\ /** - * @dev A value was attempted to be inserted on a past checkpoint. + * @dev A value was attempted to be inserted on a past checkpoint. */ error CheckpointUnorderedInsertion(); `; diff --git a/scripts/generate/templates/Checkpoints.t.js b/scripts/generate/templates/Checkpoints.t.js index c5b225f383f..492e5f8c2f4 100644 --- a/scripts/generate/templates/Checkpoints.t.js +++ b/scripts/generate/templates/Checkpoints.t.js @@ -6,9 +6,9 @@ const { OPTS } = require('./Checkpoints.opts.js'); const header = `\ pragma solidity ^0.8.19; -import "forge-std/Test.sol"; -import "../../../contracts/utils/math/SafeCast.sol"; -import "../../../contracts/utils/structs/Checkpoints.sol"; +import {Test} from "forge-std/Test.sol"; +import {SafeCast} from "../../../contracts/utils/math/SafeCast.sol"; +import {Checkpoints} from "../../../contracts/utils/structs/Checkpoints.sol"; `; /* eslint-disable max-len */ diff --git a/scripts/generate/templates/EnumerableMap.js b/scripts/generate/templates/EnumerableMap.js index 8899f481994..032f0868149 100644 --- a/scripts/generate/templates/EnumerableMap.js +++ b/scripts/generate/templates/EnumerableMap.js @@ -12,7 +12,7 @@ const TYPES = [ const header = `\ pragma solidity ^0.8.19; -import "./EnumerableSet.sol"; +import {EnumerableSet} from "./EnumerableSet.sol"; /** * @dev Library for managing an enumerable variant of Solidity's From 79f7b9b8f64559890adb0141f13dfe16f8fe5a24 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Thu, 29 Jun 2023 13:34:46 -0600 Subject: [PATCH 07/11] Add solhint rule for global imports --- .solhint.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.solhint.json b/.solhint.json index 772928849e0..cb8a8af6d78 100644 --- a/.solhint.json +++ b/.solhint.json @@ -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" } } From 57324011a689fe8e08ebc0ef3b5ae27e26edc73c Mon Sep 17 00:00:00 2001 From: ernestognw Date: Thu, 29 Jun 2023 13:34:57 -0600 Subject: [PATCH 08/11] Update doc examples --- README.md | 2 +- docs/modules/ROOT/pages/access-control.adoc | 14 +++++++------- docs/modules/ROOT/pages/erc1155.adoc | 4 ++-- docs/modules/ROOT/pages/erc20.adoc | 2 +- docs/modules/ROOT/pages/erc721.adoc | 2 +- docs/modules/ROOT/pages/extending-contracts.adoc | 6 +++--- docs/modules/ROOT/pages/governance.adoc | 12 +++++++----- docs/modules/ROOT/pages/index.adoc | 2 +- docs/modules/ROOT/pages/upgradeable.adoc | 4 ++-- docs/modules/ROOT/pages/utilities.adoc | 6 +++--- 10 files changed, 28 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 9d1c405b60e..27627f43953 100644 --- a/README.md +++ b/README.md @@ -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") { diff --git a/docs/modules/ROOT/pages/access-control.adoc b/docs/modules/ROOT/pages/access-control.adoc index 11a5fab0c5e..aa28376ad60 100644 --- a/docs/modules/ROOT/pages/access-control.adoc +++ b/docs/modules/ROOT/pages/access-control.adoc @@ -15,7 +15,7 @@ OpenZeppelin Contracts provides xref:api:access.adoc#Ownable[`Ownable`] for impl // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import "@openzeppelin/contracts/access/Ownable.sol"; +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; contract MyContract is Ownable { function normalThing() public { @@ -64,8 +64,8 @@ Here's a simple example of using `AccessControl` in an xref:tokens.adoc#ERC20[`E // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import "@openzeppelin/contracts/access/AccessControl.sol"; -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; +import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract MyToken is ERC20, AccessControl { // Create a new role identifier for the minter role @@ -96,8 +96,8 @@ Let's augment our ERC20 token example by also defining a 'burner' role, which le // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import "@openzeppelin/contracts/access/AccessControl.sol"; -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; +import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract MyToken is ERC20, AccessControl { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); @@ -141,8 +141,8 @@ Let's take a look at the ERC20 token example, this time taking advantage of the // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import "@openzeppelin/contracts/access/AccessControl.sol"; -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; +import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract MyToken is ERC20, AccessControl { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); diff --git a/docs/modules/ROOT/pages/erc1155.adoc b/docs/modules/ROOT/pages/erc1155.adoc index 067bde89e8d..f1d2f88ceae 100644 --- a/docs/modules/ROOT/pages/erc1155.adoc +++ b/docs/modules/ROOT/pages/erc1155.adoc @@ -36,7 +36,7 @@ Here's what a contract for tokenized items might look like: // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; +import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; contract GameItems is ERC1155 { uint256 public constant GOLD = 0; @@ -136,7 +136,7 @@ In order for our contract to receive ERC1155 tokens we can inherit from the conv // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; +import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; contract MyContract is ERC1155Holder { } diff --git a/docs/modules/ROOT/pages/erc20.adoc b/docs/modules/ROOT/pages/erc20.adoc index 817d364b1c6..f9f77aec004 100644 --- a/docs/modules/ROOT/pages/erc20.adoc +++ b/docs/modules/ROOT/pages/erc20.adoc @@ -17,7 +17,7 @@ Here's what our GLD token might look like. // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import {ERC20} "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract GLDToken is ERC20 { constructor(uint256 initialSupply) ERC20("Gold", "GLD") { diff --git a/docs/modules/ROOT/pages/erc721.adoc b/docs/modules/ROOT/pages/erc721.adoc index 6d839c81e5d..42c01bbd8b5 100644 --- a/docs/modules/ROOT/pages/erc721.adoc +++ b/docs/modules/ROOT/pages/erc721.adoc @@ -16,7 +16,7 @@ Here's what a contract for tokenized items might look like: // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; +import {ERC721URIStorage} "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; contract GameItem is ERC721URIStorage { uint256 private _nextTokenId; diff --git a/docs/modules/ROOT/pages/extending-contracts.adoc b/docs/modules/ROOT/pages/extending-contracts.adoc index df93f21330c..ac673098405 100644 --- a/docs/modules/ROOT/pages/extending-contracts.adoc +++ b/docs/modules/ROOT/pages/extending-contracts.adoc @@ -22,7 +22,7 @@ For example, imagine you want to change xref:api:access.adoc#AccessControl[`Acce // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import "@openzeppelin/contracts/access/AccessControl.sol"; +import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; contract ModifiedAccessControl is AccessControl { // Override the revokeRole function @@ -50,7 +50,7 @@ Here is a modified version of xref:api:access.adoc#AccessControl[`AccessControl` // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import "@openzeppelin/contracts/access/AccessControl.sol"; +import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; contract ModifiedAccessControl is AccessControl { function revokeRole(bytes32 role, address account) public override { @@ -82,7 +82,7 @@ Here's how you would implement the `IERC721Receiver` pattern in `ERC20`, using t ```solidity pragma solidity ^0.8.19; -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract ERC20WithSafeTransfer is ERC20 { function _beforeTokenTransfer(address from, address to, uint256 amount) diff --git a/docs/modules/ROOT/pages/governance.adoc b/docs/modules/ROOT/pages/governance.adoc index 3d2bc05f30a..cae2f14f6c9 100644 --- a/docs/modules/ROOT/pages/governance.adoc +++ b/docs/modules/ROOT/pages/governance.adoc @@ -200,11 +200,12 @@ The Governor will automatically detect the clock mode used by the token and adap // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import "@openzeppelin/contracts/governance/Governor.sol"; -import "@openzeppelin/contracts/governance/compatibility/GovernorCompatibilityBravo.sol"; -import "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol"; -import "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol"; -import "@openzeppelin/contracts/governance/extensions/GovernorTimelockControl.sol"; +import {Governor} from "@openzeppelin/contracts/governance/Governor.sol"; +import {GovernorCompatibilityBravo} from "@openzeppelin/contracts/governance/compatibility/GovernorCompatibilityBravo.sol"; +import {GovernorVotes} from "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol"; +import {GovernorVotesQuorumFraction} from "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol"; +import {GovernorTimelockControl} from "@openzeppelin/contracts/governance/extensions/GovernorTimelockControl.sol"; +import {IVotes} from "@openzeppelin/contracts/governance/utils/IVotes.sol"; contract MyGovernor is Governor, GovernorCompatibilityBravo, GovernorVotes, GovernorVotesQuorumFraction, GovernorTimelockControl { constructor(IVotes _token, TimelockController _timelock) @@ -228,6 +229,7 @@ contract MyGovernor is Governor, GovernorCompatibilityBravo, GovernorVotes, Gove // ... } + ``` === Disclaimer diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc index b46a8d5a36b..b24412ae754 100644 --- a/docs/modules/ROOT/pages/index.adoc +++ b/docs/modules/ROOT/pages/index.adoc @@ -28,7 +28,7 @@ Once installed, you can use the contracts in the library by importing them: // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; +import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract MyNFT is ERC721 { constructor() ERC721("MyNFT", "MNFT") { diff --git a/docs/modules/ROOT/pages/upgradeable.adoc b/docs/modules/ROOT/pages/upgradeable.adoc index 2b8d27204cd..7324c9bad74 100644 --- a/docs/modules/ROOT/pages/upgradeable.adoc +++ b/docs/modules/ROOT/pages/upgradeable.adoc @@ -21,8 +21,8 @@ $ npm install @openzeppelin/contracts-upgradeable The package replicates the structure of the main OpenZeppelin Contracts package, but every file and contract has the suffix `Upgradeable`. ```diff --import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; -+import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; +-import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; ++import {ERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; -contract MyCollectible is ERC721 { +contract MyCollectible is ERC721Upgradeable { diff --git a/docs/modules/ROOT/pages/utilities.adoc b/docs/modules/ROOT/pages/utilities.adoc index 0b178d9fec5..3a1ba5420d6 100644 --- a/docs/modules/ROOT/pages/utilities.adoc +++ b/docs/modules/ROOT/pages/utilities.adoc @@ -110,9 +110,9 @@ Here is an example to send JSON Metadata through a Base64 Data URI using an ERC7 // contracts/My721Token.sol // SPDX-License-Identifier: MIT -import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; -import "@openzeppelin/contracts/utils/Strings.sol"; -import "@openzeppelin/contracts/utils/Base64.sol"; +import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; +import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; +import {Base64} from "@openzeppelin/contracts/utils/Base64.sol"; contract My721Token is ERC721 { using Strings for uint256; From aff850f235f857aaac88740b0a220bd63d026980 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Thu, 29 Jun 2023 13:38:14 -0600 Subject: [PATCH 09/11] Fix incorrect doc imports --- docs/modules/ROOT/pages/erc20.adoc | 2 +- docs/modules/ROOT/pages/erc721.adoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/modules/ROOT/pages/erc20.adoc b/docs/modules/ROOT/pages/erc20.adoc index f9f77aec004..2ffa60f2aae 100644 --- a/docs/modules/ROOT/pages/erc20.adoc +++ b/docs/modules/ROOT/pages/erc20.adoc @@ -17,7 +17,7 @@ Here's what our GLD token might look like. // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import {ERC20} "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract GLDToken is ERC20 { constructor(uint256 initialSupply) ERC20("Gold", "GLD") { diff --git a/docs/modules/ROOT/pages/erc721.adoc b/docs/modules/ROOT/pages/erc721.adoc index 42c01bbd8b5..cd4d14b8f4d 100644 --- a/docs/modules/ROOT/pages/erc721.adoc +++ b/docs/modules/ROOT/pages/erc721.adoc @@ -16,7 +16,7 @@ Here's what a contract for tokenized items might look like: // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import {ERC721URIStorage} "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; +import {ERC721URIStorage} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; contract GameItem is ERC721URIStorage { uint256 private _nextTokenId; From ee89385da8b17dccd2fc65588b4518e50bcf0d5b Mon Sep 17 00:00:00 2001 From: ernestognw Date: Thu, 29 Jun 2023 13:41:40 -0600 Subject: [PATCH 10/11] Fix upgradeable patch --- scripts/upgradeable/upgradeable.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/upgradeable/upgradeable.patch b/scripts/upgradeable/upgradeable.patch index 34d56642c7f..7826439dea0 100644 --- a/scripts/upgradeable/upgradeable.patch +++ b/scripts/upgradeable/upgradeable.patch @@ -59,7 +59,7 @@ index ff596b0c..00000000 - - diff --git a/README.md b/README.md -index 9d1c405b..c264e29c 100644 +index 27627f43..47c5c7a4 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,9 @@ @@ -94,8 +94,8 @@ index 9d1c405b..c264e29c 100644 ```solidity pragma solidity ^0.8.19; --import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; -+import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; +-import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; ++import {ERC71Upgradeable} "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; -contract MyCollectible is ERC721 { - constructor() ERC721("MyCollectible", "MCO") { @@ -191,7 +191,7 @@ index 2cbff622..97f43d7a 100644 abstract contract ERC20Wrapper is ERC20 { IERC20 private immutable _underlying; diff --git a/contracts/utils/cryptography/EIP712.sol b/contracts/utils/cryptography/EIP712.sol -index 711aaba8..4848badd 100644 +index d94e956a..86bb5713 100644 --- a/contracts/utils/cryptography/EIP712.sol +++ b/contracts/utils/cryptography/EIP712.sol @@ -4,7 +4,6 @@ From eeecdd14f937ad35754f420ebc3af71b0ed8301e Mon Sep 17 00:00:00 2001 From: ernestognw Date: Thu, 29 Jun 2023 13:42:52 -0600 Subject: [PATCH 11/11] Fix upgradeable patch again --- scripts/upgradeable/upgradeable.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgradeable/upgradeable.patch b/scripts/upgradeable/upgradeable.patch index 7826439dea0..466d1d1ca43 100644 --- a/scripts/upgradeable/upgradeable.patch +++ b/scripts/upgradeable/upgradeable.patch @@ -59,7 +59,7 @@ index ff596b0c..00000000 - - diff --git a/README.md b/README.md -index 27627f43..47c5c7a4 100644 +index 27627f43..e42a66e8 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,9 @@ @@ -95,7 +95,7 @@ index 27627f43..47c5c7a4 100644 pragma solidity ^0.8.19; -import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; -+import {ERC71Upgradeable} "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; ++import {ERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; -contract MyCollectible is ERC721 { - constructor() ERC721("MyCollectible", "MCO") {