diff --git a/CHANGELOG.md b/CHANGELOG.md index 8515ed31564..f2676c54dbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,14 @@ ### New features: ### Improvements:: + * Upgraded the minimum compiler version to v0.5.2: this removes many Solidity warnings that were false positives. * `Counter`'s API has been improved, and is now used by `ERC721` (though it is still in `drafts`). * `ERC721`'s transfers are now more gas efficient due to removal of unnecessary `SafeMath` calls. + * Fixed variable shadowing issues. + +### Bugfixes: + +### Breaking changes: ## 2.1.1 (2019-04-01) * Version bump to avoid conflict in the npm registry. diff --git a/contracts/access/Roles.sol b/contracts/access/Roles.sol index 63148d1f10a..1c97678c845 100644 --- a/contracts/access/Roles.sol +++ b/contracts/access/Roles.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * @title Roles diff --git a/contracts/access/roles/CapperRole.sol b/contracts/access/roles/CapperRole.sol index 94bc6e2f06a..a6d9da06cb1 100644 --- a/contracts/access/roles/CapperRole.sol +++ b/contracts/access/roles/CapperRole.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../Roles.sol"; diff --git a/contracts/access/roles/MinterRole.sol b/contracts/access/roles/MinterRole.sol index 61e70f64ff9..23d16c04290 100644 --- a/contracts/access/roles/MinterRole.sol +++ b/contracts/access/roles/MinterRole.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../Roles.sol"; diff --git a/contracts/access/roles/PauserRole.sol b/contracts/access/roles/PauserRole.sol index 2882d0ecc05..073a08e414d 100644 --- a/contracts/access/roles/PauserRole.sol +++ b/contracts/access/roles/PauserRole.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../Roles.sol"; diff --git a/contracts/access/roles/SignerRole.sol b/contracts/access/roles/SignerRole.sol index 8021cfd2b5e..91bb59c2e3b 100644 --- a/contracts/access/roles/SignerRole.sol +++ b/contracts/access/roles/SignerRole.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../Roles.sol"; diff --git a/contracts/access/roles/WhitelistAdminRole.sol b/contracts/access/roles/WhitelistAdminRole.sol index 8af7412ba6a..e5f0883d9ae 100644 --- a/contracts/access/roles/WhitelistAdminRole.sol +++ b/contracts/access/roles/WhitelistAdminRole.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../Roles.sol"; diff --git a/contracts/access/roles/WhitelistedRole.sol b/contracts/access/roles/WhitelistedRole.sol index 3ba5ae0cf93..89cf357f9ea 100644 --- a/contracts/access/roles/WhitelistedRole.sol +++ b/contracts/access/roles/WhitelistedRole.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../Roles.sol"; import "./WhitelistAdminRole.sol"; diff --git a/contracts/crowdsale/Crowdsale.sol b/contracts/crowdsale/Crowdsale.sol index fab17d18109..be0af7060b0 100644 --- a/contracts/crowdsale/Crowdsale.sol +++ b/contracts/crowdsale/Crowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/IERC20.sol"; import "../math/SafeMath.sol"; diff --git a/contracts/crowdsale/distribution/FinalizableCrowdsale.sol b/contracts/crowdsale/distribution/FinalizableCrowdsale.sol index f904e226f45..72249dbbb70 100644 --- a/contracts/crowdsale/distribution/FinalizableCrowdsale.sol +++ b/contracts/crowdsale/distribution/FinalizableCrowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../../math/SafeMath.sol"; import "../validation/TimedCrowdsale.sol"; diff --git a/contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol b/contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol index 6e10fa540c3..151b1a62498 100644 --- a/contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol +++ b/contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../validation/TimedCrowdsale.sol"; import "../../math/SafeMath.sol"; diff --git a/contracts/crowdsale/distribution/RefundableCrowdsale.sol b/contracts/crowdsale/distribution/RefundableCrowdsale.sol index 732103a1f2a..f2ba9e9f7ab 100644 --- a/contracts/crowdsale/distribution/RefundableCrowdsale.sol +++ b/contracts/crowdsale/distribution/RefundableCrowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../../math/SafeMath.sol"; import "./FinalizableCrowdsale.sol"; diff --git a/contracts/crowdsale/distribution/RefundablePostDeliveryCrowdsale.sol b/contracts/crowdsale/distribution/RefundablePostDeliveryCrowdsale.sol index be4c5b6a061..0dd351ed549 100644 --- a/contracts/crowdsale/distribution/RefundablePostDeliveryCrowdsale.sol +++ b/contracts/crowdsale/distribution/RefundablePostDeliveryCrowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./RefundableCrowdsale.sol"; import "./PostDeliveryCrowdsale.sol"; diff --git a/contracts/crowdsale/emission/AllowanceCrowdsale.sol b/contracts/crowdsale/emission/AllowanceCrowdsale.sol index b4f3aceb4f7..e7f545f5a03 100644 --- a/contracts/crowdsale/emission/AllowanceCrowdsale.sol +++ b/contracts/crowdsale/emission/AllowanceCrowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../Crowdsale.sol"; import "../../token/ERC20/IERC20.sol"; diff --git a/contracts/crowdsale/emission/MintedCrowdsale.sol b/contracts/crowdsale/emission/MintedCrowdsale.sol index f239735e0dc..b6b07ec8e46 100644 --- a/contracts/crowdsale/emission/MintedCrowdsale.sol +++ b/contracts/crowdsale/emission/MintedCrowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../Crowdsale.sol"; import "../../token/ERC20/ERC20Mintable.sol"; diff --git a/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol b/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol index 941cfe0615c..647b532fcac 100644 --- a/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol +++ b/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../validation/TimedCrowdsale.sol"; import "../../math/SafeMath.sol"; diff --git a/contracts/crowdsale/validation/CappedCrowdsale.sol b/contracts/crowdsale/validation/CappedCrowdsale.sol index 2d21c04184a..9de2fe125f4 100644 --- a/contracts/crowdsale/validation/CappedCrowdsale.sol +++ b/contracts/crowdsale/validation/CappedCrowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../../math/SafeMath.sol"; import "../Crowdsale.sol"; diff --git a/contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol b/contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol index 34bc0951935..9c317e13b1d 100644 --- a/contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol +++ b/contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../../math/SafeMath.sol"; import "../Crowdsale.sol"; diff --git a/contracts/crowdsale/validation/PausableCrowdsale.sol b/contracts/crowdsale/validation/PausableCrowdsale.sol index cc89aebab46..da2feeac2aa 100644 --- a/contracts/crowdsale/validation/PausableCrowdsale.sol +++ b/contracts/crowdsale/validation/PausableCrowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../Crowdsale.sol"; import "../../lifecycle/Pausable.sol"; diff --git a/contracts/crowdsale/validation/TimedCrowdsale.sol b/contracts/crowdsale/validation/TimedCrowdsale.sol index a67206696ad..3ce60e4b51c 100644 --- a/contracts/crowdsale/validation/TimedCrowdsale.sol +++ b/contracts/crowdsale/validation/TimedCrowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../../math/SafeMath.sol"; import "../Crowdsale.sol"; diff --git a/contracts/crowdsale/validation/WhitelistCrowdsale.sol b/contracts/crowdsale/validation/WhitelistCrowdsale.sol index 16e28786e43..b838bb97588 100644 --- a/contracts/crowdsale/validation/WhitelistCrowdsale.sol +++ b/contracts/crowdsale/validation/WhitelistCrowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../Crowdsale.sol"; import "../../access/roles/WhitelistedRole.sol"; diff --git a/contracts/cryptography/ECDSA.sol b/contracts/cryptography/ECDSA.sol index 432a23c9a81..39b6ad476fe 100644 --- a/contracts/cryptography/ECDSA.sol +++ b/contracts/cryptography/ECDSA.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * @title Elliptic curve signature operations diff --git a/contracts/cryptography/MerkleProof.sol b/contracts/cryptography/MerkleProof.sol index 2a964c8bab4..c48b58e3df0 100644 --- a/contracts/cryptography/MerkleProof.sol +++ b/contracts/cryptography/MerkleProof.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * @title MerkleProof diff --git a/contracts/drafts/Counter.sol b/contracts/drafts/Counters.sol similarity index 95% rename from contracts/drafts/Counter.sol rename to contracts/drafts/Counters.sol index 9e82147815b..7a68039cc7c 100644 --- a/contracts/drafts/Counter.sol +++ b/contracts/drafts/Counters.sol @@ -1,9 +1,9 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../math/SafeMath.sol"; /** - * @title Counter + * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids @@ -13,7 +13,7 @@ import "../math/SafeMath.sol"; * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never * directly accessed. */ -library Counter { +library Counters { using SafeMath for uint256; struct Counter { diff --git a/contracts/drafts/ERC1046/TokenMetadata.sol b/contracts/drafts/ERC1046/TokenMetadata.sol index 6b00d62fc83..de7aba0807b 100644 --- a/contracts/drafts/ERC1046/TokenMetadata.sol +++ b/contracts/drafts/ERC1046/TokenMetadata.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../../token/ERC20/IERC20.sol"; diff --git a/contracts/drafts/ERC20Migrator.sol b/contracts/drafts/ERC20Migrator.sol index ae07399a620..6553b3d9930 100644 --- a/contracts/drafts/ERC20Migrator.sol +++ b/contracts/drafts/ERC20Migrator.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/IERC20.sol"; import "../token/ERC20/ERC20Mintable.sol"; @@ -65,14 +65,14 @@ contract ERC20Migrator { /** * @dev Begins the migration by setting which is the new token that will be * minted. This contract must be a minter for the new token. - * @param newToken the token that will be minted + * @param newToken_ the token that will be minted */ - function beginMigration(ERC20Mintable newToken) public { + function beginMigration(ERC20Mintable newToken_) public { require(address(_newToken) == address(0)); - require(address(newToken) != address(0)); - require(newToken.isMinter(address(this))); + require(address(newToken_) != address(0)); + require(newToken_.isMinter(address(this))); - _newToken = newToken; + _newToken = newToken_; } /** diff --git a/contracts/drafts/SignatureBouncer.sol b/contracts/drafts/SignatureBouncer.sol index a5ec7f71290..0f259d399a1 100644 --- a/contracts/drafts/SignatureBouncer.sol +++ b/contracts/drafts/SignatureBouncer.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../access/roles/SignerRole.sol"; import "../cryptography/ECDSA.sol"; diff --git a/contracts/drafts/SignedSafeMath.sol b/contracts/drafts/SignedSafeMath.sol index 4e6ab0af7a3..24b217be898 100644 --- a/contracts/drafts/SignedSafeMath.sol +++ b/contracts/drafts/SignedSafeMath.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * @title SignedSafeMath diff --git a/contracts/drafts/TokenVesting.sol b/contracts/drafts/TokenVesting.sol index 3b42df82ca4..117dccba1bd 100644 --- a/contracts/drafts/TokenVesting.sol +++ b/contracts/drafts/TokenVesting.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/SafeERC20.sol"; import "../ownership/Ownable.sol"; diff --git a/contracts/examples/SampleCrowdsale.sol b/contracts/examples/SampleCrowdsale.sol index 674f2c22ec5..ac8aac11dec 100644 --- a/contracts/examples/SampleCrowdsale.sol +++ b/contracts/examples/SampleCrowdsale.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../crowdsale/validation/CappedCrowdsale.sol"; import "../crowdsale/distribution/RefundableCrowdsale.sol"; diff --git a/contracts/examples/SimpleToken.sol b/contracts/examples/SimpleToken.sol index 50a4f433f62..6193fc745b1 100644 --- a/contracts/examples/SimpleToken.sol +++ b/contracts/examples/SimpleToken.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20Detailed.sol"; diff --git a/contracts/introspection/ERC165.sol b/contracts/introspection/ERC165.sol index 9b57ba2fc4a..540a3b52535 100644 --- a/contracts/introspection/ERC165.sol +++ b/contracts/introspection/ERC165.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./IERC165.sol"; diff --git a/contracts/introspection/ERC165Checker.sol b/contracts/introspection/ERC165Checker.sol index f6034d4833b..0234e16ba40 100644 --- a/contracts/introspection/ERC165Checker.sol +++ b/contracts/introspection/ERC165Checker.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * @title ERC165Checker diff --git a/contracts/introspection/IERC165.sol b/contracts/introspection/IERC165.sol index 393e6fb2936..02fe2530d1a 100644 --- a/contracts/introspection/IERC165.sol +++ b/contracts/introspection/IERC165.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * @title IERC165 diff --git a/contracts/lifecycle/Pausable.sol b/contracts/lifecycle/Pausable.sol index 9c7298971dc..a1a715f5122 100644 --- a/contracts/lifecycle/Pausable.sol +++ b/contracts/lifecycle/Pausable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../access/roles/PauserRole.sol"; diff --git a/contracts/math/Math.sol b/contracts/math/Math.sol index 1cdc075f001..9eb3fe02179 100644 --- a/contracts/math/Math.sol +++ b/contracts/math/Math.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * @title Math diff --git a/contracts/math/SafeMath.sol b/contracts/math/SafeMath.sol index 54ab43acf52..759e232c6a3 100644 --- a/contracts/math/SafeMath.sol +++ b/contracts/math/SafeMath.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * @title SafeMath diff --git a/contracts/mocks/Acknowledger.sol b/contracts/mocks/Acknowledger.sol index f3f514cb0fc..b633965df0f 100644 --- a/contracts/mocks/Acknowledger.sol +++ b/contracts/mocks/Acknowledger.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; contract Acknowledger { event AcknowledgeFoo(uint256 a); diff --git a/contracts/mocks/AddressImpl.sol b/contracts/mocks/AddressImpl.sol index a73591c370a..92029cd91a2 100644 --- a/contracts/mocks/AddressImpl.sol +++ b/contracts/mocks/AddressImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../utils/Address.sol"; diff --git a/contracts/mocks/AllowanceCrowdsaleImpl.sol b/contracts/mocks/AllowanceCrowdsaleImpl.sol index 9c6fdb51193..769e677218b 100644 --- a/contracts/mocks/AllowanceCrowdsaleImpl.sol +++ b/contracts/mocks/AllowanceCrowdsaleImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/IERC20.sol"; import "../crowdsale/emission/AllowanceCrowdsale.sol"; diff --git a/contracts/mocks/ArraysImpl.sol b/contracts/mocks/ArraysImpl.sol index b2067526d5b..979cabab6ab 100644 --- a/contracts/mocks/ArraysImpl.sol +++ b/contracts/mocks/ArraysImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../utils/Arrays.sol"; diff --git a/contracts/mocks/CappedCrowdsaleImpl.sol b/contracts/mocks/CappedCrowdsaleImpl.sol index d0c59db4cdf..87e7757c46f 100644 --- a/contracts/mocks/CappedCrowdsaleImpl.sol +++ b/contracts/mocks/CappedCrowdsaleImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/IERC20.sol"; import "../crowdsale/validation/CappedCrowdsale.sol"; diff --git a/contracts/mocks/CapperRoleMock.sol b/contracts/mocks/CapperRoleMock.sol index 0090d1ff6c4..2a138f63d24 100644 --- a/contracts/mocks/CapperRoleMock.sol +++ b/contracts/mocks/CapperRoleMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../access/roles/CapperRole.sol"; diff --git a/contracts/mocks/ConditionalEscrowMock.sol b/contracts/mocks/ConditionalEscrowMock.sol index 4b39ba38698..67f75aefb67 100644 --- a/contracts/mocks/ConditionalEscrowMock.sol +++ b/contracts/mocks/ConditionalEscrowMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../payment/escrow/ConditionalEscrow.sol"; diff --git a/contracts/mocks/CounterImpl.sol b/contracts/mocks/CountersImpl.sol similarity index 60% rename from contracts/mocks/CounterImpl.sol rename to contracts/mocks/CountersImpl.sol index b1b327dff57..21d4f04c6b0 100644 --- a/contracts/mocks/CounterImpl.sol +++ b/contracts/mocks/CountersImpl.sol @@ -1,11 +1,11 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; -import "../drafts/Counter.sol"; +import "../drafts/Counters.sol"; -contract CounterImpl { - using Counter for Counter.Counter; +contract CountersImpl { + using Counters for Counters.Counter; - Counter.Counter private _counter; + Counters.Counter private _counter; function current() public view returns (uint256) { return _counter.current(); diff --git a/contracts/mocks/CrowdsaleMock.sol b/contracts/mocks/CrowdsaleMock.sol index 6dafa4b7e00..eb25fc13961 100644 --- a/contracts/mocks/CrowdsaleMock.sol +++ b/contracts/mocks/CrowdsaleMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../crowdsale/Crowdsale.sol"; diff --git a/contracts/mocks/ECDSAMock.sol b/contracts/mocks/ECDSAMock.sol index 977f324aca3..dcf82bf1e3e 100644 --- a/contracts/mocks/ECDSAMock.sol +++ b/contracts/mocks/ECDSAMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../cryptography/ECDSA.sol"; diff --git a/contracts/mocks/ERC165/ERC165InterfacesSupported.sol b/contracts/mocks/ERC165/ERC165InterfacesSupported.sol index fccf84e6993..241be723f50 100644 --- a/contracts/mocks/ERC165/ERC165InterfacesSupported.sol +++ b/contracts/mocks/ERC165/ERC165InterfacesSupported.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../../introspection/IERC165.sol"; diff --git a/contracts/mocks/ERC165/ERC165NotSupported.sol b/contracts/mocks/ERC165/ERC165NotSupported.sol index d154da33ea2..d7664b6e349 100644 --- a/contracts/mocks/ERC165/ERC165NotSupported.sol +++ b/contracts/mocks/ERC165/ERC165NotSupported.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; contract ERC165NotSupported { // solhint-disable-previous-line no-empty-blocks diff --git a/contracts/mocks/ERC165CheckerMock.sol b/contracts/mocks/ERC165CheckerMock.sol index db1853de0fd..2a163a10f8e 100644 --- a/contracts/mocks/ERC165CheckerMock.sol +++ b/contracts/mocks/ERC165CheckerMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../introspection/ERC165Checker.sol"; diff --git a/contracts/mocks/ERC165Mock.sol b/contracts/mocks/ERC165Mock.sol index e21581b52ad..fbb333ff07f 100644 --- a/contracts/mocks/ERC165Mock.sol +++ b/contracts/mocks/ERC165Mock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../introspection/ERC165.sol"; diff --git a/contracts/mocks/ERC20BurnableMock.sol b/contracts/mocks/ERC20BurnableMock.sol index 20db0b9a406..a43823cf309 100644 --- a/contracts/mocks/ERC20BurnableMock.sol +++ b/contracts/mocks/ERC20BurnableMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/ERC20Burnable.sol"; diff --git a/contracts/mocks/ERC20DetailedMock.sol b/contracts/mocks/ERC20DetailedMock.sol index f2761b34882..0380369caff 100644 --- a/contracts/mocks/ERC20DetailedMock.sol +++ b/contracts/mocks/ERC20DetailedMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20Detailed.sol"; diff --git a/contracts/mocks/ERC20MintableMock.sol b/contracts/mocks/ERC20MintableMock.sol index 3ea65ef627f..91295cd5c57 100644 --- a/contracts/mocks/ERC20MintableMock.sol +++ b/contracts/mocks/ERC20MintableMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/ERC20Mintable.sol"; import "./MinterRoleMock.sol"; diff --git a/contracts/mocks/ERC20Mock.sol b/contracts/mocks/ERC20Mock.sol index 857cf3ff132..b7e48a563db 100644 --- a/contracts/mocks/ERC20Mock.sol +++ b/contracts/mocks/ERC20Mock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/ERC20.sol"; diff --git a/contracts/mocks/ERC20PausableMock.sol b/contracts/mocks/ERC20PausableMock.sol index 4c9cdb7f81a..286b9479af0 100644 --- a/contracts/mocks/ERC20PausableMock.sol +++ b/contracts/mocks/ERC20PausableMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/ERC20Pausable.sol"; import "./PauserRoleMock.sol"; diff --git a/contracts/mocks/ERC20WithMetadataMock.sol b/contracts/mocks/ERC20WithMetadataMock.sol index 16b967fc8a0..86bd81a7c8f 100644 --- a/contracts/mocks/ERC20WithMetadataMock.sol +++ b/contracts/mocks/ERC20WithMetadataMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/ERC20.sol"; import "../drafts/ERC1046/TokenMetadata.sol"; diff --git a/contracts/mocks/ERC721FullMock.sol b/contracts/mocks/ERC721FullMock.sol index b0f00918bdf..b9e40a974c4 100644 --- a/contracts/mocks/ERC721FullMock.sol +++ b/contracts/mocks/ERC721FullMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC721/ERC721Full.sol"; import "../token/ERC721/ERC721Mintable.sol"; diff --git a/contracts/mocks/ERC721MintableBurnableImpl.sol b/contracts/mocks/ERC721MintableBurnableImpl.sol index fcb69272311..60af40987b7 100644 --- a/contracts/mocks/ERC721MintableBurnableImpl.sol +++ b/contracts/mocks/ERC721MintableBurnableImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC721/ERC721Full.sol"; import "../token/ERC721/ERC721Mintable.sol"; diff --git a/contracts/mocks/ERC721Mock.sol b/contracts/mocks/ERC721Mock.sol index b02df5d2117..dc6daf6234a 100644 --- a/contracts/mocks/ERC721Mock.sol +++ b/contracts/mocks/ERC721Mock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC721/ERC721.sol"; diff --git a/contracts/mocks/ERC721PausableMock.sol b/contracts/mocks/ERC721PausableMock.sol index f46f9e7766c..7bf447a1dbf 100644 --- a/contracts/mocks/ERC721PausableMock.sol +++ b/contracts/mocks/ERC721PausableMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC721/ERC721Pausable.sol"; import "./PauserRoleMock.sol"; diff --git a/contracts/mocks/ERC721ReceiverMock.sol b/contracts/mocks/ERC721ReceiverMock.sol index 1b4de67373f..7dd9d3ee6c4 100644 --- a/contracts/mocks/ERC721ReceiverMock.sol +++ b/contracts/mocks/ERC721ReceiverMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC721/IERC721Receiver.sol"; diff --git a/contracts/mocks/EventEmitter.sol b/contracts/mocks/EventEmitter.sol index 4ffc77c4bcb..1004f661b9e 100644 --- a/contracts/mocks/EventEmitter.sol +++ b/contracts/mocks/EventEmitter.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; contract EventEmitter { event Argumentless(); diff --git a/contracts/mocks/Failer.sol b/contracts/mocks/Failer.sol index 088bc498cc9..eee3ccdf7de 100644 --- a/contracts/mocks/Failer.sol +++ b/contracts/mocks/Failer.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; contract Failer { uint256[] private array; diff --git a/contracts/mocks/FinalizableCrowdsaleImpl.sol b/contracts/mocks/FinalizableCrowdsaleImpl.sol index 99f7a255d65..45a1d5ffd28 100644 --- a/contracts/mocks/FinalizableCrowdsaleImpl.sol +++ b/contracts/mocks/FinalizableCrowdsaleImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/IERC20.sol"; import "../crowdsale/distribution/FinalizableCrowdsale.sol"; diff --git a/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol b/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol index c5b0e7957b3..17d0708d1a2 100644 --- a/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol +++ b/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../crowdsale/price/IncreasingPriceCrowdsale.sol"; import "../math/SafeMath.sol"; diff --git a/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol b/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol index 43b0366ee5f..cd5a6343f9e 100644 --- a/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol +++ b/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/IERC20.sol"; import "../crowdsale/validation/IndividuallyCappedCrowdsale.sol"; diff --git a/contracts/mocks/MathMock.sol b/contracts/mocks/MathMock.sol index 2461fe90288..9fa47240614 100644 --- a/contracts/mocks/MathMock.sol +++ b/contracts/mocks/MathMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../math/Math.sol"; diff --git a/contracts/mocks/MerkleProofWrapper.sol b/contracts/mocks/MerkleProofWrapper.sol index 23c72b26975..2921ebb91d0 100644 --- a/contracts/mocks/MerkleProofWrapper.sol +++ b/contracts/mocks/MerkleProofWrapper.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import { MerkleProof } from "../cryptography/MerkleProof.sol"; diff --git a/contracts/mocks/MintedCrowdsaleImpl.sol b/contracts/mocks/MintedCrowdsaleImpl.sol index 22f4d36c064..4a1d268e5a0 100644 --- a/contracts/mocks/MintedCrowdsaleImpl.sol +++ b/contracts/mocks/MintedCrowdsaleImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/ERC20Mintable.sol"; import "../crowdsale/emission/MintedCrowdsale.sol"; diff --git a/contracts/mocks/MinterRoleMock.sol b/contracts/mocks/MinterRoleMock.sol index 4b0401d8762..8e31b1588a7 100644 --- a/contracts/mocks/MinterRoleMock.sol +++ b/contracts/mocks/MinterRoleMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../access/roles/MinterRole.sol"; diff --git a/contracts/mocks/OwnableInterfaceId.sol b/contracts/mocks/OwnableInterfaceId.sol index 363d9a2acf8..6b33c1c49d7 100644 --- a/contracts/mocks/OwnableInterfaceId.sol +++ b/contracts/mocks/OwnableInterfaceId.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../ownership/Ownable.sol"; diff --git a/contracts/mocks/OwnableMock.sol b/contracts/mocks/OwnableMock.sol index c7b1cf5c7a4..9280a93f4c0 100644 --- a/contracts/mocks/OwnableMock.sol +++ b/contracts/mocks/OwnableMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../ownership/Ownable.sol"; diff --git a/contracts/mocks/PausableCrowdsaleImpl.sol b/contracts/mocks/PausableCrowdsaleImpl.sol index 11f44c7b831..ddbad522563 100644 --- a/contracts/mocks/PausableCrowdsaleImpl.sol +++ b/contracts/mocks/PausableCrowdsaleImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/ERC20.sol"; import "../crowdsale/validation/PausableCrowdsale.sol"; diff --git a/contracts/mocks/PausableMock.sol b/contracts/mocks/PausableMock.sol index 8e9ae03d3e6..0d8a0bbb7af 100644 --- a/contracts/mocks/PausableMock.sol +++ b/contracts/mocks/PausableMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../lifecycle/Pausable.sol"; import "./PauserRoleMock.sol"; diff --git a/contracts/mocks/PauserRoleMock.sol b/contracts/mocks/PauserRoleMock.sol index fc2ed16d97a..fce86114607 100644 --- a/contracts/mocks/PauserRoleMock.sol +++ b/contracts/mocks/PauserRoleMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../access/roles/PauserRole.sol"; diff --git a/contracts/mocks/PostDeliveryCrowdsaleImpl.sol b/contracts/mocks/PostDeliveryCrowdsaleImpl.sol index efb67c084fe..77eda6def44 100644 --- a/contracts/mocks/PostDeliveryCrowdsaleImpl.sol +++ b/contracts/mocks/PostDeliveryCrowdsaleImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/IERC20.sol"; import "../crowdsale/distribution/PostDeliveryCrowdsale.sol"; diff --git a/contracts/mocks/PullPaymentMock.sol b/contracts/mocks/PullPaymentMock.sol index 1a26b62428d..defc43c4810 100644 --- a/contracts/mocks/PullPaymentMock.sol +++ b/contracts/mocks/PullPaymentMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../payment/PullPayment.sol"; diff --git a/contracts/mocks/ReentrancyAttack.sol b/contracts/mocks/ReentrancyAttack.sol index 965a053e0f4..7f7fd35d4db 100644 --- a/contracts/mocks/ReentrancyAttack.sol +++ b/contracts/mocks/ReentrancyAttack.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; contract ReentrancyAttack { function callSender(bytes4 data) public { diff --git a/contracts/mocks/ReentrancyMock.sol b/contracts/mocks/ReentrancyMock.sol index a32a4047248..bf14a8f3504 100644 --- a/contracts/mocks/ReentrancyMock.sol +++ b/contracts/mocks/ReentrancyMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../utils/ReentrancyGuard.sol"; import "./ReentrancyAttack.sol"; diff --git a/contracts/mocks/RefundableCrowdsaleImpl.sol b/contracts/mocks/RefundableCrowdsaleImpl.sol index 5ed5d1ed54c..bc67f2f26f0 100644 --- a/contracts/mocks/RefundableCrowdsaleImpl.sol +++ b/contracts/mocks/RefundableCrowdsaleImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/IERC20.sol"; import "../crowdsale/distribution/RefundableCrowdsale.sol"; diff --git a/contracts/mocks/RefundablePostDeliveryCrowdsaleImpl.sol b/contracts/mocks/RefundablePostDeliveryCrowdsaleImpl.sol index b81f0757c89..36133ae066b 100644 --- a/contracts/mocks/RefundablePostDeliveryCrowdsaleImpl.sol +++ b/contracts/mocks/RefundablePostDeliveryCrowdsaleImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/IERC20.sol"; import "../crowdsale/distribution/RefundablePostDeliveryCrowdsale.sol"; diff --git a/contracts/mocks/RolesMock.sol b/contracts/mocks/RolesMock.sol index 4b0f0de0ac4..a4a2fef1803 100644 --- a/contracts/mocks/RolesMock.sol +++ b/contracts/mocks/RolesMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../access/Roles.sol"; diff --git a/contracts/mocks/SafeERC20Helper.sol b/contracts/mocks/SafeERC20Helper.sol index c9c455e5865..9b13eaa0a03 100644 --- a/contracts/mocks/SafeERC20Helper.sol +++ b/contracts/mocks/SafeERC20Helper.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/IERC20.sol"; import "../token/ERC20/SafeERC20.sol"; @@ -6,19 +6,27 @@ import "../token/ERC20/SafeERC20.sol"; contract ERC20FailingMock { uint256 private _allowance; + // IERC20's functions are not pure, but these mock implementations are: to prevent Solidity from issuing warnings, + // we write to a dummy state variable. + uint256 private _dummy; + function transfer(address, uint256) public returns (bool) { + _dummy = 0; return false; } function transferFrom(address, address, uint256) public returns (bool) { + _dummy = 0; return false; } function approve(address, uint256) public returns (bool) { + _dummy = 0; return false; } function allowance(address, address) public view returns (uint256) { + require(_dummy == 0); return 0; } } @@ -26,15 +34,22 @@ contract ERC20FailingMock { contract ERC20SucceedingMock { uint256 private _allowance; + // IERC20's functions are not pure, but these mock implementations are: to prevent Solidity from issuing warnings, + // we write to a dummy state variable. + uint256 private _dummy; + function transfer(address, uint256) public returns (bool) { + _dummy = 0; return true; } function transferFrom(address, address, uint256) public returns (bool) { + _dummy = 0; return true; } function approve(address, uint256) public returns (bool) { + _dummy = 0; return true; } diff --git a/contracts/mocks/SafeMathMock.sol b/contracts/mocks/SafeMathMock.sol index 43dac5ec29f..c943488541a 100644 --- a/contracts/mocks/SafeMathMock.sol +++ b/contracts/mocks/SafeMathMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../math/SafeMath.sol"; diff --git a/contracts/mocks/SecondaryMock.sol b/contracts/mocks/SecondaryMock.sol index 1ff45b11ec8..225938bd32d 100644 --- a/contracts/mocks/SecondaryMock.sol +++ b/contracts/mocks/SecondaryMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../ownership/Secondary.sol"; diff --git a/contracts/mocks/SignatureBouncerMock.sol b/contracts/mocks/SignatureBouncerMock.sol index 59c59b437d5..fa449f8664e 100644 --- a/contracts/mocks/SignatureBouncerMock.sol +++ b/contracts/mocks/SignatureBouncerMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../drafts/SignatureBouncer.sol"; import "./SignerRoleMock.sol"; diff --git a/contracts/mocks/SignedSafeMathMock.sol b/contracts/mocks/SignedSafeMathMock.sol index 90a3ee642bc..9bb00233f04 100644 --- a/contracts/mocks/SignedSafeMathMock.sol +++ b/contracts/mocks/SignedSafeMathMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../drafts/SignedSafeMath.sol"; diff --git a/contracts/mocks/SignerRoleMock.sol b/contracts/mocks/SignerRoleMock.sol index 71b4c792a76..5ff66e9d50c 100644 --- a/contracts/mocks/SignerRoleMock.sol +++ b/contracts/mocks/SignerRoleMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../access/roles/SignerRole.sol"; diff --git a/contracts/mocks/TimedCrowdsaleImpl.sol b/contracts/mocks/TimedCrowdsaleImpl.sol index 463fdcb8896..ecf07f2450e 100644 --- a/contracts/mocks/TimedCrowdsaleImpl.sol +++ b/contracts/mocks/TimedCrowdsaleImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/IERC20.sol"; import "../crowdsale/validation/TimedCrowdsale.sol"; diff --git a/contracts/mocks/WhitelistAdminRoleMock.sol b/contracts/mocks/WhitelistAdminRoleMock.sol index 7a267ca2177..75f15b62c45 100644 --- a/contracts/mocks/WhitelistAdminRoleMock.sol +++ b/contracts/mocks/WhitelistAdminRoleMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../access/roles/WhitelistAdminRole.sol"; diff --git a/contracts/mocks/WhitelistCrowdsaleImpl.sol b/contracts/mocks/WhitelistCrowdsaleImpl.sol index 0200f7f7f25..66a80cfec39 100644 --- a/contracts/mocks/WhitelistCrowdsaleImpl.sol +++ b/contracts/mocks/WhitelistCrowdsaleImpl.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../token/ERC20/IERC20.sol"; import "../crowdsale/validation/WhitelistCrowdsale.sol"; diff --git a/contracts/mocks/WhitelistedRoleMock.sol b/contracts/mocks/WhitelistedRoleMock.sol index 7f7c8941219..f880a5fc578 100644 --- a/contracts/mocks/WhitelistedRoleMock.sol +++ b/contracts/mocks/WhitelistedRoleMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../access/roles/WhitelistedRole.sol"; diff --git a/contracts/ownership/Ownable.sol b/contracts/ownership/Ownable.sol index 4d3558f16cf..4acc0cbab04 100644 --- a/contracts/ownership/Ownable.sol +++ b/contracts/ownership/Ownable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * @title Ownable diff --git a/contracts/ownership/Secondary.sol b/contracts/ownership/Secondary.sol index 3ca57e4a7d9..93ed425e444 100644 --- a/contracts/ownership/Secondary.sol +++ b/contracts/ownership/Secondary.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * @title Secondary diff --git a/contracts/payment/PaymentSplitter.sol b/contracts/payment/PaymentSplitter.sol index 280e4b9ac28..f7e56389ef4 100644 --- a/contracts/payment/PaymentSplitter.sol +++ b/contracts/payment/PaymentSplitter.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../math/SafeMath.sol"; diff --git a/contracts/payment/PullPayment.sol b/contracts/payment/PullPayment.sol index ad961e47bff..ccfb12a48f2 100644 --- a/contracts/payment/PullPayment.sol +++ b/contracts/payment/PullPayment.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./escrow/Escrow.sol"; diff --git a/contracts/payment/escrow/ConditionalEscrow.sol b/contracts/payment/escrow/ConditionalEscrow.sol index 268d731fa4c..425c53277b3 100644 --- a/contracts/payment/escrow/ConditionalEscrow.sol +++ b/contracts/payment/escrow/ConditionalEscrow.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./Escrow.sol"; diff --git a/contracts/payment/escrow/Escrow.sol b/contracts/payment/escrow/Escrow.sol index c010add4521..8497c4f91a9 100644 --- a/contracts/payment/escrow/Escrow.sol +++ b/contracts/payment/escrow/Escrow.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../../math/SafeMath.sol"; import "../../ownership/Secondary.sol"; diff --git a/contracts/payment/escrow/RefundEscrow.sol b/contracts/payment/escrow/RefundEscrow.sol index 0c9cd99a610..22c08075fe0 100644 --- a/contracts/payment/escrow/RefundEscrow.sol +++ b/contracts/payment/escrow/RefundEscrow.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./ConditionalEscrow.sol"; diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index 30f9642f8be..9d5d7b7fa81 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./IERC20.sol"; import "../../math/SafeMath.sol"; diff --git a/contracts/token/ERC20/ERC20Burnable.sol b/contracts/token/ERC20/ERC20Burnable.sol index 324275711d6..c43a5addbe5 100644 --- a/contracts/token/ERC20/ERC20Burnable.sol +++ b/contracts/token/ERC20/ERC20Burnable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./ERC20.sol"; diff --git a/contracts/token/ERC20/ERC20Capped.sol b/contracts/token/ERC20/ERC20Capped.sol index 3d4a2f1ab6b..56964bc3534 100644 --- a/contracts/token/ERC20/ERC20Capped.sol +++ b/contracts/token/ERC20/ERC20Capped.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./ERC20Mintable.sol"; diff --git a/contracts/token/ERC20/ERC20Detailed.sol b/contracts/token/ERC20/ERC20Detailed.sol index 71c0b01591f..c7face24ad4 100644 --- a/contracts/token/ERC20/ERC20Detailed.sol +++ b/contracts/token/ERC20/ERC20Detailed.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./IERC20.sol"; diff --git a/contracts/token/ERC20/ERC20Mintable.sol b/contracts/token/ERC20/ERC20Mintable.sol index c6c0d647bb1..9a1d8cfef2c 100644 --- a/contracts/token/ERC20/ERC20Mintable.sol +++ b/contracts/token/ERC20/ERC20Mintable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./ERC20.sol"; import "../../access/roles/MinterRole.sol"; diff --git a/contracts/token/ERC20/ERC20Pausable.sol b/contracts/token/ERC20/ERC20Pausable.sol index a27de259d2d..9f68fb0fa44 100644 --- a/contracts/token/ERC20/ERC20Pausable.sol +++ b/contracts/token/ERC20/ERC20Pausable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./ERC20.sol"; import "../../lifecycle/Pausable.sol"; diff --git a/contracts/token/ERC20/IERC20.sol b/contracts/token/ERC20/IERC20.sol index af4a4855847..4d208c79660 100644 --- a/contracts/token/ERC20/IERC20.sol +++ b/contracts/token/ERC20/IERC20.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * @title ERC20 interface diff --git a/contracts/token/ERC20/SafeERC20.sol b/contracts/token/ERC20/SafeERC20.sol index 25ac9bae799..61641c35fd6 100644 --- a/contracts/token/ERC20/SafeERC20.sol +++ b/contracts/token/ERC20/SafeERC20.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./IERC20.sol"; import "../../math/SafeMath.sol"; diff --git a/contracts/token/ERC20/TokenTimelock.sol b/contracts/token/ERC20/TokenTimelock.sol index fb56a331017..0d8a052c602 100644 --- a/contracts/token/ERC20/TokenTimelock.sol +++ b/contracts/token/ERC20/TokenTimelock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./SafeERC20.sol"; diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index 8ae3c1d7798..d26ce72e56d 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -1,10 +1,10 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; -import "../../drafts/Counter.sol"; +import "../../drafts/Counters.sol"; import "../../introspection/ERC165.sol"; /** @@ -14,7 +14,7 @@ import "../../introspection/ERC165.sol"; contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; - using Counter for Counter.Counter; + using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` @@ -27,7 +27,7 @@ contract ERC721 is ERC165, IERC721 { mapping (uint256 => address) private _tokenApprovals; // Mapping from owner to number of owned token - mapping (address => Counter.Counter) private _ownedTokensCount; + mapping (address => Counters.Counter) private _ownedTokensCount; // Mapping from owner to operator approvals mapping (address => mapping (address => bool)) private _operatorApprovals; diff --git a/contracts/token/ERC721/ERC721Burnable.sol b/contracts/token/ERC721/ERC721Burnable.sol index 21bdc51a318..e2dc6cf7724 100644 --- a/contracts/token/ERC721/ERC721Burnable.sol +++ b/contracts/token/ERC721/ERC721Burnable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./ERC721.sol"; diff --git a/contracts/token/ERC721/ERC721Enumerable.sol b/contracts/token/ERC721/ERC721Enumerable.sol index 282e9873b67..205395d0e82 100644 --- a/contracts/token/ERC721/ERC721Enumerable.sol +++ b/contracts/token/ERC721/ERC721Enumerable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./IERC721Enumerable.sol"; import "./ERC721.sol"; diff --git a/contracts/token/ERC721/ERC721Full.sol b/contracts/token/ERC721/ERC721Full.sol index f4e8042c4a7..fde729a9506 100644 --- a/contracts/token/ERC721/ERC721Full.sol +++ b/contracts/token/ERC721/ERC721Full.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./ERC721.sol"; import "./ERC721Enumerable.sol"; diff --git a/contracts/token/ERC721/ERC721Holder.sol b/contracts/token/ERC721/ERC721Holder.sol index bcc10d7e225..3121ec9b825 100644 --- a/contracts/token/ERC721/ERC721Holder.sol +++ b/contracts/token/ERC721/ERC721Holder.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./IERC721Receiver.sol"; diff --git a/contracts/token/ERC721/ERC721Metadata.sol b/contracts/token/ERC721/ERC721Metadata.sol index 41593297e81..6615aad0555 100644 --- a/contracts/token/ERC721/ERC721Metadata.sol +++ b/contracts/token/ERC721/ERC721Metadata.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./ERC721.sol"; import "./IERC721Metadata.sol"; diff --git a/contracts/token/ERC721/ERC721MetadataMintable.sol b/contracts/token/ERC721/ERC721MetadataMintable.sol index 01a1a51746a..b73f5631d39 100644 --- a/contracts/token/ERC721/ERC721MetadataMintable.sol +++ b/contracts/token/ERC721/ERC721MetadataMintable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./ERC721Metadata.sol"; import "../../access/roles/MinterRole.sol"; diff --git a/contracts/token/ERC721/ERC721Mintable.sol b/contracts/token/ERC721/ERC721Mintable.sol index 7e7503d0a66..10a47dd4b75 100644 --- a/contracts/token/ERC721/ERC721Mintable.sol +++ b/contracts/token/ERC721/ERC721Mintable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./ERC721.sol"; import "../../access/roles/MinterRole.sol"; diff --git a/contracts/token/ERC721/ERC721Pausable.sol b/contracts/token/ERC721/ERC721Pausable.sol index 656df238722..00a9450812e 100644 --- a/contracts/token/ERC721/ERC721Pausable.sol +++ b/contracts/token/ERC721/ERC721Pausable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./ERC721.sol"; import "../../lifecycle/Pausable.sol"; diff --git a/contracts/token/ERC721/IERC721.sol b/contracts/token/ERC721/IERC721.sol index 4aa3038967e..4201eab7d15 100644 --- a/contracts/token/ERC721/IERC721.sol +++ b/contracts/token/ERC721/IERC721.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../../introspection/IERC165.sol"; diff --git a/contracts/token/ERC721/IERC721Enumerable.sol b/contracts/token/ERC721/IERC721Enumerable.sol index 80df93f4f50..065380a3213 100644 --- a/contracts/token/ERC721/IERC721Enumerable.sol +++ b/contracts/token/ERC721/IERC721Enumerable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./IERC721.sol"; diff --git a/contracts/token/ERC721/IERC721Full.sol b/contracts/token/ERC721/IERC721Full.sol index 17f593894e3..cfe6e067b1a 100644 --- a/contracts/token/ERC721/IERC721Full.sol +++ b/contracts/token/ERC721/IERC721Full.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./IERC721.sol"; import "./IERC721Enumerable.sol"; diff --git a/contracts/token/ERC721/IERC721Metadata.sol b/contracts/token/ERC721/IERC721Metadata.sol index ee87a158cba..f7de1d8214a 100644 --- a/contracts/token/ERC721/IERC721Metadata.sol +++ b/contracts/token/ERC721/IERC721Metadata.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "./IERC721.sol"; diff --git a/contracts/token/ERC721/IERC721Receiver.sol b/contracts/token/ERC721/IERC721Receiver.sol index e2d019759c2..50b8b694281 100644 --- a/contracts/token/ERC721/IERC721Receiver.sol +++ b/contracts/token/ERC721/IERC721Receiver.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * @title ERC721 token receiver interface diff --git a/contracts/utils/Address.sol b/contracts/utils/Address.sol index 500467212f5..98c8778f8c7 100644 --- a/contracts/utils/Address.sol +++ b/contracts/utils/Address.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * Utility library of inline functions on addresses diff --git a/contracts/utils/Arrays.sol b/contracts/utils/Arrays.sol index c34154c5245..18a86cacd54 100644 --- a/contracts/utils/Arrays.sol +++ b/contracts/utils/Arrays.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; import "../math/Math.sol"; diff --git a/contracts/utils/ReentrancyGuard.sol b/contracts/utils/ReentrancyGuard.sol index 86ab57cf8fb..36186d1ed52 100644 --- a/contracts/utils/ReentrancyGuard.sol +++ b/contracts/utils/ReentrancyGuard.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.5.2; /** * @title Helps contracts guard against reentrancy attacks. diff --git a/test/drafts/Counter.test.js b/test/drafts/Counters.test.js similarity index 92% rename from test/drafts/Counter.test.js rename to test/drafts/Counters.test.js index 48c8a7a2eae..ad10d51c633 100644 --- a/test/drafts/Counter.test.js +++ b/test/drafts/Counters.test.js @@ -1,10 +1,10 @@ const { shouldFail } = require('openzeppelin-test-helpers'); -const CounterImpl = artifacts.require('CounterImpl'); +const CountersImpl = artifacts.require('CountersImpl'); -contract('Counter', function () { +contract('Counters', function () { beforeEach(async function () { - this.counter = await CounterImpl.new(); + this.counter = await CountersImpl.new(); }); it('starts at zero', async function () { diff --git a/truffle-config.js b/truffle-config.js index efd7997addd..7238c99e5d6 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -16,7 +16,7 @@ module.exports = { compilers: { solc: { - version: '0.5.0', + version: '0.5.2', }, }, };