From 743b54b90ca2c2f914aa99f49e4aeed2069f42f0 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 28 Aug 2018 20:41:03 -0300 Subject: [PATCH 01/27] rename ERC20 to IERC20 --- contracts/crowdsale/Crowdsale.sol | 6 +++--- contracts/crowdsale/emission/AllowanceCrowdsale.sol | 2 +- contracts/lifecycle/TokenDestructible.sol | 2 +- contracts/mocks/AllowanceCrowdsaleImpl.sol | 2 +- contracts/mocks/CappedCrowdsaleImpl.sol | 2 +- contracts/mocks/IncreasingPriceCrowdsaleImpl.sol | 2 +- contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol | 2 +- contracts/mocks/PostDeliveryCrowdsaleImpl.sol | 2 +- contracts/mocks/SafeERC20Helper.sol | 10 +++++----- contracts/mocks/TimedCrowdsaleImpl.sol | 2 +- contracts/mocks/WhitelistedCrowdsaleImpl.sol | 2 +- contracts/ownership/CanReclaimToken.sol | 4 ++-- contracts/proposals/ERC1046/TokenMetadata.sol | 2 +- contracts/token/ERC20/DetailedERC20.sol | 2 +- contracts/token/ERC20/ERC20.sol | 2 +- contracts/token/ERC20/SafeERC20.sol | 6 +++--- contracts/token/ERC20/StandardToken.sol | 2 +- contracts/token/ERC20/TokenTimelock.sol | 6 +++--- contracts/token/ERC20/TokenVesting.sol | 10 +++++----- 19 files changed, 34 insertions(+), 34 deletions(-) diff --git a/contracts/crowdsale/Crowdsale.sol b/contracts/crowdsale/Crowdsale.sol index 9e219a304f9..c3ec4086d74 100644 --- a/contracts/crowdsale/Crowdsale.sol +++ b/contracts/crowdsale/Crowdsale.sol @@ -19,10 +19,10 @@ import "../token/ERC20/SafeERC20.sol"; */ contract Crowdsale { using SafeMath for uint256; - using SafeERC20 for ERC20; + using SafeERC20 for IERC20; // The token being sold - ERC20 public token; + IERC20 public token; // Address where funds are collected address public wallet; @@ -55,7 +55,7 @@ contract Crowdsale { * @param _wallet Address where collected funds will be forwarded to * @param _token Address of the token being sold */ - constructor(uint256 _rate, address _wallet, ERC20 _token) public { + constructor(uint256 _rate, address _wallet, IERC20 _token) public { require(_rate > 0); require(_wallet != address(0)); require(_token != address(0)); diff --git a/contracts/crowdsale/emission/AllowanceCrowdsale.sol b/contracts/crowdsale/emission/AllowanceCrowdsale.sol index 4b0665cba20..fd9b314d158 100644 --- a/contracts/crowdsale/emission/AllowanceCrowdsale.sol +++ b/contracts/crowdsale/emission/AllowanceCrowdsale.sol @@ -12,7 +12,7 @@ import "../../math/SafeMath.sol"; */ contract AllowanceCrowdsale is Crowdsale { using SafeMath for uint256; - using SafeERC20 for ERC20; + using SafeERC20 for IERC20; address public tokenWallet; diff --git a/contracts/lifecycle/TokenDestructible.sol b/contracts/lifecycle/TokenDestructible.sol index 38aabcbb18a..9d995143d8e 100644 --- a/contracts/lifecycle/TokenDestructible.sol +++ b/contracts/lifecycle/TokenDestructible.sol @@ -25,7 +25,7 @@ contract TokenDestructible is Ownable { // Transfer tokens to owner for (uint256 i = 0; i < _tokens.length; i++) { - ERC20 token = ERC20(_tokens[i]); + IERC20 token = IERC20(_tokens[i]); uint256 balance = token.balanceOf(this); token.transfer(owner, balance); } diff --git a/contracts/mocks/AllowanceCrowdsaleImpl.sol b/contracts/mocks/AllowanceCrowdsaleImpl.sol index 5c179d2deb6..4c04a5a4e5b 100644 --- a/contracts/mocks/AllowanceCrowdsaleImpl.sol +++ b/contracts/mocks/AllowanceCrowdsaleImpl.sol @@ -9,7 +9,7 @@ contract AllowanceCrowdsaleImpl is AllowanceCrowdsale { constructor ( uint256 _rate, address _wallet, - ERC20 _token, + IERC20 _token, address _tokenWallet ) public diff --git a/contracts/mocks/CappedCrowdsaleImpl.sol b/contracts/mocks/CappedCrowdsaleImpl.sol index a43c8b4176c..df101650526 100644 --- a/contracts/mocks/CappedCrowdsaleImpl.sol +++ b/contracts/mocks/CappedCrowdsaleImpl.sol @@ -9,7 +9,7 @@ contract CappedCrowdsaleImpl is CappedCrowdsale { constructor ( uint256 _rate, address _wallet, - ERC20 _token, + IERC20 _token, uint256 _cap ) public diff --git a/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol b/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol index 286eb616c89..95e4e367c54 100644 --- a/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol +++ b/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol @@ -10,7 +10,7 @@ contract IncreasingPriceCrowdsaleImpl is IncreasingPriceCrowdsale { uint256 _openingTime, uint256 _closingTime, address _wallet, - ERC20 _token, + IERC20 _token, uint256 _initialRate, uint256 _finalRate ) diff --git a/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol b/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol index b796060ed07..9e1fa6c1ec9 100644 --- a/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol +++ b/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol @@ -9,7 +9,7 @@ contract IndividuallyCappedCrowdsaleImpl is IndividuallyCappedCrowdsale { constructor ( uint256 _rate, address _wallet, - ERC20 _token + IERC20 _token ) public Crowdsale(_rate, _wallet, _token) diff --git a/contracts/mocks/PostDeliveryCrowdsaleImpl.sol b/contracts/mocks/PostDeliveryCrowdsaleImpl.sol index add2d866b01..8a85354870c 100644 --- a/contracts/mocks/PostDeliveryCrowdsaleImpl.sol +++ b/contracts/mocks/PostDeliveryCrowdsaleImpl.sol @@ -11,7 +11,7 @@ contract PostDeliveryCrowdsaleImpl is PostDeliveryCrowdsale { uint256 _closingTime, uint256 _rate, address _wallet, - ERC20 _token + IERC20 _token ) public TimedCrowdsale(_openingTime, _closingTime) diff --git a/contracts/mocks/SafeERC20Helper.sol b/contracts/mocks/SafeERC20Helper.sol index 60254af7c7d..d6b5c2605f2 100644 --- a/contracts/mocks/SafeERC20Helper.sol +++ b/contracts/mocks/SafeERC20Helper.sol @@ -4,7 +4,7 @@ import "../token/ERC20/ERC20.sol"; import "../token/ERC20/SafeERC20.sol"; -contract ERC20FailingMock is ERC20 { +contract ERC20FailingMock is IERC20 { function totalSupply() public view returns (uint256) { return 0; } @@ -31,7 +31,7 @@ contract ERC20FailingMock is ERC20 { } -contract ERC20SucceedingMock is ERC20 { +contract ERC20SucceedingMock is IERC20 { function totalSupply() public view returns (uint256) { return 0; } @@ -59,10 +59,10 @@ contract ERC20SucceedingMock is ERC20 { contract SafeERC20Helper { - using SafeERC20 for ERC20; + using SafeERC20 for IERC20; - ERC20 failing; - ERC20 succeeding; + IERC20 failing; + IERC20 succeeding; constructor() public { failing = new ERC20FailingMock(); diff --git a/contracts/mocks/TimedCrowdsaleImpl.sol b/contracts/mocks/TimedCrowdsaleImpl.sol index 9e9c17486d8..b9aefb37262 100644 --- a/contracts/mocks/TimedCrowdsaleImpl.sol +++ b/contracts/mocks/TimedCrowdsaleImpl.sol @@ -11,7 +11,7 @@ contract TimedCrowdsaleImpl is TimedCrowdsale { uint256 _closingTime, uint256 _rate, address _wallet, - ERC20 _token + IERC20 _token ) public Crowdsale(_rate, _wallet, _token) diff --git a/contracts/mocks/WhitelistedCrowdsaleImpl.sol b/contracts/mocks/WhitelistedCrowdsaleImpl.sol index 4cfd739ec40..0f5391ca960 100644 --- a/contracts/mocks/WhitelistedCrowdsaleImpl.sol +++ b/contracts/mocks/WhitelistedCrowdsaleImpl.sol @@ -10,7 +10,7 @@ contract WhitelistedCrowdsaleImpl is Crowdsale, WhitelistedCrowdsale { constructor ( uint256 _rate, address _wallet, - ERC20 _token + IERC20 _token ) Crowdsale(_rate, _wallet, _token) public diff --git a/contracts/ownership/CanReclaimToken.sol b/contracts/ownership/CanReclaimToken.sol index 37a78918cfb..ddc2a477862 100644 --- a/contracts/ownership/CanReclaimToken.sol +++ b/contracts/ownership/CanReclaimToken.sol @@ -12,13 +12,13 @@ import "../token/ERC20/SafeERC20.sol"; * This will prevent any accidental loss of tokens. */ contract CanReclaimToken is Ownable { - using SafeERC20 for ERC20; + using SafeERC20 for IERC20; /** * @dev Reclaim all ERC20 compatible tokens * @param _token ERC20 The address of the token contract */ - function reclaimToken(ERC20 _token) external onlyOwner { + function reclaimToken(IERC20 _token) external onlyOwner { uint256 balance = _token.balanceOf(this); _token.safeTransfer(owner, balance); } diff --git a/contracts/proposals/ERC1046/TokenMetadata.sol b/contracts/proposals/ERC1046/TokenMetadata.sol index 38edbd06419..f128abf7039 100644 --- a/contracts/proposals/ERC1046/TokenMetadata.sol +++ b/contracts/proposals/ERC1046/TokenMetadata.sol @@ -9,7 +9,7 @@ import "../../token/ERC20/ERC20.sol"; * @dev tokenURI must respond with a URI that implements https://eips.ethereum.org/EIPS/eip-1047 * @dev TODO - update https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC721/ERC721.sol#L17 when 1046 is finalized */ -contract ERC20TokenMetadata is ERC20 { +contract ERC20TokenMetadata is IERC20 { function tokenURI() external view returns (string); } diff --git a/contracts/token/ERC20/DetailedERC20.sol b/contracts/token/ERC20/DetailedERC20.sol index 20ba0f60c91..b6549630ead 100644 --- a/contracts/token/ERC20/DetailedERC20.sol +++ b/contracts/token/ERC20/DetailedERC20.sol @@ -9,7 +9,7 @@ import "./ERC20.sol"; * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */ -contract DetailedERC20 is ERC20 { +contract DetailedERC20 is IERC20 { string public name; string public symbol; uint8 public decimals; diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index 7b152953f0f..8f8c40528da 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -5,7 +5,7 @@ pragma solidity ^0.4.24; * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ -contract ERC20 { +interface IERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); diff --git a/contracts/token/ERC20/SafeERC20.sol b/contracts/token/ERC20/SafeERC20.sol index 92aaa0fd2e2..245bfe9947d 100644 --- a/contracts/token/ERC20/SafeERC20.sol +++ b/contracts/token/ERC20/SafeERC20.sol @@ -12,7 +12,7 @@ import "./ERC20.sol"; */ library SafeERC20 { function safeTransfer( - ERC20 _token, + IERC20 _token, address _to, uint256 _value ) @@ -22,7 +22,7 @@ library SafeERC20 { } function safeTransferFrom( - ERC20 _token, + IERC20 _token, address _from, address _to, uint256 _value @@ -33,7 +33,7 @@ library SafeERC20 { } function safeApprove( - ERC20 _token, + IERC20 _token, address _spender, uint256 _value ) diff --git a/contracts/token/ERC20/StandardToken.sol b/contracts/token/ERC20/StandardToken.sol index bf902a8c062..ee8460572cc 100644 --- a/contracts/token/ERC20/StandardToken.sol +++ b/contracts/token/ERC20/StandardToken.sol @@ -11,7 +11,7 @@ import "../../math/SafeMath.sol"; * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ -contract StandardToken is ERC20 { +contract StandardToken is IERC20 { using SafeMath for uint256; mapping (address => uint256) private balances_; diff --git a/contracts/token/ERC20/TokenTimelock.sol b/contracts/token/ERC20/TokenTimelock.sol index 2e3cd6dd55e..a24642f6de5 100644 --- a/contracts/token/ERC20/TokenTimelock.sol +++ b/contracts/token/ERC20/TokenTimelock.sol @@ -9,10 +9,10 @@ import "./SafeERC20.sol"; * beneficiary to extract the tokens after a given release time */ contract TokenTimelock { - using SafeERC20 for ERC20; + using SafeERC20 for IERC20; // ERC20 basic token contract being held - ERC20 public token; + IERC20 public token; // beneficiary of tokens after they are released address public beneficiary; @@ -21,7 +21,7 @@ contract TokenTimelock { uint256 public releaseTime; constructor( - ERC20 _token, + IERC20 _token, address _beneficiary, uint256 _releaseTime ) diff --git a/contracts/token/ERC20/TokenVesting.sol b/contracts/token/ERC20/TokenVesting.sol index 2ceaa31352e..31fac8882ce 100644 --- a/contracts/token/ERC20/TokenVesting.sol +++ b/contracts/token/ERC20/TokenVesting.sol @@ -15,7 +15,7 @@ import "../../math/SafeMath.sol"; */ contract TokenVesting is Ownable { using SafeMath for uint256; - using SafeERC20 for ERC20; + using SafeERC20 for IERC20; event Released(uint256 amount); event Revoked(); @@ -65,7 +65,7 @@ contract TokenVesting is Ownable { * @notice Transfers vested tokens to beneficiary. * @param _token ERC20 token which is being vested */ - function release(ERC20 _token) public { + function release(IERC20 _token) public { uint256 unreleased = releasableAmount(_token); require(unreleased > 0); @@ -82,7 +82,7 @@ contract TokenVesting is Ownable { * remain in the contract, the rest are returned to the owner. * @param _token ERC20 token which is being vested */ - function revoke(ERC20 _token) public onlyOwner { + function revoke(IERC20 _token) public onlyOwner { require(revocable); require(!revoked[_token]); @@ -102,7 +102,7 @@ contract TokenVesting is Ownable { * @dev Calculates the amount that has already vested but hasn't been released yet. * @param _token ERC20 token which is being vested */ - function releasableAmount(ERC20 _token) public view returns (uint256) { + function releasableAmount(IERC20 _token) public view returns (uint256) { return vestedAmount(_token).sub(released[_token]); } @@ -110,7 +110,7 @@ contract TokenVesting is Ownable { * @dev Calculates the amount that has already vested. * @param _token ERC20 token which is being vested */ - function vestedAmount(ERC20 _token) public view returns (uint256) { + function vestedAmount(IERC20 _token) public view returns (uint256) { uint256 currentBalance = _token.balanceOf(this); uint256 totalBalance = currentBalance.add(released[_token]); From 74ed56332d6cf7fa3cdd13fe78ca79bb0610d237 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 28 Aug 2018 20:43:15 -0300 Subject: [PATCH 02/27] move ERC20.sol to IERC20.sol --- contracts/crowdsale/Crowdsale.sol | 2 +- contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol | 2 +- contracts/crowdsale/emission/AllowanceCrowdsale.sol | 2 +- contracts/lifecycle/TokenDestructible.sol | 2 +- contracts/mocks/AllowanceCrowdsaleImpl.sol | 2 +- contracts/mocks/CappedCrowdsaleImpl.sol | 2 +- contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol | 2 +- contracts/mocks/PostDeliveryCrowdsaleImpl.sol | 2 +- contracts/mocks/SafeERC20Helper.sol | 2 +- contracts/mocks/TimedCrowdsaleImpl.sol | 2 +- contracts/mocks/WhitelistedCrowdsaleImpl.sol | 2 +- contracts/ownership/CanReclaimToken.sol | 2 +- contracts/proposals/ERC1046/TokenMetadata.sol | 2 +- contracts/token/ERC20/DetailedERC20.sol | 2 +- contracts/token/ERC20/{ERC20.sol => IERC20.sol} | 0 contracts/token/ERC20/SafeERC20.sol | 2 +- contracts/token/ERC20/StandardToken.sol | 2 +- 17 files changed, 16 insertions(+), 16 deletions(-) rename contracts/token/ERC20/{ERC20.sol => IERC20.sol} (100%) diff --git a/contracts/crowdsale/Crowdsale.sol b/contracts/crowdsale/Crowdsale.sol index c3ec4086d74..fe30eaf09cc 100644 --- a/contracts/crowdsale/Crowdsale.sol +++ b/contracts/crowdsale/Crowdsale.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/ERC20.sol"; +import "../token/ERC20/IERC20.sol"; import "../math/SafeMath.sol"; import "../token/ERC20/SafeERC20.sol"; diff --git a/contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol b/contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol index 652f21e5d74..b09d09709a5 100644 --- a/contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol +++ b/contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; import "../validation/TimedCrowdsale.sol"; -import "../../token/ERC20/ERC20.sol"; +import "../../token/ERC20/IERC20.sol"; import "../../math/SafeMath.sol"; diff --git a/contracts/crowdsale/emission/AllowanceCrowdsale.sol b/contracts/crowdsale/emission/AllowanceCrowdsale.sol index fd9b314d158..4e48638ab74 100644 --- a/contracts/crowdsale/emission/AllowanceCrowdsale.sol +++ b/contracts/crowdsale/emission/AllowanceCrowdsale.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; import "../Crowdsale.sol"; -import "../../token/ERC20/ERC20.sol"; +import "../../token/ERC20/IERC20.sol"; import "../../token/ERC20/SafeERC20.sol"; import "../../math/SafeMath.sol"; diff --git a/contracts/lifecycle/TokenDestructible.sol b/contracts/lifecycle/TokenDestructible.sol index 9d995143d8e..783a4e7887b 100644 --- a/contracts/lifecycle/TokenDestructible.sol +++ b/contracts/lifecycle/TokenDestructible.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; import "../ownership/Ownable.sol"; -import "../token/ERC20/ERC20.sol"; +import "../token/ERC20/IERC20.sol"; /** diff --git a/contracts/mocks/AllowanceCrowdsaleImpl.sol b/contracts/mocks/AllowanceCrowdsaleImpl.sol index 4c04a5a4e5b..872dd66e193 100644 --- a/contracts/mocks/AllowanceCrowdsaleImpl.sol +++ b/contracts/mocks/AllowanceCrowdsaleImpl.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/ERC20.sol"; +import "../token/ERC20/IERC20.sol"; import "../crowdsale/emission/AllowanceCrowdsale.sol"; diff --git a/contracts/mocks/CappedCrowdsaleImpl.sol b/contracts/mocks/CappedCrowdsaleImpl.sol index df101650526..a05fbd7d25f 100644 --- a/contracts/mocks/CappedCrowdsaleImpl.sol +++ b/contracts/mocks/CappedCrowdsaleImpl.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/ERC20.sol"; +import "../token/ERC20/IERC20.sol"; import "../crowdsale/validation/CappedCrowdsale.sol"; diff --git a/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol b/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol index 9e1fa6c1ec9..b4b470f7ca6 100644 --- a/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol +++ b/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/ERC20.sol"; +import "../token/ERC20/IERC20.sol"; import "../crowdsale/validation/IndividuallyCappedCrowdsale.sol"; diff --git a/contracts/mocks/PostDeliveryCrowdsaleImpl.sol b/contracts/mocks/PostDeliveryCrowdsaleImpl.sol index 8a85354870c..b4dea2700e5 100644 --- a/contracts/mocks/PostDeliveryCrowdsaleImpl.sol +++ b/contracts/mocks/PostDeliveryCrowdsaleImpl.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/ERC20.sol"; +import "../token/ERC20/IERC20.sol"; import "../crowdsale/distribution/PostDeliveryCrowdsale.sol"; diff --git a/contracts/mocks/SafeERC20Helper.sol b/contracts/mocks/SafeERC20Helper.sol index d6b5c2605f2..d64d7c0deb2 100644 --- a/contracts/mocks/SafeERC20Helper.sol +++ b/contracts/mocks/SafeERC20Helper.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/ERC20.sol"; +import "../token/ERC20/IERC20.sol"; import "../token/ERC20/SafeERC20.sol"; diff --git a/contracts/mocks/TimedCrowdsaleImpl.sol b/contracts/mocks/TimedCrowdsaleImpl.sol index b9aefb37262..b99178aee7c 100644 --- a/contracts/mocks/TimedCrowdsaleImpl.sol +++ b/contracts/mocks/TimedCrowdsaleImpl.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/ERC20.sol"; +import "../token/ERC20/IERC20.sol"; import "../crowdsale/validation/TimedCrowdsale.sol"; diff --git a/contracts/mocks/WhitelistedCrowdsaleImpl.sol b/contracts/mocks/WhitelistedCrowdsaleImpl.sol index 0f5391ca960..25cd5118aea 100644 --- a/contracts/mocks/WhitelistedCrowdsaleImpl.sol +++ b/contracts/mocks/WhitelistedCrowdsaleImpl.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/ERC20.sol"; +import "../token/ERC20/IERC20.sol"; import "../crowdsale/validation/WhitelistedCrowdsale.sol"; import "../crowdsale/Crowdsale.sol"; diff --git a/contracts/ownership/CanReclaimToken.sol b/contracts/ownership/CanReclaimToken.sol index ddc2a477862..858a1db84e8 100644 --- a/contracts/ownership/CanReclaimToken.sol +++ b/contracts/ownership/CanReclaimToken.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; import "./Ownable.sol"; -import "../token/ERC20/ERC20.sol"; +import "../token/ERC20/IERC20.sol"; import "../token/ERC20/SafeERC20.sol"; diff --git a/contracts/proposals/ERC1046/TokenMetadata.sol b/contracts/proposals/ERC1046/TokenMetadata.sol index f128abf7039..d90473e32ac 100644 --- a/contracts/proposals/ERC1046/TokenMetadata.sol +++ b/contracts/proposals/ERC1046/TokenMetadata.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.21; -import "../../token/ERC20/ERC20.sol"; +import "../../token/ERC20/IERC20.sol"; /** diff --git a/contracts/token/ERC20/DetailedERC20.sol b/contracts/token/ERC20/DetailedERC20.sol index b6549630ead..8c59d38e03a 100644 --- a/contracts/token/ERC20/DetailedERC20.sol +++ b/contracts/token/ERC20/DetailedERC20.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./ERC20.sol"; +import "./IERC20.sol"; /** diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/IERC20.sol similarity index 100% rename from contracts/token/ERC20/ERC20.sol rename to contracts/token/ERC20/IERC20.sol diff --git a/contracts/token/ERC20/SafeERC20.sol b/contracts/token/ERC20/SafeERC20.sol index 245bfe9947d..93d39c4de38 100644 --- a/contracts/token/ERC20/SafeERC20.sol +++ b/contracts/token/ERC20/SafeERC20.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; import "./StandardToken.sol"; -import "./ERC20.sol"; +import "./IERC20.sol"; /** diff --git a/contracts/token/ERC20/StandardToken.sol b/contracts/token/ERC20/StandardToken.sol index ee8460572cc..72324a1bc27 100644 --- a/contracts/token/ERC20/StandardToken.sol +++ b/contracts/token/ERC20/StandardToken.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./ERC20.sol"; +import "./IERC20.sol"; import "../../math/SafeMath.sol"; From e2cd31e9e0a04d42f441c09063d99888ed272547 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 28 Aug 2018 20:57:08 -0300 Subject: [PATCH 03/27] rename StandardToken to ERC20 --- contracts/examples/SimpleToken.sol | 4 ++-- contracts/mocks/DetailedERC20Mock.sol | 2 +- contracts/mocks/ERC20WithMetadataMock.sol | 2 +- contracts/mocks/ERC223TokenMock.sol | 2 +- contracts/mocks/StandardTokenMock.sol | 4 ++-- contracts/token/ERC20/BurnableToken.sol | 4 ++-- contracts/token/ERC20/MintableToken.sol | 2 +- contracts/token/ERC20/PausableToken.sol | 4 ++-- contracts/token/ERC20/StandardToken.sol | 2 +- test/crowdsale/MintedCrowdsale.test.js | 4 ++-- test/token/ERC20/StandardToken.test.js | 6 +++--- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/contracts/examples/SimpleToken.sol b/contracts/examples/SimpleToken.sol index 73df121dd8f..704c0744ce9 100644 --- a/contracts/examples/SimpleToken.sol +++ b/contracts/examples/SimpleToken.sol @@ -8,9 +8,9 @@ import "../token/ERC20/StandardToken.sol"; * @title SimpleToken * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * Note they can later distribute these tokens as they wish using `transfer` and other - * `StandardToken` functions. + * `ERC20` functions. */ -contract SimpleToken is StandardToken { +contract SimpleToken is ERC20 { string public constant name = "SimpleToken"; string public constant symbol = "SIM"; diff --git a/contracts/mocks/DetailedERC20Mock.sol b/contracts/mocks/DetailedERC20Mock.sol index a4f17529aab..5f0680c495e 100644 --- a/contracts/mocks/DetailedERC20Mock.sol +++ b/contracts/mocks/DetailedERC20Mock.sol @@ -4,7 +4,7 @@ import "../token/ERC20/StandardToken.sol"; import "../token/ERC20/DetailedERC20.sol"; -contract DetailedERC20Mock is StandardToken, DetailedERC20 { +contract DetailedERC20Mock is ERC20, DetailedERC20 { constructor( string _name, string _symbol, diff --git a/contracts/mocks/ERC20WithMetadataMock.sol b/contracts/mocks/ERC20WithMetadataMock.sol index 6e102bbacac..5a36a8c0afb 100644 --- a/contracts/mocks/ERC20WithMetadataMock.sol +++ b/contracts/mocks/ERC20WithMetadataMock.sol @@ -4,7 +4,7 @@ import "../token/ERC20/StandardToken.sol"; import "../proposals/ERC1046/TokenMetadata.sol"; -contract ERC20WithMetadataMock is StandardToken, ERC20WithMetadata { +contract ERC20WithMetadataMock is ERC20, ERC20WithMetadata { constructor(string _tokenURI) public ERC20WithMetadata(_tokenURI) { diff --git a/contracts/mocks/ERC223TokenMock.sol b/contracts/mocks/ERC223TokenMock.sol index 2f92bc5f1f4..61257fefb80 100644 --- a/contracts/mocks/ERC223TokenMock.sol +++ b/contracts/mocks/ERC223TokenMock.sol @@ -8,7 +8,7 @@ contract ERC223ContractInterface { } -contract ERC223TokenMock is StandardToken { +contract ERC223TokenMock is ERC20 { constructor(address _initialAccount, uint256 _initialBalance) public { _mint(_initialAccount, _initialBalance); diff --git a/contracts/mocks/StandardTokenMock.sol b/contracts/mocks/StandardTokenMock.sol index e4420c470bc..26e86730153 100644 --- a/contracts/mocks/StandardTokenMock.sol +++ b/contracts/mocks/StandardTokenMock.sol @@ -3,8 +3,8 @@ pragma solidity ^0.4.24; import "../token/ERC20/StandardToken.sol"; -// mock class using StandardToken -contract StandardTokenMock is StandardToken { +// mock class using ERC20 +contract StandardTokenMock is ERC20 { constructor(address _initialAccount, uint256 _initialBalance) public { _mint(_initialAccount, _initialBalance); diff --git a/contracts/token/ERC20/BurnableToken.sol b/contracts/token/ERC20/BurnableToken.sol index d944c2097fe..7e659d287eb 100644 --- a/contracts/token/ERC20/BurnableToken.sol +++ b/contracts/token/ERC20/BurnableToken.sol @@ -7,7 +7,7 @@ import "./StandardToken.sol"; * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ -contract BurnableToken is StandardToken { +contract BurnableToken is ERC20 { event TokensBurned(address indexed burner, uint256 value); @@ -29,7 +29,7 @@ contract BurnableToken is StandardToken { } /** - * @dev Overrides StandardToken._burn in order for burn and burnFrom to emit + * @dev Overrides ERC20._burn in order for burn and burnFrom to emit * an additional Burn event. */ function _burn(address _who, uint256 _value) internal { diff --git a/contracts/token/ERC20/MintableToken.sol b/contracts/token/ERC20/MintableToken.sol index ba1ca68336f..e162960c384 100644 --- a/contracts/token/ERC20/MintableToken.sol +++ b/contracts/token/ERC20/MintableToken.sol @@ -9,7 +9,7 @@ import "../../ownership/Ownable.sol"; * @dev Simple ERC20 Token example, with mintable token creation * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ -contract MintableToken is StandardToken, Ownable { +contract MintableToken is ERC20, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); diff --git a/contracts/token/ERC20/PausableToken.sol b/contracts/token/ERC20/PausableToken.sol index 75b4b938c69..f7a4cfa11b0 100644 --- a/contracts/token/ERC20/PausableToken.sol +++ b/contracts/token/ERC20/PausableToken.sol @@ -6,9 +6,9 @@ import "../../lifecycle/Pausable.sol"; /** * @title Pausable token - * @dev StandardToken modified with pausable transfers. + * @dev ERC20 modified with pausable transfers. **/ -contract PausableToken is StandardToken, Pausable { +contract PausableToken is ERC20, Pausable { function transfer( address _to, diff --git a/contracts/token/ERC20/StandardToken.sol b/contracts/token/ERC20/StandardToken.sol index 72324a1bc27..f6589607aa7 100644 --- a/contracts/token/ERC20/StandardToken.sol +++ b/contracts/token/ERC20/StandardToken.sol @@ -11,7 +11,7 @@ import "../../math/SafeMath.sol"; * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ -contract StandardToken is IERC20 { +contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private balances_; diff --git a/test/crowdsale/MintedCrowdsale.test.js b/test/crowdsale/MintedCrowdsale.test.js index 5fc89422c54..86e3d323f45 100644 --- a/test/crowdsale/MintedCrowdsale.test.js +++ b/test/crowdsale/MintedCrowdsale.test.js @@ -7,7 +7,7 @@ const BigNumber = web3.BigNumber; const MintedCrowdsale = artifacts.require('MintedCrowdsaleImpl'); const MintableToken = artifacts.require('MintableToken'); const RBACMintableToken = artifacts.require('RBACMintableToken'); -const StandardToken = artifacts.require('StandardToken'); +const ERC20 = artifacts.require('ERC20'); contract('MintedCrowdsale', function ([_, investor, wallet, purchaser]) { const rate = new BigNumber(1000); @@ -45,7 +45,7 @@ contract('MintedCrowdsale', function ([_, investor, wallet, purchaser]) { describe('using non-mintable token', function () { beforeEach(async function () { - this.token = await StandardToken.new(); + this.token = await ERC20.new(); this.crowdsale = await MintedCrowdsale.new(rate, wallet, this.token.address); }); diff --git a/test/token/ERC20/StandardToken.test.js b/test/token/ERC20/StandardToken.test.js index 7cd3388928b..57849f54612 100644 --- a/test/token/ERC20/StandardToken.test.js +++ b/test/token/ERC20/StandardToken.test.js @@ -1,7 +1,7 @@ const { assertRevert } = require('../../helpers/assertRevert'); const expectEvent = require('../../helpers/expectEvent'); -const StandardToken = artifacts.require('StandardTokenMock'); +const ERC20 = artifacts.require('StandardTokenMock'); const BigNumber = web3.BigNumber; @@ -9,11 +9,11 @@ require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -contract('StandardToken', function ([_, owner, recipient, anotherAccount]) { +contract('ERC20', function ([_, owner, recipient, anotherAccount]) { const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; beforeEach(async function () { - this.token = await StandardToken.new(owner, 100); + this.token = await ERC20.new(owner, 100); }); describe('total supply', function () { From 9891e064e0547b3e4f515f4d14d226e909ace553 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 28 Aug 2018 21:04:59 -0300 Subject: [PATCH 04/27] rename StandardTokenMock to ERC20Mock --- contracts/mocks/StandardTokenMock.sol | 2 +- test/lifecycle/TokenDestructible.test.js | 4 ++-- test/ownership/CanReclaimToken.test.js | 4 ++-- test/token/ERC20/StandardToken.test.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/mocks/StandardTokenMock.sol b/contracts/mocks/StandardTokenMock.sol index 26e86730153..32a1f8b9f2e 100644 --- a/contracts/mocks/StandardTokenMock.sol +++ b/contracts/mocks/StandardTokenMock.sol @@ -4,7 +4,7 @@ import "../token/ERC20/StandardToken.sol"; // mock class using ERC20 -contract StandardTokenMock is ERC20 { +contract ERC20Mock is ERC20 { constructor(address _initialAccount, uint256 _initialBalance) public { _mint(_initialAccount, _initialBalance); diff --git a/test/lifecycle/TokenDestructible.test.js b/test/lifecycle/TokenDestructible.test.js index 5aa631da51e..7e61d800f72 100644 --- a/test/lifecycle/TokenDestructible.test.js +++ b/test/lifecycle/TokenDestructible.test.js @@ -1,7 +1,7 @@ const { ethGetBalance } = require('../helpers/web3'); const TokenDestructible = artifacts.require('TokenDestructible'); -const StandardTokenMock = artifacts.require('StandardTokenMock'); +const ERC20Mock = artifacts.require('ERC20Mock'); const BigNumber = web3.BigNumber; @@ -28,7 +28,7 @@ contract('TokenDestructible', function ([_, owner]) { }); it('should send tokens to owner after destruction', async function () { - const token = await StandardTokenMock.new(tokenDestructible.address, 100); + const token = await ERC20Mock.new(tokenDestructible.address, 100); (await token.balanceOf(tokenDestructible.address)).should.be.bignumber.equal(100); (await token.balanceOf(owner)).should.be.bignumber.equal(0); diff --git a/test/ownership/CanReclaimToken.test.js b/test/ownership/CanReclaimToken.test.js index 1710ad2d60d..dd3fef62201 100644 --- a/test/ownership/CanReclaimToken.test.js +++ b/test/ownership/CanReclaimToken.test.js @@ -1,7 +1,7 @@ const { expectThrow } = require('../helpers/expectThrow'); const CanReclaimToken = artifacts.require('CanReclaimToken'); -const StandardTokenMock = artifacts.require('StandardTokenMock'); +const ERC20Mock = artifacts.require('ERC20Mock'); const BigNumber = web3.BigNumber; @@ -15,7 +15,7 @@ contract('CanReclaimToken', function ([_, owner, anyone]) { beforeEach(async function () { // Create contract and token - token = await StandardTokenMock.new(owner, 100, { from: owner }); + token = await ERC20Mock.new(owner, 100, { from: owner }); canReclaimToken = await CanReclaimToken.new({ from: owner }); // Force token into contract diff --git a/test/token/ERC20/StandardToken.test.js b/test/token/ERC20/StandardToken.test.js index 57849f54612..a5ca274c79f 100644 --- a/test/token/ERC20/StandardToken.test.js +++ b/test/token/ERC20/StandardToken.test.js @@ -1,7 +1,7 @@ const { assertRevert } = require('../../helpers/assertRevert'); const expectEvent = require('../../helpers/expectEvent'); -const ERC20 = artifacts.require('StandardTokenMock'); +const ERC20 = artifacts.require('ERC20Mock'); const BigNumber = web3.BigNumber; From 9ff5308a1a4e8d769371d6adb7d5b60e973edf64 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 28 Aug 2018 21:07:12 -0300 Subject: [PATCH 05/27] move StandardToken.sol to ERC20.sol, likewise test and mock files --- contracts/examples/SimpleToken.sol | 2 +- contracts/mocks/DetailedERC20Mock.sol | 2 +- contracts/mocks/{StandardTokenMock.sol => ERC20Mock.sol} | 2 +- contracts/mocks/ERC20WithMetadataMock.sol | 2 +- contracts/mocks/ERC223TokenMock.sol | 2 +- contracts/token/ERC20/BurnableToken.sol | 2 +- contracts/token/ERC20/{StandardToken.sol => ERC20.sol} | 0 contracts/token/ERC20/MintableToken.sol | 2 +- contracts/token/ERC20/PausableToken.sol | 2 +- contracts/token/ERC20/SafeERC20.sol | 2 +- test/token/ERC20/{StandardToken.test.js => ERC20.test.js} | 0 11 files changed, 9 insertions(+), 9 deletions(-) rename contracts/mocks/{StandardTokenMock.sol => ERC20Mock.sol} (92%) rename contracts/token/ERC20/{StandardToken.sol => ERC20.sol} (100%) rename test/token/ERC20/{StandardToken.test.js => ERC20.test.js} (100%) diff --git a/contracts/examples/SimpleToken.sol b/contracts/examples/SimpleToken.sol index 704c0744ce9..67de00ca420 100644 --- a/contracts/examples/SimpleToken.sol +++ b/contracts/examples/SimpleToken.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; -import "../token/ERC20/StandardToken.sol"; +import "../token/ERC20/ERC20.sol"; /** diff --git a/contracts/mocks/DetailedERC20Mock.sol b/contracts/mocks/DetailedERC20Mock.sol index 5f0680c495e..d4b6ae9b400 100644 --- a/contracts/mocks/DetailedERC20Mock.sol +++ b/contracts/mocks/DetailedERC20Mock.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/StandardToken.sol"; +import "../token/ERC20/ERC20.sol"; import "../token/ERC20/DetailedERC20.sol"; diff --git a/contracts/mocks/StandardTokenMock.sol b/contracts/mocks/ERC20Mock.sol similarity index 92% rename from contracts/mocks/StandardTokenMock.sol rename to contracts/mocks/ERC20Mock.sol index 32a1f8b9f2e..600169743b3 100644 --- a/contracts/mocks/StandardTokenMock.sol +++ b/contracts/mocks/ERC20Mock.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/StandardToken.sol"; +import "../token/ERC20/ERC20.sol"; // mock class using ERC20 diff --git a/contracts/mocks/ERC20WithMetadataMock.sol b/contracts/mocks/ERC20WithMetadataMock.sol index 5a36a8c0afb..025f154ab64 100644 --- a/contracts/mocks/ERC20WithMetadataMock.sol +++ b/contracts/mocks/ERC20WithMetadataMock.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.21; -import "../token/ERC20/StandardToken.sol"; +import "../token/ERC20/ERC20.sol"; import "../proposals/ERC1046/TokenMetadata.sol"; diff --git a/contracts/mocks/ERC223TokenMock.sol b/contracts/mocks/ERC223TokenMock.sol index 61257fefb80..de3dec54456 100644 --- a/contracts/mocks/ERC223TokenMock.sol +++ b/contracts/mocks/ERC223TokenMock.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/StandardToken.sol"; +import "../token/ERC20/ERC20.sol"; contract ERC223ContractInterface { diff --git a/contracts/token/ERC20/BurnableToken.sol b/contracts/token/ERC20/BurnableToken.sol index 7e659d287eb..9fec6c6c7d7 100644 --- a/contracts/token/ERC20/BurnableToken.sol +++ b/contracts/token/ERC20/BurnableToken.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./StandardToken.sol"; +import "./ERC20.sol"; /** diff --git a/contracts/token/ERC20/StandardToken.sol b/contracts/token/ERC20/ERC20.sol similarity index 100% rename from contracts/token/ERC20/StandardToken.sol rename to contracts/token/ERC20/ERC20.sol diff --git a/contracts/token/ERC20/MintableToken.sol b/contracts/token/ERC20/MintableToken.sol index e162960c384..131ba5f25d6 100644 --- a/contracts/token/ERC20/MintableToken.sol +++ b/contracts/token/ERC20/MintableToken.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./StandardToken.sol"; +import "./ERC20.sol"; import "../../ownership/Ownable.sol"; diff --git a/contracts/token/ERC20/PausableToken.sol b/contracts/token/ERC20/PausableToken.sol index f7a4cfa11b0..e97a28f0c27 100644 --- a/contracts/token/ERC20/PausableToken.sol +++ b/contracts/token/ERC20/PausableToken.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./StandardToken.sol"; +import "./ERC20.sol"; import "../../lifecycle/Pausable.sol"; diff --git a/contracts/token/ERC20/SafeERC20.sol b/contracts/token/ERC20/SafeERC20.sol index 93d39c4de38..451cf136c81 100644 --- a/contracts/token/ERC20/SafeERC20.sol +++ b/contracts/token/ERC20/SafeERC20.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./StandardToken.sol"; +import "./ERC20.sol"; import "./IERC20.sol"; diff --git a/test/token/ERC20/StandardToken.test.js b/test/token/ERC20/ERC20.test.js similarity index 100% rename from test/token/ERC20/StandardToken.test.js rename to test/token/ERC20/ERC20.test.js From 0da0906e3c50a42ad2f2efff1eedec2d050f0f0b Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 28 Aug 2018 21:20:34 -0300 Subject: [PATCH 06/27] rename MintableToken to ERC20Mintable --- contracts/crowdsale/emission/MintedCrowdsale.sol | 2 +- contracts/examples/SampleCrowdsale.sol | 4 ++-- contracts/mocks/FinalizableCrowdsaleImpl.sol | 2 +- contracts/mocks/MintedCrowdsaleImpl.sol | 2 +- contracts/mocks/RefundableCrowdsaleImpl.sol | 2 +- contracts/token/ERC20/CappedToken.sol | 2 +- contracts/token/ERC20/MintableToken.sol | 2 +- contracts/token/ERC20/RBACMintableToken.sol | 2 +- test/crowdsale/FinalizableCrowdsale.test.js | 4 ++-- test/crowdsale/MintedCrowdsale.test.js | 6 +++--- test/token/ERC20/CappedToken.test.js | 4 ++-- test/token/ERC20/MintableToken.behavior.js | 4 ++-- test/token/ERC20/MintableToken.test.js | 10 +++++----- test/token/ERC20/RBACCappedToken.test.js | 4 ++-- test/token/ERC20/RBACMintableToken.test.js | 4 ++-- test/token/ERC20/TokenTimelock.test.js | 4 ++-- test/token/ERC20/TokenVesting.test.js | 4 ++-- 17 files changed, 31 insertions(+), 31 deletions(-) diff --git a/contracts/crowdsale/emission/MintedCrowdsale.sol b/contracts/crowdsale/emission/MintedCrowdsale.sol index 0db3a7436cd..b245eba9221 100644 --- a/contracts/crowdsale/emission/MintedCrowdsale.sol +++ b/contracts/crowdsale/emission/MintedCrowdsale.sol @@ -23,6 +23,6 @@ contract MintedCrowdsale is Crowdsale { internal { // Potentially dangerous assumption about the type of the token. - require(MintableToken(address(token)).mint(_beneficiary, _tokenAmount)); + require(ERC20Mintable(address(token)).mint(_beneficiary, _tokenAmount)); } } diff --git a/contracts/examples/SampleCrowdsale.sol b/contracts/examples/SampleCrowdsale.sol index 0a3f1042edf..665bafba6fc 100644 --- a/contracts/examples/SampleCrowdsale.sol +++ b/contracts/examples/SampleCrowdsale.sol @@ -11,7 +11,7 @@ import "../token/ERC20/MintableToken.sol"; * @dev Very simple ERC20 Token that can be minted. * It is meant to be used in a crowdsale contract. */ -contract SampleCrowdsaleToken is MintableToken { +contract SampleCrowdsaleToken is ERC20Mintable { string public constant name = "Sample Crowdsale Token"; string public constant symbol = "SCT"; @@ -44,7 +44,7 @@ contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale, MintedCrowdsal uint256 _rate, address _wallet, uint256 _cap, - MintableToken _token, + ERC20Mintable _token, uint256 _goal ) public diff --git a/contracts/mocks/FinalizableCrowdsaleImpl.sol b/contracts/mocks/FinalizableCrowdsaleImpl.sol index 8321bdb9926..5f08e304a96 100644 --- a/contracts/mocks/FinalizableCrowdsaleImpl.sol +++ b/contracts/mocks/FinalizableCrowdsaleImpl.sol @@ -11,7 +11,7 @@ contract FinalizableCrowdsaleImpl is FinalizableCrowdsale { uint256 _closingTime, uint256 _rate, address _wallet, - MintableToken _token + ERC20Mintable _token ) public Crowdsale(_rate, _wallet, _token) diff --git a/contracts/mocks/MintedCrowdsaleImpl.sol b/contracts/mocks/MintedCrowdsaleImpl.sol index b776db3e044..2c1d6e617ab 100644 --- a/contracts/mocks/MintedCrowdsaleImpl.sol +++ b/contracts/mocks/MintedCrowdsaleImpl.sol @@ -9,7 +9,7 @@ contract MintedCrowdsaleImpl is MintedCrowdsale { constructor ( uint256 _rate, address _wallet, - MintableToken _token + ERC20Mintable _token ) public Crowdsale(_rate, _wallet, _token) diff --git a/contracts/mocks/RefundableCrowdsaleImpl.sol b/contracts/mocks/RefundableCrowdsaleImpl.sol index b4ff6040a12..591ee5c0a0c 100644 --- a/contracts/mocks/RefundableCrowdsaleImpl.sol +++ b/contracts/mocks/RefundableCrowdsaleImpl.sol @@ -11,7 +11,7 @@ contract RefundableCrowdsaleImpl is RefundableCrowdsale { uint256 _closingTime, uint256 _rate, address _wallet, - MintableToken _token, + ERC20Mintable _token, uint256 _goal ) public diff --git a/contracts/token/ERC20/CappedToken.sol b/contracts/token/ERC20/CappedToken.sol index 1af8bdcb647..f93ba47a361 100644 --- a/contracts/token/ERC20/CappedToken.sol +++ b/contracts/token/ERC20/CappedToken.sol @@ -7,7 +7,7 @@ import "./MintableToken.sol"; * @title Capped token * @dev Mintable token with a token cap. */ -contract CappedToken is MintableToken { +contract CappedToken is ERC20Mintable { uint256 public cap; diff --git a/contracts/token/ERC20/MintableToken.sol b/contracts/token/ERC20/MintableToken.sol index 131ba5f25d6..0ba200cdfac 100644 --- a/contracts/token/ERC20/MintableToken.sol +++ b/contracts/token/ERC20/MintableToken.sol @@ -9,7 +9,7 @@ import "../../ownership/Ownable.sol"; * @dev Simple ERC20 Token example, with mintable token creation * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ -contract MintableToken is ERC20, Ownable { +contract ERC20Mintable is ERC20, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); diff --git a/contracts/token/ERC20/RBACMintableToken.sol b/contracts/token/ERC20/RBACMintableToken.sol index ed7e8d210c3..6f2d538d442 100644 --- a/contracts/token/ERC20/RBACMintableToken.sol +++ b/contracts/token/ERC20/RBACMintableToken.sol @@ -9,7 +9,7 @@ import "../../access/rbac/RBAC.sol"; * @author Vittorio Minacori (@vittominacori) * @dev Mintable Token, with RBAC minter permissions */ -contract RBACMintableToken is MintableToken, RBAC { +contract RBACMintableToken is ERC20Mintable, RBAC { /** * A constant role name for indicating minters. */ diff --git a/test/crowdsale/FinalizableCrowdsale.test.js b/test/crowdsale/FinalizableCrowdsale.test.js index e0c8eb30834..ed2d5314157 100644 --- a/test/crowdsale/FinalizableCrowdsale.test.js +++ b/test/crowdsale/FinalizableCrowdsale.test.js @@ -11,7 +11,7 @@ const should = require('chai') .should(); const FinalizableCrowdsale = artifacts.require('FinalizableCrowdsaleImpl'); -const MintableToken = artifacts.require('MintableToken'); +const ERC20Mintable = artifacts.require('ERC20Mintable'); contract('FinalizableCrowdsale', function ([_, owner, wallet, thirdparty]) { const rate = new BigNumber(1000); @@ -26,7 +26,7 @@ contract('FinalizableCrowdsale', function ([_, owner, wallet, thirdparty]) { this.closingTime = this.openingTime + duration.weeks(1); this.afterClosingTime = this.closingTime + duration.seconds(1); - this.token = await MintableToken.new(); + this.token = await ERC20Mintable.new(); this.crowdsale = await FinalizableCrowdsale.new( this.openingTime, this.closingTime, rate, wallet, this.token.address, { from: owner } ); diff --git a/test/crowdsale/MintedCrowdsale.test.js b/test/crowdsale/MintedCrowdsale.test.js index 86e3d323f45..27f64e6edd2 100644 --- a/test/crowdsale/MintedCrowdsale.test.js +++ b/test/crowdsale/MintedCrowdsale.test.js @@ -5,7 +5,7 @@ const { assertRevert } = require('../helpers/assertRevert'); const BigNumber = web3.BigNumber; const MintedCrowdsale = artifacts.require('MintedCrowdsaleImpl'); -const MintableToken = artifacts.require('MintableToken'); +const ERC20Mintable = artifacts.require('ERC20Mintable'); const RBACMintableToken = artifacts.require('RBACMintableToken'); const ERC20 = artifacts.require('ERC20'); @@ -13,9 +13,9 @@ contract('MintedCrowdsale', function ([_, investor, wallet, purchaser]) { const rate = new BigNumber(1000); const value = ether(5); - describe('using MintableToken', function () { + describe('using ERC20Mintable', function () { beforeEach(async function () { - this.token = await MintableToken.new(); + this.token = await ERC20Mintable.new(); this.crowdsale = await MintedCrowdsale.new(rate, wallet, this.token.address); await this.token.transferOwnership(this.crowdsale.address); }); diff --git a/test/token/ERC20/CappedToken.test.js b/test/token/ERC20/CappedToken.test.js index 1098de2942c..8bc0ef25859 100644 --- a/test/token/ERC20/CappedToken.test.js +++ b/test/token/ERC20/CappedToken.test.js @@ -1,6 +1,6 @@ const { assertRevert } = require('../../helpers/assertRevert'); const { ether } = require('../../helpers/ether'); -const { shouldBehaveLikeMintableToken } = require('./MintableToken.behavior'); +const { shouldBehaveLikeERC20Mintable } = require('./MintableToken.behavior'); const { shouldBehaveLikeCappedToken } = require('./CappedToken.behavior'); const CappedToken = artifacts.require('CappedToken'); @@ -20,6 +20,6 @@ contract('Capped', function ([_, owner, ...otherAccounts]) { }); shouldBehaveLikeCappedToken(owner, otherAccounts, cap); - shouldBehaveLikeMintableToken(owner, owner, otherAccounts); + shouldBehaveLikeERC20Mintable(owner, owner, otherAccounts); }); }); diff --git a/test/token/ERC20/MintableToken.behavior.js b/test/token/ERC20/MintableToken.behavior.js index a6f39780eef..63fb861b551 100644 --- a/test/token/ERC20/MintableToken.behavior.js +++ b/test/token/ERC20/MintableToken.behavior.js @@ -7,7 +7,7 @@ require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -function shouldBehaveLikeMintableToken (owner, minter, [anyone]) { +function shouldBehaveLikeERC20Mintable (owner, minter, [anyone]) { const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; describe('as a basic mintable token', function () { @@ -160,5 +160,5 @@ function shouldBehaveLikeMintableToken (owner, minter, [anyone]) { } module.exports = { - shouldBehaveLikeMintableToken, + shouldBehaveLikeERC20Mintable, }; diff --git a/test/token/ERC20/MintableToken.test.js b/test/token/ERC20/MintableToken.test.js index c06380a80ce..8e4d8236a45 100644 --- a/test/token/ERC20/MintableToken.test.js +++ b/test/token/ERC20/MintableToken.test.js @@ -1,10 +1,10 @@ -const { shouldBehaveLikeMintableToken } = require('./MintableToken.behavior'); -const MintableToken = artifacts.require('MintableToken'); +const { shouldBehaveLikeERC20Mintable } = require('./MintableToken.behavior'); +const ERC20Mintable = artifacts.require('ERC20Mintable'); -contract('MintableToken', function ([_, owner, ...otherAccounts]) { +contract('ERC20Mintable', function ([_, owner, ...otherAccounts]) { beforeEach(async function () { - this.token = await MintableToken.new({ from: owner }); + this.token = await ERC20Mintable.new({ from: owner }); }); - shouldBehaveLikeMintableToken(owner, owner, otherAccounts); + shouldBehaveLikeERC20Mintable(owner, owner, otherAccounts); }); diff --git a/test/token/ERC20/RBACCappedToken.test.js b/test/token/ERC20/RBACCappedToken.test.js index 3f3ca71a78e..d7d0940967c 100644 --- a/test/token/ERC20/RBACCappedToken.test.js +++ b/test/token/ERC20/RBACCappedToken.test.js @@ -1,6 +1,6 @@ const { ether } = require('../../helpers/ether'); const { shouldBehaveLikeRBACMintableToken } = require('./RBACMintableToken.behavior'); -const { shouldBehaveLikeMintableToken } = require('./MintableToken.behavior'); +const { shouldBehaveLikeERC20Mintable } = require('./MintableToken.behavior'); const { shouldBehaveLikeCappedToken } = require('./CappedToken.behavior'); const RBACCappedTokenMock = artifacts.require('RBACCappedTokenMock'); @@ -13,7 +13,7 @@ contract('RBACCappedToken', function ([_, owner, minter, ...otherAccounts]) { await this.token.addMinter(minter, { from: owner }); }); - shouldBehaveLikeMintableToken(owner, minter, otherAccounts); + shouldBehaveLikeERC20Mintable(owner, minter, otherAccounts); shouldBehaveLikeRBACMintableToken(owner, otherAccounts); shouldBehaveLikeCappedToken(minter, otherAccounts, cap); }); diff --git a/test/token/ERC20/RBACMintableToken.test.js b/test/token/ERC20/RBACMintableToken.test.js index 839b73db8b6..ff6cb37be85 100644 --- a/test/token/ERC20/RBACMintableToken.test.js +++ b/test/token/ERC20/RBACMintableToken.test.js @@ -1,5 +1,5 @@ const { shouldBehaveLikeRBACMintableToken } = require('./RBACMintableToken.behavior'); -const { shouldBehaveLikeMintableToken } = require('./MintableToken.behavior'); +const { shouldBehaveLikeERC20Mintable } = require('./MintableToken.behavior'); const RBACMintableToken = artifacts.require('RBACMintableToken'); @@ -10,5 +10,5 @@ contract('RBACMintableToken', function ([_, owner, minter, ...otherAccounts]) { }); shouldBehaveLikeRBACMintableToken(owner, otherAccounts); - shouldBehaveLikeMintableToken(owner, minter, otherAccounts); + shouldBehaveLikeERC20Mintable(owner, minter, otherAccounts); }); diff --git a/test/token/ERC20/TokenTimelock.test.js b/test/token/ERC20/TokenTimelock.test.js index 4f3535efca5..168992707af 100644 --- a/test/token/ERC20/TokenTimelock.test.js +++ b/test/token/ERC20/TokenTimelock.test.js @@ -8,7 +8,7 @@ require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -const MintableToken = artifacts.require('MintableToken'); +const ERC20Mintable = artifacts.require('ERC20Mintable'); const TokenTimelock = artifacts.require('TokenTimelock'); contract('TokenTimelock', function ([_, owner, beneficiary]) { @@ -16,7 +16,7 @@ contract('TokenTimelock', function ([_, owner, beneficiary]) { context('with token', function () { beforeEach(async function () { - this.token = await MintableToken.new({ from: owner }); + this.token = await ERC20Mintable.new({ from: owner }); }); it('rejects a release time in the past', async function () { diff --git a/test/token/ERC20/TokenVesting.test.js b/test/token/ERC20/TokenVesting.test.js index 48dfa2bc0f9..60d773511ec 100644 --- a/test/token/ERC20/TokenVesting.test.js +++ b/test/token/ERC20/TokenVesting.test.js @@ -10,7 +10,7 @@ require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -const MintableToken = artifacts.require('MintableToken'); +const ERC20Mintable = artifacts.require('ERC20Mintable'); const TokenVesting = artifacts.require('TokenVesting'); contract('TokenVesting', function ([_, owner, beneficiary]) { @@ -44,7 +44,7 @@ contract('TokenVesting', function ([_, owner, beneficiary]) { beforeEach(async function () { this.vesting = await TokenVesting.new(beneficiary, this.start, this.cliff, this.duration, true, { from: owner }); - this.token = await MintableToken.new({ from: owner }); + this.token = await ERC20Mintable.new({ from: owner }); await this.token.mint(this.vesting.address, amount, { from: owner }); }); From f0b10ed39a14bca9a67a6c27d7515565e6e61d22 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 28 Aug 2018 21:29:02 -0300 Subject: [PATCH 07/27] move MintableToken.sol to ERC20Mintable.sol, likewise test and mock files --- contracts/crowdsale/emission/MintedCrowdsale.sol | 2 +- contracts/examples/SampleCrowdsale.sol | 2 +- contracts/mocks/FinalizableCrowdsaleImpl.sol | 2 +- contracts/mocks/MintedCrowdsaleImpl.sol | 2 +- contracts/mocks/RefundableCrowdsaleImpl.sol | 2 +- contracts/token/ERC20/CappedToken.sol | 2 +- contracts/token/ERC20/{MintableToken.sol => ERC20Mintable.sol} | 0 contracts/token/ERC20/RBACMintableToken.sol | 2 +- test/token/ERC20/CappedToken.test.js | 2 +- .../{MintableToken.behavior.js => ERC20Mintable.behavior.js} | 0 .../ERC20/{MintableToken.test.js => ERC20Mintable.test.js} | 2 +- test/token/ERC20/RBACCappedToken.test.js | 2 +- test/token/ERC20/RBACMintableToken.test.js | 2 +- 13 files changed, 11 insertions(+), 11 deletions(-) rename contracts/token/ERC20/{MintableToken.sol => ERC20Mintable.sol} (100%) rename test/token/ERC20/{MintableToken.behavior.js => ERC20Mintable.behavior.js} (100%) rename test/token/ERC20/{MintableToken.test.js => ERC20Mintable.test.js} (78%) diff --git a/contracts/crowdsale/emission/MintedCrowdsale.sol b/contracts/crowdsale/emission/MintedCrowdsale.sol index b245eba9221..9f3a8b4b115 100644 --- a/contracts/crowdsale/emission/MintedCrowdsale.sol +++ b/contracts/crowdsale/emission/MintedCrowdsale.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; import "../Crowdsale.sol"; -import "../../token/ERC20/MintableToken.sol"; +import "../../token/ERC20/ERC20Mintable.sol"; /** diff --git a/contracts/examples/SampleCrowdsale.sol b/contracts/examples/SampleCrowdsale.sol index 665bafba6fc..564c6a0873e 100644 --- a/contracts/examples/SampleCrowdsale.sol +++ b/contracts/examples/SampleCrowdsale.sol @@ -3,7 +3,7 @@ pragma solidity ^0.4.24; import "../crowdsale/validation/CappedCrowdsale.sol"; import "../crowdsale/distribution/RefundableCrowdsale.sol"; import "../crowdsale/emission/MintedCrowdsale.sol"; -import "../token/ERC20/MintableToken.sol"; +import "../token/ERC20/ERC20Mintable.sol"; /** diff --git a/contracts/mocks/FinalizableCrowdsaleImpl.sol b/contracts/mocks/FinalizableCrowdsaleImpl.sol index 5f08e304a96..aa419b82211 100644 --- a/contracts/mocks/FinalizableCrowdsaleImpl.sol +++ b/contracts/mocks/FinalizableCrowdsaleImpl.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/MintableToken.sol"; +import "../token/ERC20/ERC20Mintable.sol"; import "../crowdsale/distribution/FinalizableCrowdsale.sol"; diff --git a/contracts/mocks/MintedCrowdsaleImpl.sol b/contracts/mocks/MintedCrowdsaleImpl.sol index 2c1d6e617ab..77e3430b52e 100644 --- a/contracts/mocks/MintedCrowdsaleImpl.sol +++ b/contracts/mocks/MintedCrowdsaleImpl.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/MintableToken.sol"; +import "../token/ERC20/ERC20Mintable.sol"; import "../crowdsale/emission/MintedCrowdsale.sol"; diff --git a/contracts/mocks/RefundableCrowdsaleImpl.sol b/contracts/mocks/RefundableCrowdsaleImpl.sol index 591ee5c0a0c..b581031bfd5 100644 --- a/contracts/mocks/RefundableCrowdsaleImpl.sol +++ b/contracts/mocks/RefundableCrowdsaleImpl.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/MintableToken.sol"; +import "../token/ERC20/ERC20Mintable.sol"; import "../crowdsale/distribution/RefundableCrowdsale.sol"; diff --git a/contracts/token/ERC20/CappedToken.sol b/contracts/token/ERC20/CappedToken.sol index f93ba47a361..a456dc1194a 100644 --- a/contracts/token/ERC20/CappedToken.sol +++ b/contracts/token/ERC20/CappedToken.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./MintableToken.sol"; +import "./ERC20Mintable.sol"; /** diff --git a/contracts/token/ERC20/MintableToken.sol b/contracts/token/ERC20/ERC20Mintable.sol similarity index 100% rename from contracts/token/ERC20/MintableToken.sol rename to contracts/token/ERC20/ERC20Mintable.sol diff --git a/contracts/token/ERC20/RBACMintableToken.sol b/contracts/token/ERC20/RBACMintableToken.sol index 6f2d538d442..6cf9f6aba4d 100644 --- a/contracts/token/ERC20/RBACMintableToken.sol +++ b/contracts/token/ERC20/RBACMintableToken.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./MintableToken.sol"; +import "./ERC20Mintable.sol"; import "../../access/rbac/RBAC.sol"; diff --git a/test/token/ERC20/CappedToken.test.js b/test/token/ERC20/CappedToken.test.js index 8bc0ef25859..c576ee5dc0c 100644 --- a/test/token/ERC20/CappedToken.test.js +++ b/test/token/ERC20/CappedToken.test.js @@ -1,6 +1,6 @@ const { assertRevert } = require('../../helpers/assertRevert'); const { ether } = require('../../helpers/ether'); -const { shouldBehaveLikeERC20Mintable } = require('./MintableToken.behavior'); +const { shouldBehaveLikeERC20Mintable } = require('./ERC20Mintable.behavior'); const { shouldBehaveLikeCappedToken } = require('./CappedToken.behavior'); const CappedToken = artifacts.require('CappedToken'); diff --git a/test/token/ERC20/MintableToken.behavior.js b/test/token/ERC20/ERC20Mintable.behavior.js similarity index 100% rename from test/token/ERC20/MintableToken.behavior.js rename to test/token/ERC20/ERC20Mintable.behavior.js diff --git a/test/token/ERC20/MintableToken.test.js b/test/token/ERC20/ERC20Mintable.test.js similarity index 78% rename from test/token/ERC20/MintableToken.test.js rename to test/token/ERC20/ERC20Mintable.test.js index 8e4d8236a45..20727dafd9a 100644 --- a/test/token/ERC20/MintableToken.test.js +++ b/test/token/ERC20/ERC20Mintable.test.js @@ -1,4 +1,4 @@ -const { shouldBehaveLikeERC20Mintable } = require('./MintableToken.behavior'); +const { shouldBehaveLikeERC20Mintable } = require('./ERC20Mintable.behavior'); const ERC20Mintable = artifacts.require('ERC20Mintable'); contract('ERC20Mintable', function ([_, owner, ...otherAccounts]) { diff --git a/test/token/ERC20/RBACCappedToken.test.js b/test/token/ERC20/RBACCappedToken.test.js index d7d0940967c..526600e017c 100644 --- a/test/token/ERC20/RBACCappedToken.test.js +++ b/test/token/ERC20/RBACCappedToken.test.js @@ -1,6 +1,6 @@ const { ether } = require('../../helpers/ether'); const { shouldBehaveLikeRBACMintableToken } = require('./RBACMintableToken.behavior'); -const { shouldBehaveLikeERC20Mintable } = require('./MintableToken.behavior'); +const { shouldBehaveLikeERC20Mintable } = require('./ERC20Mintable.behavior'); const { shouldBehaveLikeCappedToken } = require('./CappedToken.behavior'); const RBACCappedTokenMock = artifacts.require('RBACCappedTokenMock'); diff --git a/test/token/ERC20/RBACMintableToken.test.js b/test/token/ERC20/RBACMintableToken.test.js index ff6cb37be85..2caf4bface8 100644 --- a/test/token/ERC20/RBACMintableToken.test.js +++ b/test/token/ERC20/RBACMintableToken.test.js @@ -1,5 +1,5 @@ const { shouldBehaveLikeRBACMintableToken } = require('./RBACMintableToken.behavior'); -const { shouldBehaveLikeERC20Mintable } = require('./MintableToken.behavior'); +const { shouldBehaveLikeERC20Mintable } = require('./ERC20Mintable.behavior'); const RBACMintableToken = artifacts.require('RBACMintableToken'); From 05a348494776c5e0502d25f5e973e9cf40c20544 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 28 Aug 2018 21:32:18 -0300 Subject: [PATCH 08/27] rename BurnableToken to ERC20Burnable --- contracts/mocks/BurnableTokenMock.sol | 2 +- contracts/token/ERC20/BurnableToken.sol | 2 +- test/token/ERC20/BurnableToken.behavior.js | 4 ++-- test/token/ERC20/BurnableToken.test.js | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/contracts/mocks/BurnableTokenMock.sol b/contracts/mocks/BurnableTokenMock.sol index a148f17f47e..8ed66dc8f26 100644 --- a/contracts/mocks/BurnableTokenMock.sol +++ b/contracts/mocks/BurnableTokenMock.sol @@ -3,7 +3,7 @@ pragma solidity ^0.4.24; import "../token/ERC20/BurnableToken.sol"; -contract BurnableTokenMock is BurnableToken { +contract ERC20BurnableMock is ERC20Burnable { constructor(address _initialAccount, uint256 _initialBalance) public { _mint(_initialAccount, _initialBalance); diff --git a/contracts/token/ERC20/BurnableToken.sol b/contracts/token/ERC20/BurnableToken.sol index 9fec6c6c7d7..1fc83b77a00 100644 --- a/contracts/token/ERC20/BurnableToken.sol +++ b/contracts/token/ERC20/BurnableToken.sol @@ -7,7 +7,7 @@ import "./ERC20.sol"; * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ -contract BurnableToken is ERC20 { +contract ERC20Burnable is ERC20 { event TokensBurned(address indexed burner, uint256 value); diff --git a/test/token/ERC20/BurnableToken.behavior.js b/test/token/ERC20/BurnableToken.behavior.js index 6e4e29181c6..69c5bf51541 100644 --- a/test/token/ERC20/BurnableToken.behavior.js +++ b/test/token/ERC20/BurnableToken.behavior.js @@ -8,7 +8,7 @@ require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -function shouldBehaveLikeBurnableToken (owner, initialBalance, [burner]) { +function shouldBehaveLikeERC20Burnable (owner, initialBalance, [burner]) { describe('burn', function () { describe('when the given amount is not greater than balance of the sender', function () { context('for a zero amount', function () { @@ -113,5 +113,5 @@ function shouldBehaveLikeBurnableToken (owner, initialBalance, [burner]) { } module.exports = { - shouldBehaveLikeBurnableToken, + shouldBehaveLikeERC20Burnable, }; diff --git a/test/token/ERC20/BurnableToken.test.js b/test/token/ERC20/BurnableToken.test.js index 0622a48b607..31f63997636 100644 --- a/test/token/ERC20/BurnableToken.test.js +++ b/test/token/ERC20/BurnableToken.test.js @@ -1,12 +1,12 @@ -const { shouldBehaveLikeBurnableToken } = require('./BurnableToken.behavior'); -const BurnableTokenMock = artifacts.require('BurnableTokenMock'); +const { shouldBehaveLikeERC20Burnable } = require('./BurnableToken.behavior'); +const ERC20BurnableMock = artifacts.require('ERC20BurnableMock'); -contract('BurnableToken', function ([_, owner, ...otherAccounts]) { +contract('ERC20Burnable', function ([_, owner, ...otherAccounts]) { const initialBalance = 1000; beforeEach(async function () { - this.token = await BurnableTokenMock.new(owner, initialBalance, { from: owner }); + this.token = await ERC20BurnableMock.new(owner, initialBalance, { from: owner }); }); - shouldBehaveLikeBurnableToken(owner, initialBalance, otherAccounts); + shouldBehaveLikeERC20Burnable(owner, initialBalance, otherAccounts); }); From 06cc72c4151eccc0baf16bf924adf901bb24638a Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 28 Aug 2018 21:38:24 -0300 Subject: [PATCH 09/27] move BurnableToken.sol to ERC20Burnable.sol, likewise for related files --- .../mocks/{BurnableTokenMock.sol => ERC20BurnableMock.sol} | 2 +- contracts/token/ERC20/{BurnableToken.sol => ERC20Burnable.sol} | 0 .../{BurnableToken.behavior.js => ERC20Burnable.behavior.js} | 0 .../ERC20/{BurnableToken.test.js => ERC20Burnable.test.js} | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename contracts/mocks/{BurnableTokenMock.sol => ERC20BurnableMock.sol} (82%) rename contracts/token/ERC20/{BurnableToken.sol => ERC20Burnable.sol} (100%) rename test/token/ERC20/{BurnableToken.behavior.js => ERC20Burnable.behavior.js} (100%) rename test/token/ERC20/{BurnableToken.test.js => ERC20Burnable.test.js} (82%) diff --git a/contracts/mocks/BurnableTokenMock.sol b/contracts/mocks/ERC20BurnableMock.sol similarity index 82% rename from contracts/mocks/BurnableTokenMock.sol rename to contracts/mocks/ERC20BurnableMock.sol index 8ed66dc8f26..79819b748c7 100644 --- a/contracts/mocks/BurnableTokenMock.sol +++ b/contracts/mocks/ERC20BurnableMock.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/BurnableToken.sol"; +import "../token/ERC20/ERC20Burnable.sol"; contract ERC20BurnableMock is ERC20Burnable { diff --git a/contracts/token/ERC20/BurnableToken.sol b/contracts/token/ERC20/ERC20Burnable.sol similarity index 100% rename from contracts/token/ERC20/BurnableToken.sol rename to contracts/token/ERC20/ERC20Burnable.sol diff --git a/test/token/ERC20/BurnableToken.behavior.js b/test/token/ERC20/ERC20Burnable.behavior.js similarity index 100% rename from test/token/ERC20/BurnableToken.behavior.js rename to test/token/ERC20/ERC20Burnable.behavior.js diff --git a/test/token/ERC20/BurnableToken.test.js b/test/token/ERC20/ERC20Burnable.test.js similarity index 82% rename from test/token/ERC20/BurnableToken.test.js rename to test/token/ERC20/ERC20Burnable.test.js index 31f63997636..0e18e786766 100644 --- a/test/token/ERC20/BurnableToken.test.js +++ b/test/token/ERC20/ERC20Burnable.test.js @@ -1,4 +1,4 @@ -const { shouldBehaveLikeERC20Burnable } = require('./BurnableToken.behavior'); +const { shouldBehaveLikeERC20Burnable } = require('./ERC20Burnable.behavior'); const ERC20BurnableMock = artifacts.require('ERC20BurnableMock'); contract('ERC20Burnable', function ([_, owner, ...otherAccounts]) { From d422ca07d34e92a8ea552ec9f06b108c3734fa14 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 10:56:52 -0300 Subject: [PATCH 10/27] rename CappedToken to ERC20Capped --- contracts/mocks/RBACCappedTokenMock.sol | 4 ++-- contracts/token/ERC20/CappedToken.sol | 2 +- test/token/ERC20/CappedToken.behavior.js | 4 ++-- test/token/ERC20/CappedToken.test.js | 12 ++++++------ test/token/ERC20/RBACCappedToken.test.js | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/contracts/mocks/RBACCappedTokenMock.sol b/contracts/mocks/RBACCappedTokenMock.sol index bf4ff8f2d6a..42571e67c18 100644 --- a/contracts/mocks/RBACCappedTokenMock.sol +++ b/contracts/mocks/RBACCappedTokenMock.sol @@ -4,9 +4,9 @@ import "../token/ERC20/RBACMintableToken.sol"; import "../token/ERC20/CappedToken.sol"; -contract RBACCappedTokenMock is CappedToken, RBACMintableToken { +contract RBACCappedTokenMock is ERC20Capped, RBACMintableToken { constructor(uint256 _cap) - CappedToken(_cap) + ERC20Capped(_cap) public {} } diff --git a/contracts/token/ERC20/CappedToken.sol b/contracts/token/ERC20/CappedToken.sol index a456dc1194a..3af03f167cd 100644 --- a/contracts/token/ERC20/CappedToken.sol +++ b/contracts/token/ERC20/CappedToken.sol @@ -7,7 +7,7 @@ import "./ERC20Mintable.sol"; * @title Capped token * @dev Mintable token with a token cap. */ -contract CappedToken is ERC20Mintable { +contract ERC20Capped is ERC20Mintable { uint256 public cap; diff --git a/test/token/ERC20/CappedToken.behavior.js b/test/token/ERC20/CappedToken.behavior.js index 46c541c597c..004d512c042 100644 --- a/test/token/ERC20/CappedToken.behavior.js +++ b/test/token/ERC20/CappedToken.behavior.js @@ -7,7 +7,7 @@ require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -function shouldBehaveLikeCappedToken (minter, [anyone], cap) { +function shouldBehaveLikeERC20Capped (minter, [anyone], cap) { describe('capped token', function () { const from = minter; @@ -33,5 +33,5 @@ function shouldBehaveLikeCappedToken (minter, [anyone], cap) { } module.exports = { - shouldBehaveLikeCappedToken, + shouldBehaveLikeERC20Capped, }; diff --git a/test/token/ERC20/CappedToken.test.js b/test/token/ERC20/CappedToken.test.js index c576ee5dc0c..c811649e846 100644 --- a/test/token/ERC20/CappedToken.test.js +++ b/test/token/ERC20/CappedToken.test.js @@ -1,25 +1,25 @@ const { assertRevert } = require('../../helpers/assertRevert'); const { ether } = require('../../helpers/ether'); const { shouldBehaveLikeERC20Mintable } = require('./ERC20Mintable.behavior'); -const { shouldBehaveLikeCappedToken } = require('./CappedToken.behavior'); +const { shouldBehaveLikeERC20Capped } = require('./CappedToken.behavior'); -const CappedToken = artifacts.require('CappedToken'); +const ERC20Capped = artifacts.require('ERC20Capped'); -contract('Capped', function ([_, owner, ...otherAccounts]) { +contract('ERC20Capped', function ([_, owner, ...otherAccounts]) { const cap = ether(1000); it('requires a non-zero cap', async function () { await assertRevert( - CappedToken.new(0, { from: owner }) + ERC20Capped.new(0, { from: owner }) ); }); context('once deployed', async function () { beforeEach(async function () { - this.token = await CappedToken.new(cap, { from: owner }); + this.token = await ERC20Capped.new(cap, { from: owner }); }); - shouldBehaveLikeCappedToken(owner, otherAccounts, cap); + shouldBehaveLikeERC20Capped(owner, otherAccounts, cap); shouldBehaveLikeERC20Mintable(owner, owner, otherAccounts); }); }); diff --git a/test/token/ERC20/RBACCappedToken.test.js b/test/token/ERC20/RBACCappedToken.test.js index 526600e017c..4f3d8a755d9 100644 --- a/test/token/ERC20/RBACCappedToken.test.js +++ b/test/token/ERC20/RBACCappedToken.test.js @@ -1,7 +1,7 @@ const { ether } = require('../../helpers/ether'); const { shouldBehaveLikeRBACMintableToken } = require('./RBACMintableToken.behavior'); const { shouldBehaveLikeERC20Mintable } = require('./ERC20Mintable.behavior'); -const { shouldBehaveLikeCappedToken } = require('./CappedToken.behavior'); +const { shouldBehaveLikeERC20Capped } = require('./CappedToken.behavior'); const RBACCappedTokenMock = artifacts.require('RBACCappedTokenMock'); @@ -15,5 +15,5 @@ contract('RBACCappedToken', function ([_, owner, minter, ...otherAccounts]) { shouldBehaveLikeERC20Mintable(owner, minter, otherAccounts); shouldBehaveLikeRBACMintableToken(owner, otherAccounts); - shouldBehaveLikeCappedToken(minter, otherAccounts, cap); + shouldBehaveLikeERC20Capped(minter, otherAccounts, cap); }); From 1b176eec437ae10649c4890e7fb160f01925eb05 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 10:59:01 -0300 Subject: [PATCH 11/27] move CappedToken.sol to ERC20Capped.sol, likewise for related files --- contracts/mocks/RBACCappedTokenMock.sol | 2 +- contracts/token/ERC20/{CappedToken.sol => ERC20Capped.sol} | 0 .../ERC20/{CappedToken.behavior.js => ERC20Capped.behavior.js} | 0 test/token/ERC20/{CappedToken.test.js => ERC20Capped.test.js} | 2 +- test/token/ERC20/RBACCappedToken.test.js | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) rename contracts/token/ERC20/{CappedToken.sol => ERC20Capped.sol} (100%) rename test/token/ERC20/{CappedToken.behavior.js => ERC20Capped.behavior.js} (100%) rename test/token/ERC20/{CappedToken.test.js => ERC20Capped.test.js} (92%) diff --git a/contracts/mocks/RBACCappedTokenMock.sol b/contracts/mocks/RBACCappedTokenMock.sol index 42571e67c18..8d182c6e5be 100644 --- a/contracts/mocks/RBACCappedTokenMock.sol +++ b/contracts/mocks/RBACCappedTokenMock.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; import "../token/ERC20/RBACMintableToken.sol"; -import "../token/ERC20/CappedToken.sol"; +import "../token/ERC20/ERC20Capped.sol"; contract RBACCappedTokenMock is ERC20Capped, RBACMintableToken { diff --git a/contracts/token/ERC20/CappedToken.sol b/contracts/token/ERC20/ERC20Capped.sol similarity index 100% rename from contracts/token/ERC20/CappedToken.sol rename to contracts/token/ERC20/ERC20Capped.sol diff --git a/test/token/ERC20/CappedToken.behavior.js b/test/token/ERC20/ERC20Capped.behavior.js similarity index 100% rename from test/token/ERC20/CappedToken.behavior.js rename to test/token/ERC20/ERC20Capped.behavior.js diff --git a/test/token/ERC20/CappedToken.test.js b/test/token/ERC20/ERC20Capped.test.js similarity index 92% rename from test/token/ERC20/CappedToken.test.js rename to test/token/ERC20/ERC20Capped.test.js index c811649e846..820a37be872 100644 --- a/test/token/ERC20/CappedToken.test.js +++ b/test/token/ERC20/ERC20Capped.test.js @@ -1,7 +1,7 @@ const { assertRevert } = require('../../helpers/assertRevert'); const { ether } = require('../../helpers/ether'); const { shouldBehaveLikeERC20Mintable } = require('./ERC20Mintable.behavior'); -const { shouldBehaveLikeERC20Capped } = require('./CappedToken.behavior'); +const { shouldBehaveLikeERC20Capped } = require('./ERC20Capped.behavior'); const ERC20Capped = artifacts.require('ERC20Capped'); diff --git a/test/token/ERC20/RBACCappedToken.test.js b/test/token/ERC20/RBACCappedToken.test.js index 4f3d8a755d9..988a415d450 100644 --- a/test/token/ERC20/RBACCappedToken.test.js +++ b/test/token/ERC20/RBACCappedToken.test.js @@ -1,7 +1,7 @@ const { ether } = require('../../helpers/ether'); const { shouldBehaveLikeRBACMintableToken } = require('./RBACMintableToken.behavior'); const { shouldBehaveLikeERC20Mintable } = require('./ERC20Mintable.behavior'); -const { shouldBehaveLikeERC20Capped } = require('./CappedToken.behavior'); +const { shouldBehaveLikeERC20Capped } = require('./ERC20Capped.behavior'); const RBACCappedTokenMock = artifacts.require('RBACCappedTokenMock'); From b537307aed4a3f66baa5f27c8b71594f79625958 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 13:14:23 -0300 Subject: [PATCH 12/27] rename PausableToken to ERC20Pausable --- contracts/mocks/PausableTokenMock.sol | 4 ++-- contracts/token/ERC20/PausableToken.sol | 2 +- test/token/ERC20/PausableToken.test.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/mocks/PausableTokenMock.sol b/contracts/mocks/PausableTokenMock.sol index 24ef281bade..4234d404562 100644 --- a/contracts/mocks/PausableTokenMock.sol +++ b/contracts/mocks/PausableTokenMock.sol @@ -3,8 +3,8 @@ pragma solidity ^0.4.24; import "../token/ERC20/PausableToken.sol"; -// mock class using PausableToken -contract PausableTokenMock is PausableToken { +// mock class using ERC20Pausable +contract ERC20PausableMock is ERC20Pausable { constructor(address _initialAccount, uint _initialBalance) public { _mint(_initialAccount, _initialBalance); diff --git a/contracts/token/ERC20/PausableToken.sol b/contracts/token/ERC20/PausableToken.sol index e97a28f0c27..d631fe1d960 100644 --- a/contracts/token/ERC20/PausableToken.sol +++ b/contracts/token/ERC20/PausableToken.sol @@ -8,7 +8,7 @@ import "../../lifecycle/Pausable.sol"; * @title Pausable token * @dev ERC20 modified with pausable transfers. **/ -contract PausableToken is ERC20, Pausable { +contract ERC20Pausable is ERC20, Pausable { function transfer( address _to, diff --git a/test/token/ERC20/PausableToken.test.js b/test/token/ERC20/PausableToken.test.js index 5f7ccf125f4..8fbe4f70876 100644 --- a/test/token/ERC20/PausableToken.test.js +++ b/test/token/ERC20/PausableToken.test.js @@ -1,9 +1,9 @@ const { assertRevert } = require('../../helpers/assertRevert'); -const PausableToken = artifacts.require('PausableTokenMock'); +const ERC20Pausable = artifacts.require('ERC20PausableMock'); -contract('PausableToken', function ([_, owner, recipient, anotherAccount]) { +contract('ERC20Pausable', function ([_, owner, recipient, anotherAccount]) { beforeEach(async function () { - this.token = await PausableToken.new(owner, 100, { from: owner }); + this.token = await ERC20Pausable.new(owner, 100, { from: owner }); }); describe('pause', function () { From 890574c186cf7463d7aed0bd2954f85accd87279 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 13:20:55 -0300 Subject: [PATCH 13/27] move PausableToken.sol to ERC20Pausable.sol, likewise for related files --- .../mocks/{PausableTokenMock.sol => ERC20PausableMock.sol} | 2 +- contracts/token/ERC20/{PausableToken.sol => ERC20Pausable.sol} | 0 .../ERC20/{PausableToken.test.js => ERC20Pausable.test.js} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename contracts/mocks/{PausableTokenMock.sol => ERC20PausableMock.sol} (84%) rename contracts/token/ERC20/{PausableToken.sol => ERC20Pausable.sol} (100%) rename test/token/ERC20/{PausableToken.test.js => ERC20Pausable.test.js} (100%) diff --git a/contracts/mocks/PausableTokenMock.sol b/contracts/mocks/ERC20PausableMock.sol similarity index 84% rename from contracts/mocks/PausableTokenMock.sol rename to contracts/mocks/ERC20PausableMock.sol index 4234d404562..a60f8a12da6 100644 --- a/contracts/mocks/PausableTokenMock.sol +++ b/contracts/mocks/ERC20PausableMock.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC20/PausableToken.sol"; +import "../token/ERC20/ERC20Pausable.sol"; // mock class using ERC20Pausable diff --git a/contracts/token/ERC20/PausableToken.sol b/contracts/token/ERC20/ERC20Pausable.sol similarity index 100% rename from contracts/token/ERC20/PausableToken.sol rename to contracts/token/ERC20/ERC20Pausable.sol diff --git a/test/token/ERC20/PausableToken.test.js b/test/token/ERC20/ERC20Pausable.test.js similarity index 100% rename from test/token/ERC20/PausableToken.test.js rename to test/token/ERC20/ERC20Pausable.test.js From f76cfaed5bcccdf734c7c7cc3f0c7a8dc92389df Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 13:22:27 -0300 Subject: [PATCH 14/27] rename DetailedERC20 to ERC20Detailed --- contracts/crowdsale/Crowdsale.sol | 2 +- contracts/mocks/DetailedERC20Mock.sol | 4 ++-- contracts/token/ERC20/DetailedERC20.sol | 4 ++-- test/token/ERC20/DetailedERC20.test.js | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/contracts/crowdsale/Crowdsale.sol b/contracts/crowdsale/Crowdsale.sol index fe30eaf09cc..8bf055ada87 100644 --- a/contracts/crowdsale/Crowdsale.sol +++ b/contracts/crowdsale/Crowdsale.sol @@ -29,7 +29,7 @@ contract Crowdsale { // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and indivisible token unit. - // So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK + // So, if you are using a rate of 1 with a ERC20Detailed token with 3 decimals called TOK // 1 wei will give you 1 unit, or 0.001 TOK. uint256 public rate; diff --git a/contracts/mocks/DetailedERC20Mock.sol b/contracts/mocks/DetailedERC20Mock.sol index d4b6ae9b400..83dc7acca17 100644 --- a/contracts/mocks/DetailedERC20Mock.sol +++ b/contracts/mocks/DetailedERC20Mock.sol @@ -4,13 +4,13 @@ import "../token/ERC20/ERC20.sol"; import "../token/ERC20/DetailedERC20.sol"; -contract DetailedERC20Mock is ERC20, DetailedERC20 { +contract ERC20DetailedMock is ERC20, ERC20Detailed { constructor( string _name, string _symbol, uint8 _decimals ) - DetailedERC20(_name, _symbol, _decimals) + ERC20Detailed(_name, _symbol, _decimals) public {} } diff --git a/contracts/token/ERC20/DetailedERC20.sol b/contracts/token/ERC20/DetailedERC20.sol index 8c59d38e03a..ad6f1dd059a 100644 --- a/contracts/token/ERC20/DetailedERC20.sol +++ b/contracts/token/ERC20/DetailedERC20.sol @@ -4,12 +4,12 @@ import "./IERC20.sol"; /** - * @title DetailedERC20 token + * @title ERC20Detailed token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */ -contract DetailedERC20 is IERC20 { +contract ERC20Detailed is IERC20 { string public name; string public symbol; uint8 public decimals; diff --git a/test/token/ERC20/DetailedERC20.test.js b/test/token/ERC20/DetailedERC20.test.js index 4d42f04e6aa..71b22a7b9a8 100644 --- a/test/token/ERC20/DetailedERC20.test.js +++ b/test/token/ERC20/DetailedERC20.test.js @@ -4,9 +4,9 @@ require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -const DetailedERC20Mock = artifacts.require('DetailedERC20Mock'); +const ERC20DetailedMock = artifacts.require('ERC20DetailedMock'); -contract('DetailedERC20', function () { +contract('ERC20Detailed', function () { let detailedERC20 = null; const _name = 'My Detailed ERC20'; @@ -14,7 +14,7 @@ contract('DetailedERC20', function () { const _decimals = 18; beforeEach(async function () { - detailedERC20 = await DetailedERC20Mock.new(_name, _symbol, _decimals); + detailedERC20 = await ERC20DetailedMock.new(_name, _symbol, _decimals); }); it('has a name', async function () { From 50c43fef64b2697a6ad7a20862294c47037664c5 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 13:23:28 -0300 Subject: [PATCH 15/27] move DetailedERC20.sol to ERC20Detailed.sol, likewise for related files --- contracts/mocks/DetailedERC20Mock.sol | 2 +- contracts/token/ERC20/{DetailedERC20.sol => ERC20Detailed.sol} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename contracts/token/ERC20/{DetailedERC20.sol => ERC20Detailed.sol} (100%) diff --git a/contracts/mocks/DetailedERC20Mock.sol b/contracts/mocks/DetailedERC20Mock.sol index 83dc7acca17..e9aab88e95d 100644 --- a/contracts/mocks/DetailedERC20Mock.sol +++ b/contracts/mocks/DetailedERC20Mock.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; import "../token/ERC20/ERC20.sol"; -import "../token/ERC20/DetailedERC20.sol"; +import "../token/ERC20/ERC20Detailed.sol"; contract ERC20DetailedMock is ERC20, ERC20Detailed { diff --git a/contracts/token/ERC20/DetailedERC20.sol b/contracts/token/ERC20/ERC20Detailed.sol similarity index 100% rename from contracts/token/ERC20/DetailedERC20.sol rename to contracts/token/ERC20/ERC20Detailed.sol From 7f4cb7d307a114032f9d325883028741b8980e53 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 14:18:03 -0300 Subject: [PATCH 16/27] rename ERC721 to IERC721, and likewise for other related interfaces --- contracts/mocks/ERC721ReceiverMock.sol | 2 +- contracts/token/ERC721/DeprecatedERC721.sol | 2 +- contracts/token/ERC721/ERC721.sol | 6 +++--- contracts/token/ERC721/ERC721Basic.sol | 2 +- contracts/token/ERC721/ERC721BasicToken.sol | 4 ++-- contracts/token/ERC721/ERC721Holder.sol | 2 +- contracts/token/ERC721/ERC721Receiver.sol | 2 +- contracts/token/ERC721/ERC721Token.sol | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/contracts/mocks/ERC721ReceiverMock.sol b/contracts/mocks/ERC721ReceiverMock.sol index 82b8a2610dc..e82cde59b5e 100644 --- a/contracts/mocks/ERC721ReceiverMock.sol +++ b/contracts/mocks/ERC721ReceiverMock.sol @@ -3,7 +3,7 @@ pragma solidity ^0.4.24; import "../token/ERC721/ERC721Receiver.sol"; -contract ERC721ReceiverMock is ERC721Receiver { +contract ERC721ReceiverMock is IERC721Receiver { bytes4 retval_; bool reverts_; diff --git a/contracts/token/ERC721/DeprecatedERC721.sol b/contracts/token/ERC721/DeprecatedERC721.sol index 3cf1f3b2d3b..2fa3be5f77f 100644 --- a/contracts/token/ERC721/DeprecatedERC721.sol +++ b/contracts/token/ERC721/DeprecatedERC721.sol @@ -8,7 +8,7 @@ import "./ERC721.sol"; * @dev Only use this interface for compatibility with previously deployed contracts * Use ERC721 for interacting with new contracts which are standard-compliant */ -contract DeprecatedERC721 is ERC721 { +contract IDeprecatedERC721 is IERC721 { function takeOwnership(uint256 _tokenId) public; function transfer(address _to, uint256 _tokenId) public; function tokensOf(address _owner) public view returns (uint256[]); diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index a988d8f4059..4e9e196c212 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -7,7 +7,7 @@ import "./ERC721Basic.sol"; * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ -contract ERC721Enumerable is ERC721Basic { +contract IERC721Enumerable is IERC721Basic { function totalSupply() public view returns (uint256); function tokenOfOwnerByIndex( address _owner, @@ -25,7 +25,7 @@ contract ERC721Enumerable is ERC721Basic { * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ -contract ERC721Metadata is ERC721Basic { +contract IERC721Metadata is IERC721Basic { function name() external view returns (string _name); function symbol() external view returns (string _symbol); function tokenURI(uint256 _tokenId) public view returns (string); @@ -36,5 +36,5 @@ contract ERC721Metadata is ERC721Basic { * @title ERC-721 Non-Fungible Token Standard, full implementation interface * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ -contract ERC721 is ERC721Basic, ERC721Enumerable, ERC721Metadata { +contract IERC721 is IERC721Basic, IERC721Enumerable, IERC721Metadata { } diff --git a/contracts/token/ERC721/ERC721Basic.sol b/contracts/token/ERC721/ERC721Basic.sol index f9075f06004..992c87473d0 100644 --- a/contracts/token/ERC721/ERC721Basic.sol +++ b/contracts/token/ERC721/ERC721Basic.sol @@ -7,7 +7,7 @@ import "../../introspection/ERC165.sol"; * @title ERC721 Non-Fungible Token Standard basic interface * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ -contract ERC721Basic is ERC165 { +contract IERC721Basic is ERC165 { bytes4 internal constant InterfaceId_ERC721 = 0x80ac58cd; /* diff --git a/contracts/token/ERC721/ERC721BasicToken.sol b/contracts/token/ERC721/ERC721BasicToken.sol index 568be300cbc..8d187d79a42 100644 --- a/contracts/token/ERC721/ERC721BasicToken.sol +++ b/contracts/token/ERC721/ERC721BasicToken.sol @@ -11,7 +11,7 @@ import "../../introspection/SupportsInterfaceWithLookup.sol"; * @title ERC721 Non-Fungible Token Standard basic implementation * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ -contract ERC721BasicToken is SupportsInterfaceWithLookup, ERC721Basic { +contract ERC721BasicToken is SupportsInterfaceWithLookup, IERC721Basic { using SafeMath for uint256; using AddressUtils for address; @@ -303,7 +303,7 @@ contract ERC721BasicToken is SupportsInterfaceWithLookup, ERC721Basic { if (!_to.isContract()) { return true; } - bytes4 retval = ERC721Receiver(_to).onERC721Received( + bytes4 retval = IERC721Receiver(_to).onERC721Received( msg.sender, _from, _tokenId, _data); return (retval == ERC721_RECEIVED); } diff --git a/contracts/token/ERC721/ERC721Holder.sol b/contracts/token/ERC721/ERC721Holder.sol index 0f9299c6cc7..4bf9b613e84 100644 --- a/contracts/token/ERC721/ERC721Holder.sol +++ b/contracts/token/ERC721/ERC721Holder.sol @@ -3,7 +3,7 @@ pragma solidity ^0.4.24; import "./ERC721Receiver.sol"; -contract ERC721Holder is ERC721Receiver { +contract ERC721Holder is IERC721Receiver { function onERC721Received( address, address, diff --git a/contracts/token/ERC721/ERC721Receiver.sol b/contracts/token/ERC721/ERC721Receiver.sol index 45440149a66..dca4bb61218 100644 --- a/contracts/token/ERC721/ERC721Receiver.sol +++ b/contracts/token/ERC721/ERC721Receiver.sol @@ -6,7 +6,7 @@ pragma solidity ^0.4.24; * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ -contract ERC721Receiver { +contract IERC721Receiver { /** * @dev Magic value to be returned upon successful reception of an NFT * Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`, diff --git a/contracts/token/ERC721/ERC721Token.sol b/contracts/token/ERC721/ERC721Token.sol index af610fa245a..082766ee4a2 100644 --- a/contracts/token/ERC721/ERC721Token.sol +++ b/contracts/token/ERC721/ERC721Token.sol @@ -11,7 +11,7 @@ import "../../introspection/SupportsInterfaceWithLookup.sol"; * Moreover, it includes approve all functionality using operator terminology * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ -contract ERC721Token is SupportsInterfaceWithLookup, ERC721BasicToken, ERC721 { +contract ERC721Token is SupportsInterfaceWithLookup, ERC721BasicToken, IERC721 { // Token name string internal name_; From 1e79c63c5676478ddad0089b80a4123ade0e1fb3 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 14:27:49 -0300 Subject: [PATCH 17/27] move ERC721.sol to IERC721.sol, likewise for other 721 interfaces --- contracts/mocks/ERC721ReceiverMock.sol | 2 +- contracts/proposals/ERC1046/TokenMetadata.sol | 2 +- contracts/token/ERC721/ERC721BasicToken.sol | 4 ++-- contracts/token/ERC721/ERC721Holder.sol | 2 +- contracts/token/ERC721/ERC721Token.sol | 2 +- .../ERC721/{DeprecatedERC721.sol => IDeprecatedERC721.sol} | 2 +- contracts/token/ERC721/{ERC721.sol => IERC721.sol} | 2 +- contracts/token/ERC721/{ERC721Basic.sol => IERC721Basic.sol} | 0 .../token/ERC721/{ERC721Receiver.sol => IERC721Receiver.sol} | 0 9 files changed, 8 insertions(+), 8 deletions(-) rename contracts/token/ERC721/{DeprecatedERC721.sol => IDeprecatedERC721.sol} (95%) rename contracts/token/ERC721/{ERC721.sol => IERC721.sol} (97%) rename contracts/token/ERC721/{ERC721Basic.sol => IERC721Basic.sol} (100%) rename contracts/token/ERC721/{ERC721Receiver.sol => IERC721Receiver.sol} (100%) diff --git a/contracts/mocks/ERC721ReceiverMock.sol b/contracts/mocks/ERC721ReceiverMock.sol index e82cde59b5e..cfe73a2e293 100644 --- a/contracts/mocks/ERC721ReceiverMock.sol +++ b/contracts/mocks/ERC721ReceiverMock.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC721/ERC721Receiver.sol"; +import "../token/ERC721/IERC721Receiver.sol"; contract ERC721ReceiverMock is IERC721Receiver { diff --git a/contracts/proposals/ERC1046/TokenMetadata.sol b/contracts/proposals/ERC1046/TokenMetadata.sol index d90473e32ac..6efb4ed72db 100644 --- a/contracts/proposals/ERC1046/TokenMetadata.sol +++ b/contracts/proposals/ERC1046/TokenMetadata.sol @@ -7,7 +7,7 @@ import "../../token/ERC20/IERC20.sol"; * @title ERC-1047 Token Metadata * @dev See https://eips.ethereum.org/EIPS/eip-1046 * @dev tokenURI must respond with a URI that implements https://eips.ethereum.org/EIPS/eip-1047 - * @dev TODO - update https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC721/ERC721.sol#L17 when 1046 is finalized + * @dev TODO - update https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC721/IERC721.sol#L17 when 1046 is finalized */ contract ERC20TokenMetadata is IERC20 { function tokenURI() external view returns (string); diff --git a/contracts/token/ERC721/ERC721BasicToken.sol b/contracts/token/ERC721/ERC721BasicToken.sol index 8d187d79a42..fc23260626c 100644 --- a/contracts/token/ERC721/ERC721BasicToken.sol +++ b/contracts/token/ERC721/ERC721BasicToken.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; -import "./ERC721Basic.sol"; -import "./ERC721Receiver.sol"; +import "./IERC721Basic.sol"; +import "./IERC721Receiver.sol"; import "../../math/SafeMath.sol"; import "../../AddressUtils.sol"; import "../../introspection/SupportsInterfaceWithLookup.sol"; diff --git a/contracts/token/ERC721/ERC721Holder.sol b/contracts/token/ERC721/ERC721Holder.sol index 4bf9b613e84..332061339e7 100644 --- a/contracts/token/ERC721/ERC721Holder.sol +++ b/contracts/token/ERC721/ERC721Holder.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./ERC721Receiver.sol"; +import "./IERC721Receiver.sol"; contract ERC721Holder is IERC721Receiver { diff --git a/contracts/token/ERC721/ERC721Token.sol b/contracts/token/ERC721/ERC721Token.sol index 082766ee4a2..5c52ec585ba 100644 --- a/contracts/token/ERC721/ERC721Token.sol +++ b/contracts/token/ERC721/ERC721Token.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./ERC721.sol"; +import "./IERC721.sol"; import "./ERC721BasicToken.sol"; import "../../introspection/SupportsInterfaceWithLookup.sol"; diff --git a/contracts/token/ERC721/DeprecatedERC721.sol b/contracts/token/ERC721/IDeprecatedERC721.sol similarity index 95% rename from contracts/token/ERC721/DeprecatedERC721.sol rename to contracts/token/ERC721/IDeprecatedERC721.sol index 2fa3be5f77f..5913d4476da 100644 --- a/contracts/token/ERC721/DeprecatedERC721.sol +++ b/contracts/token/ERC721/IDeprecatedERC721.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./ERC721.sol"; +import "./IERC721.sol"; /** diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/IERC721.sol similarity index 97% rename from contracts/token/ERC721/ERC721.sol rename to contracts/token/ERC721/IERC721.sol index 4e9e196c212..24b7e01ceeb 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/IERC721.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./ERC721Basic.sol"; +import "./IERC721Basic.sol"; /** diff --git a/contracts/token/ERC721/ERC721Basic.sol b/contracts/token/ERC721/IERC721Basic.sol similarity index 100% rename from contracts/token/ERC721/ERC721Basic.sol rename to contracts/token/ERC721/IERC721Basic.sol diff --git a/contracts/token/ERC721/ERC721Receiver.sol b/contracts/token/ERC721/IERC721Receiver.sol similarity index 100% rename from contracts/token/ERC721/ERC721Receiver.sol rename to contracts/token/ERC721/IERC721Receiver.sol From af192a7c631596335987ccdf61cf84edf35eb964 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 14:31:49 -0300 Subject: [PATCH 18/27] rename ERC721Token to ERC721 --- contracts/AutoIncrementing.sol | 2 +- contracts/mocks/ERC721TokenMock.sol | 6 +++--- contracts/token/ERC721/ERC721Token.sol | 2 +- test/token/ERC721/ERC721BasicToken.test.js | 4 ++-- test/token/ERC721/ERC721MintBurn.behavior.js | 6 +++--- test/token/ERC721/ERC721PausedToken.behavior.js | 2 +- test/token/ERC721/ERC721Token.test.js | 10 +++++----- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/contracts/AutoIncrementing.sol b/contracts/AutoIncrementing.sol index cf46e2f57fc..8c01861fb68 100644 --- a/contracts/AutoIncrementing.sol +++ b/contracts/AutoIncrementing.sol @@ -5,7 +5,7 @@ pragma solidity ^0.4.24; * @title AutoIncrementing * @author Matt Condon (@shrugs) * @dev Provides an auto-incrementing uint256 id acquired by the `Counter#nextId` getter. - * Use this for issuing ERC721Token ids or keeping track of request ids, anything you want, really. + * Use this for issuing ERC721 ids or keeping track of request ids, anything you want, really. * * Include with `using AutoIncrementing for AutoIncrementing.Counter;` * @notice Does not allow an Id of 0, which is popularly used to signify a null state in solidity. diff --git a/contracts/mocks/ERC721TokenMock.sol b/contracts/mocks/ERC721TokenMock.sol index a16f16f3b96..1a33d5272ab 100644 --- a/contracts/mocks/ERC721TokenMock.sol +++ b/contracts/mocks/ERC721TokenMock.sol @@ -4,13 +4,13 @@ import "../token/ERC721/ERC721Token.sol"; /** - * @title ERC721TokenMock + * @title ERC721Mock * This mock just provides a public mint and burn functions for testing purposes, * and a public setter for metadata URI */ -contract ERC721TokenMock is ERC721Token { +contract ERC721Mock is ERC721 { constructor(string name, string symbol) public - ERC721Token(name, symbol) + ERC721(name, symbol) { } function mint(address _to, uint256 _tokenId) public { diff --git a/contracts/token/ERC721/ERC721Token.sol b/contracts/token/ERC721/ERC721Token.sol index 5c52ec585ba..7990adfafbe 100644 --- a/contracts/token/ERC721/ERC721Token.sol +++ b/contracts/token/ERC721/ERC721Token.sol @@ -11,7 +11,7 @@ import "../../introspection/SupportsInterfaceWithLookup.sol"; * Moreover, it includes approve all functionality using operator terminology * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ -contract ERC721Token is SupportsInterfaceWithLookup, ERC721BasicToken, IERC721 { +contract ERC721 is SupportsInterfaceWithLookup, ERC721BasicToken, IERC721 { // Token name string internal name_; diff --git a/test/token/ERC721/ERC721BasicToken.test.js b/test/token/ERC721/ERC721BasicToken.test.js index 4525c7dc57d..12a7be79cd9 100644 --- a/test/token/ERC721/ERC721BasicToken.test.js +++ b/test/token/ERC721/ERC721BasicToken.test.js @@ -1,5 +1,5 @@ const { shouldBehaveLikeERC721BasicToken } = require('./ERC721BasicToken.behavior'); -const { shouldBehaveLikeMintAndBurnERC721Token } = require('./ERC721MintBurn.behavior'); +const { shouldBehaveLikeMintAndBurnERC721 } = require('./ERC721MintBurn.behavior'); const BigNumber = web3.BigNumber; const ERC721BasicToken = artifacts.require('ERC721BasicTokenMock.sol'); @@ -14,5 +14,5 @@ contract('ERC721BasicToken', function (accounts) { }); shouldBehaveLikeERC721BasicToken(accounts); - shouldBehaveLikeMintAndBurnERC721Token(accounts); + shouldBehaveLikeMintAndBurnERC721(accounts); }); diff --git a/test/token/ERC721/ERC721MintBurn.behavior.js b/test/token/ERC721/ERC721MintBurn.behavior.js index c09480a38b7..faf9d756f21 100644 --- a/test/token/ERC721/ERC721MintBurn.behavior.js +++ b/test/token/ERC721/ERC721MintBurn.behavior.js @@ -5,14 +5,14 @@ require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -function shouldBehaveLikeMintAndBurnERC721Token (accounts) { +function shouldBehaveLikeMintAndBurnERC721 (accounts) { const firstTokenId = 1; const secondTokenId = 2; const unknownTokenId = 3; const creator = accounts[0]; const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; - describe('like a mintable and burnable ERC721Token', function () { + describe('like a mintable and burnable ERC721', function () { beforeEach(async function () { await this.token.mint(creator, firstTokenId, { from: creator }); await this.token.mint(creator, secondTokenId, { from: creator }); @@ -106,5 +106,5 @@ function shouldBehaveLikeMintAndBurnERC721Token (accounts) { } module.exports = { - shouldBehaveLikeMintAndBurnERC721Token, + shouldBehaveLikeMintAndBurnERC721, }; diff --git a/test/token/ERC721/ERC721PausedToken.behavior.js b/test/token/ERC721/ERC721PausedToken.behavior.js index 2ef21ec0790..d14e6a39533 100644 --- a/test/token/ERC721/ERC721PausedToken.behavior.js +++ b/test/token/ERC721/ERC721PausedToken.behavior.js @@ -13,7 +13,7 @@ function shouldBehaveLikeERC721PausedToken (owner, [recipient, operator]) { const mockData = '0x42'; const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; - describe('like a paused ERC721Token', function () { + describe('like a paused ERC721', function () { beforeEach(async function () { await this.token.mint(owner, firstTokenId, { from: owner }); }); diff --git a/test/token/ERC721/ERC721Token.test.js b/test/token/ERC721/ERC721Token.test.js index aa3056eb3db..b5180cf6137 100644 --- a/test/token/ERC721/ERC721Token.test.js +++ b/test/token/ERC721/ERC721Token.test.js @@ -1,17 +1,17 @@ const { assertRevert } = require('../../helpers/assertRevert'); const { shouldBehaveLikeERC721BasicToken } = require('./ERC721BasicToken.behavior'); -const { shouldBehaveLikeMintAndBurnERC721Token } = require('./ERC721MintBurn.behavior'); +const { shouldBehaveLikeMintAndBurnERC721 } = require('./ERC721MintBurn.behavior'); const { shouldSupportInterfaces } = require('../../introspection/SupportsInterface.behavior'); const _ = require('lodash'); const BigNumber = web3.BigNumber; -const ERC721Token = artifacts.require('ERC721TokenMock.sol'); +const ERC721 = artifacts.require('ERC721Mock.sol'); require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -contract('ERC721Token', function (accounts) { +contract('ERC721', function (accounts) { const name = 'Non Fungible Token'; const symbol = 'NFT'; const firstTokenId = 100; @@ -21,11 +21,11 @@ contract('ERC721Token', function (accounts) { const anyone = accounts[9]; beforeEach(async function () { - this.token = await ERC721Token.new(name, symbol, { from: creator }); + this.token = await ERC721.new(name, symbol, { from: creator }); }); shouldBehaveLikeERC721BasicToken(accounts); - shouldBehaveLikeMintAndBurnERC721Token(accounts); + shouldBehaveLikeMintAndBurnERC721(accounts); describe('like a full ERC721', function () { beforeEach(async function () { From 47f542a8716e500594f082394b5d3b59a7df83ca Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 14:33:47 -0300 Subject: [PATCH 19/27] move ERC721Token.sol to ERC721.sol, likewise for related files --- contracts/mocks/{ERC721TokenMock.sol => ERC721Mock.sol} | 2 +- contracts/token/ERC721/{ERC721Token.sol => ERC721.sol} | 0 test/token/ERC721/{ERC721Token.test.js => ERC721.test.js} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename contracts/mocks/{ERC721TokenMock.sol => ERC721Mock.sol} (95%) rename contracts/token/ERC721/{ERC721Token.sol => ERC721.sol} (100%) rename test/token/ERC721/{ERC721Token.test.js => ERC721.test.js} (100%) diff --git a/contracts/mocks/ERC721TokenMock.sol b/contracts/mocks/ERC721Mock.sol similarity index 95% rename from contracts/mocks/ERC721TokenMock.sol rename to contracts/mocks/ERC721Mock.sol index 1a33d5272ab..8c4b0373f15 100644 --- a/contracts/mocks/ERC721TokenMock.sol +++ b/contracts/mocks/ERC721Mock.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC721/ERC721Token.sol"; +import "../token/ERC721/ERC721.sol"; /** diff --git a/contracts/token/ERC721/ERC721Token.sol b/contracts/token/ERC721/ERC721.sol similarity index 100% rename from contracts/token/ERC721/ERC721Token.sol rename to contracts/token/ERC721/ERC721.sol diff --git a/test/token/ERC721/ERC721Token.test.js b/test/token/ERC721/ERC721.test.js similarity index 100% rename from test/token/ERC721/ERC721Token.test.js rename to test/token/ERC721/ERC721.test.js From 276bfb9c1949f4cb74d6f406be6dd64ce3bed61c Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 14:38:59 -0300 Subject: [PATCH 20/27] rename ERC721BasicToken to ERC721Basic --- contracts/mocks/ERC721BasicTokenMock.sol | 4 ++-- contracts/token/ERC721/ERC721.sol | 2 +- contracts/token/ERC721/ERC721BasicToken.sol | 2 +- contracts/token/ERC721/ERC721PausableToken.sol | 4 ++-- test/token/ERC721/ERC721.test.js | 4 ++-- test/token/ERC721/ERC721BasicToken.behavior.js | 6 +++--- test/token/ERC721/ERC721BasicToken.test.js | 10 +++++----- test/token/ERC721/ERC721PausableToken.test.js | 6 +++--- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/contracts/mocks/ERC721BasicTokenMock.sol b/contracts/mocks/ERC721BasicTokenMock.sol index 704728198d6..4ee35b87e3b 100644 --- a/contracts/mocks/ERC721BasicTokenMock.sol +++ b/contracts/mocks/ERC721BasicTokenMock.sol @@ -4,10 +4,10 @@ import "../token/ERC721/ERC721BasicToken.sol"; /** - * @title ERC721BasicTokenMock + * @title ERC721BasicMock * This mock just provides a public mint and burn functions for testing purposes */ -contract ERC721BasicTokenMock is ERC721BasicToken { +contract ERC721BasicMock is ERC721Basic { function mint(address _to, uint256 _tokenId) public { super._mint(_to, _tokenId); } diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index 7990adfafbe..b46c1018a8c 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -11,7 +11,7 @@ import "../../introspection/SupportsInterfaceWithLookup.sol"; * Moreover, it includes approve all functionality using operator terminology * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ -contract ERC721 is SupportsInterfaceWithLookup, ERC721BasicToken, IERC721 { +contract ERC721 is SupportsInterfaceWithLookup, ERC721Basic, IERC721 { // Token name string internal name_; diff --git a/contracts/token/ERC721/ERC721BasicToken.sol b/contracts/token/ERC721/ERC721BasicToken.sol index fc23260626c..4c82f3c734c 100644 --- a/contracts/token/ERC721/ERC721BasicToken.sol +++ b/contracts/token/ERC721/ERC721BasicToken.sol @@ -11,7 +11,7 @@ import "../../introspection/SupportsInterfaceWithLookup.sol"; * @title ERC721 Non-Fungible Token Standard basic implementation * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ -contract ERC721BasicToken is SupportsInterfaceWithLookup, IERC721Basic { +contract ERC721Basic is SupportsInterfaceWithLookup, IERC721Basic { using SafeMath for uint256; using AddressUtils for address; diff --git a/contracts/token/ERC721/ERC721PausableToken.sol b/contracts/token/ERC721/ERC721PausableToken.sol index 2da188a7edc..93b0235cb50 100644 --- a/contracts/token/ERC721/ERC721PausableToken.sol +++ b/contracts/token/ERC721/ERC721PausableToken.sol @@ -6,9 +6,9 @@ import "../../lifecycle/Pausable.sol"; /** * @title ERC721 Non-Fungible Pausable token - * @dev ERC721BasicToken modified with pausable transfers. + * @dev ERC721Basic modified with pausable transfers. **/ -contract ERC721PausableToken is ERC721BasicToken, Pausable { +contract ERC721PausableToken is ERC721Basic, Pausable { function approve( address _to, uint256 _tokenId diff --git a/test/token/ERC721/ERC721.test.js b/test/token/ERC721/ERC721.test.js index b5180cf6137..1881c4b8fe3 100644 --- a/test/token/ERC721/ERC721.test.js +++ b/test/token/ERC721/ERC721.test.js @@ -1,5 +1,5 @@ const { assertRevert } = require('../../helpers/assertRevert'); -const { shouldBehaveLikeERC721BasicToken } = require('./ERC721BasicToken.behavior'); +const { shouldBehaveLikeERC721Basic } = require('./ERC721Basic.behavior'); const { shouldBehaveLikeMintAndBurnERC721 } = require('./ERC721MintBurn.behavior'); const { shouldSupportInterfaces } = require('../../introspection/SupportsInterface.behavior'); const _ = require('lodash'); @@ -24,7 +24,7 @@ contract('ERC721', function (accounts) { this.token = await ERC721.new(name, symbol, { from: creator }); }); - shouldBehaveLikeERC721BasicToken(accounts); + shouldBehaveLikeERC721Basic(accounts); shouldBehaveLikeMintAndBurnERC721(accounts); describe('like a full ERC721', function () { diff --git a/test/token/ERC721/ERC721BasicToken.behavior.js b/test/token/ERC721/ERC721BasicToken.behavior.js index 3eec9ff92f0..969ddceeda8 100644 --- a/test/token/ERC721/ERC721BasicToken.behavior.js +++ b/test/token/ERC721/ERC721BasicToken.behavior.js @@ -11,7 +11,7 @@ require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -function shouldBehaveLikeERC721BasicToken (accounts) { +function shouldBehaveLikeERC721Basic (accounts) { const firstTokenId = 1; const secondTokenId = 2; const unknownTokenId = 3; @@ -19,7 +19,7 @@ function shouldBehaveLikeERC721BasicToken (accounts) { const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; const RECEIVER_MAGIC_VALUE = '0x150b7a02'; - describe('like an ERC721BasicToken', function () { + describe('like an ERC721Basic', function () { beforeEach(async function () { await this.token.mint(creator, firstTokenId, { from: creator }); await this.token.mint(creator, secondTokenId, { from: creator }); @@ -521,5 +521,5 @@ function shouldBehaveLikeERC721BasicToken (accounts) { } module.exports = { - shouldBehaveLikeERC721BasicToken, + shouldBehaveLikeERC721Basic, }; diff --git a/test/token/ERC721/ERC721BasicToken.test.js b/test/token/ERC721/ERC721BasicToken.test.js index 12a7be79cd9..f86a97f5b68 100644 --- a/test/token/ERC721/ERC721BasicToken.test.js +++ b/test/token/ERC721/ERC721BasicToken.test.js @@ -1,18 +1,18 @@ -const { shouldBehaveLikeERC721BasicToken } = require('./ERC721BasicToken.behavior'); +const { shouldBehaveLikeERC721Basic } = require('./ERC721Basic.behavior'); const { shouldBehaveLikeMintAndBurnERC721 } = require('./ERC721MintBurn.behavior'); const BigNumber = web3.BigNumber; -const ERC721BasicToken = artifacts.require('ERC721BasicTokenMock.sol'); +const ERC721Basic = artifacts.require('ERC721BasicMock.sol'); require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -contract('ERC721BasicToken', function (accounts) { +contract('ERC721Basic', function (accounts) { beforeEach(async function () { - this.token = await ERC721BasicToken.new({ from: accounts[0] }); + this.token = await ERC721Basic.new({ from: accounts[0] }); }); - shouldBehaveLikeERC721BasicToken(accounts); + shouldBehaveLikeERC721Basic(accounts); shouldBehaveLikeMintAndBurnERC721(accounts); }); diff --git a/test/token/ERC721/ERC721PausableToken.test.js b/test/token/ERC721/ERC721PausableToken.test.js index 03274ffb2b1..589cd075b45 100644 --- a/test/token/ERC721/ERC721PausableToken.test.js +++ b/test/token/ERC721/ERC721PausableToken.test.js @@ -1,5 +1,5 @@ const { shouldBehaveLikeERC721PausedToken } = require('./ERC721PausedToken.behavior'); -const { shouldBehaveLikeERC721BasicToken } = require('./ERC721BasicToken.behavior'); +const { shouldBehaveLikeERC721Basic } = require('./ERC721Basic.behavior'); const BigNumber = web3.BigNumber; const ERC721PausableToken = artifacts.require('ERC721PausableTokenMock.sol'); @@ -22,7 +22,7 @@ contract('ERC721PausableToken', function ([_, owner, recipient, operator, ...oth }); context('when token is not paused yet', function () { - shouldBehaveLikeERC721BasicToken([owner, ...otherAccounts]); + shouldBehaveLikeERC721Basic([owner, ...otherAccounts]); }); context('when token is paused and then unpaused', function () { @@ -31,6 +31,6 @@ contract('ERC721PausableToken', function ([_, owner, recipient, operator, ...oth await this.token.unpause({ from: owner }); }); - shouldBehaveLikeERC721BasicToken([owner, ...otherAccounts]); + shouldBehaveLikeERC721Basic([owner, ...otherAccounts]); }); }); From 463a01b2f4feb0da8b66cff49b55208b6facd84a Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 14:40:50 -0300 Subject: [PATCH 21/27] move ERC721BasicToken.sol to ERC721Basic.sol, likewise for related files --- .../mocks/{ERC721BasicTokenMock.sol => ERC721BasicMock.sol} | 2 +- contracts/token/ERC721/ERC721.sol | 2 +- .../token/ERC721/{ERC721BasicToken.sol => ERC721Basic.sol} | 0 contracts/token/ERC721/ERC721PausableToken.sol | 2 +- .../{ERC721BasicToken.behavior.js => ERC721Basic.behavior.js} | 0 .../ERC721/{ERC721BasicToken.test.js => ERC721Basic.test.js} | 0 6 files changed, 3 insertions(+), 3 deletions(-) rename contracts/mocks/{ERC721BasicTokenMock.sol => ERC721BasicMock.sol} (88%) rename contracts/token/ERC721/{ERC721BasicToken.sol => ERC721Basic.sol} (100%) rename test/token/ERC721/{ERC721BasicToken.behavior.js => ERC721Basic.behavior.js} (100%) rename test/token/ERC721/{ERC721BasicToken.test.js => ERC721Basic.test.js} (100%) diff --git a/contracts/mocks/ERC721BasicTokenMock.sol b/contracts/mocks/ERC721BasicMock.sol similarity index 88% rename from contracts/mocks/ERC721BasicTokenMock.sol rename to contracts/mocks/ERC721BasicMock.sol index 4ee35b87e3b..87add3adb7e 100644 --- a/contracts/mocks/ERC721BasicTokenMock.sol +++ b/contracts/mocks/ERC721BasicMock.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC721/ERC721BasicToken.sol"; +import "../token/ERC721/ERC721Basic.sol"; /** diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index b46c1018a8c..ef6a98453c4 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.24; import "./IERC721.sol"; -import "./ERC721BasicToken.sol"; +import "./ERC721Basic.sol"; import "../../introspection/SupportsInterfaceWithLookup.sol"; diff --git a/contracts/token/ERC721/ERC721BasicToken.sol b/contracts/token/ERC721/ERC721Basic.sol similarity index 100% rename from contracts/token/ERC721/ERC721BasicToken.sol rename to contracts/token/ERC721/ERC721Basic.sol diff --git a/contracts/token/ERC721/ERC721PausableToken.sol b/contracts/token/ERC721/ERC721PausableToken.sol index 93b0235cb50..7aba9eea960 100644 --- a/contracts/token/ERC721/ERC721PausableToken.sol +++ b/contracts/token/ERC721/ERC721PausableToken.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./ERC721BasicToken.sol"; +import "./ERC721Basic.sol"; import "../../lifecycle/Pausable.sol"; diff --git a/test/token/ERC721/ERC721BasicToken.behavior.js b/test/token/ERC721/ERC721Basic.behavior.js similarity index 100% rename from test/token/ERC721/ERC721BasicToken.behavior.js rename to test/token/ERC721/ERC721Basic.behavior.js diff --git a/test/token/ERC721/ERC721BasicToken.test.js b/test/token/ERC721/ERC721Basic.test.js similarity index 100% rename from test/token/ERC721/ERC721BasicToken.test.js rename to test/token/ERC721/ERC721Basic.test.js From 05d9ae818b406fbdb20951614d209f8ad824ef44 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 14:42:00 -0300 Subject: [PATCH 22/27] rename ERC721PausableToken to ERC721Pausable --- contracts/mocks/ERC721PausableTokenMock.sol | 4 ++-- contracts/token/ERC721/ERC721PausableToken.sol | 2 +- test/token/ERC721/ERC721PausableToken.test.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/mocks/ERC721PausableTokenMock.sol b/contracts/mocks/ERC721PausableTokenMock.sol index b48608114b4..2356ffc4b45 100644 --- a/contracts/mocks/ERC721PausableTokenMock.sol +++ b/contracts/mocks/ERC721PausableTokenMock.sol @@ -4,10 +4,10 @@ import "../token/ERC721/ERC721PausableToken.sol"; /** - * @title ERC721PausableTokenMock + * @title ERC721PausableMock * This mock just provides a public mint, burn and exists functions for testing purposes */ -contract ERC721PausableTokenMock is ERC721PausableToken { +contract ERC721PausableMock is ERC721Pausable { function mint(address _to, uint256 _tokenId) public { super._mint(_to, _tokenId); } diff --git a/contracts/token/ERC721/ERC721PausableToken.sol b/contracts/token/ERC721/ERC721PausableToken.sol index 7aba9eea960..4604597d923 100644 --- a/contracts/token/ERC721/ERC721PausableToken.sol +++ b/contracts/token/ERC721/ERC721PausableToken.sol @@ -8,7 +8,7 @@ import "../../lifecycle/Pausable.sol"; * @title ERC721 Non-Fungible Pausable token * @dev ERC721Basic modified with pausable transfers. **/ -contract ERC721PausableToken is ERC721Basic, Pausable { +contract ERC721Pausable is ERC721Basic, Pausable { function approve( address _to, uint256 _tokenId diff --git a/test/token/ERC721/ERC721PausableToken.test.js b/test/token/ERC721/ERC721PausableToken.test.js index 589cd075b45..7c03c888ab5 100644 --- a/test/token/ERC721/ERC721PausableToken.test.js +++ b/test/token/ERC721/ERC721PausableToken.test.js @@ -2,15 +2,15 @@ const { shouldBehaveLikeERC721PausedToken } = require('./ERC721PausedToken.behav const { shouldBehaveLikeERC721Basic } = require('./ERC721Basic.behavior'); const BigNumber = web3.BigNumber; -const ERC721PausableToken = artifacts.require('ERC721PausableTokenMock.sol'); +const ERC721Pausable = artifacts.require('ERC721PausableMock.sol'); require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -contract('ERC721PausableToken', function ([_, owner, recipient, operator, ...otherAccounts]) { +contract('ERC721Pausable', function ([_, owner, recipient, operator, ...otherAccounts]) { beforeEach(async function () { - this.token = await ERC721PausableToken.new({ from: owner }); + this.token = await ERC721Pausable.new({ from: owner }); }); context('when token is paused', function () { From 6795ac40a8d9b596677448a322af3af1e6e7a54d Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 14:45:25 -0300 Subject: [PATCH 23/27] move ERC721PausableToken.sol to ERC721Pausable.sol --- .../{ERC721PausableTokenMock.sol => ERC721PausableMock.sol} | 2 +- .../ERC721/{ERC721PausableToken.sol => ERC721Pausable.sol} | 0 .../{ERC721PausableToken.test.js => ERC721Pausable.test.js} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename contracts/mocks/{ERC721PausableTokenMock.sol => ERC721PausableMock.sol} (90%) rename contracts/token/ERC721/{ERC721PausableToken.sol => ERC721Pausable.sol} (100%) rename test/token/ERC721/{ERC721PausableToken.test.js => ERC721Pausable.test.js} (100%) diff --git a/contracts/mocks/ERC721PausableTokenMock.sol b/contracts/mocks/ERC721PausableMock.sol similarity index 90% rename from contracts/mocks/ERC721PausableTokenMock.sol rename to contracts/mocks/ERC721PausableMock.sol index 2356ffc4b45..ef2722f4ace 100644 --- a/contracts/mocks/ERC721PausableTokenMock.sol +++ b/contracts/mocks/ERC721PausableMock.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../token/ERC721/ERC721PausableToken.sol"; +import "../token/ERC721/ERC721Pausable.sol"; /** diff --git a/contracts/token/ERC721/ERC721PausableToken.sol b/contracts/token/ERC721/ERC721Pausable.sol similarity index 100% rename from contracts/token/ERC721/ERC721PausableToken.sol rename to contracts/token/ERC721/ERC721Pausable.sol diff --git a/test/token/ERC721/ERC721PausableToken.test.js b/test/token/ERC721/ERC721Pausable.test.js similarity index 100% rename from test/token/ERC721/ERC721PausableToken.test.js rename to test/token/ERC721/ERC721Pausable.test.js From ef3bffe35c070177f3fd6e86ff13ae2238707716 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 14:51:31 -0300 Subject: [PATCH 24/27] rename ERC165 to IERC165 --- contracts/introspection/ERC165.sol | 4 ++-- contracts/introspection/SupportsInterfaceWithLookup.sol | 2 +- contracts/mocks/ERC165/ERC165InterfacesSupported.sol | 2 +- contracts/token/ERC721/IERC721Basic.sol | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/introspection/ERC165.sol b/contracts/introspection/ERC165.sol index 06f20a074b4..f3361f0a46d 100644 --- a/contracts/introspection/ERC165.sol +++ b/contracts/introspection/ERC165.sol @@ -2,10 +2,10 @@ pragma solidity ^0.4.24; /** - * @title ERC165 + * @title IERC165 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md */ -interface ERC165 { +interface IERC165 { /** * @notice Query if a contract implements an interface diff --git a/contracts/introspection/SupportsInterfaceWithLookup.sol b/contracts/introspection/SupportsInterfaceWithLookup.sol index 20a00088c11..2dd326c2bb1 100644 --- a/contracts/introspection/SupportsInterfaceWithLookup.sol +++ b/contracts/introspection/SupportsInterfaceWithLookup.sol @@ -8,7 +8,7 @@ import "./ERC165.sol"; * @author Matt Condon (@shrugs) * @dev Implements ERC165 using a lookup table. */ -contract SupportsInterfaceWithLookup is ERC165 { +contract SupportsInterfaceWithLookup is IERC165 { bytes4 public constant InterfaceId_ERC165 = 0x01ffc9a7; /** diff --git a/contracts/mocks/ERC165/ERC165InterfacesSupported.sol b/contracts/mocks/ERC165/ERC165InterfacesSupported.sol index be07f947c74..1b3d7e3bdd1 100644 --- a/contracts/mocks/ERC165/ERC165InterfacesSupported.sol +++ b/contracts/mocks/ERC165/ERC165InterfacesSupported.sol @@ -11,7 +11,7 @@ import "../../introspection/ERC165.sol"; * therefore, because this contract is staticcall'd we need to not emit events (which is how solidity-coverage works) * solidity-coverage ignores the /mocks folder, so we duplicate its implementation here to avoid instrumenting it */ -contract SupportsInterfaceWithLookupMock is ERC165 { +contract SupportsInterfaceWithLookupMock is IERC165 { bytes4 public constant InterfaceId_ERC165 = 0x01ffc9a7; /** diff --git a/contracts/token/ERC721/IERC721Basic.sol b/contracts/token/ERC721/IERC721Basic.sol index 992c87473d0..a0a7f5ae423 100644 --- a/contracts/token/ERC721/IERC721Basic.sol +++ b/contracts/token/ERC721/IERC721Basic.sol @@ -7,7 +7,7 @@ import "../../introspection/ERC165.sol"; * @title ERC721 Non-Fungible Token Standard basic interface * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ -contract IERC721Basic is ERC165 { +contract IERC721Basic is IERC165 { bytes4 internal constant InterfaceId_ERC721 = 0x80ac58cd; /* From 81ea4a8a0d84a5437f69c6f981dd7dd231a3d12a Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 14:52:38 -0300 Subject: [PATCH 25/27] move ERC165.sol to IERC165.sol --- contracts/introspection/{ERC165.sol => IERC165.sol} | 0 contracts/introspection/SupportsInterfaceWithLookup.sol | 2 +- contracts/mocks/ERC165/ERC165InterfacesSupported.sol | 2 +- contracts/token/ERC721/IERC721Basic.sol | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename contracts/introspection/{ERC165.sol => IERC165.sol} (100%) diff --git a/contracts/introspection/ERC165.sol b/contracts/introspection/IERC165.sol similarity index 100% rename from contracts/introspection/ERC165.sol rename to contracts/introspection/IERC165.sol diff --git a/contracts/introspection/SupportsInterfaceWithLookup.sol b/contracts/introspection/SupportsInterfaceWithLookup.sol index 2dd326c2bb1..c2b009aea0f 100644 --- a/contracts/introspection/SupportsInterfaceWithLookup.sol +++ b/contracts/introspection/SupportsInterfaceWithLookup.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "./ERC165.sol"; +import "./IERC165.sol"; /** diff --git a/contracts/mocks/ERC165/ERC165InterfacesSupported.sol b/contracts/mocks/ERC165/ERC165InterfacesSupported.sol index 1b3d7e3bdd1..9f472b64825 100644 --- a/contracts/mocks/ERC165/ERC165InterfacesSupported.sol +++ b/contracts/mocks/ERC165/ERC165InterfacesSupported.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../../introspection/ERC165.sol"; +import "../../introspection/IERC165.sol"; /** diff --git a/contracts/token/ERC721/IERC721Basic.sol b/contracts/token/ERC721/IERC721Basic.sol index a0a7f5ae423..6b53f10756d 100644 --- a/contracts/token/ERC721/IERC721Basic.sol +++ b/contracts/token/ERC721/IERC721Basic.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.24; -import "../../introspection/ERC165.sol"; +import "../../introspection/IERC165.sol"; /** From 2cc6332b14d70b53846951924094b42230f55cb9 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 29 Aug 2018 15:37:18 -0300 Subject: [PATCH 26/27] amend comment that ERC20 is based on FirstBlood --- contracts/token/ERC20/ERC20.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index f6589607aa7..0201cc0b849 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -9,7 +9,7 @@ import "../../math/SafeMath.sol"; * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md - * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol + * Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract ERC20 is IERC20 { using SafeMath for uint256; From bb65756c7e119e3833b4e15aa704a3c309d7562f Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 30 Aug 2018 17:14:22 -0300 Subject: [PATCH 27/27] fix comments mentioning IERC721Receiver --- contracts/token/ERC721/ERC721Basic.sol | 2 +- contracts/token/ERC721/IERC721Receiver.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/token/ERC721/ERC721Basic.sol b/contracts/token/ERC721/ERC721Basic.sol index 4c82f3c734c..58a40cae893 100644 --- a/contracts/token/ERC721/ERC721Basic.sol +++ b/contracts/token/ERC721/ERC721Basic.sol @@ -17,7 +17,7 @@ contract ERC721Basic is SupportsInterfaceWithLookup, IERC721Basic { using AddressUtils for address; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` - // which can be also obtained as `ERC721Receiver(0).onERC721Received.selector` + // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` bytes4 private constant ERC721_RECEIVED = 0x150b7a02; // Mapping from token ID to owner diff --git a/contracts/token/ERC721/IERC721Receiver.sol b/contracts/token/ERC721/IERC721Receiver.sol index dca4bb61218..b4c228d88f1 100644 --- a/contracts/token/ERC721/IERC721Receiver.sol +++ b/contracts/token/ERC721/IERC721Receiver.sol @@ -10,7 +10,7 @@ contract IERC721Receiver { /** * @dev Magic value to be returned upon successful reception of an NFT * Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`, - * which can be also obtained as `ERC721Receiver(0).onERC721Received.selector` + * which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` */ bytes4 internal constant ERC721_RECEIVED = 0x150b7a02;