Skip to content

Commit

Permalink
Merge branch 'master' into remove-safe-math
Browse files Browse the repository at this point in the history
  • Loading branch information
nventuro committed Jan 17, 2019
2 parents 992cbb4 + b7d60f2 commit 2d8761e
Show file tree
Hide file tree
Showing 128 changed files with 164 additions and 143 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion contracts/access/Roles.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

/**
* @title Roles
Expand Down
2 changes: 1 addition & 1 deletion contracts/access/roles/CapperRole.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../Roles.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/access/roles/MinterRole.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../Roles.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/access/roles/PauserRole.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../Roles.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/access/roles/SignerRole.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../Roles.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/access/roles/WhitelistAdminRole.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../Roles.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/access/roles/WhitelistedRole.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../Roles.sol";
import "./WhitelistAdminRole.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/Crowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../token/ERC20/IERC20.sol";
import "../math/SafeMath.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/distribution/FinalizableCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../../math/SafeMath.sol";
import "../validation/TimedCrowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../validation/TimedCrowdsale.sol";
import "../../math/SafeMath.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/distribution/RefundableCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../../math/SafeMath.sol";
import "./FinalizableCrowdsale.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "./RefundableCrowdsale.sol";
import "./PostDeliveryCrowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/emission/AllowanceCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../Crowdsale.sol";
import "../../token/ERC20/IERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/emission/MintedCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../Crowdsale.sol";
import "../../token/ERC20/ERC20Mintable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/price/IncreasingPriceCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../validation/TimedCrowdsale.sol";
import "../../math/SafeMath.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/validation/CappedCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../../math/SafeMath.sol";
import "../Crowdsale.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../../math/SafeMath.sol";
import "../Crowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/validation/PausableCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../Crowdsale.sol";
import "../../lifecycle/Pausable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/validation/TimedCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../../math/SafeMath.sol";
import "../Crowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/validation/WhitelistCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;
import "../Crowdsale.sol";
import "../../access/roles/WhitelistedRole.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/cryptography/ECDSA.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

/**
* @title Elliptic curve signature operations
Expand Down
2 changes: 1 addition & 1 deletion contracts/cryptography/MerkleProof.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

/**
* @title MerkleProof
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion contracts/drafts/ERC1046/TokenMetadata.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../../token/ERC20/IERC20.sol";

Expand Down
12 changes: 6 additions & 6 deletions contracts/drafts/ERC20Migrator.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../token/ERC20/IERC20.sol";
import "../token/ERC20/ERC20Mintable.sol";
Expand Down Expand Up @@ -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_;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/drafts/SignatureBouncer.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../access/roles/SignerRole.sol";
import "../cryptography/ECDSA.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/drafts/SignedSafeMath.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

/**
* @title SignedSafeMath
Expand Down
2 changes: 1 addition & 1 deletion contracts/drafts/TokenVesting.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../token/ERC20/SafeERC20.sol";
import "../ownership/Ownable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/SampleCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../crowdsale/validation/CappedCrowdsale.sol";
import "../crowdsale/distribution/RefundableCrowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/SimpleToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../token/ERC20/ERC20.sol";
import "../token/ERC20/ERC20Detailed.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/introspection/ERC165.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "./IERC165.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/introspection/ERC165Checker.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

/**
* @title ERC165Checker
Expand Down
2 changes: 1 addition & 1 deletion contracts/introspection/IERC165.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

/**
* @title IERC165
Expand Down
2 changes: 1 addition & 1 deletion contracts/lifecycle/Pausable.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../access/roles/PauserRole.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/math/Math.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

/**
* @title Math
Expand Down
2 changes: 1 addition & 1 deletion contracts/math/SafeMath.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

/**
* @title SafeMath
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/Acknowledger.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

contract Acknowledger {
event AcknowledgeFoo(uint256 a);
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/AddressImpl.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../utils/Address.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/AllowanceCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../token/ERC20/IERC20.sol";
import "../crowdsale/emission/AllowanceCrowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ArraysImpl.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../utils/Arrays.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/CappedCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../token/ERC20/IERC20.sol";
import "../crowdsale/validation/CappedCrowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/CapperRoleMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../access/roles/CapperRole.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ConditionalEscrowMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../payment/escrow/ConditionalEscrow.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/CrowdsaleMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../crowdsale/Crowdsale.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ECDSAMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../cryptography/ECDSA.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC165/ERC165InterfacesSupported.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../../introspection/IERC165.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC165/ERC165NotSupported.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

contract ERC165NotSupported {
// solhint-disable-previous-line no-empty-blocks
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC165CheckerMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../introspection/ERC165Checker.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC165Mock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../introspection/ERC165.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC20BurnableMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../token/ERC20/ERC20Burnable.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC20DetailedMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../token/ERC20/ERC20.sol";
import "../token/ERC20/ERC20Detailed.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC20MintableMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../token/ERC20/ERC20Mintable.sol";
import "./MinterRoleMock.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC20Mock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../token/ERC20/ERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC20PausableMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../token/ERC20/ERC20Pausable.sol";
import "./PauserRoleMock.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC20WithMetadataMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;

import "../token/ERC20/ERC20.sol";
import "../drafts/ERC1046/TokenMetadata.sol";
Expand Down
Loading

0 comments on commit 2d8761e

Please sign in to comment.