From 76abd1a41ec7d96ef76370f3eadfe097226896a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Fri, 4 Jan 2019 17:01:52 -0300 Subject: [PATCH] Replaced Solium in favor of Solhint (#1575) * Adding solhint, working on style fixes. * Upgraded to solhint 1.5.0. * Removed all references to Solium * Updated mocks to make the pass the new linter rules. * Reformatted the .solhint.json file a bit. * Removed Solium configuration files. * Remove Solium dependency. * Add comment explaing disabled time rule in TokenVesting. * Revert to the old (ugly?) style. * Revert SignatureBouncerMock style. * Fix ERC165InterfacesSupported interface. --- .solhint.json | 11 + .soliumignore | 1 - .soliumrc.json | 22 - contracts/crowdsale/Crowdsale.sol | 27 +- .../distribution/FinalizableCrowdsale.sol | 4 +- .../price/IncreasingPriceCrowdsale.sol | 2 +- .../validation/PausableCrowdsale.sol | 4 +- .../crowdsale/validation/TimedCrowdsale.sol | 6 +- contracts/cryptography/ECDSA.sol | 3 +- contracts/drafts/ERC1046/TokenMetadata.sol | 1 - contracts/drafts/SignatureBouncer.sol | 4 +- contracts/drafts/TokenVesting.sol | 9 +- contracts/examples/SampleCrowdsale.sol | 9 +- contracts/introspection/ERC165.sol | 4 +- contracts/introspection/ERC165Checker.sol | 18 +- contracts/mocks/AllowanceCrowdsaleImpl.sol | 4 +- contracts/mocks/CappedCrowdsaleImpl.sol | 4 +- contracts/mocks/CapperRoleMock.sol | 1 + contracts/mocks/CrowdsaleMock.sol | 4 +- contracts/mocks/DetailedERC20Mock.sol | 7 +- .../ERC165/ERC165InterfacesSupported.sol | 7 +- contracts/mocks/ERC165/ERC165NotSupported.sol | 4 +- contracts/mocks/ERC20MintableMock.sol | 1 + contracts/mocks/ERC20WithMetadataMock.sol | 4 +- contracts/mocks/ERC721FullMock.sol | 4 +- .../mocks/ERC721MintableBurnableImpl.sol | 4 +- contracts/mocks/ERC721ReceiverMock.sol | 4 +- contracts/mocks/Failer.sol | 1 + contracts/mocks/FinalizableCrowdsaleImpl.sol | 5 +- .../mocks/IncreasingPriceCrowdsaleImpl.sol | 4 +- .../mocks/IndividuallyCappedCrowdsaleImpl.sol | 5 +- contracts/mocks/MintedCrowdsaleImpl.sol | 4 +- contracts/mocks/MinterRoleMock.sol | 1 + contracts/mocks/OwnableMock.sol | 4 +- contracts/mocks/PausableCrowdsaleImpl.sol | 1 + contracts/mocks/PauserRoleMock.sol | 1 + contracts/mocks/PostDeliveryCrowdsaleImpl.sol | 4 +- contracts/mocks/PullPaymentMock.sol | 4 +- contracts/mocks/ReentrancyAttack.sol | 4 +- contracts/mocks/ReentrancyMock.sol | 2 +- contracts/mocks/RefundableCrowdsaleImpl.sol | 4 +- .../RefundablePostDeliveryCrowdsaleImpl.sol | 4 +- contracts/mocks/SafeERC20Helper.sol | 4 - contracts/mocks/SecondaryMock.sol | 4 +- contracts/mocks/SignatureBouncerMock.sol | 38 +- contracts/mocks/SignerRoleMock.sol | 1 + contracts/mocks/TimedCrowdsaleImpl.sol | 4 +- contracts/mocks/WhitelistAdminRoleMock.sol | 1 + contracts/mocks/WhitelistCrowdsaleImpl.sol | 4 +- contracts/mocks/WhitelistedRoleMock.sol | 1 + contracts/payment/escrow/RefundEscrow.sol | 5 +- contracts/token/ERC20/ERC20.sol | 3 +- contracts/token/ERC20/ERC20Pausable.sol | 2 +- contracts/token/ERC20/IERC20.sol | 12 +- contracts/token/ERC20/TokenTimelock.sol | 4 +- contracts/token/ERC721/ERC721.sol | 13 +- contracts/token/ERC721/ERC721Enumerable.sol | 4 +- contracts/token/ERC721/ERC721Full.sol | 4 +- contracts/token/ERC721/ERC721Metadata.sol | 4 +- contracts/token/ERC721/IERC721Full.sol | 1 + contracts/token/ERC721/IERC721Receiver.sol | 3 +- contracts/utils/Address.sol | 2 +- package-lock.json | 1360 +++++++---------- package.json | 11 +- 64 files changed, 787 insertions(+), 919 deletions(-) create mode 100644 .solhint.json delete mode 100644 .soliumignore delete mode 100644 .soliumrc.json diff --git a/.solhint.json b/.solhint.json new file mode 100644 index 000000000..7a85f3cf2 --- /dev/null +++ b/.solhint.json @@ -0,0 +1,11 @@ +{ + "extends": "default", + "rules": { + "indent": ["error", 4], + + "bracket-align": false, + "compiler-fixed": false, + "no-simple-event-func-name": false, + "two-lines-top-level-separator": false + } +} diff --git a/.soliumignore b/.soliumignore deleted file mode 100644 index 3c3629e64..000000000 --- a/.soliumignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/.soliumrc.json b/.soliumrc.json deleted file mode 100644 index e7f413f9f..000000000 --- a/.soliumrc.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "solium:all", - "plugins": ["security"], - "rules": { - "arg-overflow": "off", - "blank-lines": "off", - "error-reason": "off", - "indentation": ["error", 4], - "lbrace": "off", - "linebreak-style": ["error", "unix"], - "max-len": ["error", 120], - "no-constant": ["error"], - "no-empty-blocks": "off", - "quotes": ["error", "double"], - "uppercase": "off", - "visibility-first": "error", - - "security/enforce-explicit-visibility": ["error"], - "security/no-block-members": ["warning"], - "security/no-inline-assembly": ["warning"] - } -} diff --git a/contracts/crowdsale/Crowdsale.sol b/contracts/crowdsale/Crowdsale.sol index 3e188b447..fab17d181 100644 --- a/contracts/crowdsale/Crowdsale.sol +++ b/contracts/crowdsale/Crowdsale.sol @@ -63,10 +63,6 @@ contract Crowdsale is ReentrancyGuard { _token = token; } - // ----------------------------------------- - // Crowdsale external interface - // ----------------------------------------- - /** * @dev fallback function ***DO NOT OVERRIDE*** * Note that other contracts will transfer fund with a base gas stipend @@ -130,12 +126,9 @@ contract Crowdsale is ReentrancyGuard { _postValidatePurchase(beneficiary, weiAmount); } - // ----------------------------------------- - // Internal interface (extensible) - // ----------------------------------------- - /** - * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use `super` in contracts that inherit from Crowdsale to extend their validations. + * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. + * Use `super` in contracts that inherit from Crowdsale to extend their validations. * Example from CappedCrowdsale.sol's _preValidatePurchase method: * super._preValidatePurchase(beneficiary, weiAmount); * require(weiRaised().add(weiAmount) <= cap); @@ -148,16 +141,18 @@ contract Crowdsale is ReentrancyGuard { } /** - * @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met. + * @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid + * conditions are not met. * @param beneficiary Address performing the token purchase * @param weiAmount Value in wei involved in the purchase */ function _postValidatePurchase(address beneficiary, uint256 weiAmount) internal view { - // optional override + // solhint-disable-previous-line no-empty-blocks } /** - * @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens. + * @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends + * its tokens. * @param beneficiary Address performing the token purchase * @param tokenAmount Number of tokens to be emitted */ @@ -166,7 +161,8 @@ contract Crowdsale is ReentrancyGuard { } /** - * @dev Executed when a purchase has been validated and is ready to be executed. Doesn't necessarily emit/send tokens. + * @dev Executed when a purchase has been validated and is ready to be executed. Doesn't necessarily emit/send + * tokens. * @param beneficiary Address receiving the tokens * @param tokenAmount Number of tokens to be purchased */ @@ -175,12 +171,13 @@ contract Crowdsale is ReentrancyGuard { } /** - * @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.) + * @dev Override for extensions that require an internal state to check for validity (current user contributions, + * etc.) * @param beneficiary Address receiving the tokens * @param weiAmount Value in wei involved in the purchase */ function _updatePurchasingState(address beneficiary, uint256 weiAmount) internal { - // optional override + // solhint-disable-previous-line no-empty-blocks } /** diff --git a/contracts/crowdsale/distribution/FinalizableCrowdsale.sol b/contracts/crowdsale/distribution/FinalizableCrowdsale.sol index 7573a3e9a..f904e226f 100644 --- a/contracts/crowdsale/distribution/FinalizableCrowdsale.sol +++ b/contracts/crowdsale/distribution/FinalizableCrowdsale.sol @@ -45,5 +45,7 @@ contract FinalizableCrowdsale is TimedCrowdsale { * should call super._finalization() to ensure the chain of finalization is * executed entirely. */ - function _finalization() internal {} + function _finalization() internal { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol b/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol index 51e946c7d..941cfe061 100644 --- a/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol +++ b/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol @@ -59,7 +59,7 @@ contract IncreasingPriceCrowdsale is TimedCrowdsale { return 0; } - // solium-disable-next-line security/no-block-members + // solhint-disable-next-line not-rely-on-time uint256 elapsedTime = block.timestamp.sub(openingTime()); uint256 timeRange = closingTime().sub(openingTime()); uint256 rateRange = _initialRate.sub(_finalRate); diff --git a/contracts/crowdsale/validation/PausableCrowdsale.sol b/contracts/crowdsale/validation/PausableCrowdsale.sol index 9d034e096..cc89aebab 100644 --- a/contracts/crowdsale/validation/PausableCrowdsale.sol +++ b/contracts/crowdsale/validation/PausableCrowdsale.sol @@ -8,9 +8,9 @@ import "../../lifecycle/Pausable.sol"; * @dev Extension of Crowdsale contract where purchases can be paused and unpaused by the pauser role. */ contract PausableCrowdsale is Crowdsale, Pausable { - /** - * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations. + * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. + * Use super to concatenate validations. * Adds the validation that the crowdsale must not be paused. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase diff --git a/contracts/crowdsale/validation/TimedCrowdsale.sol b/contracts/crowdsale/validation/TimedCrowdsale.sol index 418df3bcb..a67206696 100644 --- a/contracts/crowdsale/validation/TimedCrowdsale.sol +++ b/contracts/crowdsale/validation/TimedCrowdsale.sol @@ -27,7 +27,7 @@ contract TimedCrowdsale is Crowdsale { * @param closingTime Crowdsale closing time */ constructor (uint256 openingTime, uint256 closingTime) public { - // solium-disable-next-line security/no-block-members + // solhint-disable-next-line not-rely-on-time require(openingTime >= block.timestamp); require(closingTime > openingTime); @@ -53,7 +53,7 @@ contract TimedCrowdsale is Crowdsale { * @return true if the crowdsale is open, false otherwise. */ function isOpen() public view returns (bool) { - // solium-disable-next-line security/no-block-members + // solhint-disable-next-line not-rely-on-time return block.timestamp >= _openingTime && block.timestamp <= _closingTime; } @@ -62,7 +62,7 @@ contract TimedCrowdsale is Crowdsale { * @return Whether crowdsale period has elapsed */ function hasClosed() public view returns (bool) { - // solium-disable-next-line security/no-block-members + // solhint-disable-next-line not-rely-on-time return block.timestamp > _closingTime; } diff --git a/contracts/cryptography/ECDSA.sol b/contracts/cryptography/ECDSA.sol index be7bc3d55..432a23c9a 100644 --- a/contracts/cryptography/ECDSA.sol +++ b/contracts/cryptography/ECDSA.sol @@ -26,7 +26,7 @@ library ECDSA { // Divide the signature in r, s and v variables // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. - // solium-disable-next-line security/no-inline-assembly + // solhint-disable-next-line no-inline-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) @@ -42,7 +42,6 @@ library ECDSA { if (v != 27 && v != 28) { return (address(0)); } else { - // solium-disable-next-line arg-overflow return ecrecover(hash, v, r, s); } } diff --git a/contracts/drafts/ERC1046/TokenMetadata.sol b/contracts/drafts/ERC1046/TokenMetadata.sol index 1569d1b00..6b00d62fc 100644 --- a/contracts/drafts/ERC1046/TokenMetadata.sol +++ b/contracts/drafts/ERC1046/TokenMetadata.sol @@ -6,7 +6,6 @@ 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/IERC721.sol#L17 when 1046 is finalized */ contract ERC20TokenMetadata is IERC20 { function tokenURI() external view returns (string memory); diff --git a/contracts/drafts/SignatureBouncer.sol b/contracts/drafts/SignatureBouncer.sol index f0d6f29ca..a5ec7f712 100644 --- a/contracts/drafts/SignatureBouncer.sol +++ b/contracts/drafts/SignatureBouncer.sol @@ -43,7 +43,9 @@ contract SignatureBouncer is SignerRole { // Signature size is 65 bytes (tightly packed v + r + s), but gets padded to 96 bytes uint256 private constant _SIGNATURE_SIZE = 96; - constructor () internal {} + constructor () internal { + // solhint-disable-previous-line no-empty-blocks + } /** * @dev requires that a valid signature of a signer was provided diff --git a/contracts/drafts/TokenVesting.sol b/contracts/drafts/TokenVesting.sol index 6c6f34a11..3b42df82c 100644 --- a/contracts/drafts/TokenVesting.sol +++ b/contracts/drafts/TokenVesting.sol @@ -1,5 +1,3 @@ -/* solium-disable security/no-block-members */ - pragma solidity ^0.5.0; import "../token/ERC20/SafeERC20.sol"; @@ -13,6 +11,12 @@ import "../math/SafeMath.sol"; * owner. */ contract TokenVesting is Ownable { + // The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is + // therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore, + // it is recommended to avoid using short time durations (less than a minute). Typical vesting schemes, with a cliff + // period of a year and a duration of four years, are safe to use. + // solhint-disable not-rely-on-time + using SafeMath for uint256; using SafeERC20 for IERC20; @@ -22,6 +26,7 @@ contract TokenVesting is Ownable { // beneficiary of tokens after they are released address private _beneficiary; + // Durations and timestamps are expressed in UNIX time, the same units as block.timestamp. uint256 private _cliff; uint256 private _start; uint256 private _duration; diff --git a/contracts/examples/SampleCrowdsale.sol b/contracts/examples/SampleCrowdsale.sol index b120e88c6..674f2c22e 100644 --- a/contracts/examples/SampleCrowdsale.sol +++ b/contracts/examples/SampleCrowdsale.sol @@ -12,7 +12,9 @@ import "../token/ERC20/ERC20Detailed.sol"; * It is meant to be used in a crowdsale contract. */ contract SampleCrowdsaleToken is ERC20Mintable, ERC20Detailed { - constructor () public ERC20Detailed("Sample Crowdsale Token", "SCT", 18) {} + constructor () public ERC20Detailed("Sample Crowdsale Token", "SCT", 18) { + // solhint-disable-previous-line no-empty-blocks + } } /** @@ -28,11 +30,6 @@ contract SampleCrowdsaleToken is ERC20Mintable, ERC20Detailed { * After adding multiple features it's good practice to run integration tests * to ensure that subcontracts works together as intended. */ -// XXX There doesn't seem to be a way to split this line that keeps solium -// happy. See: -// https://github.com/duaraghav8/Solium/issues/205 -// --elopio - 2018-05-10 -// solium-disable-next-line max-len contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale, MintedCrowdsale { constructor ( uint256 openingTime, diff --git a/contracts/introspection/ERC165.sol b/contracts/introspection/ERC165.sol index 8903be17f..9b57ba2fc 100644 --- a/contracts/introspection/ERC165.sol +++ b/contracts/introspection/ERC165.sol @@ -8,7 +8,7 @@ import "./IERC165.sol"; * @dev Implements ERC165 using a lookup table. */ contract ERC165 is IERC165 { - bytes4 private constant _InterfaceId_ERC165 = 0x01ffc9a7; + bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; /** * 0x01ffc9a7 === * bytes4(keccak256('supportsInterface(bytes4)')) @@ -24,7 +24,7 @@ contract ERC165 is IERC165 { * implement ERC165 itself */ constructor () internal { - _registerInterface(_InterfaceId_ERC165); + _registerInterface(_INTERFACE_ID_ERC165); } /** diff --git a/contracts/introspection/ERC165Checker.sol b/contracts/introspection/ERC165Checker.sol index 6a0fb9ff6..f6034d483 100644 --- a/contracts/introspection/ERC165Checker.sol +++ b/contracts/introspection/ERC165Checker.sol @@ -7,9 +7,9 @@ pragma solidity ^0.5.0; */ library ERC165Checker { // As per the EIP-165 spec, no interface should ever match 0xffffffff - bytes4 private constant _InterfaceId_Invalid = 0xffffffff; + bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff; - bytes4 private constant _InterfaceId_ERC165 = 0x01ffc9a7; + bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; /** * 0x01ffc9a7 === * bytes4(keccak256('supportsInterface(bytes4)')) @@ -23,8 +23,8 @@ library ERC165Checker { function _supportsERC165(address account) internal view returns (bool) { // Any contract that implements ERC165 must explicitly indicate support of // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid - return _supportsERC165Interface(account, _InterfaceId_ERC165) && - !_supportsERC165Interface(account, _InterfaceId_Invalid); + return _supportsERC165Interface(account, _INTERFACE_ID_ERC165) && + !_supportsERC165Interface(account, _INTERFACE_ID_INVALID); } /** @@ -94,13 +94,13 @@ library ERC165Checker { * indicates support of the interface with identifier interfaceId, false otherwise */ function _callERC165SupportsInterface(address account, bytes4 interfaceId) - private - view - returns (bool success, bool result) + private + view + returns (bool success, bool result) { - bytes memory encodedParams = abi.encodeWithSelector(_InterfaceId_ERC165,interfaceId); + bytes memory encodedParams = abi.encodeWithSelector(_INTERFACE_ID_ERC165, interfaceId); - // solium-disable-next-line security/no-inline-assembly + // solhint-disable-next-line no-inline-assembly assembly { let encodedParams_data := add(0x20, encodedParams) let encodedParams_size := mload(encodedParams) diff --git a/contracts/mocks/AllowanceCrowdsaleImpl.sol b/contracts/mocks/AllowanceCrowdsaleImpl.sol index 944ec21a6..9c6fdb511 100644 --- a/contracts/mocks/AllowanceCrowdsaleImpl.sol +++ b/contracts/mocks/AllowanceCrowdsaleImpl.sol @@ -8,5 +8,7 @@ contract AllowanceCrowdsaleImpl is AllowanceCrowdsale { public Crowdsale(rate, wallet, token) AllowanceCrowdsale(tokenWallet) - {} + { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/CappedCrowdsaleImpl.sol b/contracts/mocks/CappedCrowdsaleImpl.sol index 4c5811b65..d0c59db4c 100644 --- a/contracts/mocks/CappedCrowdsaleImpl.sol +++ b/contracts/mocks/CappedCrowdsaleImpl.sol @@ -8,5 +8,7 @@ contract CappedCrowdsaleImpl is CappedCrowdsale { public Crowdsale(rate, wallet, token) CappedCrowdsale(cap) - {} + { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/CapperRoleMock.sol b/contracts/mocks/CapperRoleMock.sol index 090502068..0090d1ff6 100644 --- a/contracts/mocks/CapperRoleMock.sol +++ b/contracts/mocks/CapperRoleMock.sol @@ -8,6 +8,7 @@ contract CapperRoleMock is CapperRole { } function onlyCapperMock() public view onlyCapper { + // solhint-disable-previous-line no-empty-blocks } // Causes a compilation error if super._removeCapper is not internal diff --git a/contracts/mocks/CrowdsaleMock.sol b/contracts/mocks/CrowdsaleMock.sol index 007f49ee8..6dafa4b7e 100644 --- a/contracts/mocks/CrowdsaleMock.sol +++ b/contracts/mocks/CrowdsaleMock.sol @@ -3,5 +3,7 @@ pragma solidity ^0.5.0; import "../crowdsale/Crowdsale.sol"; contract CrowdsaleMock is Crowdsale { - constructor (uint256 rate, address payable wallet, IERC20 token) public Crowdsale(rate, wallet, token) {} + constructor (uint256 rate, address payable wallet, IERC20 token) public Crowdsale(rate, wallet, token) { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/DetailedERC20Mock.sol b/contracts/mocks/DetailedERC20Mock.sol index bd45c34b5..f2761b348 100644 --- a/contracts/mocks/DetailedERC20Mock.sol +++ b/contracts/mocks/DetailedERC20Mock.sol @@ -4,5 +4,10 @@ import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20Detailed.sol"; contract ERC20DetailedMock is ERC20, ERC20Detailed { - constructor (string memory name, string memory symbol, uint8 decimals) ERC20Detailed(name, symbol, decimals) public {} + constructor (string memory name, string memory symbol, uint8 decimals) + public + ERC20Detailed(name, symbol, decimals) + { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/ERC165/ERC165InterfacesSupported.sol b/contracts/mocks/ERC165/ERC165InterfacesSupported.sol index 9eb7060ed..fccf84e69 100644 --- a/contracts/mocks/ERC165/ERC165InterfacesSupported.sol +++ b/contracts/mocks/ERC165/ERC165InterfacesSupported.sol @@ -4,14 +4,15 @@ import "../../introspection/IERC165.sol"; /** * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-214.md#specification - * > Any attempts to make state-changing operations inside an execution instance with STATIC set to true will instead throw an exception. + * > Any attempts to make state-changing operations inside an execution instance with STATIC set to true will instead + * throw an exception. * > These operations include [...], LOG0, LOG1, LOG2, [...] * * 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 IERC165 { - bytes4 public constant InterfaceId_ERC165 = 0x01ffc9a7; + bytes4 public constant INTERFACE_ID_ERC165 = 0x01ffc9a7; /** * 0x01ffc9a7 === * bytes4(keccak256('supportsInterface(bytes4)')) @@ -27,7 +28,7 @@ contract SupportsInterfaceWithLookupMock is IERC165 { * implement ERC165 itself */ constructor () public { - _registerInterface(InterfaceId_ERC165); + _registerInterface(INTERFACE_ID_ERC165); } /** diff --git a/contracts/mocks/ERC165/ERC165NotSupported.sol b/contracts/mocks/ERC165/ERC165NotSupported.sol index d77baedf3..d154da33e 100644 --- a/contracts/mocks/ERC165/ERC165NotSupported.sol +++ b/contracts/mocks/ERC165/ERC165NotSupported.sol @@ -1,3 +1,5 @@ pragma solidity ^0.5.0; -contract ERC165NotSupported {} +contract ERC165NotSupported { + // solhint-disable-previous-line no-empty-blocks +} diff --git a/contracts/mocks/ERC20MintableMock.sol b/contracts/mocks/ERC20MintableMock.sol index 3e74e8f92..3ea65ef62 100644 --- a/contracts/mocks/ERC20MintableMock.sol +++ b/contracts/mocks/ERC20MintableMock.sol @@ -4,4 +4,5 @@ import "../token/ERC20/ERC20Mintable.sol"; import "./MinterRoleMock.sol"; contract ERC20MintableMock is ERC20Mintable, MinterRoleMock { + // solhint-disable-previous-line no-empty-blocks } diff --git a/contracts/mocks/ERC20WithMetadataMock.sol b/contracts/mocks/ERC20WithMetadataMock.sol index ea61bd3f3..16b967fc8 100644 --- a/contracts/mocks/ERC20WithMetadataMock.sol +++ b/contracts/mocks/ERC20WithMetadataMock.sol @@ -4,5 +4,7 @@ import "../token/ERC20/ERC20.sol"; import "../drafts/ERC1046/TokenMetadata.sol"; contract ERC20WithMetadataMock is ERC20, ERC20WithMetadata { - constructor (string memory tokenURI) public ERC20WithMetadata(tokenURI) {} + constructor (string memory tokenURI) public ERC20WithMetadata(tokenURI) { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/ERC721FullMock.sol b/contracts/mocks/ERC721FullMock.sol index a21c59d36..b0f00918b 100644 --- a/contracts/mocks/ERC721FullMock.sol +++ b/contracts/mocks/ERC721FullMock.sol @@ -11,7 +11,9 @@ import "../token/ERC721/ERC721Burnable.sol"; * checking token existence, removal of a token from an address */ contract ERC721FullMock is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable { - constructor (string memory name, string memory symbol) public ERC721Mintable() ERC721Full(name, symbol) {} + constructor (string memory name, string memory symbol) public ERC721Mintable() ERC721Full(name, symbol) { + // solhint-disable-previous-line no-empty-blocks + } function exists(uint256 tokenId) public view returns (bool) { return _exists(tokenId); diff --git a/contracts/mocks/ERC721MintableBurnableImpl.sol b/contracts/mocks/ERC721MintableBurnableImpl.sol index 169dc7790..fcb692723 100644 --- a/contracts/mocks/ERC721MintableBurnableImpl.sol +++ b/contracts/mocks/ERC721MintableBurnableImpl.sol @@ -9,5 +9,7 @@ import "../token/ERC721/ERC721Burnable.sol"; * @title ERC721MintableBurnableImpl */ contract ERC721MintableBurnableImpl is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable { - constructor () ERC721Mintable() ERC721Full("Test", "TEST") public {} + constructor () public ERC721Mintable() ERC721Full("Test", "TEST") { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/ERC721ReceiverMock.sol b/contracts/mocks/ERC721ReceiverMock.sol index 0bf650c21..1b4de6737 100644 --- a/contracts/mocks/ERC721ReceiverMock.sol +++ b/contracts/mocks/ERC721ReceiverMock.sol @@ -13,7 +13,9 @@ contract ERC721ReceiverMock is IERC721Receiver { _reverts = reverts; } - function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) public returns (bytes4) { + function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) + public returns (bytes4) + { require(!_reverts); emit Received(operator, from, tokenId, data, gasleft()); return _retval; diff --git a/contracts/mocks/Failer.sol b/contracts/mocks/Failer.sol index 77bdae0f7..088bc498c 100644 --- a/contracts/mocks/Failer.sol +++ b/contracts/mocks/Failer.sol @@ -4,6 +4,7 @@ contract Failer { uint256[] private array; function dontFail() public pure { + // solhint-disable-previous-line no-empty-blocks } function failWithRevert() public pure { diff --git a/contracts/mocks/FinalizableCrowdsaleImpl.sol b/contracts/mocks/FinalizableCrowdsaleImpl.sol index 6622d15a5..99f7a255d 100644 --- a/contracts/mocks/FinalizableCrowdsaleImpl.sol +++ b/contracts/mocks/FinalizableCrowdsaleImpl.sol @@ -4,10 +4,11 @@ import "../token/ERC20/IERC20.sol"; import "../crowdsale/distribution/FinalizableCrowdsale.sol"; contract FinalizableCrowdsaleImpl is FinalizableCrowdsale { - constructor (uint256 openingTime, uint256 closingTime, uint256 rate, address payable wallet, IERC20 token) public Crowdsale(rate, wallet, token) TimedCrowdsale(openingTime, closingTime) - {} + { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol b/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol index bcb37e9cd..c5b0e7957 100644 --- a/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol +++ b/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol @@ -16,5 +16,7 @@ contract IncreasingPriceCrowdsaleImpl is IncreasingPriceCrowdsale { Crowdsale(initialRate, wallet, token) TimedCrowdsale(openingTime, closingTime) IncreasingPriceCrowdsale(initialRate, finalRate) - {} + { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol b/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol index 83e8f6e53..43b0366ee 100644 --- a/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol +++ b/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol @@ -5,6 +5,7 @@ import "../crowdsale/validation/IndividuallyCappedCrowdsale.sol"; import "./CapperRoleMock.sol"; contract IndividuallyCappedCrowdsaleImpl is IndividuallyCappedCrowdsale, CapperRoleMock { - constructor (uint256 rate, address payable wallet, IERC20 token) public Crowdsale(rate, wallet, token) - {} + constructor (uint256 rate, address payable wallet, IERC20 token) public Crowdsale(rate, wallet, token) { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/MintedCrowdsaleImpl.sol b/contracts/mocks/MintedCrowdsaleImpl.sol index 16f2a1c02..22f4d36c0 100644 --- a/contracts/mocks/MintedCrowdsaleImpl.sol +++ b/contracts/mocks/MintedCrowdsaleImpl.sol @@ -4,5 +4,7 @@ import "../token/ERC20/ERC20Mintable.sol"; import "../crowdsale/emission/MintedCrowdsale.sol"; contract MintedCrowdsaleImpl is MintedCrowdsale { - constructor (uint256 rate, address payable wallet, ERC20Mintable token) public Crowdsale(rate, wallet, token) {} + constructor (uint256 rate, address payable wallet, ERC20Mintable token) public Crowdsale(rate, wallet, token) { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/MinterRoleMock.sol b/contracts/mocks/MinterRoleMock.sol index 7e1d7d15d..4b0401d87 100644 --- a/contracts/mocks/MinterRoleMock.sol +++ b/contracts/mocks/MinterRoleMock.sol @@ -8,6 +8,7 @@ contract MinterRoleMock is MinterRole { } function onlyMinterMock() public view onlyMinter { + // solhint-disable-previous-line no-empty-blocks } // Causes a compilation error if super._removeMinter is not internal diff --git a/contracts/mocks/OwnableMock.sol b/contracts/mocks/OwnableMock.sol index f64f8e7a0..c7b1cf5c7 100644 --- a/contracts/mocks/OwnableMock.sol +++ b/contracts/mocks/OwnableMock.sol @@ -2,4 +2,6 @@ pragma solidity ^0.5.0; import "../ownership/Ownable.sol"; -contract OwnableMock is Ownable {} +contract OwnableMock is Ownable { + // solhint-disable-previous-line no-empty-blocks +} diff --git a/contracts/mocks/PausableCrowdsaleImpl.sol b/contracts/mocks/PausableCrowdsaleImpl.sol index 8ac695078..11f44c7b8 100644 --- a/contracts/mocks/PausableCrowdsaleImpl.sol +++ b/contracts/mocks/PausableCrowdsaleImpl.sol @@ -5,5 +5,6 @@ import "../crowdsale/validation/PausableCrowdsale.sol"; contract PausableCrowdsaleImpl is PausableCrowdsale { constructor (uint256 _rate, address payable _wallet, ERC20 _token) public Crowdsale(_rate, _wallet, _token) { + // solhint-disable-previous-line no-empty-blocks } } diff --git a/contracts/mocks/PauserRoleMock.sol b/contracts/mocks/PauserRoleMock.sol index b6dce92b4..fc2ed16d9 100644 --- a/contracts/mocks/PauserRoleMock.sol +++ b/contracts/mocks/PauserRoleMock.sol @@ -8,6 +8,7 @@ contract PauserRoleMock is PauserRole { } function onlyPauserMock() public view onlyPauser { + // solhint-disable-previous-line no-empty-blocks } // Causes a compilation error if super._removePauser is not internal diff --git a/contracts/mocks/PostDeliveryCrowdsaleImpl.sol b/contracts/mocks/PostDeliveryCrowdsaleImpl.sol index b612ac518..efb67c084 100644 --- a/contracts/mocks/PostDeliveryCrowdsaleImpl.sol +++ b/contracts/mocks/PostDeliveryCrowdsaleImpl.sol @@ -8,5 +8,7 @@ contract PostDeliveryCrowdsaleImpl is PostDeliveryCrowdsale { public TimedCrowdsale(openingTime, closingTime) Crowdsale(rate, wallet, token) - {} + { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/PullPaymentMock.sol b/contracts/mocks/PullPaymentMock.sol index 1ecddccd3..1a26b6242 100644 --- a/contracts/mocks/PullPaymentMock.sol +++ b/contracts/mocks/PullPaymentMock.sol @@ -4,7 +4,9 @@ import "../payment/PullPayment.sol"; // mock class using PullPayment contract PullPaymentMock is PullPayment { - constructor () public payable { } + constructor () public payable { + // solhint-disable-previous-line no-empty-blocks + } // test helper function to call asyncTransfer function callTransfer(address dest, uint256 amount) public { diff --git a/contracts/mocks/ReentrancyAttack.sol b/contracts/mocks/ReentrancyAttack.sol index a4675f986..965a053e0 100644 --- a/contracts/mocks/ReentrancyAttack.sol +++ b/contracts/mocks/ReentrancyAttack.sol @@ -1,11 +1,9 @@ pragma solidity ^0.5.0; contract ReentrancyAttack { - function callSender(bytes4 data) public { - // solium-disable-next-line security/no-low-level-calls + // solhint-disable-next-line avoid-low-level-calls (bool success,) = msg.sender.call(abi.encodeWithSelector(data)); require(success); } - } diff --git a/contracts/mocks/ReentrancyMock.sol b/contracts/mocks/ReentrancyMock.sol index b314e54f0..a32a40472 100644 --- a/contracts/mocks/ReentrancyMock.sol +++ b/contracts/mocks/ReentrancyMock.sol @@ -24,7 +24,7 @@ contract ReentrancyMock is ReentrancyGuard { function countThisRecursive(uint256 n) public nonReentrant { if (n > 0) { count(); - // solium-disable-next-line security/no-low-level-calls + // solhint-disable-next-line avoid-low-level-calls (bool success,) = address(this).call(abi.encodeWithSignature("countThisRecursive(uint256)", n - 1)); require(success); } diff --git a/contracts/mocks/RefundableCrowdsaleImpl.sol b/contracts/mocks/RefundableCrowdsaleImpl.sol index 9e466867b..5ed5d1ed5 100644 --- a/contracts/mocks/RefundableCrowdsaleImpl.sol +++ b/contracts/mocks/RefundableCrowdsaleImpl.sol @@ -16,5 +16,7 @@ contract RefundableCrowdsaleImpl is RefundableCrowdsale { Crowdsale(rate, wallet, token) TimedCrowdsale(openingTime, closingTime) RefundableCrowdsale(goal) - {} + { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/RefundablePostDeliveryCrowdsaleImpl.sol b/contracts/mocks/RefundablePostDeliveryCrowdsaleImpl.sol index 6772971c8..b81f0757c 100644 --- a/contracts/mocks/RefundablePostDeliveryCrowdsaleImpl.sol +++ b/contracts/mocks/RefundablePostDeliveryCrowdsaleImpl.sol @@ -16,5 +16,7 @@ contract RefundablePostDeliveryCrowdsaleImpl is RefundablePostDeliveryCrowdsale Crowdsale(rate, wallet, token) TimedCrowdsale(openingTime, closingTime) RefundableCrowdsale(goal) - {} + { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/SafeERC20Helper.sol b/contracts/mocks/SafeERC20Helper.sol index e374ead8c..c9c455e58 100644 --- a/contracts/mocks/SafeERC20Helper.sol +++ b/contracts/mocks/SafeERC20Helper.sol @@ -58,8 +58,6 @@ contract SafeERC20Helper { _succeeding = IERC20(address(new ERC20SucceedingMock())); } - // Using _failing - function doFailingTransfer() public { _failing.safeTransfer(address(0), 0); } @@ -80,8 +78,6 @@ contract SafeERC20Helper { _failing.safeDecreaseAllowance(address(0), 0); } - // Using _succeeding - function doSucceedingTransfer() public { _succeeding.safeTransfer(address(0), 0); } diff --git a/contracts/mocks/SecondaryMock.sol b/contracts/mocks/SecondaryMock.sol index b20b5c2a0..1ff45b11e 100644 --- a/contracts/mocks/SecondaryMock.sol +++ b/contracts/mocks/SecondaryMock.sol @@ -3,5 +3,7 @@ pragma solidity ^0.5.0; import "../ownership/Secondary.sol"; contract SecondaryMock is Secondary { - function onlyPrimaryMock() public view onlyPrimary {} + function onlyPrimaryMock() public view onlyPrimary { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/SignatureBouncerMock.sol b/contracts/mocks/SignatureBouncerMock.sol index b31fb1986..59c59b437 100644 --- a/contracts/mocks/SignatureBouncerMock.sol +++ b/contracts/mocks/SignatureBouncerMock.sol @@ -4,25 +4,47 @@ import "../drafts/SignatureBouncer.sol"; import "./SignerRoleMock.sol"; contract SignatureBouncerMock is SignatureBouncer, SignerRoleMock { - function checkValidSignature(address account, bytes memory signature) public view returns (bool) { + function checkValidSignature(address account, bytes memory signature) + public view returns (bool) + { return _isValidSignature(account, signature); } - function onlyWithValidSignature(bytes memory signature) public onlyValidSignature(signature) view {} + function onlyWithValidSignature(bytes memory signature) + public onlyValidSignature(signature) view + { + // solhint-disable-previous-line no-empty-blocks + } - function checkValidSignatureAndMethod(address account, bytes memory signature) public view returns (bool) { + function checkValidSignatureAndMethod(address account, bytes memory signature) + public view returns (bool) + { return _isValidSignatureAndMethod(account, signature); } - function onlyWithValidSignatureAndMethod(bytes memory signature) public onlyValidSignatureAndMethod(signature) view {} + function onlyWithValidSignatureAndMethod(bytes memory signature) + public onlyValidSignatureAndMethod(signature) view + { + // solhint-disable-previous-line no-empty-blocks + } - function checkValidSignatureAndData(address account, bytes memory, uint, bytes memory signature) public view returns (bool) { + function checkValidSignatureAndData(address account, bytes memory, uint, bytes memory signature) + public view returns (bool) + { return _isValidSignatureAndData(account, signature); } - function onlyWithValidSignatureAndData(uint, bytes memory signature) public onlyValidSignatureAndData(signature) view {} + function onlyWithValidSignatureAndData(uint, bytes memory signature) + public onlyValidSignatureAndData(signature) view + { + // solhint-disable-previous-line no-empty-blocks + } - function theWrongMethod(bytes memory) public pure {} + function theWrongMethod(bytes memory) public pure { + // solhint-disable-previous-line no-empty-blocks + } - function tooShortMsgData() public onlyValidSignatureAndData("") view {} + function tooShortMsgData() public onlyValidSignatureAndData("") view { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/SignerRoleMock.sol b/contracts/mocks/SignerRoleMock.sol index f9ed2876a..71b4c792a 100644 --- a/contracts/mocks/SignerRoleMock.sol +++ b/contracts/mocks/SignerRoleMock.sol @@ -8,6 +8,7 @@ contract SignerRoleMock is SignerRole { } function onlySignerMock() public view onlySigner { + // solhint-disable-previous-line no-empty-blocks } // Causes a compilation error if super._removeSigner is not internal diff --git a/contracts/mocks/TimedCrowdsaleImpl.sol b/contracts/mocks/TimedCrowdsaleImpl.sol index 63bf24cce..463fdcb88 100644 --- a/contracts/mocks/TimedCrowdsaleImpl.sol +++ b/contracts/mocks/TimedCrowdsaleImpl.sol @@ -8,5 +8,7 @@ contract TimedCrowdsaleImpl is TimedCrowdsale { public Crowdsale(rate, wallet, token) TimedCrowdsale(openingTime, closingTime) - {} + { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/WhitelistAdminRoleMock.sol b/contracts/mocks/WhitelistAdminRoleMock.sol index 5d07f0c40..7a267ca21 100644 --- a/contracts/mocks/WhitelistAdminRoleMock.sol +++ b/contracts/mocks/WhitelistAdminRoleMock.sol @@ -8,6 +8,7 @@ contract WhitelistAdminRoleMock is WhitelistAdminRole { } function onlyWhitelistAdminMock() public view onlyWhitelistAdmin { + // solhint-disable-previous-line no-empty-blocks } // Causes a compilation error if super._removeWhitelistAdmin is not internal diff --git a/contracts/mocks/WhitelistCrowdsaleImpl.sol b/contracts/mocks/WhitelistCrowdsaleImpl.sol index 6682e392e..0200f7f7f 100644 --- a/contracts/mocks/WhitelistCrowdsaleImpl.sol +++ b/contracts/mocks/WhitelistCrowdsaleImpl.sol @@ -6,5 +6,7 @@ import "../crowdsale/Crowdsale.sol"; contract WhitelistCrowdsaleImpl is Crowdsale, WhitelistCrowdsale { - constructor (uint256 _rate, address payable _wallet, IERC20 _token) Crowdsale(_rate, _wallet, _token) public {} + constructor (uint256 _rate, address payable _wallet, IERC20 _token) public Crowdsale(_rate, _wallet, _token) { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/mocks/WhitelistedRoleMock.sol b/contracts/mocks/WhitelistedRoleMock.sol index 34761a548..7f7c89412 100644 --- a/contracts/mocks/WhitelistedRoleMock.sol +++ b/contracts/mocks/WhitelistedRoleMock.sol @@ -4,5 +4,6 @@ import "../access/roles/WhitelistedRole.sol"; contract WhitelistedRoleMock is WhitelistedRole { function onlyWhitelistedMock() public view onlyWhitelisted { + // solhint-disable-previous-line no-empty-blocks } } diff --git a/contracts/payment/escrow/RefundEscrow.sol b/contracts/payment/escrow/RefundEscrow.sol index 18c6fd355..0c9cd99a6 100644 --- a/contracts/payment/escrow/RefundEscrow.sol +++ b/contracts/payment/escrow/RefundEscrow.sol @@ -83,9 +83,10 @@ contract RefundEscrow is ConditionalEscrow { } /** - * @dev Returns whether refundees can withdraw their deposits (be refunded). + * @dev Returns whether refundees can withdraw their deposits (be refunded). The overriden function receives a + * 'payee' argument, but we ignore it here since the condition is global, not per-payee. */ - function withdrawalAllowed(address payee) public view returns (bool) { + function withdrawalAllowed(address) public view returns (bool) { return _state == State.Refunding; } } diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index 318445fc4..30f9642f8 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -8,7 +8,8 @@ import "../../math/SafeMath.sol"; * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md - * Originally 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 * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other diff --git a/contracts/token/ERC20/ERC20Pausable.sol b/contracts/token/ERC20/ERC20Pausable.sol index e54228eaa..a27de259d 100644 --- a/contracts/token/ERC20/ERC20Pausable.sol +++ b/contracts/token/ERC20/ERC20Pausable.sol @@ -12,7 +12,7 @@ contract ERC20Pausable is ERC20, Pausable { return super.transfer(to, value); } - function transferFrom(address from,address to, uint256 value) public whenNotPaused returns (bool) { + function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { return super.transferFrom(from, to, value); } diff --git a/contracts/token/ERC20/IERC20.sol b/contracts/token/ERC20/IERC20.sol index 5ae0a6d93..af4a48558 100644 --- a/contracts/token/ERC20/IERC20.sol +++ b/contracts/token/ERC20/IERC20.sol @@ -5,18 +5,18 @@ pragma solidity ^0.5.0; * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { - function totalSupply() external view returns (uint256); - - function balanceOf(address who) external view returns (uint256); - - function allowance(address owner, address spender) external view returns (uint256); - function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); + function totalSupply() external view returns (uint256); + + function balanceOf(address who) external view returns (uint256); + + function allowance(address owner, address spender) external view returns (uint256); + event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); diff --git a/contracts/token/ERC20/TokenTimelock.sol b/contracts/token/ERC20/TokenTimelock.sol index f8899d212..fb56a3310 100644 --- a/contracts/token/ERC20/TokenTimelock.sol +++ b/contracts/token/ERC20/TokenTimelock.sol @@ -20,7 +20,7 @@ contract TokenTimelock { uint256 private _releaseTime; constructor (IERC20 token, address beneficiary, uint256 releaseTime) public { - // solium-disable-next-line security/no-block-members + // solhint-disable-next-line not-rely-on-time require(releaseTime > block.timestamp); _token = token; _beneficiary = beneficiary; @@ -52,7 +52,7 @@ contract TokenTimelock { * @notice Transfers tokens held by timelock to beneficiary. */ function release() public { - // solium-disable-next-line security/no-block-members + // solhint-disable-next-line not-rely-on-time require(block.timestamp >= _releaseTime); uint256 amount = _token.balanceOf(address(this)); diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index 6d177e8d9..7c51ce60a 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -30,7 +30,7 @@ contract ERC721 is ERC165, IERC721 { // Mapping from owner to operator approvals mapping (address => mapping (address => bool)) private _operatorApprovals; - bytes4 private constant _InterfaceId_ERC721 = 0x80ac58cd; + bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd; /* * 0x80ac58cd === * bytes4(keccak256('balanceOf(address)')) ^ @@ -46,7 +46,7 @@ contract ERC721 is ERC165, IERC721 { constructor () public { // register the supported interfaces to conform to ERC721 via ERC165 - _registerInterface(_InterfaceId_ERC721); + _registerInterface(_INTERFACE_ID_ERC721); } /** @@ -147,7 +147,6 @@ contract ERC721 is ERC165, IERC721 { * @param tokenId uint256 ID of the token to be transferred */ function safeTransferFrom(address from, address to, uint256 tokenId) public { - // solium-disable-next-line arg-overflow safeTransferFrom(from, to, tokenId, ""); } @@ -165,7 +164,6 @@ contract ERC721 is ERC165, IERC721 { */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public { transferFrom(from, to, tokenId); - // solium-disable-next-line arg-overflow require(_checkOnERC721Received(from, to, tokenId, _data)); } @@ -188,9 +186,6 @@ contract ERC721 is ERC165, IERC721 { */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) { address owner = ownerOf(tokenId); - // Disable solium check because of - // https://github.com/duaraghav8/Solium/issues/175 - // solium-disable-next-line operator-whitespace return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } @@ -267,7 +262,9 @@ contract ERC721 is ERC165, IERC721 { * @param _data bytes optional data to send along with the call * @return whether the call correctly returned the expected magic value */ - function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) internal returns (bool) { + function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) + internal returns (bool) + { if (!to.isContract()) { return true; } diff --git a/contracts/token/ERC721/ERC721Enumerable.sol b/contracts/token/ERC721/ERC721Enumerable.sol index e1f291ea3..282e9873b 100644 --- a/contracts/token/ERC721/ERC721Enumerable.sol +++ b/contracts/token/ERC721/ERC721Enumerable.sol @@ -21,7 +21,7 @@ contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable { // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; - bytes4 private constant _InterfaceId_ERC721Enumerable = 0x780e9d63; + bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63; /** * 0x780e9d63 === * bytes4(keccak256('totalSupply()')) ^ @@ -34,7 +34,7 @@ contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable { */ constructor () public { // register the supported interface to conform to ERC721 via ERC165 - _registerInterface(_InterfaceId_ERC721Enumerable); + _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE); } /** diff --git a/contracts/token/ERC721/ERC721Full.sol b/contracts/token/ERC721/ERC721Full.sol index 2db57305c..f4e8042c4 100644 --- a/contracts/token/ERC721/ERC721Full.sol +++ b/contracts/token/ERC721/ERC721Full.sol @@ -11,5 +11,7 @@ import "./ERC721Metadata.sol"; * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ contract ERC721Full is ERC721, ERC721Enumerable, ERC721Metadata { - constructor (string memory name, string memory symbol) ERC721Metadata(name, symbol) public {} + constructor (string memory name, string memory symbol) public ERC721Metadata(name, symbol) { + // solhint-disable-previous-line no-empty-blocks + } } diff --git a/contracts/token/ERC721/ERC721Metadata.sol b/contracts/token/ERC721/ERC721Metadata.sol index 703d524b2..41593297e 100644 --- a/contracts/token/ERC721/ERC721Metadata.sol +++ b/contracts/token/ERC721/ERC721Metadata.sol @@ -14,7 +14,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; - bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; + bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; /** * 0x5b5e139f === * bytes4(keccak256('name()')) ^ @@ -30,7 +30,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { _symbol = symbol; // register the supported interfaces to conform to ERC721 via ERC165 - _registerInterface(InterfaceId_ERC721Metadata); + _registerInterface(_INTERFACE_ID_ERC721_METADATA); } /** diff --git a/contracts/token/ERC721/IERC721Full.sol b/contracts/token/ERC721/IERC721Full.sol index 9779a8204..17f593894 100644 --- a/contracts/token/ERC721/IERC721Full.sol +++ b/contracts/token/ERC721/IERC721Full.sol @@ -9,4 +9,5 @@ import "./IERC721Metadata.sol"; * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ contract IERC721Full is IERC721, IERC721Enumerable, IERC721Metadata { + // solhint-disable-previous-line no-empty-blocks } diff --git a/contracts/token/ERC721/IERC721Receiver.sol b/contracts/token/ERC721/IERC721Receiver.sol index 0d13d66a1..e2d019759 100644 --- a/contracts/token/ERC721/IERC721Receiver.sol +++ b/contracts/token/ERC721/IERC721Receiver.sol @@ -20,5 +20,6 @@ contract IERC721Receiver { * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` */ - function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) public returns (bytes4); + function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) + public returns (bytes4); } diff --git a/contracts/utils/Address.sol b/contracts/utils/Address.sol index 8b6d4255e..500467212 100644 --- a/contracts/utils/Address.sol +++ b/contracts/utils/Address.sol @@ -19,7 +19,7 @@ library Address { // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. - // solium-disable-next-line security/no-inline-assembly + // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } diff --git a/package-lock.json b/package-lock.json index 7d0594d02..3bfa7a9f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,63 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "@mrmlnc/readdir-enhanced": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", @@ -152,15 +209,11 @@ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, - "anymatch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", - "dev": true, - "requires": { - "micromatch": "^2.1.5", - "normalize-path": "^2.0.0" - } + "antlr4": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/antlr4/-/antlr4-4.7.1.tgz", + "integrity": "sha512-haHyTW7Y9joE5MVs37P2lNYfU2RWBLfcRDD8OWldcdZm5TiCE91B5Xl1oWSwiDUSd4rlExpt2pu1fksYQjRBYQ==", + "dev": true }, "argparse": { "version": "1.0.10", @@ -255,18 +308,18 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, - "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true - }, "async-limiter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", @@ -1531,12 +1584,6 @@ "from": "bignumber.js@git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", "dev": true }, - "binary-extensions": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", - "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", - "dev": true - }, "binaryextensions": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-2.1.1.tgz", @@ -1831,23 +1878,6 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, - "chokidar": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", - "dev": true, - "requires": { - "anymatch": "^1.3.0", - "async-each": "^1.0.0", - "fsevents": "^1.0.0", - "glob-parent": "^2.0.0", - "inherits": "^2.0.1", - "is-binary-path": "^1.0.0", - "is-glob": "^2.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0" - } - }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -2554,6 +2584,13 @@ "minimalistic-crypto-utils": "^1.0.0" } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true, + "optional": true + }, "emojis-list": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", @@ -2577,12 +2614,6 @@ "tapable": "^1.0.0" } }, - "eol": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/eol/-/eol-0.9.1.tgz", - "integrity": "sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==", - "dev": true - }, "errno": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz", @@ -2994,6 +3025,12 @@ "estraverse": "^4.1.1" } }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", + "dev": true + }, "eslint-visitor-keys": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", @@ -3016,6 +3053,25 @@ "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", "dev": true }, + "esprima-extract-comments": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/esprima-extract-comments/-/esprima-extract-comments-1.1.0.tgz", + "integrity": "sha512-sBQUnvJwpeE9QnPrxh7dpI/dp67erYG4WXEAreAMoelPRpMR7NWb4YtwRPn9b+H1uLQKl/qS8WYmyaljTpjIsw==", + "dev": true, + "optional": true, + "requires": { + "esprima": "^4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "optional": true + } + } + }, "esquery": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", @@ -3391,6 +3447,17 @@ "is-extglob": "^1.0.0" } }, + "extract-comments": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/extract-comments/-/extract-comments-1.1.0.tgz", + "integrity": "sha512-dzbZV2AdSSVW/4E7Ti5hZdHWbA+Z80RJsJhr5uiL10oyjl/gy7/o+HI1HwK4/WSZhlq4SNKU3oUzXlM13Qx02Q==", + "dev": true, + "optional": true, + "requires": { + "esprima-extract-comments": "^1.1.0", + "parse-code-context": "^1.0.0" + } + }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -3403,6 +3470,12 @@ "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", "dev": true }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, "fast-glob": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.2.tgz", @@ -3949,7 +4022,7 @@ }, "fs-extra": { "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "resolved": "http://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "dev": true, "requires": { @@ -3966,549 +4039,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.21", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "^2.1.0" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true, - "optional": true - }, - "minipass": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.1", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.0", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.1.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.1.10", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.5.1", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.1", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true, - "dev": true - } - } - }, "function-bind": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz", @@ -5259,15 +4789,6 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, "is-buffer": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", @@ -5620,12 +5141,6 @@ "integrity": "sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM=", "dev": true }, - "js-string-escape": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", - "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=", - "dev": true - }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", @@ -5760,7 +5275,7 @@ }, "jsonfile": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "dev": true, "requires": { @@ -6903,6 +6418,13 @@ "p-finally": "^1.0.0" } }, + "parse-code-context": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-code-context/-/parse-code-context-1.0.0.tgz", + "integrity": "sha512-OZQaqKaQnR21iqhlnPfVisFjBWjhnMl5J9MgbP8xC+EwoVqbXrq78lp+9Zb3ahmLzrIX5Us/qbvBnaS3hkH6OA==", + "dev": true, + "optional": true + }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", @@ -7094,6 +6616,74 @@ "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", "dev": true }, + "prettier": { + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.15.3.tgz", + "integrity": "sha512-gAU9AGAPMaKb3NNSUUuhhFAS7SCO4ALTN4nRIn6PJ075Qd28Yn2Ig2ahEJWdJwJmlEBTUfC7mMUSFy8MwsOCfg==", + "dev": true, + "optional": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, + "prettier-plugin-solidity": { + "version": "1.0.0-alpha.12", + "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-alpha.12.tgz", + "integrity": "sha512-H5SqMHv1jttrm8h8JwVIm+f3BAXLGvqgxfXioUfPl7x0Rw+3KZaQ53bW2DBpJG7NefJxnUKq5dZrWZkclqp9AA==", + "dev": true, + "optional": true, + "requires": { + "emoji-regex": "^7.0.1", + "escape-string-regexp": "^1.0.5", + "extract-comments": "^1.1.0", + "prettier": "^1.15.2", + "solidity-parser-antlr": "^0.3.1", + "string-width": "^2.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "optional": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "optional": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "optional": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, "pretty-bytes": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-4.0.2.tgz", @@ -7252,18 +6842,6 @@ "util-deprecate": "~1.0.1" } }, - "readdirp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "minimatch": "^3.0.2", - "readable-stream": "^2.0.2", - "set-immediate-shim": "^1.0.1" - } - }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -7731,12 +7309,6 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true - }, "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", @@ -7960,12 +7532,6 @@ "kind-of": "^3.2.0" } }, - "sol-digger": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/sol-digger/-/sol-digger-0.0.2.tgz", - "integrity": "sha1-QGxKnTHiaef4jrHC6hATGOXgkCU=", - "dev": true - }, "sol-explore": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/sol-explore/-/sol-explore-1.6.2.tgz", @@ -8009,6 +7575,372 @@ } } }, + "solhint": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/solhint/-/solhint-1.5.0.tgz", + "integrity": "sha512-D4vmV9hlBRcBEdCap6kHUKtBOjKJbC6JhvsoGrcTKW6+WHRDkbpif35R1Enzd0+OvvIC2UReMwK85dSqrqUSoQ==", + "dev": true, + "requires": { + "antlr4": "4.7.1", + "commander": "2.18.0", + "eslint": "^5.6.0", + "fast-diff": "^1.1.2", + "glob": "7.1.3", + "ignore": "^4.0.6", + "lodash": "^4.17.11", + "prettier": "^1.14.3", + "prettier-linter-helpers": "^1.0.0", + "prettier-plugin-solidity": "^1.0.0-alpha.4" + }, + "dependencies": { + "acorn": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", + "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==", + "dev": true + }, + "acorn-jsx": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", + "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", + "dev": true + }, + "ajv": { + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.2.tgz", + "integrity": "sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "commander": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.18.0.tgz", + "integrity": "sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ==", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "eslint": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.11.0.tgz", + "integrity": "sha512-gbEg0ttToZPkZUv2yYjpipxuYrv/9aSSmgM4V6GkiO3u04QosHYBtduUCqLEulEg3YvNDAkk3OWzyQJ/heZ3Nw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.5.3", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^2.1.0", + "eslint-scope": "^4.0.0", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.0", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "imurmurhash": "^0.1.4", + "inquirer": "^6.1.0", + "js-yaml": "^3.12.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.5", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "require-uncached": "^1.0.3", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.0.2", + "text-table": "^0.2.0" + } + }, + "eslint-scope": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "espree": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.0.tgz", + "integrity": "sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA==", + "dev": true, + "requires": { + "acorn": "^6.0.2", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globals": { + "version": "11.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", + "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "inquirer": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.1.tgz", + "integrity": "sha512-088kl3DRT2dLU5riVMKKr1DlImd6X7smDhpXUCkJDCKvTEJeRiXh0G132HG9u5a+6Ylw9plFRY7RuTnwohYSpg==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.0", + "figures": "^2.0.0", + "lodash": "^4.17.10", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.1.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", + "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "dev": true + }, + "strip-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", + "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "dev": true, + "requires": { + "ansi-regex": "^4.0.0" + } + } + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "rxjs": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", + "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "slice-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.0.0.tgz", + "integrity": "sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/table/-/table-5.1.1.tgz", + "integrity": "sha512-NUjapYb/qd4PeFW03HnAuOJ7OMcBkJlqeClWxeNlQ0lXGSb52oZXGzkO0/I0ARegQ2eUT1g2VDJH0eUxDRcHmw==", + "dev": true, + "requires": { + "ajv": "^6.6.1", + "lodash": "^4.17.11", + "slice-ansi": "2.0.0", + "string-width": "^2.1.1" + } + } + } + }, "solidity-coverage": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.5.4.tgz", @@ -8027,6 +7959,13 @@ "web3": "^0.18.4" } }, + "solidity-parser-antlr": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/solidity-parser-antlr/-/solidity-parser-antlr-0.3.3.tgz", + "integrity": "sha512-RNUc18pjf7DLWs//WF+V+VnvrbetEbNFUYxm2JFbXU62G9WSu+nVyDxV5r+FG4wu8jom17vLdM/3I7bMBGfZ9g==", + "dev": true, + "optional": true + }, "solidity-parser-sc": { "version": "0.4.10", "resolved": "https://registry.npmjs.org/solidity-parser-sc/-/solidity-parser-sc-0.4.10.tgz", @@ -8062,154 +8001,6 @@ } } }, - "solium": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/solium/-/solium-1.1.8.tgz", - "integrity": "sha512-fn0lusM6of14CytIDDHK73SGjn6NsVTaCVJjaKCKJyqKhT00rH/hDtvnIeZ2ZTD9z/xaXd4Js2brW3az6AV9RA==", - "dev": true, - "requires": { - "ajv": "^5.2.2", - "chokidar": "^1.6.0", - "colors": "^1.1.2", - "commander": "^2.9.0", - "eol": "^0.9.1", - "js-string-escape": "^1.0.1", - "lodash": "^4.14.2", - "sol-digger": "0.0.2", - "sol-explore": "1.6.1", - "solium-plugin-security": "0.1.1", - "solparse": "2.2.5", - "text-table": "^0.2.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", - "dev": true, - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" - } - }, - "sol-explore": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/sol-explore/-/sol-explore-1.6.1.tgz", - "integrity": "sha1-tZ8HPGn+MyVg1aEMMrqMp/KYbPs=", - "dev": true - }, - "solparse": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/solparse/-/solparse-2.2.5.tgz", - "integrity": "sha512-t7tvtR6KU6QfPYLMv1nlCh9DA8HYIu5tbjHpKu0fhGFZ1NuSp0KKDHfFHv07g6v1xgcuUY3rVqNFjZt5b9+5qA==", - "dev": true, - "requires": { - "mocha": "^4.0.1", - "pegjs": "^0.10.0", - "yargs": "^10.0.3" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "yargs": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.1.2.tgz", - "integrity": "sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^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": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^8.1.0" - } - }, - "yargs-parser": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz", - "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } - } - } - }, - "solium-plugin-security": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/solium-plugin-security/-/solium-plugin-security-0.1.1.tgz", - "integrity": "sha512-kpLirBwIq4mhxk0Y/nn5cQ6qdJTI+U1LO3gpoNIcqNaW+sI058moXBe2UiHs+9wvF9IzYD49jcKhFTxcR9u9SQ==", - "dev": true - }, "sort-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", @@ -8849,6 +8640,23 @@ "integrity": "sha1-fx8wIFWz/qDz6B3HjrNnZstl4/E=", "dev": true }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", diff --git a/package.json b/package.json index 9dcecbc2c..855496221 100644 --- a/package.json +++ b/package.json @@ -13,14 +13,13 @@ "console": "truffle console", "coverage": "scripts/coverage.sh", "lint": "npm run lint:js && npm run lint:sol", - "lint:fix": "npm run lint:js:fix && npm run lint:sol:fix", + "lint:fix": "npm run lint:js:fix", "lint:js": "eslint .", "lint:js:fix": "eslint . --fix", - "lint:sol": "solium -d .", - "lint:sol:fix": "solium -d . --fix", + "lint:sol": "solhint --max-warnings 0 \"contracts/**/*.sol\"", "prepack": "npm run build", - "test": "npm run compile && scripts/test.sh", - "version": "scripts/version.js" + "version": "scripts/version.js", + "test": "npm run compile && scripts/test.sh" }, "repository": { "type": "git", @@ -55,8 +54,8 @@ "ethjs-abi": "^0.2.1", "ganache-cli": "6.1.8", "pify": "^4.0.1", + "solhint": "^1.5.0", "solidity-coverage": "^0.5.4", - "solium": "^1.1.8", "truffle": "^4.1.13", "web3-utils": "^1.0.0-beta.34" },