From 091e27458c4aa092096823858856e5c811ad2f05 Mon Sep 17 00:00:00 2001 From: Chris Yuen Date: Tue, 26 Feb 2019 18:27:37 +0800 Subject: [PATCH] refactor: update to truffle ^5 and solidity ^0.5 Add data location specification to contracts --- contracts/ERC1410/ERC1410Basic.sol | 12 +- contracts/ERC1410/ERC1410Operator.sol | 6 +- contracts/ERC1410/ERC1410Standard.sol | 12 +- contracts/ERC1410/IERC1410.sol | 18 +- contracts/ERC1594/ERC1594.sol | 18 +- contracts/ERC1594/IERC1594.sol | 18 +- contracts/ERC1594/examples/ERC1594Token.sol | 6 +- contracts/ERC1643/ERC1643.sol | 10 +- contracts/ERC1643/IERC1643.sol | 10 +- contracts/ERC1644/ERC1644.sol | 8 +- contracts/ERC1644/ERC1644Controllable.sol | 4 +- contracts/ERC1644/IERC1644.sol | 8 +- contracts/ERC1644/examples/ERC1644Token.sol | 4 +- contracts/ERC20Token.sol | 6 +- contracts/Migrations.sol | 2 +- contracts/math/KindMath.sol | 2 +- package.json | 4 +- yarn.lock | 436 ++++++++++++-------- 18 files changed, 331 insertions(+), 253 deletions(-) diff --git a/contracts/ERC1410/ERC1410Basic.sol b/contracts/ERC1410/ERC1410Basic.sol index f6919f6..c33bef4 100644 --- a/contracts/ERC1410/ERC1410Basic.sol +++ b/contracts/ERC1410/ERC1410Basic.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../math/KindMath.sol"; @@ -63,7 +63,7 @@ contract ERC1410Basic { /// @notice Use to get the list of partitions `_tokenHolder` is associated with /// @param _tokenHolder An address corresponds whom partition list is queried /// @return List of partitions - function partitionsOf(address _tokenHolder) external view returns (bytes32[]) { + function partitionsOf(address _tokenHolder) external view returns (bytes32[] memory) { bytes32[] memory partitionsList = new bytes32[](partitions[_tokenHolder].length); for (uint256 i = 0; i < partitions[_tokenHolder].length; i++) { partitionsList[i] = partitions[_tokenHolder][i].partition; @@ -77,7 +77,7 @@ contract ERC1410Basic { /// @param _value The amount of tokens to transfer from `_partition` /// @param _data Additional data attached to the transfer of tokens /// @return The partition to which the transferred tokens were allocated for the _to address - function transferByPartition(bytes32 _partition, address _to, uint256 _value, bytes _data) external returns (bytes32) { + function transferByPartition(bytes32 _partition, address _to, uint256 _value, bytes calldata _data) external returns (bytes32) { // Add a function to verify the `_data` parameter // TODO: Need to create the bytes division of the `_partition` so it can be easily findout in which receiver's partition // token will transfered. For current implementation we are assuming that the receiver's partition will be same as sender's @@ -98,7 +98,7 @@ contract ERC1410Basic { /// @return ESC (Ethereum Status Code) following the EIP-1066 standard /// @return Application specific reason codes with additional details /// @return The partition to which the transferred tokens were allocated for the _to address - function canTransferByPartition(address _from, address _to, bytes32 _partition, uint256 _value, bytes _data) external view returns (byte, bytes32, bytes32) { + function canTransferByPartition(address _from, address _to, bytes32 _partition, uint256 _value, bytes calldata _data) external view returns (byte, bytes32, bytes32) { // TODO: Applied the check over the `_data` parameter if (!_validPartition(_partition, _from)) return (0x50, "Partition not exists", bytes32("")); @@ -113,7 +113,7 @@ contract ERC1410Basic { return (0x51, "Success", _partition); } - function _transferByPartition(address _from, address _to, uint256 _value, bytes32 _partition, bytes _data, address _operator, bytes _operatorData) internal { + function _transferByPartition(address _from, address _to, uint256 _value, bytes32 _partition , bytes memory _data, address _operator, bytes memory _operatorData) internal { require(_validPartition(_partition, _from), "Invalid partition"); require(partitions[_from][partitionToIndex[_from][_partition] - 1].amount >= _value, "Insufficient balance"); require(_to != address(0), "0x address not allowed"); @@ -138,4 +138,4 @@ contract ERC1410Basic { -} \ No newline at end of file +} diff --git a/contracts/ERC1410/ERC1410Operator.sol b/contracts/ERC1410/ERC1410Operator.sol index 852c4cb..15ceb8a 100644 --- a/contracts/ERC1410/ERC1410Operator.sol +++ b/contracts/ERC1410/ERC1410Operator.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "./ERC1410Basic.sol"; @@ -75,7 +75,7 @@ contract ERC1410Operator is ERC1410Basic { /// @param _data Additional data attached to the transfer of tokens /// @param _operatorData Additional data attached to the transfer of tokens by the operator /// @return The partition to which the transferred tokens were allocated for the _to address - function operatorTransferByPartition(bytes32 _partition, address _from, address _to, uint256 _value, bytes _data, bytes _operatorData) external returns (bytes32) { + function operatorTransferByPartition(bytes32 _partition, address _from, address _to, uint256 _value, bytes calldata _data, bytes calldata _operatorData) external returns (bytes32) { // TODO: Add a functionality of verifying the `_operatorData` // TODO: Add a functionality of verifying the `_data` require( @@ -85,4 +85,4 @@ contract ERC1410Operator is ERC1410Basic { _transferByPartition(_from, _to, _value, _partition, _data, msg.sender, _operatorData); } -} \ No newline at end of file +} diff --git a/contracts/ERC1410/ERC1410Standard.sol b/contracts/ERC1410/ERC1410Standard.sol index 07eb3a8..ad120f2 100644 --- a/contracts/ERC1410/ERC1410Standard.sol +++ b/contracts/ERC1410/ERC1410Standard.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "./ERC1410Operator.sol"; import "./IERC1410.sol"; @@ -11,7 +11,7 @@ contract ERC1410Standard is IERC1410, ERC1410Operator, Ownable { /// @param _tokenHolder The token holder whose balance should be increased /// @param _value The amount by which to increase the balance /// @param _data Additional data attached to the minting of tokens - function issueByPartition(bytes32 _partition, address _tokenHolder, uint256 _value, bytes _data) external onlyOwner { + function issueByPartition(bytes32 _partition, address _tokenHolder, uint256 _value, bytes calldata _data) external onlyOwner { // Add the function to validate the `_data` parameter _validateParams(_partition, _value); require(_tokenHolder != address(0), "Invalid token receiver"); @@ -31,7 +31,7 @@ contract ERC1410Standard is IERC1410, ERC1410Operator, Ownable { /// @param _partition The partition to allocate the decrease in balance /// @param _value The amount by which to decrease the balance /// @param _data Additional data attached to the burning of tokens - function redeemByPartition(bytes32 _partition, uint256 _value, bytes _data) external { + function redeemByPartition(bytes32 _partition, uint256 _value, bytes calldata _data) external { // Add the function to validate the `_data` parameter _redeemByPartition(_partition, msg.sender, address(0), _value, _data, ""); } @@ -43,7 +43,7 @@ contract ERC1410Standard is IERC1410, ERC1410Operator, Ownable { /// @param _value The amount by which to decrease the balance /// @param _data Additional data attached to the burning of tokens /// @param _operatorData Additional data attached to the transfer of tokens by the operator - function operatorRedeemByPartition(bytes32 _partition, address _tokenHolder, uint256 _value, bytes _data, bytes _operatorData) external { + function operatorRedeemByPartition(bytes32 _partition, address _tokenHolder, uint256 _value, bytes calldata _data, bytes calldata _operatorData) external { // Add the function to validate the `_data` parameter // TODO: Add a functionality of verifying the `_operatorData` require(_tokenHolder != address(0), "Invalid from address"); @@ -54,7 +54,7 @@ contract ERC1410Standard is IERC1410, ERC1410Operator, Ownable { _redeemByPartition(_partition, _tokenHolder, msg.sender, _value, _data, _operatorData); } - function _redeemByPartition(bytes32 _partition, address _from, address _operator, uint256 _value, bytes _data, bytes _operatorData) internal { + function _redeemByPartition(bytes32 _partition, address _from, address _operator, uint256 _value, bytes memory _data, bytes memory _operatorData) internal { // Add the function to validate the `_data` parameter _validateParams(_partition, _value); require(_validPartition(_partition, _from), "Invalid partition"); @@ -84,4 +84,4 @@ contract ERC1410Standard is IERC1410, ERC1410Operator, Ownable { require(_partition != bytes32(0), "Invalid partition"); } -} \ No newline at end of file +} diff --git a/contracts/ERC1410/IERC1410.sol b/contracts/ERC1410/IERC1410.sol index 91750ac..f13904c 100644 --- a/contracts/ERC1410/IERC1410.sol +++ b/contracts/ERC1410/IERC1410.sol @@ -1,17 +1,17 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; interface IERC1410 { // Token Information function balanceOf(address _tokenHolder) external view returns (uint256); function balanceOfByPartition(bytes32 _partition, address _tokenHolder) external view returns (uint256); - function partitionsOf(address _tokenHolder) external view returns (bytes32[]); + function partitionsOf(address _tokenHolder) external view returns (bytes32[] memory); function totalSupply() external view returns (uint256); // Token Transfers - function transferByPartition(bytes32 _partition, address _to, uint256 _value, bytes _data) external returns (bytes32); - function operatorTransferByPartition(bytes32 _partition, address _from, address _to, uint256 _value, bytes _data, bytes _operatorData) external returns (bytes32); - function canTransferByPartition(address _from, address _to, bytes32 _partition, uint256 _value, bytes _data) external view returns (byte, bytes32, bytes32); + function transferByPartition(bytes32 _partition, address _to, uint256 _value, bytes calldata _data) external returns (bytes32); + function operatorTransferByPartition(bytes32 _partition, address _from, address _to, uint256 _value, bytes calldata _data, bytes calldata _operatorData) external returns (bytes32); + function canTransferByPartition(address _from, address _to, bytes32 _partition, uint256 _value, bytes calldata _data) external view returns (byte, bytes32, bytes32); // Operator Information function isOperator(address _operator, address _tokenHolder) external view returns (bool); @@ -24,9 +24,9 @@ interface IERC1410 { function revokeOperatorByPartition(bytes32 _partition, address _operator) external; // Issuance / Redemption - function issueByPartition(bytes32 _partition, address _tokenHolder, uint256 _value, bytes _data) external; - function redeemByPartition(bytes32 _partition, uint256 _value, bytes _data) external; - function operatorRedeemByPartition(bytes32 _partition, address _tokenHolder, uint256 _value, bytes _data, bytes _operatorData) external; + function issueByPartition(bytes32 _partition, address _tokenHolder, uint256 _value, bytes calldata _data) external; + function redeemByPartition(bytes32 _partition, uint256 _value, bytes calldata _data) external; + function operatorRedeemByPartition(bytes32 _partition, address _tokenHolder, uint256 _value, bytes calldata _data, bytes calldata _operatorData) external; // Transfer Events event TransferByPartition( @@ -49,4 +49,4 @@ interface IERC1410 { event IssuedByPartition(bytes32 indexed partition, address indexed to, uint256 value, bytes data); event RedeemedByPartition(bytes32 indexed partition, address indexed operator, address indexed from, uint256 value, bytes data, bytes operatorData); -} \ No newline at end of file +} diff --git a/contracts/ERC1594/ERC1594.sol b/contracts/ERC1594/ERC1594.sol index e739d66..9937928 100644 --- a/contracts/ERC1594/ERC1594.sol +++ b/contracts/ERC1594/ERC1594.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "./IERC1594.sol"; import "../ERC20Token.sol"; @@ -32,7 +32,7 @@ contract ERC1594 is IERC1594, ERC20Token, Ownable { * for the token contract to interpret or record. This could be signed data authorising the transfer * (e.g. a dynamic whitelist) but is flexible enough to accomadate other use-cases. */ - function transferWithData(address _to, uint256 _value, bytes _data) external { + function transferWithData(address _to, uint256 _value, bytes calldata _data) external { // Add a function to validate the `_data` parameter _transfer(msg.sender, _to, _value); } @@ -50,7 +50,7 @@ contract ERC1594 is IERC1594, ERC20Token, Ownable { * for the token contract to interpret or record. This could be signed data authorising the transfer * (e.g. a dynamic whitelist) but is flexible enough to accomadate other use-cases. */ - function transferFromWithData(address _from, address _to, uint256 _value, bytes _data) external { + function transferFromWithData(address _from, address _to, uint256 _value, bytes calldata _data) external { // Add a function to validate the `_data` parameter _transferFrom(msg.sender, _from, _to, _value); } @@ -75,7 +75,7 @@ contract ERC1594 is IERC1594, ERC20Token, Ownable { * @param _value The amount of tokens need to be issued * @param _data The `bytes _data` allows arbitrary data to be submitted alongside the transfer. */ - function issue(address _tokenHolder, uint256 _value, bytes _data) external onlyOwner { + function issue(address _tokenHolder, uint256 _value, bytes calldata _data) external onlyOwner { // Add a function to validate the `_data` parameter require(issuance, "Issuance is closed"); _mint(_tokenHolder, _value); @@ -89,7 +89,7 @@ contract ERC1594 is IERC1594, ERC20Token, Ownable { * @param _value The amount of tokens need to be redeemed * @param _data The `bytes _data` it can be used in the token contract to authenticate the redemption. */ - function redeem(uint256 _value, bytes _data) external { + function redeem(uint256 _value, bytes calldata _data) external { // Add a function to validate the `_data` parameter _burn(msg.sender, _value); emit Redeemed(address(0), msg.sender, _value, _data); @@ -104,7 +104,7 @@ contract ERC1594 is IERC1594, ERC20Token, Ownable { * @param _value The amount of tokens need to be redeemed * @param _data The `bytes _data` it can be used in the token contract to authenticate the redemption. */ - function redeemFrom(address _tokenHolder, uint256 _value, bytes _data) external { + function redeemFrom(address _tokenHolder, uint256 _value, bytes calldata _data) external { // Add a function to validate the `_data` parameter _burnFrom(_tokenHolder, _value); emit Redeemed(msg.sender, _tokenHolder, _value, _data); @@ -121,7 +121,7 @@ contract ERC1594 is IERC1594, ERC20Token, Ownable { * @return byte Ethereum status code (ESC) * @return bytes32 Application specific reason code */ - function canTransfer(address _to, uint256 _value, bytes _data) external view returns (bool, byte, bytes32) { + function canTransfer(address _to, uint256 _value, bytes calldata _data) external view returns (bool, byte, bytes32) { // Add a function to validate the `_data` parameter if (_balances[msg.sender] < _value) return (false, 0x52, bytes32(0)); @@ -146,7 +146,7 @@ contract ERC1594 is IERC1594, ERC20Token, Ownable { * @return byte Ethereum status code (ESC) * @return bytes32 Application specific reason code */ - function canTransferFrom(address _from, address _to, uint256 _value, bytes _data) external view returns (bool, byte, bytes32) { + function canTransferFrom(address _from, address _to, uint256 _value, bytes calldata _data) external view returns (bool, byte, bytes32) { // Add a function to validate the `_data` parameter if (_value > _allowed[_from][msg.sender]) return (false, 0x53, bytes32(0)); @@ -162,4 +162,4 @@ contract ERC1594 is IERC1594, ERC20Token, Ownable { return (true, 0x51, bytes32(0)); } -} \ No newline at end of file +} diff --git a/contracts/ERC1594/IERC1594.sol b/contracts/ERC1594/IERC1594.sol index 3f43344..cf2dc5b 100644 --- a/contracts/ERC1594/IERC1594.sol +++ b/contracts/ERC1594/IERC1594.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; /** * @title Standard Interface of ERC1594 @@ -6,23 +6,23 @@ pragma solidity ^0.4.24; interface IERC1594 { // Transfers - function transferWithData(address _to, uint256 _value, bytes _data) external; - function transferFromWithData(address _from, address _to, uint256 _value, bytes _data) external; + function transferWithData(address _to, uint256 _value, bytes calldata _data) external; + function transferFromWithData(address _from, address _to, uint256 _value, bytes calldata _data) external; // Token Issuance function isIssuable() external view returns (bool); - function issue(address _tokenHolder, uint256 _value, bytes _data) external; + function issue(address _tokenHolder, uint256 _value, bytes calldata _data) external; // Token Redemption - function redeem(uint256 _value, bytes _data) external; - function redeemFrom(address _tokenHolder, uint256 _value, bytes _data) external; + function redeem(uint256 _value, bytes calldata _data) external; + function redeemFrom(address _tokenHolder, uint256 _value, bytes calldata _data) external; // Transfer Validity - function canTransfer(address _to, uint256 _value, bytes _data) external view returns (bool, byte, bytes32); - function canTransferFrom(address _from, address _to, uint256 _value, bytes _data) external view returns (bool, byte, bytes32); + function canTransfer(address _to, uint256 _value, bytes calldata _data) external view returns (bool, byte, bytes32); + function canTransferFrom(address _from, address _to, uint256 _value, bytes calldata _data) external view returns (bool, byte, bytes32); // Issuance / Redemption Events event Issued(address indexed _operator, address indexed _to, uint256 _value, bytes _data); event Redeemed(address indexed _operator, address indexed _from, uint256 _value, bytes _data); -} \ No newline at end of file +} diff --git a/contracts/ERC1594/examples/ERC1594Token.sol b/contracts/ERC1594/examples/ERC1594Token.sol index 84c1e57..2c9316a 100644 --- a/contracts/ERC1594/examples/ERC1594Token.sol +++ b/contracts/ERC1594/examples/ERC1594Token.sol @@ -1,11 +1,11 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "../ERC1594.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; contract ERC1594Token is ERC1594, ERC20Detailed { - constructor(string name, string symbol, uint8 decimals) + constructor(string memory name, string memory symbol, uint8 decimals) public ERC20Detailed(name, symbol, decimals) { @@ -20,4 +20,4 @@ contract ERC1594Token is ERC1594, ERC20Detailed { emit IssuanceFinalized(); } -} \ No newline at end of file +} diff --git a/contracts/ERC1643/ERC1643.sol b/contracts/ERC1643/ERC1643.sol index 97a3037..4a03e53 100644 --- a/contracts/ERC1643/ERC1643.sol +++ b/contracts/ERC1643/ERC1643.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "./IERC1643.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; @@ -33,7 +33,7 @@ contract ERC1643 is IERC1643, Ownable { * @param _uri Off-chain uri of the document from where it is accessible to investors/advisors to read. * @param _documentHash hash (of the contents) of the document. */ - function setDocument(bytes32 _name, string _uri, bytes32 _documentHash) external onlyOwner { + function setDocument(bytes32 _name, string calldata _uri, bytes32 _documentHash) external onlyOwner { require(_name != bytes32(0), "Zero value is not allowed"); require(bytes(_uri).length > 0, "Should not be a empty uri"); if (_documents[_name].lastModified == uint256(0)) { @@ -68,7 +68,7 @@ contract ERC1643 is IERC1643, Ownable { * @return bytes32 The hash (of the contents) of the document. * @return uint256 the timestamp at which the document was last modified. */ - function getDocument(bytes32 _name) external view returns (string, bytes32, uint256) { + function getDocument(bytes32 _name) external view returns (string memory, bytes32, uint256) { return ( _documents[_name].uri, _documents[_name].docHash, @@ -80,8 +80,8 @@ contract ERC1643 is IERC1643, Ownable { * @notice Used to retrieve a full list of documents attached to the smart contract. * @return bytes32 List of all documents names present in the contract. */ - function getAllDocuments() external view returns (bytes32[]) { + function getAllDocuments() external view returns (bytes32[] memory) { return _docNames; } -} \ No newline at end of file +} diff --git a/contracts/ERC1643/IERC1643.sol b/contracts/ERC1643/IERC1643.sol index 3b40213..ff52c13 100644 --- a/contracts/ERC1643/IERC1643.sol +++ b/contracts/ERC1643/IERC1643.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; // @title IERC1643 Document Management (part of the ERC1400 Security Token Standards) /// @dev See https://github.com/SecurityTokenStandard/EIP-Spec @@ -6,13 +6,13 @@ pragma solidity ^0.4.24; interface IERC1643 { // Document Management - function getDocument(bytes32 _name) external view returns (string, bytes32, uint256); - function setDocument(bytes32 _name, string _uri, bytes32 _documentHash) external; + function getDocument(bytes32 _name) external view returns (string memory, bytes32, uint256); + function setDocument(bytes32 _name, string calldata _uri, bytes32 _documentHash) external; function removeDocument(bytes32 _name) external; - function getAllDocuments() external view returns (bytes32[]); + function getAllDocuments() external view returns (bytes32[] memory); // Document Events event DocumentRemoved(bytes32 indexed _name, string _uri, bytes32 _documentHash); event DocumentUpdated(bytes32 indexed _name, string _uri, bytes32 _documentHash); -} \ No newline at end of file +} diff --git a/contracts/ERC1644/ERC1644.sol b/contracts/ERC1644/ERC1644.sol index ca4f83d..bf14a4a 100644 --- a/contracts/ERC1644/ERC1644.sol +++ b/contracts/ERC1644/ERC1644.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "./IERC1644.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; @@ -48,7 +48,7 @@ contract ERC1644 is ERC1644Controllable, IERC1644, ERC20 { * @param _operatorData data attached to the transfer by controller to emit in event. (It is more like a reason string * for calling this function (aka force transfer) which provides the transparency on-chain). */ - function controllerTransfer(address _from, address _to, uint256 _value, bytes _data, bytes _operatorData) external onlyController { + function controllerTransfer(address _from, address _to, uint256 _value, bytes calldata _data, bytes calldata _operatorData) external onlyController { _transfer(_from, _to, _value); emit ControllerTransfer(msg.sender, _from, _to, _value, _data, _operatorData); } @@ -65,9 +65,9 @@ contract ERC1644 is ERC1644Controllable, IERC1644, ERC20 { * @param _operatorData data attached to the transfer by controller to emit in event. (It is more like a reason string * for calling this function (aka force transfer) which provides the transparency on-chain). */ - function controllerRedeem(address _tokenHolder, uint256 _value, bytes _data, bytes _operatorData) external onlyController { + function controllerRedeem(address _tokenHolder, uint256 _value, bytes calldata _data, bytes calldata _operatorData) external onlyController { _burn(_tokenHolder, _value); emit ControllerRedemption(msg.sender, _tokenHolder, _value, _data, _operatorData); } -} \ No newline at end of file +} diff --git a/contracts/ERC1644/ERC1644Controllable.sol b/contracts/ERC1644/ERC1644Controllable.sol index 4d10cc4..a7a5ac9 100644 --- a/contracts/ERC1644/ERC1644Controllable.sol +++ b/contracts/ERC1644/ERC1644Controllable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; @@ -58,4 +58,4 @@ contract ERC1644Controllable is Ownable { return true; } -} \ No newline at end of file +} diff --git a/contracts/ERC1644/IERC1644.sol b/contracts/ERC1644/IERC1644.sol index 1fdaf77..3a588b9 100644 --- a/contracts/ERC1644/IERC1644.sol +++ b/contracts/ERC1644/IERC1644.sol @@ -1,11 +1,11 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; interface IERC1644 { // Controller Operation function isControllable() external view returns (bool); - function controllerTransfer(address _from, address _to, uint256 _value, bytes _data, bytes _operatorData) external; - function controllerRedeem(address _tokenHolder, uint256 _value, bytes _data, bytes _operatorData) external; + function controllerTransfer(address _from, address _to, uint256 _value, bytes calldata _data, bytes calldata _operatorData) external; + function controllerRedeem(address _tokenHolder, uint256 _value, bytes calldata _data, bytes calldata _operatorData) external; // Controller Events event ControllerTransfer( @@ -25,4 +25,4 @@ interface IERC1644 { bytes _operatorData ); -} \ No newline at end of file +} diff --git a/contracts/ERC1644/examples/ERC1644Token.sol b/contracts/ERC1644/examples/ERC1644Token.sol index 5a60b7c..4e3c4b3 100644 --- a/contracts/ERC1644/examples/ERC1644Token.sol +++ b/contracts/ERC1644/examples/ERC1644Token.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "../ERC1644.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol"; @@ -11,4 +11,4 @@ contract ERC1644Token is ERC1644, ERC20Burnable, ERC20Mintable { ERC1644(_controller) { } -} \ No newline at end of file +} diff --git a/contracts/ERC20Token.sol b/contracts/ERC20Token.sol index b373b61..80373f2 100644 --- a/contracts/ERC20Token.sol +++ b/contracts/ERC20Token.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; @@ -175,7 +175,7 @@ contract ERC20Token is IERC20 { * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { - require(account != 0); + require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); @@ -188,7 +188,7 @@ contract ERC20Token is IERC20 { * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { - require(account != 0); + require(account != address(0)); require(value <= _balances[account]); _totalSupply = _totalSupply.sub(value); diff --git a/contracts/Migrations.sol b/contracts/Migrations.sol index c4efb65..4ca7a41 100644 --- a/contracts/Migrations.sol +++ b/contracts/Migrations.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.23; +pragma solidity ^0.5.0; contract Migrations { address public owner; diff --git a/contracts/math/KindMath.sol b/contracts/math/KindMath.sol index a099d90..e9de30c 100644 --- a/contracts/math/KindMath.sol +++ b/contracts/math/KindMath.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; /** * @title KindMath diff --git a/package.json b/package.json index 51f8ef1..b06270a 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ }, "devDependencies": { "bignumber.js": "^8.0.1", - "ganache-cli": "6.1.8", + "ganache-cli": "^6.3.0", "web3": "^1.0.0-beta.37", - "truffle": "4.1.14" + "truffle": "^5.0.5" } } diff --git a/yarn.lock b/yarn.lock index 064277a..e017699 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30,6 +30,11 @@ ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -38,6 +43,11 @@ any-promise@1.3.0, any-promise@^1.0.0, any-promise@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" +app-module-path@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/app-module-path/-/app-module-path-2.2.0.tgz#641aa55dfb7d6a6f0a8141c4b9c0aa50b6c24dd5" + integrity sha1-ZBqlXft9am8KgUHEucCqULbCTdU= + array-flatten@1.1.1: version "1.1.1" resolved "http://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -648,6 +658,13 @@ bignumber.js@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-8.0.1.tgz#5d419191370fb558c64e3e5f70d68e5947138832" +bindings@^1.2.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.4.0.tgz#909efa49f2ebe07ecd3cb136778f665052040127" + integrity sha512-7znEVX22Djn+nYjxCWKDne0RRloa9XfYa84yk3s+HkE3LpDYZmhArYr9O9huBoHY3/oXispx5LorIX7Sl2CgSQ== + dependencies: + file-uri-to-path "1.0.0" + bl@^1.0.0: version "1.2.2" resolved "http://registry.npmjs.org/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" @@ -673,9 +690,10 @@ bn.js@4.11.6: version "4.11.6" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.6, bn.js@^4.4.0: +bn.js@4.11.8, bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.6, bn.js@^4.4.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== body-parser@1.18.3, body-parser@^1.16.0: version "1.18.3" @@ -806,17 +824,14 @@ buffer@^5.0.5: base64-js "^1.0.2" ieee754 "^1.1.4" -builtin-modules@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" -camelcase@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= caseless@~0.12.0: version "0.12.0" @@ -839,12 +854,13 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" -cliui@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" + string-width "^2.1.1" + strip-ansi "^4.0.0" wrap-ansi "^2.0.0" code-point-at@^1.0.0: @@ -944,6 +960,15 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: safe-buffer "^5.0.1" sha.js "^2.4.8" +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + crypto-browserify@3.12.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -1127,12 +1152,6 @@ end-of-stream@^1.0.0: dependencies: once "^1.4.0" -error-ex@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - dependencies: - is-arrayish "^0.2.1" - escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -1209,6 +1228,19 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + express@^4.14.0: version "4.16.4" resolved "https://registry.yarnpkg.com/express/-/express-4.16.4.tgz#fddef61926109e24c515ea97fd2f1bdbf62df12e" @@ -1282,6 +1314,11 @@ file-type@^6.1.0: version "6.2.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919" +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + finalhandler@1.1.1: version "1.1.1" resolved "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" @@ -1294,12 +1331,12 @@ finalhandler@1.1.1: statuses "~1.4.0" unpipe "~1.0.0" -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" + locate-path "^2.0.0" for-each@^0.3.2: version "0.3.3" @@ -1370,11 +1407,14 @@ fstream@^1.0.2, fstream@^1.0.8: mkdirp ">=0.5 0" rimraf "2" -ganache-cli@6.1.8: - version "6.1.8" - resolved "https://registry.yarnpkg.com/ganache-cli/-/ganache-cli-6.1.8.tgz#49a8a331683a9652183f82ef1378d17e1814fcd3" +ganache-cli@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/ganache-cli/-/ganache-cli-6.3.0.tgz#574f9d35aaec8da6e01c2be49db8fe73129eb561" + integrity sha512-8SyzfX2ipRVBx1fBZLg3j8I3E334U3Vazk5mEpYcWqnIjC2ace6jtOXHG4aTuAvSz3+HzQ8p8pRjOJxdDZ2pnQ== dependencies: - source-map-support "^0.5.3" + bn.js "4.11.8" + source-map-support "0.5.9" + yargs "11.1.0" get-caller-file@^1.0.1: version "1.0.3" @@ -1532,10 +1572,6 @@ home-or-tmp@^2.0.0: os-homedir "^1.0.0" os-tmpdir "^1.0.1" -hosted-git-info@^2.1.4: - version "2.7.1" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" - http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: version "1.6.3" resolved "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" @@ -1598,16 +1634,6 @@ ipaddr.js@1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.8.0.tgz#eaa33d6ddd7ace8f7f6fe0c9ca0440e706738b1e" -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - -is-builtin-module@^1.0.0: - version "1.0.0" - resolved "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - dependencies: - builtin-modules "^1.0.0" - is-callable@^1.1.3: version "1.1.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" @@ -1624,6 +1650,11 @@ is-fullwidth-code-point@^1.0.0: dependencies: number-is-nan "^1.0.0" +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + is-function@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" @@ -1656,14 +1687,15 @@ is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" -is-utf8@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -1734,6 +1766,16 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +keccak@^1.0.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-1.4.0.tgz#572f8a6dbee8e7b3aa421550f9e6408ca2186f80" + integrity sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw== + dependencies: + bindings "^1.2.1" + inherits "^2.0.3" + nan "^2.2.1" + safe-buffer "^5.1.0" + keccakjs@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/keccakjs/-/keccakjs-0.2.1.tgz#1d633af907ef305bbf9f2fa616d56c44561dfa4d" @@ -1753,19 +1795,13 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" -load-json-file@^1.0.0: - version "1.1.0" - resolved "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - pinkie-promise "^2.0.0" - strip-bom "^2.0.0" - -lodash.assign@^4.0.3, lodash.assign@^4.0.6: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" + p-locate "^2.0.0" + path-exists "^3.0.0" lodash@^4.17.4: version "4.17.11" @@ -1781,6 +1817,14 @@ lowercase-keys@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" +lru-cache@^4.0.1: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + make-dir@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" @@ -1799,6 +1843,13 @@ media-typer@0.3.0: version "0.3.0" resolved "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= + dependencies: + mimic-fn "^1.0.0" + memorystream@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" @@ -1832,6 +1883,11 @@ mime@1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + mimic-response@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" @@ -1915,6 +1971,11 @@ nan@^2.0.8, nan@^2.3.3: version "2.12.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.0.tgz#9d443fdb5e13a20770cc5e602eee59760a685885" +nan@^2.2.1: + version "2.12.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" + integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw== + nano-json-stream-parser@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" @@ -1923,14 +1984,12 @@ negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" -normalize-package-data@^2.3.2: - version "2.4.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= dependencies: - hosted-git-info "^2.1.4" - is-builtin-module "^1.0.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" + path-key "^2.0.0" number-is-nan@^1.0.0: version "1.0.1" @@ -1981,11 +2040,14 @@ os-homedir@^1.0.0: version "1.0.2" resolved "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" -os-locale@^1.4.0: - version "1.4.0" - resolved "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== dependencies: + execa "^0.7.0" lcid "^1.0.0" + mem "^1.1.0" os-tmpdir@^1.0.1: version "1.0.2" @@ -1999,12 +2061,31 @@ p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + p-timeout@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" dependencies: p-finally "^1.0.0" +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + parse-asn1@^5.0.0: version "5.1.1" resolved "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz#f6bf293818332bd0dab54efb16087724745e6ca8" @@ -2022,38 +2103,28 @@ parse-headers@^2.0.0: for-each "^0.3.2" trim "0.0.1" -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - dependencies: - error-ex "^1.2.0" - parseurl@~1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - dependencies: - pinkie-promise "^2.0.0" +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" -path-type@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - dependencies: - graceful-fs "^4.1.2" - pify "^2.0.0" - pinkie-promise "^2.0.0" - pbkdf2@^3.0.3: version "3.0.17" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" @@ -2072,7 +2143,7 @@ performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" -pify@^2.0.0, pify@^2.3.0: +pify@^2.3.0: version "2.3.0" resolved "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -2113,6 +2184,11 @@ proxy-addr@~2.0.4: forwarded "~0.1.2" ipaddr.js "1.8.0" +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + psl@^1.1.24: version "1.1.31" resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" @@ -2182,21 +2258,6 @@ raw-body@2.3.3: iconv-lite "0.4.23" unpipe "1.0.0" -read-pkg-up@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - dependencies: - find-up "^1.0.0" - read-pkg "^1.0.0" - -read-pkg@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - dependencies: - load-json-file "^1.0.0" - normalize-package-data "^2.3.2" - path-type "^1.0.0" - readable-stream@^2.3.0, readable-stream@^2.3.5: version "2.3.6" resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" @@ -2282,9 +2343,10 @@ require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" -require-from-string@^1.1.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" +require-from-string@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== require-main-filename@^1.0.1: version "1.0.1" @@ -2346,9 +2408,10 @@ seek-bzip@^1.0.5: dependencies: commander "~2.8.1" -"semver@2 || 3 || 4 || 5", semver@^5.3.0: +semver@^5.5.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== send@0.16.2: version "0.16.2" @@ -2416,6 +2479,23 @@ sha3@^1.1.0: dependencies: nan "2.10.0" +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + simple-concat@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" @@ -2432,29 +2512,32 @@ slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" -solc@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.24.tgz#354f14b269b38cbaa82a47d1ff151723502b954e" +solc@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.5.0.tgz#2deb2ae992acac3afb909f85c38d00f01dcb335e" + integrity sha512-mdLHDl9WeYrN+FIKcMc9PlPfnA9DG9ur5QpCDKcv6VC4RINAsTF4EMuXMZMKoQTvZhtLyJIVH/BZ+KU830Z8Xg== dependencies: fs-extra "^0.30.0" + keccak "^1.0.2" memorystream "^0.3.1" - require-from-string "^1.1.0" - semver "^5.3.0" - yargs "^4.7.1" - -source-map-support@^0.4.15: - version "0.4.18" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - dependencies: - source-map "^0.5.6" + require-from-string "^2.0.0" + semver "^5.5.0" + yargs "^11.0.0" -source-map-support@^0.5.3: +source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -2463,28 +2546,6 @@ source-map@^0.6.0: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" -spdx-correct@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" - -spdx-expression-parse@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz#81c0ce8f21474756148bbb5f3bfc0f36bf15d76e" - sshpk@^1.7.0: version "1.15.2" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.15.2.tgz#c946d6bd9b1a39d0e8635763f5242d6ed6dcb629" @@ -2519,6 +2580,14 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +string-width@^2.0.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + string_decoder@~1.1.1: version "1.1.1" resolved "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -2531,11 +2600,12 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= dependencies: - is-utf8 "^0.2.0" + ansi-regex "^3.0.0" strip-dirs@^2.0.0: version "2.1.0" @@ -2543,6 +2613,11 @@ strip-dirs@^2.0.0: dependencies: is-natural-number "^4.0.1" +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + strip-hex-prefix@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" @@ -2650,13 +2725,15 @@ trim@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" -truffle@4.1.14: - version "4.1.14" - resolved "https://registry.yarnpkg.com/truffle/-/truffle-4.1.14.tgz#8d2c298e29abf9b1e486e44ff9faca6d34bb9030" +truffle@^5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/truffle/-/truffle-5.0.5.tgz#428b5e776bd0bef0272874d636a2607d1fc7ede8" + integrity sha512-YKAfHvq3C5hGCc+S+14FNDM8iZPeta9McocKSAkYBxDTiRfyT6yeDrHmSNEU7fzNAc7jFSlwhY7Cs5bXUR3RKg== dependencies: + app-module-path "^2.2.0" mocha "^4.1.0" original-require "1.0.1" - solc "0.4.24" + solc "0.5.0" tunnel-agent@^0.6.0: version "0.6.0" @@ -2740,13 +2817,6 @@ uuid@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" @@ -2976,13 +3046,17 @@ web3@^1.0.0-beta.37: typedarray-to-buffer "^3.1.2" yaeti "^0.0.6" -which-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -window-size@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" +which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" wrap-ansi@^2.0.0: version "2.1.0" @@ -3052,31 +3126,35 @@ yaeti@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" -yargs-parser@^2.4.1: - version "2.4.1" - resolved "http://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= dependencies: - camelcase "^3.0.0" - lodash.assign "^4.0.6" + camelcase "^4.1.0" -yargs@^4.7.1: - version "4.8.1" - resolved "http://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" +yargs@11.1.0, yargs@^11.0.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" + integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== dependencies: - cliui "^3.2.0" + cliui "^4.0.0" decamelize "^1.1.1" + find-up "^2.1.0" get-caller-file "^1.0.1" - lodash.assign "^4.0.3" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" + os-locale "^2.0.0" require-directory "^2.1.1" require-main-filename "^1.0.1" set-blocking "^2.0.0" - string-width "^1.0.1" - which-module "^1.0.0" - window-size "^0.2.0" + string-width "^2.0.0" + which-module "^2.0.0" y18n "^3.2.1" - yargs-parser "^2.4.1" + yargs-parser "^9.0.2" yauzl@^2.4.2: version "2.10.0"