diff --git a/CHANGELOG.md b/CHANGELOG.md index 56acee0d..89d46dd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ * `TimelockController`: added a contract to augment access control schemes with a delay. ([#2354](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2354)) * `EnumerableSet`: added `Bytes32Set`, for sets of `bytes32`. ([#2395](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2395)) +## 3.2.2-solc-0.7 (2020-10-28) + * Resolve warnings introduced by Solidity 0.7.4. ([#2396](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2396)) + +## 3.2.1-solc-0.7 (2020-09-15) + * `ERC777`: Remove a warning about function state visibility in Solidity 0.7. ([#2327](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2327)) + ## 3.2.0 (2020-09-10) ### New features diff --git a/README.md b/README.md index 80aa6683..f6979f75 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,12 @@ OpenZeppelin Contracts features a [stable API](https://docs.openzeppelin.com/con Once installed, you can use the contracts in the library by importing them: ```solidity -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract MyCollectible is ERC721 { - constructor() ERC721("MyCollectible", "MCO") public { + constructor() ERC721("MyCollectible", "MCO") { } } ``` diff --git a/buidler.config.js b/buidler.config.js index bf28eeed..7444cfe8 100644 --- a/buidler.config.js +++ b/buidler.config.js @@ -15,6 +15,6 @@ module.exports = { }, }, solc: { - version: '0.6.12', + version: '0.7.4', }, }; diff --git a/contracts/GSN/Context.sol b/contracts/GSN/Context.sol index 3d07c4aa..26e56a02 100644 --- a/contracts/GSN/Context.sol +++ b/contracts/GSN/Context.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /* * @dev Provides information about the current execution context, including the diff --git a/contracts/GSN/GSNRecipient.sol b/contracts/GSN/GSNRecipient.sol index ae0c795b..f77b5d2c 100644 --- a/contracts/GSN/GSNRecipient.sol +++ b/contracts/GSN/GSNRecipient.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./IRelayRecipient.sol"; import "./IRelayHub.sol"; diff --git a/contracts/GSN/GSNRecipientERC20Fee.sol b/contracts/GSN/GSNRecipientERC20Fee.sol index 1abe9f3b..adba2742 100644 --- a/contracts/GSN/GSNRecipientERC20Fee.sol +++ b/contracts/GSN/GSNRecipientERC20Fee.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./GSNRecipient.sol"; import "../math/SafeMath.sol"; @@ -30,7 +30,7 @@ contract GSNRecipientERC20Fee is GSNRecipient { /** * @dev The arguments to the constructor are the details that the gas payment token will have: `name` and `symbol`. `decimals` is hard-coded to 18. */ - constructor(string memory name, string memory symbol) public { + constructor(string memory name, string memory symbol) { _token = new __unstable__ERC20Owned(name, symbol); } @@ -118,7 +118,7 @@ contract GSNRecipientERC20Fee is GSNRecipient { contract __unstable__ERC20Owned is ERC20, Ownable { uint256 private constant _UINT256_MAX = 2**256 - 1; - constructor(string memory name, string memory symbol) public ERC20(name, symbol) { } + constructor(string memory name, string memory symbol) ERC20(name, symbol) { } // The owner (GSNRecipientERC20Fee) can mint tokens function mint(address account, uint256 amount) public onlyOwner { diff --git a/contracts/GSN/GSNRecipientSignature.sol b/contracts/GSN/GSNRecipientSignature.sol index e6193949..3955db59 100644 --- a/contracts/GSN/GSNRecipientSignature.sol +++ b/contracts/GSN/GSNRecipientSignature.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./GSNRecipient.sol"; import "../cryptography/ECDSA.sol"; @@ -23,7 +23,7 @@ contract GSNRecipientSignature is GSNRecipient { /** * @dev Sets the trusted signer that is going to be producing signatures to approve relayed calls. */ - constructor(address trustedSigner) public { + constructor(address trustedSigner) { require(trustedSigner != address(0), "GSNRecipientSignature: trusted signer is the zero address"); _trustedSigner = trustedSigner; } diff --git a/contracts/GSN/IRelayHub.sol b/contracts/GSN/IRelayHub.sol index 34930334..5ee97871 100644 --- a/contracts/GSN/IRelayHub.sol +++ b/contracts/GSN/IRelayHub.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Interface for `RelayHub`, the core contract of the GSN. Users should not need to interact with this contract diff --git a/contracts/GSN/IRelayRecipient.sol b/contracts/GSN/IRelayRecipient.sol index 0257e655..f8b2e5bd 100644 --- a/contracts/GSN/IRelayRecipient.sol +++ b/contracts/GSN/IRelayRecipient.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Base interface for a contract that will be called via the GSN from {IRelayHub}. diff --git a/contracts/access/AccessControl.sol b/contracts/access/AccessControl.sol index 395e9a41..42c8d256 100644 --- a/contracts/access/AccessControl.sol +++ b/contracts/access/AccessControl.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../utils/EnumerableSet.sol"; import "../utils/Address.sol"; diff --git a/contracts/access/Ownable.sol b/contracts/access/Ownable.sol index 0223a15f..db868134 100644 --- a/contracts/access/Ownable.sol +++ b/contracts/access/Ownable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../GSN/Context.sol"; /** @@ -23,7 +23,7 @@ abstract contract Ownable is Context { /** * @dev Initializes the contract setting the deployer as the initial owner. */ - constructor () internal { + constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); diff --git a/contracts/access/TimelockController.sol b/contracts/access/TimelockController.sol index 0d86286a..41682e05 100644 --- a/contracts/access/TimelockController.sol +++ b/contracts/access/TimelockController.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.9 <0.8.0; +pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "./../math/SafeMath.sol"; @@ -52,7 +52,7 @@ contract TimelockController is AccessControl { /** * @dev Initializes the contract with a given `minDelay`. */ - constructor(uint256 minDelay, address[] memory proposers, address[] memory executors) public { + constructor(uint256 minDelay, address[] memory proposers, address[] memory executors) { _setRoleAdmin(TIMELOCK_ADMIN_ROLE, TIMELOCK_ADMIN_ROLE); _setRoleAdmin(PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE); _setRoleAdmin(EXECUTOR_ROLE, TIMELOCK_ADMIN_ROLE); diff --git a/contracts/cryptography/ECDSA.sol b/contracts/cryptography/ECDSA.sol index ae2a014e..08db8614 100644 --- a/contracts/cryptography/ECDSA.sol +++ b/contracts/cryptography/ECDSA.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. diff --git a/contracts/cryptography/MerkleProof.sol b/contracts/cryptography/MerkleProof.sol index 665a93a3..7207cb58 100644 --- a/contracts/cryptography/MerkleProof.sol +++ b/contracts/cryptography/MerkleProof.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev These functions deal with verification of Merkle trees (hash trees), diff --git a/contracts/introspection/ERC165.sol b/contracts/introspection/ERC165.sol index 79e5f646..04e27c70 100644 --- a/contracts/introspection/ERC165.sol +++ b/contracts/introspection/ERC165.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./IERC165.sol"; @@ -21,7 +21,7 @@ abstract contract ERC165 is IERC165 { */ mapping(bytes4 => bool) private _supportedInterfaces; - constructor () internal { + constructor () { // Derived contracts need only register support for their own interfaces, // we register support for ERC165 itself here _registerInterface(_INTERFACE_ID_ERC165); diff --git a/contracts/introspection/ERC165Checker.sol b/contracts/introspection/ERC165Checker.sol index 75eb50ee..03ed537e 100644 --- a/contracts/introspection/ERC165Checker.sol +++ b/contracts/introspection/ERC165Checker.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Library used to query support of an interface declared via {IERC165}. diff --git a/contracts/introspection/ERC1820Implementer.sol b/contracts/introspection/ERC1820Implementer.sol index 69b644e9..dd7731c1 100644 --- a/contracts/introspection/ERC1820Implementer.sol +++ b/contracts/introspection/ERC1820Implementer.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./IERC1820Implementer.sol"; diff --git a/contracts/introspection/IERC165.sol b/contracts/introspection/IERC165.sol index d4743552..4d5d7668 100644 --- a/contracts/introspection/IERC165.sol +++ b/contracts/introspection/IERC165.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Interface of the ERC165 standard, as defined in the diff --git a/contracts/introspection/IERC1820Implementer.sol b/contracts/introspection/IERC1820Implementer.sol index c507da0c..024c759d 100644 --- a/contracts/introspection/IERC1820Implementer.sol +++ b/contracts/introspection/IERC1820Implementer.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Interface for an ERC1820 implementer, as defined in the diff --git a/contracts/introspection/IERC1820Registry.sol b/contracts/introspection/IERC1820Registry.sol index e63bf041..cc163f6e 100644 --- a/contracts/introspection/IERC1820Registry.sol +++ b/contracts/introspection/IERC1820Registry.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Interface of the global ERC1820 Registry, as defined in the diff --git a/contracts/math/Math.sol b/contracts/math/Math.sol index a0c35b5a..a4c5c4ea 100644 --- a/contracts/math/Math.sol +++ b/contracts/math/Math.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Standard math utilities missing in the Solidity language. diff --git a/contracts/math/SafeMath.sol b/contracts/math/SafeMath.sol index 7975c634..4b2a49d4 100644 --- a/contracts/math/SafeMath.sol +++ b/contracts/math/SafeMath.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow diff --git a/contracts/math/SignedSafeMath.sol b/contracts/math/SignedSafeMath.sol index c8b1bc53..07ddd13f 100644 --- a/contracts/math/SignedSafeMath.sol +++ b/contracts/math/SignedSafeMath.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @title SignedSafeMath diff --git a/contracts/mocks/AccessControlMock.sol b/contracts/mocks/AccessControlMock.sol index 968d3893..7cd2c8e3 100644 --- a/contracts/mocks/AccessControlMock.sol +++ b/contracts/mocks/AccessControlMock.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../access/AccessControl.sol"; contract AccessControlMock is AccessControl { - constructor() public { + constructor() { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); } diff --git a/contracts/mocks/AddressImpl.sol b/contracts/mocks/AddressImpl.sol index 0d1513a0..07debd36 100644 --- a/contracts/mocks/AddressImpl.sol +++ b/contracts/mocks/AddressImpl.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../utils/Address.sol"; diff --git a/contracts/mocks/ArraysImpl.sol b/contracts/mocks/ArraysImpl.sol index d3c4a13d..0302b266 100644 --- a/contracts/mocks/ArraysImpl.sol +++ b/contracts/mocks/ArraysImpl.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../utils/Arrays.sol"; @@ -9,7 +9,7 @@ contract ArraysImpl { uint256[] private _array; - constructor (uint256[] memory array) public { + constructor (uint256[] memory array) { _array = array; } diff --git a/contracts/mocks/CallReceiverMock.sol b/contracts/mocks/CallReceiverMock.sol index 0ab2d84d..3e54e5a0 100644 --- a/contracts/mocks/CallReceiverMock.sol +++ b/contracts/mocks/CallReceiverMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; contract CallReceiverMock { string public sharedAnswer; diff --git a/contracts/mocks/ClashingImplementation.sol b/contracts/mocks/ClashingImplementation.sol index 1780781a..4351fd88 100644 --- a/contracts/mocks/ClashingImplementation.sol +++ b/contracts/mocks/ClashingImplementation.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** diff --git a/contracts/mocks/ConditionalEscrowMock.sol b/contracts/mocks/ConditionalEscrowMock.sol index 4d5f1f05..518481e9 100644 --- a/contracts/mocks/ConditionalEscrowMock.sol +++ b/contracts/mocks/ConditionalEscrowMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../payment/escrow/ConditionalEscrow.sol"; diff --git a/contracts/mocks/ContextMock.sol b/contracts/mocks/ContextMock.sol index daae264f..6080971c 100644 --- a/contracts/mocks/ContextMock.sol +++ b/contracts/mocks/ContextMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../GSN/Context.sol"; diff --git a/contracts/mocks/CountersImpl.sol b/contracts/mocks/CountersImpl.sol index ee7c8304..4f8a49af 100644 --- a/contracts/mocks/CountersImpl.sol +++ b/contracts/mocks/CountersImpl.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../utils/Counters.sol"; diff --git a/contracts/mocks/Create2Impl.sol b/contracts/mocks/Create2Impl.sol index 0bcd8cbb..812a43c5 100644 --- a/contracts/mocks/Create2Impl.sol +++ b/contracts/mocks/Create2Impl.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../utils/Create2.sol"; import "../introspection/ERC1820Implementer.sol"; diff --git a/contracts/mocks/DummyImplementation.sol b/contracts/mocks/DummyImplementation.sol index 38569ebd..f7ea58c4 100644 --- a/contracts/mocks/DummyImplementation.sol +++ b/contracts/mocks/DummyImplementation.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; abstract contract Impl { function version() public pure virtual returns (string memory); diff --git a/contracts/mocks/ECDSAMock.sol b/contracts/mocks/ECDSAMock.sol index d8ef1062..efb0c79f 100644 --- a/contracts/mocks/ECDSAMock.sol +++ b/contracts/mocks/ECDSAMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../cryptography/ECDSA.sol"; diff --git a/contracts/mocks/ERC1155BurnableMock.sol b/contracts/mocks/ERC1155BurnableMock.sol index 38f117e6..9e77288a 100644 --- a/contracts/mocks/ERC1155BurnableMock.sol +++ b/contracts/mocks/ERC1155BurnableMock.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC1155/ERC1155Burnable.sol"; contract ERC1155BurnableMock is ERC1155Burnable { - constructor(string memory uri) public ERC1155(uri) { } + constructor(string memory uri) ERC1155(uri) { } function mint(address to, uint256 id, uint256 value, bytes memory data) public { _mint(to, id, value, data); diff --git a/contracts/mocks/ERC1155Mock.sol b/contracts/mocks/ERC1155Mock.sol index e1127086..f403745f 100644 --- a/contracts/mocks/ERC1155Mock.sol +++ b/contracts/mocks/ERC1155Mock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC1155/ERC1155.sol"; @@ -9,7 +9,7 @@ import "../token/ERC1155/ERC1155.sol"; * This mock just publicizes internal functions for testing purposes */ contract ERC1155Mock is ERC1155 { - constructor (string memory uri) public ERC1155(uri) { + constructor (string memory uri) ERC1155(uri) { // solhint-disable-previous-line no-empty-blocks } diff --git a/contracts/mocks/ERC1155PausableMock.sol b/contracts/mocks/ERC1155PausableMock.sol index 2502b8f3..5c3bb176 100644 --- a/contracts/mocks/ERC1155PausableMock.sol +++ b/contracts/mocks/ERC1155PausableMock.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./ERC1155Mock.sol"; import "../token/ERC1155/ERC1155Pausable.sol"; contract ERC1155PausableMock is ERC1155Mock, ERC1155Pausable { - constructor(string memory uri) public ERC1155Mock(uri) { } + constructor(string memory uri) ERC1155Mock(uri) { } function pause() external { _pause(); diff --git a/contracts/mocks/ERC1155ReceiverMock.sol b/contracts/mocks/ERC1155ReceiverMock.sol index 9e665c82..f5925f8e 100644 --- a/contracts/mocks/ERC1155ReceiverMock.sol +++ b/contracts/mocks/ERC1155ReceiverMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC1155/IERC1155Receiver.sol"; import "./ERC165Mock.sol"; @@ -20,7 +20,6 @@ contract ERC1155ReceiverMock is IERC1155Receiver, ERC165Mock { bytes4 batRetval, bool batReverts ) - public { _recRetval = recRetval; _recReverts = recReverts; diff --git a/contracts/mocks/ERC165/ERC165InterfacesSupported.sol b/contracts/mocks/ERC165/ERC165InterfacesSupported.sol index b44f2352..55002cc0 100644 --- a/contracts/mocks/ERC165/ERC165InterfacesSupported.sol +++ b/contracts/mocks/ERC165/ERC165InterfacesSupported.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../../introspection/IERC165.sol"; @@ -29,7 +29,7 @@ contract SupportsInterfaceWithLookupMock is IERC165 { * @dev A contract implementing SupportsInterfaceWithLookup * implement ERC165 itself. */ - constructor () public { + constructor () { _registerInterface(INTERFACE_ID_ERC165); } @@ -50,7 +50,7 @@ contract SupportsInterfaceWithLookupMock is IERC165 { } contract ERC165InterfacesSupported is SupportsInterfaceWithLookupMock { - constructor (bytes4[] memory interfaceIds) public { + constructor (bytes4[] memory interfaceIds) { for (uint256 i = 0; i < interfaceIds.length; i++) { _registerInterface(interfaceIds[i]); } diff --git a/contracts/mocks/ERC165/ERC165NotSupported.sol b/contracts/mocks/ERC165/ERC165NotSupported.sol index 0a8a2646..cbc584d1 100644 --- a/contracts/mocks/ERC165/ERC165NotSupported.sol +++ b/contracts/mocks/ERC165/ERC165NotSupported.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; contract ERC165NotSupported { } diff --git a/contracts/mocks/ERC165CheckerMock.sol b/contracts/mocks/ERC165CheckerMock.sol index 5c18e66b..4d6c5fd3 100644 --- a/contracts/mocks/ERC165CheckerMock.sol +++ b/contracts/mocks/ERC165CheckerMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../introspection/ERC165Checker.sol"; diff --git a/contracts/mocks/ERC165Mock.sol b/contracts/mocks/ERC165Mock.sol index 6a3ffb6a..1ceb5f32 100644 --- a/contracts/mocks/ERC165Mock.sol +++ b/contracts/mocks/ERC165Mock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../introspection/ERC165.sol"; diff --git a/contracts/mocks/ERC1820ImplementerMock.sol b/contracts/mocks/ERC1820ImplementerMock.sol index 95838770..8908d62f 100644 --- a/contracts/mocks/ERC1820ImplementerMock.sol +++ b/contracts/mocks/ERC1820ImplementerMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../introspection/ERC1820Implementer.sol"; diff --git a/contracts/mocks/ERC20BurnableMock.sol b/contracts/mocks/ERC20BurnableMock.sol index ffcaf440..7e61c154 100644 --- a/contracts/mocks/ERC20BurnableMock.sol +++ b/contracts/mocks/ERC20BurnableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC20/ERC20Burnable.sol"; @@ -10,7 +10,7 @@ contract ERC20BurnableMock is ERC20Burnable { string memory symbol, address initialAccount, uint256 initialBalance - ) public ERC20(name, symbol) { + ) ERC20(name, symbol) { _mint(initialAccount, initialBalance); } } diff --git a/contracts/mocks/ERC20CappedMock.sol b/contracts/mocks/ERC20CappedMock.sol index a59bec9e..23760f67 100644 --- a/contracts/mocks/ERC20CappedMock.sol +++ b/contracts/mocks/ERC20CappedMock.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC20/ERC20Capped.sol"; contract ERC20CappedMock is ERC20Capped { constructor (string memory name, string memory symbol, uint256 cap) - public ERC20(name, symbol) ERC20Capped(cap) + ERC20(name, symbol) ERC20Capped(cap) { } function mint(address to, uint256 tokenId) public { diff --git a/contracts/mocks/ERC20DecimalsMock.sol b/contracts/mocks/ERC20DecimalsMock.sol index 5fcad4c4..5dc69a4f 100644 --- a/contracts/mocks/ERC20DecimalsMock.sol +++ b/contracts/mocks/ERC20DecimalsMock.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC20/ERC20.sol"; contract ERC20DecimalsMock is ERC20 { - constructor (string memory name, string memory symbol, uint8 decimals) public ERC20(name, symbol) { + constructor (string memory name, string memory symbol, uint8 decimals) ERC20(name, symbol) { _setupDecimals(decimals); } } diff --git a/contracts/mocks/ERC20Mock.sol b/contracts/mocks/ERC20Mock.sol index 4e441d9c..743f6e69 100644 --- a/contracts/mocks/ERC20Mock.sol +++ b/contracts/mocks/ERC20Mock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC20/ERC20.sol"; @@ -11,7 +11,7 @@ contract ERC20Mock is ERC20 { string memory symbol, address initialAccount, uint256 initialBalance - ) public payable ERC20(name, symbol) { + ) payable ERC20(name, symbol) { _mint(initialAccount, initialBalance); } diff --git a/contracts/mocks/ERC20PausableMock.sol b/contracts/mocks/ERC20PausableMock.sol index 541b62cc..2b39f288 100644 --- a/contracts/mocks/ERC20PausableMock.sol +++ b/contracts/mocks/ERC20PausableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC20/ERC20Pausable.sol"; @@ -11,7 +11,7 @@ contract ERC20PausableMock is ERC20Pausable { string memory symbol, address initialAccount, uint256 initialBalance - ) public ERC20(name, symbol) { + ) ERC20(name, symbol) { _mint(initialAccount, initialBalance); } diff --git a/contracts/mocks/ERC20SnapshotMock.sol b/contracts/mocks/ERC20SnapshotMock.sol index 66a90c26..412c18fb 100644 --- a/contracts/mocks/ERC20SnapshotMock.sol +++ b/contracts/mocks/ERC20SnapshotMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC20/ERC20Snapshot.sol"; @@ -11,7 +11,7 @@ contract ERC20SnapshotMock is ERC20Snapshot { string memory symbol, address initialAccount, uint256 initialBalance - ) public ERC20(name, symbol) { + ) ERC20(name, symbol) { _mint(initialAccount, initialBalance); } diff --git a/contracts/mocks/ERC721BurnableMock.sol b/contracts/mocks/ERC721BurnableMock.sol index ff0b843b..2b9735ef 100644 --- a/contracts/mocks/ERC721BurnableMock.sol +++ b/contracts/mocks/ERC721BurnableMock.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC721/ERC721Burnable.sol"; contract ERC721BurnableMock is ERC721Burnable { - constructor(string memory name, string memory symbol) public ERC721(name, symbol) { } + constructor(string memory name, string memory symbol) ERC721(name, symbol) { } function mint(address to, uint256 tokenId) public { _mint(to, tokenId); diff --git a/contracts/mocks/ERC721GSNRecipientMock.sol b/contracts/mocks/ERC721GSNRecipientMock.sol index 5709b3c8..c22defb0 100644 --- a/contracts/mocks/ERC721GSNRecipientMock.sol +++ b/contracts/mocks/ERC721GSNRecipientMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC721/ERC721.sol"; import "../GSN/GSNRecipient.sol"; @@ -12,7 +12,6 @@ import "../GSN/GSNRecipientSignature.sol"; */ contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { constructor(string memory name, string memory symbol, address trustedSigner) - public ERC721(name, symbol) GSNRecipientSignature(trustedSigner) { } diff --git a/contracts/mocks/ERC721Mock.sol b/contracts/mocks/ERC721Mock.sol index 70e8285c..80d7eec9 100644 --- a/contracts/mocks/ERC721Mock.sol +++ b/contracts/mocks/ERC721Mock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC721/ERC721.sol"; @@ -9,7 +9,7 @@ import "../token/ERC721/ERC721.sol"; * This mock just provides a public safeMint, mint, and burn functions for testing purposes */ contract ERC721Mock is ERC721 { - constructor (string memory name, string memory symbol) public ERC721(name, symbol) { } + constructor (string memory name, string memory symbol) ERC721(name, symbol) { } function exists(uint256 tokenId) public view returns (bool) { return _exists(tokenId); diff --git a/contracts/mocks/ERC721PausableMock.sol b/contracts/mocks/ERC721PausableMock.sol index 35be858e..0a16e5b6 100644 --- a/contracts/mocks/ERC721PausableMock.sol +++ b/contracts/mocks/ERC721PausableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC721/ERC721Pausable.sol"; @@ -9,7 +9,7 @@ import "../token/ERC721/ERC721Pausable.sol"; * This mock just provides a public mint, burn and exists functions for testing purposes */ contract ERC721PausableMock is ERC721Pausable { - constructor (string memory name, string memory symbol) public ERC721(name, symbol) { } + constructor (string memory name, string memory symbol) ERC721(name, symbol) { } function mint(address to, uint256 tokenId) public { super._mint(to, tokenId); diff --git a/contracts/mocks/ERC721ReceiverMock.sol b/contracts/mocks/ERC721ReceiverMock.sol index 836c3c01..0d8a370f 100644 --- a/contracts/mocks/ERC721ReceiverMock.sol +++ b/contracts/mocks/ERC721ReceiverMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../token/ERC721/IERC721Receiver.sol"; @@ -10,7 +10,7 @@ contract ERC721ReceiverMock is IERC721Receiver { event Received(address operator, address from, uint256 tokenId, bytes data, uint256 gas); - constructor (bytes4 retval, bool reverts) public { + constructor (bytes4 retval, bool reverts) { _retval = retval; _reverts = reverts; } diff --git a/contracts/mocks/ERC777Mock.sol b/contracts/mocks/ERC777Mock.sol index db624cc0..b9626d8b 100644 --- a/contracts/mocks/ERC777Mock.sol +++ b/contracts/mocks/ERC777Mock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../GSN/Context.sol"; import "../token/ERC777/ERC777.sol"; @@ -12,7 +12,7 @@ contract ERC777Mock is Context, ERC777 { string memory name, string memory symbol, address[] memory defaultOperators - ) public ERC777(name, symbol, defaultOperators) { + ) ERC777(name, symbol, defaultOperators) { _mint(initialHolder, initialBalance, "", ""); } diff --git a/contracts/mocks/ERC777SenderRecipientMock.sol b/contracts/mocks/ERC777SenderRecipientMock.sol index e4ce53f8..5c30db58 100644 --- a/contracts/mocks/ERC777SenderRecipientMock.sol +++ b/contracts/mocks/ERC777SenderRecipientMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../GSN/Context.sol"; import "../token/ERC777/IERC777.sol"; diff --git a/contracts/mocks/EnumerableMapMock.sol b/contracts/mocks/EnumerableMapMock.sol index 79226d73..769597d3 100644 --- a/contracts/mocks/EnumerableMapMock.sol +++ b/contracts/mocks/EnumerableMapMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../utils/EnumerableMap.sol"; diff --git a/contracts/mocks/EnumerableSetMock.sol b/contracts/mocks/EnumerableSetMock.sol index 80454381..320e266e 100644 --- a/contracts/mocks/EnumerableSetMock.sol +++ b/contracts/mocks/EnumerableSetMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../utils/EnumerableSet.sol"; diff --git a/contracts/mocks/EtherReceiverMock.sol b/contracts/mocks/EtherReceiverMock.sol index 3e45bf13..aa1ecf9c 100644 --- a/contracts/mocks/EtherReceiverMock.sol +++ b/contracts/mocks/EtherReceiverMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; contract EtherReceiverMock { bool private _acceptEther; diff --git a/contracts/mocks/GSNRecipientERC20FeeMock.sol b/contracts/mocks/GSNRecipientERC20FeeMock.sol index 624c7307..9ec8c33b 100644 --- a/contracts/mocks/GSNRecipientERC20FeeMock.sol +++ b/contracts/mocks/GSNRecipientERC20FeeMock.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../GSN/GSNRecipient.sol"; import "../GSN/GSNRecipientERC20Fee.sol"; contract GSNRecipientERC20FeeMock is GSNRecipient, GSNRecipientERC20Fee { - constructor(string memory name, string memory symbol) public GSNRecipientERC20Fee(name, symbol) { } + constructor(string memory name, string memory symbol) GSNRecipientERC20Fee(name, symbol) { } function mint(address account, uint256 amount) public { _mint(account, amount); diff --git a/contracts/mocks/GSNRecipientMock.sol b/contracts/mocks/GSNRecipientMock.sol index 966bff32..13065c5d 100644 --- a/contracts/mocks/GSNRecipientMock.sol +++ b/contracts/mocks/GSNRecipientMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./ContextMock.sol"; import "../GSN/GSNRecipient.sol"; @@ -13,7 +13,7 @@ contract GSNRecipientMock is ContextMock, GSNRecipient { function acceptRelayedCall(address, address, bytes calldata, uint256, uint256, uint256, uint256, bytes calldata, uint256) external - view + pure override returns (uint256, bytes memory) { diff --git a/contracts/mocks/GSNRecipientSignatureMock.sol b/contracts/mocks/GSNRecipientSignatureMock.sol index a0f7a26d..17606220 100644 --- a/contracts/mocks/GSNRecipientSignatureMock.sol +++ b/contracts/mocks/GSNRecipientSignatureMock.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../GSN/GSNRecipient.sol"; import "../GSN/GSNRecipientSignature.sol"; contract GSNRecipientSignatureMock is GSNRecipient, GSNRecipientSignature { - constructor(address trustedSigner) public GSNRecipientSignature(trustedSigner) { } + constructor(address trustedSigner) GSNRecipientSignature(trustedSigner) { } event MockFunctionCalled(); diff --git a/contracts/mocks/InitializableMock.sol b/contracts/mocks/InitializableMock.sol index 424b0706..da42be20 100644 --- a/contracts/mocks/InitializableMock.sol +++ b/contracts/mocks/InitializableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../proxy/Initializable.sol"; diff --git a/contracts/mocks/MathMock.sol b/contracts/mocks/MathMock.sol index cfafcf28..97ec6f1f 100644 --- a/contracts/mocks/MathMock.sol +++ b/contracts/mocks/MathMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../math/Math.sol"; diff --git a/contracts/mocks/MerkleProofWrapper.sol b/contracts/mocks/MerkleProofWrapper.sol index f18cf8db..39878221 100644 --- a/contracts/mocks/MerkleProofWrapper.sol +++ b/contracts/mocks/MerkleProofWrapper.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import { MerkleProof } from "../cryptography/MerkleProof.sol"; diff --git a/contracts/mocks/MultipleInheritanceInitializableMocks.sol b/contracts/mocks/MultipleInheritanceInitializableMocks.sol index 8db5f9c2..cb70dc8e 100644 --- a/contracts/mocks/MultipleInheritanceInitializableMocks.sol +++ b/contracts/mocks/MultipleInheritanceInitializableMocks.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../proxy/Initializable.sol"; diff --git a/contracts/mocks/OwnableMock.sol b/contracts/mocks/OwnableMock.sol index 3ef3c7a4..6508fc38 100644 --- a/contracts/mocks/OwnableMock.sol +++ b/contracts/mocks/OwnableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../access/Ownable.sol"; diff --git a/contracts/mocks/PausableMock.sol b/contracts/mocks/PausableMock.sol index 14402850..a55f02c1 100644 --- a/contracts/mocks/PausableMock.sol +++ b/contracts/mocks/PausableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../utils/Pausable.sol"; @@ -8,7 +8,7 @@ contract PausableMock is Pausable { bool public drasticMeasureTaken; uint256 public count; - constructor () public { + constructor () { drasticMeasureTaken = false; count = 0; } diff --git a/contracts/mocks/PullPaymentMock.sol b/contracts/mocks/PullPaymentMock.sol index d4b2d656..a97c67c1 100644 --- a/contracts/mocks/PullPaymentMock.sol +++ b/contracts/mocks/PullPaymentMock.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../payment/PullPayment.sol"; // mock class using PullPayment contract PullPaymentMock is PullPayment { - constructor () public payable { } + constructor () payable { } // test helper function to call asyncTransfer function callTransfer(address dest, uint256 amount) public { diff --git a/contracts/mocks/ReentrancyAttack.sol b/contracts/mocks/ReentrancyAttack.sol index ce528e48..49cfea95 100644 --- a/contracts/mocks/ReentrancyAttack.sol +++ b/contracts/mocks/ReentrancyAttack.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../GSN/Context.sol"; contract ReentrancyAttack is Context { diff --git a/contracts/mocks/ReentrancyMock.sol b/contracts/mocks/ReentrancyMock.sol index 65444eb9..6a2422fa 100644 --- a/contracts/mocks/ReentrancyMock.sol +++ b/contracts/mocks/ReentrancyMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../utils/ReentrancyGuard.sol"; import "./ReentrancyAttack.sol"; @@ -8,7 +8,7 @@ import "./ReentrancyAttack.sol"; contract ReentrancyMock is ReentrancyGuard { uint256 public counter; - constructor () public { + constructor () { counter = 0; } diff --git a/contracts/mocks/RegressionImplementation.sol b/contracts/mocks/RegressionImplementation.sol index 7a62638a..1ba73e14 100644 --- a/contracts/mocks/RegressionImplementation.sol +++ b/contracts/mocks/RegressionImplementation.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../proxy/Initializable.sol"; diff --git a/contracts/mocks/SafeCastMock.sol b/contracts/mocks/SafeCastMock.sol index b51192fb..03a11535 100644 --- a/contracts/mocks/SafeCastMock.sol +++ b/contracts/mocks/SafeCastMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../utils/SafeCast.sol"; diff --git a/contracts/mocks/SafeERC20Helper.sol b/contracts/mocks/SafeERC20Helper.sol index fbd05d3e..ab1bc176 100644 --- a/contracts/mocks/SafeERC20Helper.sol +++ b/contracts/mocks/SafeERC20Helper.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../GSN/Context.sol"; import "../token/ERC20/IERC20.sol"; @@ -98,7 +98,7 @@ contract SafeERC20Wrapper is Context { IERC20 private _token; - constructor (IERC20 token) public { + constructor (IERC20 token) { _token = token; } diff --git a/contracts/mocks/SafeMathMock.sol b/contracts/mocks/SafeMathMock.sol index 5d2b8d8b..2aa52eff 100644 --- a/contracts/mocks/SafeMathMock.sol +++ b/contracts/mocks/SafeMathMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../math/SafeMath.sol"; diff --git a/contracts/mocks/SignedSafeMathMock.sol b/contracts/mocks/SignedSafeMathMock.sol index e5dcf32c..1e482f1e 100644 --- a/contracts/mocks/SignedSafeMathMock.sol +++ b/contracts/mocks/SignedSafeMathMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../math/SignedSafeMath.sol"; diff --git a/contracts/mocks/SingleInheritanceInitializableMocks.sol b/contracts/mocks/SingleInheritanceInitializableMocks.sol index 617eeb4f..aabda6b6 100644 --- a/contracts/mocks/SingleInheritanceInitializableMocks.sol +++ b/contracts/mocks/SingleInheritanceInitializableMocks.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../proxy/Initializable.sol"; diff --git a/contracts/mocks/StringsMock.sol b/contracts/mocks/StringsMock.sol index 203491b3..0cc76b5b 100644 --- a/contracts/mocks/StringsMock.sol +++ b/contracts/mocks/StringsMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../utils/Strings.sol"; diff --git a/contracts/package.json b/contracts/package.json index 87f19581..006dce89 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,7 +1,7 @@ { "name": "@openzeppelin/contracts", "description": "Secure Smart Contract library for Solidity", - "version": "3.3.0", + "version": "3.3.0-solc-0.7", "files": [ "**/*.sol", "/build/contracts/*.json", diff --git a/contracts/payment/PaymentSplitter.sol b/contracts/payment/PaymentSplitter.sol index f2697797..fb05cb9a 100644 --- a/contracts/payment/PaymentSplitter.sol +++ b/contracts/payment/PaymentSplitter.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../GSN/Context.sol"; import "../math/SafeMath.sol"; @@ -39,7 +39,7 @@ contract PaymentSplitter is Context { * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ - constructor (address[] memory payees, uint256[] memory shares_) public payable { + constructor (address[] memory payees, uint256[] memory shares_) payable { // solhint-disable-next-line max-line-length require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); diff --git a/contracts/payment/PullPayment.sol b/contracts/payment/PullPayment.sol index c8ade2bc..9f03976a 100644 --- a/contracts/payment/PullPayment.sol +++ b/contracts/payment/PullPayment.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.8.0; +pragma solidity ^0.7.0; import "./escrow/Escrow.sol"; @@ -25,7 +25,7 @@ import "./escrow/Escrow.sol"; abstract contract PullPayment { Escrow private _escrow; - constructor () internal { + constructor () { _escrow = new Escrow(); } diff --git a/contracts/payment/escrow/ConditionalEscrow.sol b/contracts/payment/escrow/ConditionalEscrow.sol index 8e3b36f0..4aab43ad 100644 --- a/contracts/payment/escrow/ConditionalEscrow.sol +++ b/contracts/payment/escrow/ConditionalEscrow.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./Escrow.sol"; diff --git a/contracts/payment/escrow/Escrow.sol b/contracts/payment/escrow/Escrow.sol index 4e2ea5cb..fc85802c 100644 --- a/contracts/payment/escrow/Escrow.sol +++ b/contracts/payment/escrow/Escrow.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../../math/SafeMath.sol"; import "../../access/Ownable.sol"; diff --git a/contracts/payment/escrow/RefundEscrow.sol b/contracts/payment/escrow/RefundEscrow.sol index 03cffc8d..a0bd53be 100644 --- a/contracts/payment/escrow/RefundEscrow.sol +++ b/contracts/payment/escrow/RefundEscrow.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./ConditionalEscrow.sol"; @@ -27,7 +27,7 @@ contract RefundEscrow is ConditionalEscrow { * @dev Constructor. * @param beneficiary_ The beneficiary of the deposits. */ - constructor (address payable beneficiary_) public { + constructor (address payable beneficiary_) { require(beneficiary_ != address(0), "RefundEscrow: beneficiary is the zero address"); _beneficiary = beneficiary_; _state = State.Active; diff --git a/contracts/presets/ERC1155PresetMinterPauser.sol b/contracts/presets/ERC1155PresetMinterPauser.sol index 45d59f23..1c9b0238 100644 --- a/contracts/presets/ERC1155PresetMinterPauser.sol +++ b/contracts/presets/ERC1155PresetMinterPauser.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../access/AccessControl.sol"; import "../GSN/Context.sol"; @@ -30,7 +30,7 @@ contract ERC1155PresetMinterPauser is Context, AccessControl, ERC1155Burnable, E * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE`, and `PAUSER_ROLE` to the account that * deploys the contract. */ - constructor(string memory uri) public ERC1155(uri) { + constructor(string memory uri) ERC1155(uri) { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(MINTER_ROLE, _msgSender()); diff --git a/contracts/presets/ERC20PresetMinterPauser.sol b/contracts/presets/ERC20PresetMinterPauser.sol index a3c332d7..c0634ddd 100644 --- a/contracts/presets/ERC20PresetMinterPauser.sol +++ b/contracts/presets/ERC20PresetMinterPauser.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../access/AccessControl.sol"; import "../GSN/Context.sol"; @@ -32,7 +32,7 @@ contract ERC20PresetMinterPauser is Context, AccessControl, ERC20Burnable, ERC20 * * See {ERC20-constructor}. */ - constructor(string memory name, string memory symbol) public ERC20(name, symbol) { + constructor(string memory name, string memory symbol) ERC20(name, symbol) { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(MINTER_ROLE, _msgSender()); diff --git a/contracts/presets/ERC721PresetMinterPauserAutoId.sol b/contracts/presets/ERC721PresetMinterPauserAutoId.sol index 461e014a..c043806c 100644 --- a/contracts/presets/ERC721PresetMinterPauserAutoId.sol +++ b/contracts/presets/ERC721PresetMinterPauserAutoId.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../access/AccessControl.sol"; import "../GSN/Context.sol"; @@ -39,7 +39,7 @@ contract ERC721PresetMinterPauserAutoId is Context, AccessControl, ERC721Burnabl * Token URIs will be autogenerated based on `baseURI` and their token IDs. * See {ERC721-tokenURI}. */ - constructor(string memory name, string memory symbol, string memory baseURI) public ERC721(name, symbol) { + constructor(string memory name, string memory symbol, string memory baseURI) ERC721(name, symbol) { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(MINTER_ROLE, _msgSender()); diff --git a/contracts/proxy/Proxy.sol b/contracts/proxy/Proxy.sol index a444637e..2534dd70 100644 --- a/contracts/proxy/Proxy.sol +++ b/contracts/proxy/Proxy.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM diff --git a/contracts/proxy/ProxyAdmin.sol b/contracts/proxy/ProxyAdmin.sol index f93c204c..02f63932 100644 --- a/contracts/proxy/ProxyAdmin.sol +++ b/contracts/proxy/ProxyAdmin.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../access/Ownable.sol"; import "./TransparentUpgradeableProxy.sol"; diff --git a/contracts/proxy/TransparentUpgradeableProxy.sol b/contracts/proxy/TransparentUpgradeableProxy.sol index 7908a649..18927c0b 100644 --- a/contracts/proxy/TransparentUpgradeableProxy.sol +++ b/contracts/proxy/TransparentUpgradeableProxy.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./UpgradeableProxy.sol"; @@ -30,7 +30,7 @@ contract TransparentUpgradeableProxy is UpgradeableProxy { * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and * optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}. */ - constructor(address _logic, address admin_, bytes memory _data) public payable UpgradeableProxy(_logic, _data) { + constructor(address _logic, address admin_, bytes memory _data) payable UpgradeableProxy(_logic, _data) { assert(_ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)); _setAdmin(admin_); } diff --git a/contracts/proxy/UpgradeableProxy.sol b/contracts/proxy/UpgradeableProxy.sol index 1889351a..9fd6f86c 100644 --- a/contracts/proxy/UpgradeableProxy.sol +++ b/contracts/proxy/UpgradeableProxy.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./Proxy.sol"; import "../utils/Address.sol"; @@ -21,7 +21,7 @@ contract UpgradeableProxy is Proxy { * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded * function call, and allows initializating the storage of the proxy like a Solidity constructor. */ - constructor(address _logic, bytes memory _data) public payable { + constructor(address _logic, bytes memory _data) payable { assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)); _setImplementation(_logic); if(_data.length > 0) { diff --git a/contracts/token/ERC1155/ERC1155.sol b/contracts/token/ERC1155/ERC1155.sol index b1052f67..1ecc394a 100644 --- a/contracts/token/ERC1155/ERC1155.sol +++ b/contracts/token/ERC1155/ERC1155.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./IERC1155.sol"; import "./IERC1155MetadataURI.sol"; @@ -52,7 +52,7 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { /** * @dev See {_setURI}. */ - constructor (string memory uri_) public { + constructor (string memory uri_) { _setURI(uri_); // register the supported interfaces to conform to ERC1155 via ERC165 diff --git a/contracts/token/ERC1155/ERC1155Burnable.sol b/contracts/token/ERC1155/ERC1155Burnable.sol index 9218e7ad..92a8b46e 100644 --- a/contracts/token/ERC1155/ERC1155Burnable.sol +++ b/contracts/token/ERC1155/ERC1155Burnable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./ERC1155.sol"; diff --git a/contracts/token/ERC1155/ERC1155Holder.sol b/contracts/token/ERC1155/ERC1155Holder.sol index 7f7ea9b9..647feb35 100644 --- a/contracts/token/ERC1155/ERC1155Holder.sol +++ b/contracts/token/ERC1155/ERC1155Holder.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./ERC1155Receiver.sol"; diff --git a/contracts/token/ERC1155/ERC1155Pausable.sol b/contracts/token/ERC1155/ERC1155Pausable.sol index 82d99161..436bf1a2 100644 --- a/contracts/token/ERC1155/ERC1155Pausable.sol +++ b/contracts/token/ERC1155/ERC1155Pausable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./ERC1155.sol"; import "../../utils/Pausable.sol"; diff --git a/contracts/token/ERC1155/ERC1155Receiver.sol b/contracts/token/ERC1155/ERC1155Receiver.sol index 7a4a342d..d65eba87 100644 --- a/contracts/token/ERC1155/ERC1155Receiver.sol +++ b/contracts/token/ERC1155/ERC1155Receiver.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./IERC1155Receiver.sol"; import "../../introspection/ERC165.sol"; @@ -9,7 +9,7 @@ import "../../introspection/ERC165.sol"; * @dev _Available since v3.1._ */ abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { - constructor() internal { + constructor() { _registerInterface( ERC1155Receiver(0).onERC1155Received.selector ^ ERC1155Receiver(0).onERC1155BatchReceived.selector diff --git a/contracts/token/ERC1155/IERC1155.sol b/contracts/token/ERC1155/IERC1155.sol index 1f501416..1ee547f7 100644 --- a/contracts/token/ERC1155/IERC1155.sol +++ b/contracts/token/ERC1155/IERC1155.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.8.0; +pragma solidity ^0.7.0; import "../../introspection/IERC165.sol"; diff --git a/contracts/token/ERC1155/IERC1155MetadataURI.sol b/contracts/token/ERC1155/IERC1155MetadataURI.sol index ce784a5a..c0b769e1 100644 --- a/contracts/token/ERC1155/IERC1155MetadataURI.sol +++ b/contracts/token/ERC1155/IERC1155MetadataURI.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.8.0; +pragma solidity ^0.7.0; import "./IERC1155.sol"; diff --git a/contracts/token/ERC1155/IERC1155Receiver.sol b/contracts/token/ERC1155/IERC1155Receiver.sol index 4b7627e1..f4bf40f0 100644 --- a/contracts/token/ERC1155/IERC1155Receiver.sol +++ b/contracts/token/ERC1155/IERC1155Receiver.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../../introspection/IERC165.sol"; diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index f688ed6d..bbea125f 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../../GSN/Context.sol"; import "./IERC20.sol"; @@ -52,7 +52,7 @@ contract ERC20 is Context, IERC20 { * All three of these values are immutable: they can only be set once during * construction. */ - constructor (string memory name_, string memory symbol_) public { + constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _decimals = 18; diff --git a/contracts/token/ERC20/ERC20Burnable.sol b/contracts/token/ERC20/ERC20Burnable.sol index 4383f216..f85bee46 100644 --- a/contracts/token/ERC20/ERC20Burnable.sol +++ b/contracts/token/ERC20/ERC20Burnable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../../GSN/Context.sol"; import "./ERC20.sol"; diff --git a/contracts/token/ERC20/ERC20Capped.sol b/contracts/token/ERC20/ERC20Capped.sol index c42bfd99..dc779702 100644 --- a/contracts/token/ERC20/ERC20Capped.sol +++ b/contracts/token/ERC20/ERC20Capped.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./ERC20.sol"; @@ -16,7 +16,7 @@ abstract contract ERC20Capped is ERC20 { * @dev Sets the value of the `cap`. This value is immutable, it can only be * set once during construction. */ - constructor (uint256 cap_) internal { + constructor (uint256 cap_) { require(cap_ > 0, "ERC20Capped: cap is 0"); _cap = cap_; } diff --git a/contracts/token/ERC20/ERC20Pausable.sol b/contracts/token/ERC20/ERC20Pausable.sol index a2568f64..f7f0b70d 100644 --- a/contracts/token/ERC20/ERC20Pausable.sol +++ b/contracts/token/ERC20/ERC20Pausable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./ERC20.sol"; import "../../utils/Pausable.sol"; diff --git a/contracts/token/ERC20/ERC20Snapshot.sol b/contracts/token/ERC20/ERC20Snapshot.sol index 996ba731..555f2a71 100644 --- a/contracts/token/ERC20/ERC20Snapshot.sol +++ b/contracts/token/ERC20/ERC20Snapshot.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../../math/SafeMath.sol"; import "../../utils/Arrays.sol"; diff --git a/contracts/token/ERC20/IERC20.sol b/contracts/token/ERC20/IERC20.sol index 9b877d11..935dd17e 100644 --- a/contracts/token/ERC20/IERC20.sol +++ b/contracts/token/ERC20/IERC20.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. diff --git a/contracts/token/ERC20/SafeERC20.sol b/contracts/token/ERC20/SafeERC20.sol index b0511091..d048b8e5 100644 --- a/contracts/token/ERC20/SafeERC20.sol +++ b/contracts/token/ERC20/SafeERC20.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./IERC20.sol"; import "../../math/SafeMath.sol"; diff --git a/contracts/token/ERC20/TokenTimelock.sol b/contracts/token/ERC20/TokenTimelock.sol index 130a4faa..42d29e0c 100644 --- a/contracts/token/ERC20/TokenTimelock.sol +++ b/contracts/token/ERC20/TokenTimelock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./SafeERC20.sol"; @@ -23,7 +23,7 @@ contract TokenTimelock { // timestamp when token release is enabled uint256 private _releaseTime; - constructor (IERC20 token_, address beneficiary_, uint256 releaseTime_) public { + constructor (IERC20 token_, address beneficiary_, uint256 releaseTime_) { // solhint-disable-next-line not-rely-on-time require(releaseTime_ > block.timestamp, "TokenTimelock: release time is before current time"); _token = token_; diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index 15a0619c..cd84ac71 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../../GSN/Context.sol"; import "./IERC721.sol"; @@ -90,7 +90,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ - constructor (string memory name_, string memory symbol_) public { + constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; diff --git a/contracts/token/ERC721/ERC721Burnable.sol b/contracts/token/ERC721/ERC721Burnable.sol index 69bec710..2bb3042b 100644 --- a/contracts/token/ERC721/ERC721Burnable.sol +++ b/contracts/token/ERC721/ERC721Burnable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../../GSN/Context.sol"; import "./ERC721.sol"; diff --git a/contracts/token/ERC721/ERC721Holder.sol b/contracts/token/ERC721/ERC721Holder.sol index c0910e24..aea1fdda 100644 --- a/contracts/token/ERC721/ERC721Holder.sol +++ b/contracts/token/ERC721/ERC721Holder.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./IERC721Receiver.sol"; diff --git a/contracts/token/ERC721/ERC721Pausable.sol b/contracts/token/ERC721/ERC721Pausable.sol index 9301e19d..d5aa0c7d 100644 --- a/contracts/token/ERC721/ERC721Pausable.sol +++ b/contracts/token/ERC721/ERC721Pausable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "./ERC721.sol"; import "../../utils/Pausable.sol"; diff --git a/contracts/token/ERC721/IERC721.sol b/contracts/token/ERC721/IERC721.sol index 72a81c6d..24ecf25f 100644 --- a/contracts/token/ERC721/IERC721.sol +++ b/contracts/token/ERC721/IERC721.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.8.0; +pragma solidity ^0.7.0; import "../../introspection/IERC165.sol"; diff --git a/contracts/token/ERC721/IERC721Enumerable.sol b/contracts/token/ERC721/IERC721Enumerable.sol index cd08125f..94a3efa4 100644 --- a/contracts/token/ERC721/IERC721Enumerable.sol +++ b/contracts/token/ERC721/IERC721Enumerable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.8.0; +pragma solidity ^0.7.0; import "./IERC721.sol"; diff --git a/contracts/token/ERC721/IERC721Metadata.sol b/contracts/token/ERC721/IERC721Metadata.sol index 9a64c87c..a5480854 100644 --- a/contracts/token/ERC721/IERC721Metadata.sol +++ b/contracts/token/ERC721/IERC721Metadata.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.8.0; +pragma solidity ^0.7.0; import "./IERC721.sol"; diff --git a/contracts/token/ERC721/IERC721Receiver.sol b/contracts/token/ERC721/IERC721Receiver.sol index 85fd1e48..e07363d2 100644 --- a/contracts/token/ERC721/IERC721Receiver.sol +++ b/contracts/token/ERC721/IERC721Receiver.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @title ERC721 token receiver interface diff --git a/contracts/token/ERC777/ERC777.sol b/contracts/token/ERC777/ERC777.sol index 91f6f1ec..38d271ed 100644 --- a/contracts/token/ERC777/ERC777.sol +++ b/contracts/token/ERC777/ERC777.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../../GSN/Context.sol"; import "./IERC777.sol"; @@ -70,7 +70,7 @@ contract ERC777 is Context, IERC777, IERC20 { string memory name_, string memory symbol_, address[] memory defaultOperators_ - ) public { + ) { _name = name_; _symbol = symbol_; @@ -113,7 +113,7 @@ contract ERC777 is Context, IERC777, IERC20 { * * This implementation always returns `1`. */ - function granularity() public view override returns (uint256) { + function granularity() public pure override returns (uint256) { return 1; } diff --git a/contracts/token/ERC777/IERC777.sol b/contracts/token/ERC777/IERC777.sol index b68e6dc5..b37c564d 100644 --- a/contracts/token/ERC777/IERC777.sol +++ b/contracts/token/ERC777/IERC777.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Interface of the ERC777Token standard as defined in the EIP. diff --git a/contracts/token/ERC777/IERC777Recipient.sol b/contracts/token/ERC777/IERC777Recipient.sol index 71c8738a..e610996b 100644 --- a/contracts/token/ERC777/IERC777Recipient.sol +++ b/contracts/token/ERC777/IERC777Recipient.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Interface of the ERC777TokensRecipient standard as defined in the EIP. diff --git a/contracts/token/ERC777/IERC777Sender.sol b/contracts/token/ERC777/IERC777Sender.sol index 74b8a952..31190d0c 100644 --- a/contracts/token/ERC777/IERC777Sender.sol +++ b/contracts/token/ERC777/IERC777Sender.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Interface of the ERC777TokensSender standard as defined in the EIP. diff --git a/contracts/utils/Address.sol b/contracts/utils/Address.sol index 51713f27..fb76aaf3 100644 --- a/contracts/utils/Address.sol +++ b/contracts/utils/Address.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Collection of functions related to the address type diff --git a/contracts/utils/Arrays.sol b/contracts/utils/Arrays.sol index acd3b0ef..65402827 100644 --- a/contracts/utils/Arrays.sol +++ b/contracts/utils/Arrays.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../math/Math.sol"; diff --git a/contracts/utils/Counters.sol b/contracts/utils/Counters.sol index a65f7179..c424816d 100644 --- a/contracts/utils/Counters.sol +++ b/contracts/utils/Counters.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../math/SafeMath.sol"; diff --git a/contracts/utils/Create2.sol b/contracts/utils/Create2.sol index fee0510c..b5923228 100644 --- a/contracts/utils/Create2.sol +++ b/contracts/utils/Create2.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer. diff --git a/contracts/utils/EnumerableMap.sol b/contracts/utils/EnumerableMap.sol index de6f3a52..0124c78b 100644 --- a/contracts/utils/EnumerableMap.sol +++ b/contracts/utils/EnumerableMap.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Library for managing an enumerable variant of Solidity's diff --git a/contracts/utils/EnumerableSet.sol b/contracts/utils/EnumerableSet.sol index 5e22e821..609d08b6 100644 --- a/contracts/utils/EnumerableSet.sol +++ b/contracts/utils/EnumerableSet.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Library for managing diff --git a/contracts/utils/Pausable.sol b/contracts/utils/Pausable.sol index c16e22e4..81d23a05 100644 --- a/contracts/utils/Pausable.sol +++ b/contracts/utils/Pausable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; import "../GSN/Context.sol"; @@ -29,7 +29,7 @@ abstract contract Pausable is Context { /** * @dev Initializes the contract in unpaused state. */ - constructor () internal { + constructor () { _paused = false; } diff --git a/contracts/utils/ReentrancyGuard.sol b/contracts/utils/ReentrancyGuard.sol index 24c90c32..8bdebd2e 100644 --- a/contracts/utils/ReentrancyGuard.sol +++ b/contracts/utils/ReentrancyGuard.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev Contract module that helps prevent reentrant calls to a function. @@ -35,7 +35,7 @@ abstract contract ReentrancyGuard { uint256 private _status; - constructor () internal { + constructor () { _status = _NOT_ENTERED; } diff --git a/contracts/utils/SafeCast.sol b/contracts/utils/SafeCast.sol index 151bd73a..1e8355e2 100644 --- a/contracts/utils/SafeCast.sol +++ b/contracts/utils/SafeCast.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** diff --git a/contracts/utils/Strings.sol b/contracts/utils/Strings.sol index adaa6886..5177785e 100644 --- a/contracts/utils/Strings.sol +++ b/contracts/utils/Strings.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.8.0; +pragma solidity ^0.7.0; /** * @dev String operations. diff --git a/docs/modules/ROOT/pages/access-control.adoc b/docs/modules/ROOT/pages/access-control.adoc index d9b09019..195045cf 100644 --- a/docs/modules/ROOT/pages/access-control.adoc +++ b/docs/modules/ROOT/pages/access-control.adoc @@ -13,7 +13,7 @@ OpenZeppelin provides xref:api:access.adoc#Ownable[`Ownable`] for implementing o ---- // contracts/MyContract.sol // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/access/Ownable.sol"; @@ -62,7 +62,7 @@ Here's a simple example of using `AccessControl` in an xref:tokens.adoc#ERC20[`E ---- // contracts/MyToken.sol // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; @@ -71,7 +71,7 @@ contract MyToken is ERC20, AccessControl { // Create a new role identifier for the minter role bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); - constructor(address minter) public ERC20("MyToken", "TKN") { + constructor(address minter) ERC20("MyToken", "TKN") { // Grant the minter role to a specified account _setupRole(MINTER_ROLE, minter); } @@ -94,7 +94,7 @@ Let's augment our ERC20 token example by also defining a 'burner' role, which le ---- // contracts/MyToken.sol // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; @@ -103,7 +103,7 @@ contract MyToken is ERC20, AccessControl { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE"); - constructor(address minter, address burner) public ERC20("MyToken", "TKN") { + constructor(address minter, address burner) ERC20("MyToken", "TKN") { _setupRole(MINTER_ROLE, minter); _setupRole(BURNER_ROLE, burner); } @@ -139,7 +139,7 @@ Let's take a look at the ERC20 token example, this time taking advantage of the ---- // contracts/MyToken.sol // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; @@ -148,7 +148,7 @@ contract MyToken is ERC20, AccessControl { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE"); - constructor() public ERC20("MyToken", "TKN") { + constructor() ERC20("MyToken", "TKN") { // Grant the contract deployer the default admin role: it will be able // to grant and revoke any roles _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); diff --git a/docs/modules/ROOT/pages/erc1155.adoc b/docs/modules/ROOT/pages/erc1155.adoc index 9180a4b5..273f457c 100644 --- a/docs/modules/ROOT/pages/erc1155.adoc +++ b/docs/modules/ROOT/pages/erc1155.adoc @@ -34,7 +34,7 @@ Here's what a contract for tokenized items might look like: ---- // contracts/GameItems.sol // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; @@ -45,7 +45,7 @@ contract GameItems is ERC1155 { uint256 public constant SWORD = 3; uint256 public constant SHIELD = 4; - constructor() public ERC1155("https://game.example/api/item/{id}.json") { + constructor() ERC1155("https://game.example/api/item/{id}.json") { _mint(msg.sender, GOLD, 10**18, ""); _mint(msg.sender, SILVER, 10**27, ""); _mint(msg.sender, THORS_HAMMER, 1, ""); @@ -132,7 +132,7 @@ In order for our contract to receive ERC1155 tokens we can inherit from the conv ---- // contracts/MyContract.sol // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155Holder.sol"; diff --git a/docs/modules/ROOT/pages/erc20-supply.adoc b/docs/modules/ROOT/pages/erc20-supply.adoc index 3db0828d..84830615 100644 --- a/docs/modules/ROOT/pages/erc20-supply.adoc +++ b/docs/modules/ROOT/pages/erc20-supply.adoc @@ -14,7 +14,7 @@ Let's say we want a token with a fixed supply of 1000, initially allocated to th [source,solidity] ---- contract ERC20FixedSupply is ERC20 { - constructor() public { + constructor() { totalSupply += 1000; balances[msg.sender] += 1000; } @@ -26,7 +26,7 @@ Starting with Contracts v2 this pattern is not only discouraged, but disallowed. [source,solidity] ---- contract ERC20FixedSupply is ERC20 { - constructor() public ERC20("Fixed", "FIX") { + constructor() ERC20("Fixed", "FIX") { _mint(msg.sender, 1000); } } @@ -44,7 +44,7 @@ The mechanism we will implement is a token reward for the miners that produce Et [source,solidity] ---- contract ERC20WithMinerReward is ERC20 { - constructor() public ERC20("Reward", "RWD") {} + constructor() ERC20("Reward", "RWD") {} function mintMinerReward() public { _mint(block.coinbase, 1000); @@ -68,7 +68,7 @@ The accounts with the minter role don't need to be externally owned, though, and contract MinerRewardMinter { ERC20PresetMinterPauser _token; - constructor(ERC20PresetMinterPauser token) public { + constructor(ERC20PresetMinterPauser token) { _token = token; } @@ -92,7 +92,7 @@ Adding to the supply mechanism from previous sections, we can use this hook to m [source,solidity] ---- contract ERC20WithAutoMinerReward is ERC20 { - constructor() public ERC20("Reward", "RWD") {} + constructor() ERC20("Reward", "RWD") {} function _mintMinerReward() internal { _mint(block.coinbase, 1000); diff --git a/docs/modules/ROOT/pages/erc20.adoc b/docs/modules/ROOT/pages/erc20.adoc index 7a132019..3f8e579c 100644 --- a/docs/modules/ROOT/pages/erc20.adoc +++ b/docs/modules/ROOT/pages/erc20.adoc @@ -15,12 +15,12 @@ Here's what our GLD token might look like. ---- // contracts/GLDToken.sol // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract GLDToken is ERC20 { - constructor(uint256 initialSupply) public ERC20("Gold", "GLD") { + constructor(uint256 initialSupply) ERC20("Gold", "GLD") { _mint(msg.sender, initialSupply); } } diff --git a/docs/modules/ROOT/pages/erc721.adoc b/docs/modules/ROOT/pages/erc721.adoc index 005ed3f7..ef322a9a 100644 --- a/docs/modules/ROOT/pages/erc721.adoc +++ b/docs/modules/ROOT/pages/erc721.adoc @@ -14,7 +14,7 @@ Here's what a contract for tokenized items might look like: ---- // contracts/GameItem.sol // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; @@ -23,7 +23,7 @@ contract GameItem is ERC721 { using Counters for Counters.Counter; Counters.Counter private _tokenIds; - constructor() public ERC721("GameItem", "ITM") {} + constructor() ERC721("GameItem", "ITM") {} function awardItem(address player, string memory tokenURI) public diff --git a/docs/modules/ROOT/pages/erc777.adoc b/docs/modules/ROOT/pages/erc777.adoc index 7d69ca01..741afac1 100644 --- a/docs/modules/ROOT/pages/erc777.adoc +++ b/docs/modules/ROOT/pages/erc777.adoc @@ -20,13 +20,12 @@ We will replicate the `GLD` example of the xref:erc20.adoc#constructing-an-erc20 ---- // contracts/GLDToken.sol // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC777/ERC777.sol"; contract GLDToken is ERC777 { constructor(uint256 initialSupply, address[] memory defaultOperators) - public ERC777("Gold", "GLD", defaultOperators) { _mint(msg.sender, initialSupply, "", ""); diff --git a/docs/modules/ROOT/pages/extending-contracts.adoc b/docs/modules/ROOT/pages/extending-contracts.adoc index a97e2e45..bbbb1ab0 100644 --- a/docs/modules/ROOT/pages/extending-contracts.adoc +++ b/docs/modules/ROOT/pages/extending-contracts.adoc @@ -20,7 +20,7 @@ For example, imagine you want to change xref:api:access.adoc#AccessControl[`Acce ```solidity // contracts/ModifiedAccessControl.sol // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/access/AccessControl.sol"; @@ -48,7 +48,7 @@ Here is a modified version of xref:api:access.adoc#AccessControl[`AccessControl` ```solidity // contracts/ModifiedAccessControl.sol // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/access/AccessControl.sol"; @@ -80,7 +80,7 @@ Hooks are simply functions that are called before or after some action takes pla Here's how you would implement the `IERC721Receiver` pattern in `ERC20`, using the xref:api:token/ERC20.adoc#ERC20-_beforeTokenTransfer-address-address-uint256-[`_beforeTokenTransfer`] hook: ```solidity -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/docs/modules/ROOT/pages/gsn-strategies.adoc b/docs/modules/ROOT/pages/gsn-strategies.adoc index 1a7543d6..0771e4d1 100644 --- a/docs/modules/ROOT/pages/gsn-strategies.adoc +++ b/docs/modules/ROOT/pages/gsn-strategies.adoc @@ -62,7 +62,7 @@ Instead of using `GSNRecipient` directly, your GSN recipient contract will inste import "@openzeppelin/contracts/GSN/GSNRecipientSignature.sol"; contract MyContract is GSNRecipientSignature { - constructor(address trustedSigner) public GSNRecipientSignature(trustedSigner) { + constructor(address trustedSigner) GSNRecipientSignature(trustedSigner) { } } ---- @@ -108,7 +108,7 @@ Your GSN recipient contract needs to inherit from `GSNRecipientERC20Fee` along w ---- // contracts/MyContract.sol // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/GSN/GSNRecipientERC20Fee.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; @@ -116,7 +116,7 @@ import "@openzeppelin/contracts/access/AccessControl.sol"; contract MyContract is GSNRecipientERC20Fee, AccessControl { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); - constructor() public GSNRecipientERC20Fee("FeeToken", "FEE") { + constructor() GSNRecipientERC20Fee("FeeToken", "FEE") { _setupRole(MINTER_ROLE, _msgSender()); } @@ -154,7 +154,7 @@ Once your strategy is ready, all your GSN recipient needs to do is inherit from [source,solidity] ---- contract MyContract is MyCustomGSNStrategy { - constructor() public MyCustomGSNStrategy() { + constructor() MyCustomGSNStrategy() { } } ---- diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc index 96041fe6..eec9aaec 100644 --- a/docs/modules/ROOT/pages/index.adoc +++ b/docs/modules/ROOT/pages/index.adoc @@ -28,12 +28,12 @@ Once installed, you can use the contracts in the library by importing them: ---- // contracts/MyNFT.sol // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract MyNFT is ERC721 { - constructor() ERC721("MyNFT", "MNFT") public { + constructor() ERC721("MyNFT", "MNFT") { } } ---- diff --git a/package-lock.json b/package-lock.json index b682eb4c..a5c6ac5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "openzeppelin-solidity", - "version": "3.3.0", + "version": "3.3.0-solc-0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index fb4befe9..9808a711 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "openzeppelin-solidity", "description": "Secure Smart Contract library for Solidity", - "version": "3.3.0", + "version": "3.3.0-solc-0.7", "files": [ "/contracts/**/*.sol", "/build/contracts/*.json",