diff --git a/.solhint.json b/.solhint.json index 44741b02f..072ceedcc 100644 --- a/.solhint.json +++ b/.solhint.json @@ -4,8 +4,9 @@ "func-order": "off", "mark-callable-contracts": "off", "no-empty-blocks": "off", - "compiler-version": ["error", "^0.6.0"], + "compiler-version": "off", "private-vars-leading-underscore": "error", - "reason-string": "off" + "reason-string": "off", + "func-visibility": ["error", { "ignoreConstructors": true }] } } diff --git a/contracts/GSN/Context.sol b/contracts/GSN/Context.sol index 337acb193..3d07c4aad 100644 --- a/contracts/GSN/Context.sol +++ b/contracts/GSN/Context.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the diff --git a/contracts/GSN/GSNRecipient.sol b/contracts/GSN/GSNRecipient.sol index c69d53bbc..ae0c795b3 100644 --- a/contracts/GSN/GSNRecipient.sol +++ b/contracts/GSN/GSNRecipient.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "./IRelayRecipient.sol"; import "./IRelayHub.sol"; diff --git a/contracts/GSN/GSNRecipientERC20Fee.sol b/contracts/GSN/GSNRecipientERC20Fee.sol index 240532556..1abe9f3b1 100644 --- a/contracts/GSN/GSNRecipientERC20Fee.sol +++ b/contracts/GSN/GSNRecipientERC20Fee.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "./GSNRecipient.sol"; import "../math/SafeMath.sol"; @@ -86,6 +86,8 @@ contract GSNRecipientERC20Fee is GSNRecipient { // The maximum token charge is pre-charged from the user _token.safeTransferFrom(from, address(this), maxPossibleCharge); + + return 0; } /** diff --git a/contracts/GSN/GSNRecipientSignature.sol b/contracts/GSN/GSNRecipientSignature.sol index ee514de6e..e61939494 100644 --- a/contracts/GSN/GSNRecipientSignature.sol +++ b/contracts/GSN/GSNRecipientSignature.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "./GSNRecipient.sol"; import "../cryptography/ECDSA.sol"; diff --git a/contracts/GSN/IRelayHub.sol b/contracts/GSN/IRelayHub.sol index 7e4be7cfb..34930334a 100644 --- a/contracts/GSN/IRelayHub.sol +++ b/contracts/GSN/IRelayHub.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.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 4ecaf1e25..0257e6551 100644 --- a/contracts/GSN/IRelayRecipient.sol +++ b/contracts/GSN/IRelayRecipient.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.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 27ba9e8dc..395e9a413 100644 --- a/contracts/access/AccessControl.sol +++ b/contracts/access/AccessControl.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../utils/EnumerableSet.sol"; import "../utils/Address.sol"; diff --git a/contracts/access/Ownable.sol b/contracts/access/Ownable.sol index 353e79c2c..0223a15fe 100644 --- a/contracts/access/Ownable.sol +++ b/contracts/access/Ownable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../GSN/Context.sol"; /** @@ -15,7 +15,7 @@ import "../GSN/Context.sol"; * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ -contract Ownable is Context { +abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); diff --git a/contracts/access/TimelockController.sol b/contracts/access/TimelockController.sol index f2a025c4c..540a69e07 100644 --- a/contracts/access/TimelockController.sol +++ b/contracts/access/TimelockController.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.9 <0.8.0; pragma experimental ABIEncoderV2; import "./../math/SafeMath.sol"; diff --git a/contracts/cryptography/ECDSA.sol b/contracts/cryptography/ECDSA.sol index 5e58a26a4..ae2a014e4 100644 --- a/contracts/cryptography/ECDSA.sol +++ b/contracts/cryptography/ECDSA.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. diff --git a/contracts/cryptography/MerkleProof.sol b/contracts/cryptography/MerkleProof.sol index 8a5fc90f5..665a93a3d 100644 --- a/contracts/cryptography/MerkleProof.sol +++ b/contracts/cryptography/MerkleProof.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.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 8f34a88ac..79e5f6460 100644 --- a/contracts/introspection/ERC165.sol +++ b/contracts/introspection/ERC165.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "./IERC165.sol"; @@ -10,7 +10,7 @@ import "./IERC165.sol"; * Contracts may inherit from this and call {_registerInterface} to declare * their support of an interface. */ -contract ERC165 is IERC165 { +abstract contract ERC165 is IERC165 { /* * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7 */ diff --git a/contracts/introspection/ERC165Checker.sol b/contracts/introspection/ERC165Checker.sol index 5469e020a..75eb50ee4 100644 --- a/contracts/introspection/ERC165Checker.sol +++ b/contracts/introspection/ERC165Checker.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.2; +pragma solidity >=0.6.2 <0.8.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 df740a7a5..69b644e9d 100644 --- a/contracts/introspection/ERC1820Implementer.sol +++ b/contracts/introspection/ERC1820Implementer.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "./IERC1820Implementer.sol"; diff --git a/contracts/introspection/IERC165.sol b/contracts/introspection/IERC165.sol index 425458d69..d47435525 100644 --- a/contracts/introspection/IERC165.sol +++ b/contracts/introspection/IERC165.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the diff --git a/contracts/introspection/IERC1820Implementer.sol b/contracts/introspection/IERC1820Implementer.sol index 1eb89e78d..c507da0cc 100644 --- a/contracts/introspection/IERC1820Implementer.sol +++ b/contracts/introspection/IERC1820Implementer.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface for an ERC1820 implementer, as defined in the diff --git a/contracts/introspection/IERC1820Registry.sol b/contracts/introspection/IERC1820Registry.sol index be92e465a..e63bf0417 100644 --- a/contracts/introspection/IERC1820Registry.sol +++ b/contracts/introspection/IERC1820Registry.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the global ERC1820 Registry, as defined in the @@ -59,7 +59,7 @@ interface IERC1820Registry { * queried for support, unless `implementer` is the caller. See * {IERC1820Implementer-canImplementInterfaceForAddress}. */ - function setInterfaceImplementer(address account, bytes32 interfaceHash, address implementer) external; + function setInterfaceImplementer(address account, bytes32 _interfaceHash, address implementer) external; /** * @dev Returns the implementer of `interfaceHash` for `account`. If no such @@ -70,7 +70,7 @@ interface IERC1820Registry { * * `account` being the zero address is an alias for the caller's address. */ - function getInterfaceImplementer(address account, bytes32 interfaceHash) external view returns (address); + function getInterfaceImplementer(address account, bytes32 _interfaceHash) external view returns (address); /** * @dev Returns the interface hash for an `interfaceName`, as defined in the diff --git a/contracts/math/Math.sol b/contracts/math/Math.sol index ec4ac227d..a0c35b5a2 100644 --- a/contracts/math/Math.sol +++ b/contracts/math/Math.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /** * @dev Standard math utilities missing in the Solidity language. diff --git a/contracts/math/SafeMath.sol b/contracts/math/SafeMath.sol index 80490effe..7975c634c 100644 --- a/contracts/math/SafeMath.sol +++ b/contracts/math/SafeMath.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow diff --git a/contracts/math/SignedSafeMath.sol b/contracts/math/SignedSafeMath.sol index ab87c27c9..c8b1bc53f 100644 --- a/contracts/math/SignedSafeMath.sol +++ b/contracts/math/SignedSafeMath.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /** * @title SignedSafeMath diff --git a/contracts/mocks/AccessControlMock.sol b/contracts/mocks/AccessControlMock.sol index 2f31a7a69..968d3893b 100644 --- a/contracts/mocks/AccessControlMock.sol +++ b/contracts/mocks/AccessControlMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../access/AccessControl.sol"; diff --git a/contracts/mocks/AddressImpl.sol b/contracts/mocks/AddressImpl.sol index 8a80a84bc..1d84dbec4 100644 --- a/contracts/mocks/AddressImpl.sol +++ b/contracts/mocks/AddressImpl.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../utils/Address.sol"; diff --git a/contracts/mocks/ArraysImpl.sol b/contracts/mocks/ArraysImpl.sol index b4bfcf1fb..d3c4a13d2 100644 --- a/contracts/mocks/ArraysImpl.sol +++ b/contracts/mocks/ArraysImpl.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../utils/Arrays.sol"; diff --git a/contracts/mocks/CallReceiverMock.sol b/contracts/mocks/CallReceiverMock.sol index b76175214..0ab2d84d2 100644 --- a/contracts/mocks/CallReceiverMock.sol +++ b/contracts/mocks/CallReceiverMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; contract CallReceiverMock { string public sharedAnswer; diff --git a/contracts/mocks/ClashingImplementation.sol b/contracts/mocks/ClashingImplementation.sol index b75621351..1780781a5 100644 --- a/contracts/mocks/ClashingImplementation.sol +++ b/contracts/mocks/ClashingImplementation.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /** diff --git a/contracts/mocks/ConditionalEscrowMock.sol b/contracts/mocks/ConditionalEscrowMock.sol index a93b2d760..4d5f1f054 100644 --- a/contracts/mocks/ConditionalEscrowMock.sol +++ b/contracts/mocks/ConditionalEscrowMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../payment/escrow/ConditionalEscrow.sol"; diff --git a/contracts/mocks/ContextMock.sol b/contracts/mocks/ContextMock.sol index ec7c8844c..daae264fc 100644 --- a/contracts/mocks/ContextMock.sol +++ b/contracts/mocks/ContextMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../GSN/Context.sol"; diff --git a/contracts/mocks/CountersImpl.sol b/contracts/mocks/CountersImpl.sol index 46f9ef9e0..ee7c83042 100644 --- a/contracts/mocks/CountersImpl.sol +++ b/contracts/mocks/CountersImpl.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../utils/Counters.sol"; diff --git a/contracts/mocks/Create2Impl.sol b/contracts/mocks/Create2Impl.sol index 23f6c172b..0bcd8cbbf 100644 --- a/contracts/mocks/Create2Impl.sol +++ b/contracts/mocks/Create2Impl.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../utils/Create2.sol"; import "../introspection/ERC1820Implementer.sol"; diff --git a/contracts/mocks/DummyImplementation.sol b/contracts/mocks/DummyImplementation.sol index 0d4883d94..38569ebd8 100644 --- a/contracts/mocks/DummyImplementation.sol +++ b/contracts/mocks/DummyImplementation.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.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 d1e135000..d8ef1062d 100644 --- a/contracts/mocks/ECDSAMock.sol +++ b/contracts/mocks/ECDSAMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../cryptography/ECDSA.sol"; diff --git a/contracts/mocks/ERC1155BurnableMock.sol b/contracts/mocks/ERC1155BurnableMock.sol index cce25894b..38f117e67 100644 --- a/contracts/mocks/ERC1155BurnableMock.sol +++ b/contracts/mocks/ERC1155BurnableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC1155/ERC1155Burnable.sol"; diff --git a/contracts/mocks/ERC1155Mock.sol b/contracts/mocks/ERC1155Mock.sol index 5b66cfe8e..e1127086c 100644 --- a/contracts/mocks/ERC1155Mock.sol +++ b/contracts/mocks/ERC1155Mock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC1155/ERC1155.sol"; diff --git a/contracts/mocks/ERC1155PausableMock.sol b/contracts/mocks/ERC1155PausableMock.sol index d76fe8123..2502b8f39 100644 --- a/contracts/mocks/ERC1155PausableMock.sol +++ b/contracts/mocks/ERC1155PausableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "./ERC1155Mock.sol"; import "../token/ERC1155/ERC1155Pausable.sol"; diff --git a/contracts/mocks/ERC1155ReceiverMock.sol b/contracts/mocks/ERC1155ReceiverMock.sol index 145c16352..9e665c821 100644 --- a/contracts/mocks/ERC1155ReceiverMock.sol +++ b/contracts/mocks/ERC1155ReceiverMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC1155/IERC1155Receiver.sol"; import "./ERC165Mock.sol"; diff --git a/contracts/mocks/ERC165/ERC165InterfacesSupported.sol b/contracts/mocks/ERC165/ERC165InterfacesSupported.sol index 32a430c2e..b44f23520 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; +pragma solidity >=0.6.0 <0.8.0; import "../../introspection/IERC165.sol"; diff --git a/contracts/mocks/ERC165/ERC165NotSupported.sol b/contracts/mocks/ERC165/ERC165NotSupported.sol index 0a8a2f8cc..0a8a26464 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; +pragma solidity >=0.6.0 <0.8.0; contract ERC165NotSupported { } diff --git a/contracts/mocks/ERC165CheckerMock.sol b/contracts/mocks/ERC165CheckerMock.sol index 85093113f..5c18e66bf 100644 --- a/contracts/mocks/ERC165CheckerMock.sol +++ b/contracts/mocks/ERC165CheckerMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../introspection/ERC165Checker.sol"; diff --git a/contracts/mocks/ERC165Mock.sol b/contracts/mocks/ERC165Mock.sol index 147039293..6a3ffb6a7 100644 --- a/contracts/mocks/ERC165Mock.sol +++ b/contracts/mocks/ERC165Mock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../introspection/ERC165.sol"; diff --git a/contracts/mocks/ERC1820ImplementerMock.sol b/contracts/mocks/ERC1820ImplementerMock.sol index 18b75672b..958387705 100644 --- a/contracts/mocks/ERC1820ImplementerMock.sol +++ b/contracts/mocks/ERC1820ImplementerMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../introspection/ERC1820Implementer.sol"; diff --git a/contracts/mocks/ERC20BurnableMock.sol b/contracts/mocks/ERC20BurnableMock.sol index ae777a225..ffcaf440c 100644 --- a/contracts/mocks/ERC20BurnableMock.sol +++ b/contracts/mocks/ERC20BurnableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC20/ERC20Burnable.sol"; diff --git a/contracts/mocks/ERC20CappedMock.sol b/contracts/mocks/ERC20CappedMock.sol index 1de31c918..a59bec9ea 100644 --- a/contracts/mocks/ERC20CappedMock.sol +++ b/contracts/mocks/ERC20CappedMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC20/ERC20Capped.sol"; diff --git a/contracts/mocks/ERC20DecimalsMock.sol b/contracts/mocks/ERC20DecimalsMock.sol index 8eaf70090..5fcad4c43 100644 --- a/contracts/mocks/ERC20DecimalsMock.sol +++ b/contracts/mocks/ERC20DecimalsMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC20/ERC20.sol"; diff --git a/contracts/mocks/ERC20Mock.sol b/contracts/mocks/ERC20Mock.sol index 525ba6abe..4e441d9c8 100644 --- a/contracts/mocks/ERC20Mock.sol +++ b/contracts/mocks/ERC20Mock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC20/ERC20.sol"; diff --git a/contracts/mocks/ERC20PausableMock.sol b/contracts/mocks/ERC20PausableMock.sol index a6f5cc48d..541b62cc1 100644 --- a/contracts/mocks/ERC20PausableMock.sol +++ b/contracts/mocks/ERC20PausableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC20/ERC20Pausable.sol"; diff --git a/contracts/mocks/ERC20SnapshotMock.sol b/contracts/mocks/ERC20SnapshotMock.sol index 1fee817c8..66a90c269 100644 --- a/contracts/mocks/ERC20SnapshotMock.sol +++ b/contracts/mocks/ERC20SnapshotMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC20/ERC20Snapshot.sol"; diff --git a/contracts/mocks/ERC721BurnableMock.sol b/contracts/mocks/ERC721BurnableMock.sol index ee1ca3ff5..ff0b843b0 100644 --- a/contracts/mocks/ERC721BurnableMock.sol +++ b/contracts/mocks/ERC721BurnableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC721/ERC721Burnable.sol"; diff --git a/contracts/mocks/ERC721GSNRecipientMock.sol b/contracts/mocks/ERC721GSNRecipientMock.sol index e761b3f7c..5709b3c86 100644 --- a/contracts/mocks/ERC721GSNRecipientMock.sol +++ b/contracts/mocks/ERC721GSNRecipientMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC721/ERC721.sol"; import "../GSN/GSNRecipient.sol"; diff --git a/contracts/mocks/ERC721Mock.sol b/contracts/mocks/ERC721Mock.sol index f2d8ee88e..70e8285c3 100644 --- a/contracts/mocks/ERC721Mock.sol +++ b/contracts/mocks/ERC721Mock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC721/ERC721.sol"; diff --git a/contracts/mocks/ERC721PausableMock.sol b/contracts/mocks/ERC721PausableMock.sol index edfdc081d..35be858ec 100644 --- a/contracts/mocks/ERC721PausableMock.sol +++ b/contracts/mocks/ERC721PausableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC721/ERC721Pausable.sol"; diff --git a/contracts/mocks/ERC721ReceiverMock.sol b/contracts/mocks/ERC721ReceiverMock.sol index 35c794ecd..836c3c010 100644 --- a/contracts/mocks/ERC721ReceiverMock.sol +++ b/contracts/mocks/ERC721ReceiverMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../token/ERC721/IERC721Receiver.sol"; diff --git a/contracts/mocks/ERC777Mock.sol b/contracts/mocks/ERC777Mock.sol index 42a02a3d7..db624cc06 100644 --- a/contracts/mocks/ERC777Mock.sol +++ b/contracts/mocks/ERC777Mock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../GSN/Context.sol"; import "../token/ERC777/ERC777.sol"; diff --git a/contracts/mocks/ERC777SenderRecipientMock.sol b/contracts/mocks/ERC777SenderRecipientMock.sol index 707eb0182..e4ce53f89 100644 --- a/contracts/mocks/ERC777SenderRecipientMock.sol +++ b/contracts/mocks/ERC777SenderRecipientMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../GSN/Context.sol"; import "../token/ERC777/IERC777.sol"; diff --git a/contracts/mocks/EnumerableMapMock.sol b/contracts/mocks/EnumerableMapMock.sol index 8e15be43b..79226d739 100644 --- a/contracts/mocks/EnumerableMapMock.sol +++ b/contracts/mocks/EnumerableMapMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../utils/EnumerableMap.sol"; diff --git a/contracts/mocks/EnumerableSetMock.sol b/contracts/mocks/EnumerableSetMock.sol index 2241b3236..80454381e 100644 --- a/contracts/mocks/EnumerableSetMock.sol +++ b/contracts/mocks/EnumerableSetMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../utils/EnumerableSet.sol"; diff --git a/contracts/mocks/EtherReceiverMock.sol b/contracts/mocks/EtherReceiverMock.sol index 35d502079..3e45bf133 100644 --- a/contracts/mocks/EtherReceiverMock.sol +++ b/contracts/mocks/EtherReceiverMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; contract EtherReceiverMock { bool private _acceptEther; diff --git a/contracts/mocks/GSNRecipientERC20FeeMock.sol b/contracts/mocks/GSNRecipientERC20FeeMock.sol index b7f8d6a7d..624c7307c 100644 --- a/contracts/mocks/GSNRecipientERC20FeeMock.sol +++ b/contracts/mocks/GSNRecipientERC20FeeMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../GSN/GSNRecipient.sol"; import "../GSN/GSNRecipientERC20Fee.sol"; diff --git a/contracts/mocks/GSNRecipientMock.sol b/contracts/mocks/GSNRecipientMock.sol index d2ba511f3..966bff321 100644 --- a/contracts/mocks/GSNRecipientMock.sol +++ b/contracts/mocks/GSNRecipientMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "./ContextMock.sol"; import "../GSN/GSNRecipient.sol"; diff --git a/contracts/mocks/GSNRecipientSignatureMock.sol b/contracts/mocks/GSNRecipientSignatureMock.sol index 7f776e65c..a0f7a26de 100644 --- a/contracts/mocks/GSNRecipientSignatureMock.sol +++ b/contracts/mocks/GSNRecipientSignatureMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../GSN/GSNRecipient.sol"; import "../GSN/GSNRecipientSignature.sol"; diff --git a/contracts/mocks/InitializableMock.sol b/contracts/mocks/InitializableMock.sol index a3f53687c..424b0706e 100644 --- a/contracts/mocks/InitializableMock.sol +++ b/contracts/mocks/InitializableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../proxy/Initializable.sol"; diff --git a/contracts/mocks/MathMock.sol b/contracts/mocks/MathMock.sol index 11472f26f..cfafcf280 100644 --- a/contracts/mocks/MathMock.sol +++ b/contracts/mocks/MathMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../math/Math.sol"; diff --git a/contracts/mocks/MerkleProofWrapper.sol b/contracts/mocks/MerkleProofWrapper.sol index 9f6da8a15..f18cf8dbb 100644 --- a/contracts/mocks/MerkleProofWrapper.sol +++ b/contracts/mocks/MerkleProofWrapper.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import { MerkleProof } from "../cryptography/MerkleProof.sol"; diff --git a/contracts/mocks/MultipleInheritanceInitializableMocks.sol b/contracts/mocks/MultipleInheritanceInitializableMocks.sol index e7e82c57f..8db5f9c23 100644 --- a/contracts/mocks/MultipleInheritanceInitializableMocks.sol +++ b/contracts/mocks/MultipleInheritanceInitializableMocks.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../proxy/Initializable.sol"; diff --git a/contracts/mocks/OwnableMock.sol b/contracts/mocks/OwnableMock.sol index 63562f50c..3ef3c7a46 100644 --- a/contracts/mocks/OwnableMock.sol +++ b/contracts/mocks/OwnableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../access/Ownable.sol"; diff --git a/contracts/mocks/PausableMock.sol b/contracts/mocks/PausableMock.sol index 827441dc3..144028503 100644 --- a/contracts/mocks/PausableMock.sol +++ b/contracts/mocks/PausableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../utils/Pausable.sol"; diff --git a/contracts/mocks/PullPaymentMock.sol b/contracts/mocks/PullPaymentMock.sol index aaaebf7f0..d4b2d6567 100644 --- a/contracts/mocks/PullPaymentMock.sol +++ b/contracts/mocks/PullPaymentMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../payment/PullPayment.sol"; diff --git a/contracts/mocks/ReentrancyAttack.sol b/contracts/mocks/ReentrancyAttack.sol index b3fbde536..ce528e482 100644 --- a/contracts/mocks/ReentrancyAttack.sol +++ b/contracts/mocks/ReentrancyAttack.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../GSN/Context.sol"; contract ReentrancyAttack is Context { diff --git a/contracts/mocks/ReentrancyMock.sol b/contracts/mocks/ReentrancyMock.sol index 67610bb95..65444eb90 100644 --- a/contracts/mocks/ReentrancyMock.sol +++ b/contracts/mocks/ReentrancyMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../utils/ReentrancyGuard.sol"; import "./ReentrancyAttack.sol"; diff --git a/contracts/mocks/RegressionImplementation.sol b/contracts/mocks/RegressionImplementation.sol index 1db26ac96..7a62638a7 100644 --- a/contracts/mocks/RegressionImplementation.sol +++ b/contracts/mocks/RegressionImplementation.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../proxy/Initializable.sol"; diff --git a/contracts/mocks/SafeCastMock.sol b/contracts/mocks/SafeCastMock.sol index cb953213d..b51192fb0 100644 --- a/contracts/mocks/SafeCastMock.sol +++ b/contracts/mocks/SafeCastMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../utils/SafeCast.sol"; diff --git a/contracts/mocks/SafeERC20Helper.sol b/contracts/mocks/SafeERC20Helper.sol index d2dd31475..fbd05d3e0 100644 --- a/contracts/mocks/SafeERC20Helper.sol +++ b/contracts/mocks/SafeERC20Helper.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../GSN/Context.sol"; import "../token/ERC20/IERC20.sol"; diff --git a/contracts/mocks/SafeMathMock.sol b/contracts/mocks/SafeMathMock.sol index 0a07b3eba..5d2b8d8b2 100644 --- a/contracts/mocks/SafeMathMock.sol +++ b/contracts/mocks/SafeMathMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../math/SafeMath.sol"; diff --git a/contracts/mocks/SignedSafeMathMock.sol b/contracts/mocks/SignedSafeMathMock.sol index 01c390764..e5dcf32cc 100644 --- a/contracts/mocks/SignedSafeMathMock.sol +++ b/contracts/mocks/SignedSafeMathMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../math/SignedSafeMath.sol"; diff --git a/contracts/mocks/SingleInheritanceInitializableMocks.sol b/contracts/mocks/SingleInheritanceInitializableMocks.sol index a9fcbce2d..617eeb4f7 100644 --- a/contracts/mocks/SingleInheritanceInitializableMocks.sol +++ b/contracts/mocks/SingleInheritanceInitializableMocks.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../proxy/Initializable.sol"; diff --git a/contracts/mocks/StringsMock.sol b/contracts/mocks/StringsMock.sol index 56963791b..203491b32 100644 --- a/contracts/mocks/StringsMock.sol +++ b/contracts/mocks/StringsMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../utils/Strings.sol"; diff --git a/contracts/package.json b/contracts/package.json index dbcd10202..0a2eadd77 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.2.0", + "version": "3.2.2-solc-0.7", "files": [ "**/*.sol", "/build/contracts/*.json", diff --git a/contracts/payment/PaymentSplitter.sol b/contracts/payment/PaymentSplitter.sol index cba962181..f2697797d 100644 --- a/contracts/payment/PaymentSplitter.sol +++ b/contracts/payment/PaymentSplitter.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../GSN/Context.sol"; import "../math/SafeMath.sol"; @@ -39,13 +39,13 @@ 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_) public payable { // solhint-disable-next-line max-line-length - require(payees.length == shares.length, "PaymentSplitter: payees and shares length mismatch"); + require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { - _addPayee(payees[i], shares[i]); + _addPayee(payees[i], shares_[i]); } } diff --git a/contracts/payment/PullPayment.sol b/contracts/payment/PullPayment.sol index 605edce65..c8ade2bcc 100644 --- a/contracts/payment/PullPayment.sol +++ b/contracts/payment/PullPayment.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.2; +pragma solidity >=0.6.2 <0.8.0; import "./escrow/Escrow.sol"; @@ -22,7 +22,7 @@ import "./escrow/Escrow.sol"; * instead of Solidity's `transfer` function. Payees can query their due * payments with {payments}, and retrieve them with {withdrawPayments}. */ -contract PullPayment { +abstract contract PullPayment { Escrow private _escrow; constructor () internal { diff --git a/contracts/payment/escrow/ConditionalEscrow.sol b/contracts/payment/escrow/ConditionalEscrow.sol index 54bf17471..8e3b36f06 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; +pragma solidity >=0.6.0 <0.8.0; import "./Escrow.sol"; diff --git a/contracts/payment/escrow/Escrow.sol b/contracts/payment/escrow/Escrow.sol index c9fc76e9f..4e2ea5cb8 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; +pragma solidity >=0.6.0 <0.8.0; import "../../math/SafeMath.sol"; import "../../access/Ownable.sol"; diff --git a/contracts/payment/escrow/RefundEscrow.sol b/contracts/payment/escrow/RefundEscrow.sol index e581e7530..03cffc8d3 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; +pragma solidity >=0.6.0 <0.8.0; import "./ConditionalEscrow.sol"; @@ -25,11 +25,11 @@ contract RefundEscrow is ConditionalEscrow { /** * @dev Constructor. - * @param beneficiary The beneficiary of the deposits. + * @param beneficiary_ The beneficiary of the deposits. */ - constructor (address payable beneficiary) public { - require(beneficiary != address(0), "RefundEscrow: beneficiary is the zero address"); - _beneficiary = beneficiary; + constructor (address payable beneficiary_) public { + 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 078406ae5..45d59f239 100644 --- a/contracts/presets/ERC1155PresetMinterPauser.sol +++ b/contracts/presets/ERC1155PresetMinterPauser.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../access/AccessControl.sol"; import "../GSN/Context.sol"; diff --git a/contracts/presets/ERC20PresetMinterPauser.sol b/contracts/presets/ERC20PresetMinterPauser.sol index 00175955f..a3c332d78 100644 --- a/contracts/presets/ERC20PresetMinterPauser.sol +++ b/contracts/presets/ERC20PresetMinterPauser.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../access/AccessControl.sol"; import "../GSN/Context.sol"; diff --git a/contracts/presets/ERC721PresetMinterPauserAutoId.sol b/contracts/presets/ERC721PresetMinterPauserAutoId.sol index 18605c7b0..461e014a1 100644 --- a/contracts/presets/ERC721PresetMinterPauserAutoId.sol +++ b/contracts/presets/ERC721PresetMinterPauserAutoId.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../access/AccessControl.sol"; import "../GSN/Context.sol"; diff --git a/contracts/proxy/Initializable.sol b/contracts/proxy/Initializable.sol index e974746fe..514fbbb19 100644 --- a/contracts/proxy/Initializable.sol +++ b/contracts/proxy/Initializable.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version -pragma solidity >=0.4.24 <0.7.0; +pragma solidity >=0.4.24 <0.8.0; /** diff --git a/contracts/proxy/Proxy.sol b/contracts/proxy/Proxy.sol index 28cb9853e..a444637ed 100644 --- a/contracts/proxy/Proxy.sol +++ b/contracts/proxy/Proxy.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.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 26af407f4..f93c204ce 100644 --- a/contracts/proxy/ProxyAdmin.sol +++ b/contracts/proxy/ProxyAdmin.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../access/Ownable.sol"; import "./TransparentUpgradeableProxy.sol"; diff --git a/contracts/proxy/TransparentUpgradeableProxy.sol b/contracts/proxy/TransparentUpgradeableProxy.sol index 547007f6b..7908a6497 100644 --- a/contracts/proxy/TransparentUpgradeableProxy.sol +++ b/contracts/proxy/TransparentUpgradeableProxy.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "./UpgradeableProxy.sol"; @@ -30,9 +30,9 @@ 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) public payable UpgradeableProxy(_logic, _data) { assert(_ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)); - _setAdmin(_admin); + _setAdmin(admin_); } /** @@ -67,8 +67,8 @@ contract TransparentUpgradeableProxy is UpgradeableProxy { * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103` */ - function admin() external ifAdmin returns (address) { - return _admin(); + function admin() external ifAdmin returns (address admin_) { + admin_ = _admin(); } /** @@ -80,8 +80,8 @@ contract TransparentUpgradeableProxy is UpgradeableProxy { * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` */ - function implementation() external ifAdmin returns (address) { - return _implementation(); + function implementation() external ifAdmin returns (address implementation_) { + implementation_ = _implementation(); } /** diff --git a/contracts/proxy/UpgradeableProxy.sol b/contracts/proxy/UpgradeableProxy.sol index e031d4121..1889351a3 100644 --- a/contracts/proxy/UpgradeableProxy.sol +++ b/contracts/proxy/UpgradeableProxy.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "./Proxy.sol"; import "../utils/Address.sol"; diff --git a/contracts/token/ERC1155/ERC1155.sol b/contracts/token/ERC1155/ERC1155.sol index 6cb5ca978..b1052f670 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; +pragma solidity >=0.6.0 <0.8.0; import "./IERC1155.sol"; import "./IERC1155MetadataURI.sol"; @@ -52,8 +52,8 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { /** * @dev See {_setURI}. */ - constructor (string memory uri) public { - _setURI(uri); + constructor (string memory uri_) public { + _setURI(uri_); // register the supported interfaces to conform to ERC1155 via ERC165 _registerInterface(_INTERFACE_ID_ERC1155); diff --git a/contracts/token/ERC1155/ERC1155Burnable.sol b/contracts/token/ERC1155/ERC1155Burnable.sol index 83edd4778..9218e7ad2 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; +pragma solidity >=0.6.0 <0.8.0; import "./ERC1155.sol"; diff --git a/contracts/token/ERC1155/ERC1155Holder.sol b/contracts/token/ERC1155/ERC1155Holder.sol index 82d5979a3..7f7ea9b9b 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; +pragma solidity >=0.6.0 <0.8.0; import "./ERC1155Receiver.sol"; diff --git a/contracts/token/ERC1155/ERC1155Pausable.sol b/contracts/token/ERC1155/ERC1155Pausable.sol index a2626cc5f..82d99161a 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; +pragma solidity >=0.6.0 <0.8.0; import "./ERC1155.sol"; import "../../utils/Pausable.sol"; diff --git a/contracts/token/ERC1155/ERC1155Receiver.sol b/contracts/token/ERC1155/ERC1155Receiver.sol index 201660bce..7a4a342dc 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; +pragma solidity >=0.6.0 <0.8.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() public { + constructor() internal { _registerInterface( ERC1155Receiver(0).onERC1155Received.selector ^ ERC1155Receiver(0).onERC1155BatchReceived.selector diff --git a/contracts/token/ERC1155/IERC1155.sol b/contracts/token/ERC1155/IERC1155.sol index 5262661eb..1f5014162 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; +pragma solidity >=0.6.2 <0.8.0; import "../../introspection/IERC165.sol"; diff --git a/contracts/token/ERC1155/IERC1155MetadataURI.sol b/contracts/token/ERC1155/IERC1155MetadataURI.sol index 2716c7708..ce784a5a2 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; +pragma solidity >=0.6.2 <0.8.0; import "./IERC1155.sol"; diff --git a/contracts/token/ERC1155/IERC1155Receiver.sol b/contracts/token/ERC1155/IERC1155Receiver.sol index 6bd3dc2cf..4b7627e1e 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; +pragma solidity >=0.6.0 <0.8.0; import "../../introspection/IERC165.sol"; diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index 0158f3570..f688ed6d7 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; +pragma solidity >=0.6.0 <0.8.0; import "../../GSN/Context.sol"; import "./IERC20.sol"; @@ -52,9 +52,9 @@ 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 { - _name = name; - _symbol = symbol; + constructor (string memory name_, string memory symbol_) public { + _name = name_; + _symbol = symbol_; _decimals = 18; } diff --git a/contracts/token/ERC20/ERC20Burnable.sol b/contracts/token/ERC20/ERC20Burnable.sol index 2ce6bac09..4383f2168 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; +pragma solidity >=0.6.0 <0.8.0; import "../../GSN/Context.sol"; import "./ERC20.sol"; @@ -11,6 +11,8 @@ import "./ERC20.sol"; * recognized off-chain (via event analysis). */ abstract contract ERC20Burnable is Context, ERC20 { + using SafeMath for uint256; + /** * @dev Destroys `amount` tokens from the caller. * diff --git a/contracts/token/ERC20/ERC20Capped.sol b/contracts/token/ERC20/ERC20Capped.sol index 3cff3b736..c42bfd99c 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; +pragma solidity >=0.6.0 <0.8.0; import "./ERC20.sol"; @@ -8,15 +8,17 @@ import "./ERC20.sol"; * @dev Extension of {ERC20} that adds a cap to the supply of tokens. */ abstract contract ERC20Capped is ERC20 { + using SafeMath for uint256; + uint256 private _cap; /** * @dev Sets the value of the `cap`. This value is immutable, it can only be * set once during construction. */ - constructor (uint256 cap) public { - require(cap > 0, "ERC20Capped: cap is 0"); - _cap = cap; + constructor (uint256 cap_) internal { + require(cap_ > 0, "ERC20Capped: cap is 0"); + _cap = cap_; } /** diff --git a/contracts/token/ERC20/ERC20Pausable.sol b/contracts/token/ERC20/ERC20Pausable.sol index a08b9df69..a2568f643 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; +pragma solidity >=0.6.0 <0.8.0; import "./ERC20.sol"; import "../../utils/Pausable.sol"; diff --git a/contracts/token/ERC20/ERC20Snapshot.sol b/contracts/token/ERC20/ERC20Snapshot.sol index 0f8e7b6f5..996ba731e 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; +pragma solidity >=0.6.0 <0.8.0; import "../../math/SafeMath.sol"; import "../../utils/Arrays.sol"; diff --git a/contracts/token/ERC20/IERC20.sol b/contracts/token/ERC20/IERC20.sol index a1f9ca7f6..9b877d119 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; +pragma solidity >=0.6.0 <0.8.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 e5f0d23aa..b05110913 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; +pragma solidity >=0.6.0 <0.8.0; import "./IERC20.sol"; import "../../math/SafeMath.sol"; diff --git a/contracts/token/ERC20/TokenTimelock.sol b/contracts/token/ERC20/TokenTimelock.sol index 0d05ed82c..130a4faaf 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; +pragma solidity >=0.6.0 <0.8.0; import "./SafeERC20.sol"; @@ -23,12 +23,12 @@ 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_) public { // solhint-disable-next-line not-rely-on-time - require(releaseTime > block.timestamp, "TokenTimelock: release time is before current time"); - _token = token; - _beneficiary = beneficiary; - _releaseTime = releaseTime; + require(releaseTime_ > block.timestamp, "TokenTimelock: release time is before current time"); + _token = token_; + _beneficiary = beneficiary_; + _releaseTime = releaseTime_; } /** diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index fc04f1dde..15a0619c5 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; +pragma solidity >=0.6.0 <0.8.0; import "../../GSN/Context.sol"; import "./IERC721.sol"; @@ -90,9 +90,9 @@ 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 { - _name = name; - _symbol = symbol; + constructor (string memory name_, string memory symbol_) public { + _name = name_; + _symbol = symbol_; // register the supported interfaces to conform to ERC721 via ERC165 _registerInterface(_INTERFACE_ID_ERC721); diff --git a/contracts/token/ERC721/ERC721Burnable.sol b/contracts/token/ERC721/ERC721Burnable.sol index 6f767d23a..69bec7107 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; +pragma solidity >=0.6.0 <0.8.0; import "../../GSN/Context.sol"; import "./ERC721.sol"; diff --git a/contracts/token/ERC721/ERC721Holder.sol b/contracts/token/ERC721/ERC721Holder.sol index 3684bd1cc..c0910e249 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; +pragma solidity >=0.6.0 <0.8.0; import "./IERC721Receiver.sol"; diff --git a/contracts/token/ERC721/ERC721Pausable.sol b/contracts/token/ERC721/ERC721Pausable.sol index c59064743..9301e19dc 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; +pragma solidity >=0.6.0 <0.8.0; import "./ERC721.sol"; import "../../utils/Pausable.sol"; diff --git a/contracts/token/ERC721/IERC721.sol b/contracts/token/ERC721/IERC721.sol index 5e7d20e35..72a81c6d6 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; +pragma solidity >=0.6.2 <0.8.0; import "../../introspection/IERC165.sol"; diff --git a/contracts/token/ERC721/IERC721Enumerable.sol b/contracts/token/ERC721/IERC721Enumerable.sol index bd3c86d18..cd08125fb 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; +pragma solidity >=0.6.2 <0.8.0; import "./IERC721.sol"; diff --git a/contracts/token/ERC721/IERC721Metadata.sol b/contracts/token/ERC721/IERC721Metadata.sol index f2ebb4955..9a64c87c2 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; +pragma solidity >=0.6.2 <0.8.0; import "./IERC721.sol"; diff --git a/contracts/token/ERC721/IERC721Receiver.sol b/contracts/token/ERC721/IERC721Receiver.sol index 0d17a070b..85fd1e482 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; +pragma solidity >=0.6.0 <0.8.0; /** * @title ERC721 token receiver interface diff --git a/contracts/token/ERC777/ERC777.sol b/contracts/token/ERC777/ERC777.sol index 5adb8ff0d..91f6f1ec2 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; +pragma solidity >=0.6.0 <0.8.0; import "../../GSN/Context.sol"; import "./IERC777.sol"; @@ -67,14 +67,14 @@ contract ERC777 is Context, IERC777, IERC20 { * @dev `defaultOperators` may be an empty array. */ constructor( - string memory name, - string memory symbol, - address[] memory defaultOperators + string memory name_, + string memory symbol_, + address[] memory defaultOperators_ ) public { - _name = name; - _symbol = symbol; + _name = name_; + _symbol = symbol_; - _defaultOperatorsArray = defaultOperators; + _defaultOperatorsArray = defaultOperators_; for (uint256 i = 0; i < _defaultOperatorsArray.length; i++) { _defaultOperators[_defaultOperatorsArray[i]] = true; } diff --git a/contracts/token/ERC777/IERC777.sol b/contracts/token/ERC777/IERC777.sol index f3dcbe93c..b68e6dc51 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; +pragma solidity >=0.6.0 <0.8.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 179ed6626..71c8738a7 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; +pragma solidity >=0.6.0 <0.8.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 841ca208f..74b8a9528 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; +pragma solidity >=0.6.0 <0.8.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 a3a98d5d4..5d09d5edd 100644 --- a/contracts/utils/Address.sol +++ b/contracts/utils/Address.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.2; +pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type diff --git a/contracts/utils/Arrays.sol b/contracts/utils/Arrays.sol index 8d586e9e9..acd3b0ef8 100644 --- a/contracts/utils/Arrays.sol +++ b/contracts/utils/Arrays.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../math/Math.sol"; diff --git a/contracts/utils/Counters.sol b/contracts/utils/Counters.sol index 82cb62bfd..a65f71794 100644 --- a/contracts/utils/Counters.sol +++ b/contracts/utils/Counters.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../math/SafeMath.sol"; diff --git a/contracts/utils/Create2.sol b/contracts/utils/Create2.sol index 8f9efa10b..fee0510c3 100644 --- a/contracts/utils/Create2.sol +++ b/contracts/utils/Create2.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.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 82eb04c9c..de6f3a526 100644 --- a/contracts/utils/EnumerableMap.sol +++ b/contracts/utils/EnumerableMap.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /** * @dev Library for managing an enumerable variant of Solidity's diff --git a/contracts/utils/EnumerableSet.sol b/contracts/utils/EnumerableSet.sol index 3685c648b..5e22e8212 100644 --- a/contracts/utils/EnumerableSet.sol +++ b/contracts/utils/EnumerableSet.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /** * @dev Library for managing diff --git a/contracts/utils/Pausable.sol b/contracts/utils/Pausable.sol index 9e1b42ab7..c16e22e45 100644 --- a/contracts/utils/Pausable.sol +++ b/contracts/utils/Pausable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; import "../GSN/Context.sol"; @@ -13,7 +13,7 @@ import "../GSN/Context.sol"; * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ -contract Pausable is Context { +abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ diff --git a/contracts/utils/ReentrancyGuard.sol b/contracts/utils/ReentrancyGuard.sol index b7bea91f8..24c90c32f 100644 --- a/contracts/utils/ReentrancyGuard.sol +++ b/contracts/utils/ReentrancyGuard.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. @@ -18,7 +18,7 @@ pragma solidity ^0.6.0; * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ -contract ReentrancyGuard { +abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write diff --git a/contracts/utils/SafeCast.sol b/contracts/utils/SafeCast.sol index 9d283ff25..151bd73a4 100644 --- a/contracts/utils/SafeCast.sol +++ b/contracts/utils/SafeCast.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /** diff --git a/contracts/utils/Strings.sol b/contracts/utils/Strings.sol index aacce819c..adaa6886b 100644 --- a/contracts/utils/Strings.sol +++ b/contracts/utils/Strings.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; /** * @dev String operations.