Browse Source

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.
Nicolás Venturo 6 years ago
parent
commit
76abd1a41e
64 changed files with 430 additions and 840 deletions
  1. 11 0
      .solhint.json
  2. 0 1
      .soliumignore
  3. 0 22
      .soliumrc.json
  4. 12 15
      contracts/crowdsale/Crowdsale.sol
  5. 3 1
      contracts/crowdsale/distribution/FinalizableCrowdsale.sol
  6. 1 1
      contracts/crowdsale/price/IncreasingPriceCrowdsale.sol
  7. 2 2
      contracts/crowdsale/validation/PausableCrowdsale.sol
  8. 3 3
      contracts/crowdsale/validation/TimedCrowdsale.sol
  9. 1 2
      contracts/cryptography/ECDSA.sol
  10. 0 1
      contracts/drafts/ERC1046/TokenMetadata.sol
  11. 3 1
      contracts/drafts/SignatureBouncer.sol
  12. 7 2
      contracts/drafts/TokenVesting.sol
  13. 3 6
      contracts/examples/SampleCrowdsale.sol
  14. 2 2
      contracts/introspection/ERC165.sol
  15. 9 9
      contracts/introspection/ERC165Checker.sol
  16. 3 1
      contracts/mocks/AllowanceCrowdsaleImpl.sol
  17. 3 1
      contracts/mocks/CappedCrowdsaleImpl.sol
  18. 1 0
      contracts/mocks/CapperRoleMock.sol
  19. 3 1
      contracts/mocks/CrowdsaleMock.sol
  20. 6 1
      contracts/mocks/DetailedERC20Mock.sol
  21. 4 3
      contracts/mocks/ERC165/ERC165InterfacesSupported.sol
  22. 3 1
      contracts/mocks/ERC165/ERC165NotSupported.sol
  23. 1 0
      contracts/mocks/ERC20MintableMock.sol
  24. 3 1
      contracts/mocks/ERC20WithMetadataMock.sol
  25. 3 1
      contracts/mocks/ERC721FullMock.sol
  26. 3 1
      contracts/mocks/ERC721MintableBurnableImpl.sol
  27. 3 1
      contracts/mocks/ERC721ReceiverMock.sol
  28. 1 0
      contracts/mocks/Failer.sol
  29. 3 2
      contracts/mocks/FinalizableCrowdsaleImpl.sol
  30. 3 1
      contracts/mocks/IncreasingPriceCrowdsaleImpl.sol
  31. 3 2
      contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol
  32. 3 1
      contracts/mocks/MintedCrowdsaleImpl.sol
  33. 1 0
      contracts/mocks/MinterRoleMock.sol
  34. 3 1
      contracts/mocks/OwnableMock.sol
  35. 1 0
      contracts/mocks/PausableCrowdsaleImpl.sol
  36. 1 0
      contracts/mocks/PauserRoleMock.sol
  37. 3 1
      contracts/mocks/PostDeliveryCrowdsaleImpl.sol
  38. 3 1
      contracts/mocks/PullPaymentMock.sol
  39. 1 3
      contracts/mocks/ReentrancyAttack.sol
  40. 1 1
      contracts/mocks/ReentrancyMock.sol
  41. 3 1
      contracts/mocks/RefundableCrowdsaleImpl.sol
  42. 3 1
      contracts/mocks/RefundablePostDeliveryCrowdsaleImpl.sol
  43. 0 4
      contracts/mocks/SafeERC20Helper.sol
  44. 3 1
      contracts/mocks/SecondaryMock.sol
  45. 30 8
      contracts/mocks/SignatureBouncerMock.sol
  46. 1 0
      contracts/mocks/SignerRoleMock.sol
  47. 3 1
      contracts/mocks/TimedCrowdsaleImpl.sol
  48. 1 0
      contracts/mocks/WhitelistAdminRoleMock.sol
  49. 3 1
      contracts/mocks/WhitelistCrowdsaleImpl.sol
  50. 1 0
      contracts/mocks/WhitelistedRoleMock.sol
  51. 3 2
      contracts/payment/escrow/RefundEscrow.sol
  52. 2 1
      contracts/token/ERC20/ERC20.sol
  53. 1 1
      contracts/token/ERC20/ERC20Pausable.sol
  54. 6 6
      contracts/token/ERC20/IERC20.sol
  55. 2 2
      contracts/token/ERC20/TokenTimelock.sol
  56. 5 8
      contracts/token/ERC721/ERC721.sol
  57. 2 2
      contracts/token/ERC721/ERC721Enumerable.sol
  58. 3 1
      contracts/token/ERC721/ERC721Full.sol
  59. 2 2
      contracts/token/ERC721/ERC721Metadata.sol
  60. 1 0
      contracts/token/ERC721/IERC721Full.sol
  61. 2 1
      contracts/token/ERC721/IERC721Receiver.sol
  62. 1 1
      contracts/utils/Address.sol
  63. 227 697
      package-lock.json
  64. 5 6
      package.json

+ 11 - 0
.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
+  }
+}

+ 0 - 1
.soliumignore

@@ -1 +0,0 @@
-node_modules

+ 0 - 22
.soliumrc.json

@@ -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"]
-  }
-}

+ 12 - 15
contracts/crowdsale/Crowdsale.sol

@@ -63,10 +63,6 @@ contract Crowdsale is ReentrancyGuard {
         _token = token;
         _token = token;
     }
     }
 
 
-    // -----------------------------------------
-    // Crowdsale external interface
-    // -----------------------------------------
-
     /**
     /**
      * @dev fallback function ***DO NOT OVERRIDE***
      * @dev fallback function ***DO NOT OVERRIDE***
      * Note that other contracts will transfer fund with a base gas stipend
      * Note that other contracts will transfer fund with a base gas stipend
@@ -130,12 +126,9 @@ contract Crowdsale is ReentrancyGuard {
         _postValidatePurchase(beneficiary, weiAmount);
         _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:
      * Example from CappedCrowdsale.sol's _preValidatePurchase method:
      *     super._preValidatePurchase(beneficiary, weiAmount);
      *     super._preValidatePurchase(beneficiary, weiAmount);
      *     require(weiRaised().add(weiAmount) <= cap);
      *     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 beneficiary Address performing the token purchase
      * @param weiAmount Value in wei involved in the purchase
      * @param weiAmount Value in wei involved in the purchase
      */
      */
     function _postValidatePurchase(address beneficiary, uint256 weiAmount) internal view {
     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 beneficiary Address performing the token purchase
      * @param tokenAmount Number of tokens to be emitted
      * @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 beneficiary Address receiving the tokens
      * @param tokenAmount Number of tokens to be purchased
      * @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 beneficiary Address receiving the tokens
      * @param weiAmount Value in wei involved in the purchase
      * @param weiAmount Value in wei involved in the purchase
      */
      */
     function _updatePurchasingState(address beneficiary, uint256 weiAmount) internal {
     function _updatePurchasingState(address beneficiary, uint256 weiAmount) internal {
-        // optional override
+        // solhint-disable-previous-line no-empty-blocks
     }
     }
 
 
     /**
     /**

+ 3 - 1
contracts/crowdsale/distribution/FinalizableCrowdsale.sol

@@ -45,5 +45,7 @@ contract FinalizableCrowdsale is TimedCrowdsale {
      * should call super._finalization() to ensure the chain of finalization is
      * should call super._finalization() to ensure the chain of finalization is
      * executed entirely.
      * executed entirely.
      */
      */
-    function _finalization() internal {}
+    function _finalization() internal {
+        // solhint-disable-previous-line no-empty-blocks
+    }
 }
 }

+ 1 - 1
contracts/crowdsale/price/IncreasingPriceCrowdsale.sol

@@ -59,7 +59,7 @@ contract IncreasingPriceCrowdsale is TimedCrowdsale {
             return 0;
             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 elapsedTime = block.timestamp.sub(openingTime());
         uint256 timeRange = closingTime().sub(openingTime());
         uint256 timeRange = closingTime().sub(openingTime());
         uint256 rateRange = _initialRate.sub(_finalRate);
         uint256 rateRange = _initialRate.sub(_finalRate);

+ 2 - 2
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.
  * @dev Extension of Crowdsale contract where purchases can be paused and unpaused by the pauser role.
  */
  */
 contract PausableCrowdsale is Crowdsale, Pausable {
 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.
      * Adds the validation that the crowdsale must not be paused.
      * @param _beneficiary Address performing the token purchase
      * @param _beneficiary Address performing the token purchase
      * @param _weiAmount Value in wei involved in the purchase
      * @param _weiAmount Value in wei involved in the purchase

+ 3 - 3
contracts/crowdsale/validation/TimedCrowdsale.sol

@@ -27,7 +27,7 @@ contract TimedCrowdsale is Crowdsale {
      * @param closingTime Crowdsale closing time
      * @param closingTime Crowdsale closing time
      */
      */
     constructor (uint256 openingTime, uint256 closingTime) public {
     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(openingTime >= block.timestamp);
         require(closingTime > openingTime);
         require(closingTime > openingTime);
 
 
@@ -53,7 +53,7 @@ contract TimedCrowdsale is Crowdsale {
      * @return true if the crowdsale is open, false otherwise.
      * @return true if the crowdsale is open, false otherwise.
      */
      */
     function isOpen() public view returns (bool) {
     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;
         return block.timestamp >= _openingTime && block.timestamp <= _closingTime;
     }
     }
 
 
@@ -62,7 +62,7 @@ contract TimedCrowdsale is Crowdsale {
      * @return Whether crowdsale period has elapsed
      * @return Whether crowdsale period has elapsed
      */
      */
     function hasClosed() public view returns (bool) {
     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;
         return block.timestamp > _closingTime;
     }
     }
 
 

+ 1 - 2
contracts/cryptography/ECDSA.sol

@@ -26,7 +26,7 @@ library ECDSA {
         // Divide the signature in r, s and v variables
         // Divide the signature in r, s and v variables
         // ecrecover takes the signature parameters, and the only way to get them
         // ecrecover takes the signature parameters, and the only way to get them
         // currently is to use assembly.
         // currently is to use assembly.
-        // solium-disable-next-line security/no-inline-assembly
+        // solhint-disable-next-line no-inline-assembly
         assembly {
         assembly {
             r := mload(add(signature, 0x20))
             r := mload(add(signature, 0x20))
             s := mload(add(signature, 0x40))
             s := mload(add(signature, 0x40))
@@ -42,7 +42,6 @@ library ECDSA {
         if (v != 27 && v != 28) {
         if (v != 27 && v != 28) {
             return (address(0));
             return (address(0));
         } else {
         } else {
-            // solium-disable-next-line arg-overflow
             return ecrecover(hash, v, r, s);
             return ecrecover(hash, v, r, s);
         }
         }
     }
     }

+ 0 - 1
contracts/drafts/ERC1046/TokenMetadata.sol

@@ -6,7 +6,6 @@ import "../../token/ERC20/IERC20.sol";
  * @title ERC-1047 Token Metadata
  * @title ERC-1047 Token Metadata
  * @dev See https://eips.ethereum.org/EIPS/eip-1046
  * @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 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 {
 contract ERC20TokenMetadata is IERC20 {
     function tokenURI() external view returns (string memory);
     function tokenURI() external view returns (string memory);

+ 3 - 1
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
     // Signature size is 65 bytes (tightly packed v + r + s), but gets padded to 96 bytes
     uint256 private constant _SIGNATURE_SIZE = 96;
     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
      * @dev requires that a valid signature of a signer was provided

+ 7 - 2
contracts/drafts/TokenVesting.sol

@@ -1,5 +1,3 @@
-/* solium-disable security/no-block-members */
-
 pragma solidity ^0.5.0;
 pragma solidity ^0.5.0;
 
 
 import "../token/ERC20/SafeERC20.sol";
 import "../token/ERC20/SafeERC20.sol";
@@ -13,6 +11,12 @@ import "../math/SafeMath.sol";
  * owner.
  * owner.
  */
  */
 contract TokenVesting is Ownable {
 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 SafeMath for uint256;
     using SafeERC20 for IERC20;
     using SafeERC20 for IERC20;
 
 
@@ -22,6 +26,7 @@ contract TokenVesting is Ownable {
     // beneficiary of tokens after they are released
     // beneficiary of tokens after they are released
     address private _beneficiary;
     address private _beneficiary;
 
 
+    // Durations and timestamps are expressed in UNIX time, the same units as block.timestamp.
     uint256 private _cliff;
     uint256 private _cliff;
     uint256 private _start;
     uint256 private _start;
     uint256 private _duration;
     uint256 private _duration;

+ 3 - 6
contracts/examples/SampleCrowdsale.sol

@@ -12,7 +12,9 @@ import "../token/ERC20/ERC20Detailed.sol";
  * It is meant to be used in a crowdsale contract.
  * It is meant to be used in a crowdsale contract.
  */
  */
 contract SampleCrowdsaleToken is ERC20Mintable, ERC20Detailed {
 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
  * After adding multiple features it's good practice to run integration tests
  * to ensure that subcontracts works together as intended.
  * 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 {
 contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale, MintedCrowdsale {
     constructor (
     constructor (
         uint256 openingTime,
         uint256 openingTime,

+ 2 - 2
contracts/introspection/ERC165.sol

@@ -8,7 +8,7 @@ import "./IERC165.sol";
  * @dev Implements ERC165 using a lookup table.
  * @dev Implements ERC165 using a lookup table.
  */
  */
 contract ERC165 is IERC165 {
 contract ERC165 is IERC165 {
-    bytes4 private constant _InterfaceId_ERC165 = 0x01ffc9a7;
+    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
     /**
     /**
      * 0x01ffc9a7 ===
      * 0x01ffc9a7 ===
      *     bytes4(keccak256('supportsInterface(bytes4)'))
      *     bytes4(keccak256('supportsInterface(bytes4)'))
@@ -24,7 +24,7 @@ contract ERC165 is IERC165 {
      * implement ERC165 itself
      * implement ERC165 itself
      */
      */
     constructor () internal {
     constructor () internal {
-        _registerInterface(_InterfaceId_ERC165);
+        _registerInterface(_INTERFACE_ID_ERC165);
     }
     }
 
 
     /**
     /**

+ 9 - 9
contracts/introspection/ERC165Checker.sol

@@ -7,9 +7,9 @@ pragma solidity ^0.5.0;
  */
  */
 library ERC165Checker {
 library ERC165Checker {
     // As per the EIP-165 spec, no interface should ever match 0xffffffff
     // 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 ===
      * 0x01ffc9a7 ===
      *     bytes4(keccak256('supportsInterface(bytes4)'))
      *     bytes4(keccak256('supportsInterface(bytes4)'))
@@ -23,8 +23,8 @@ library ERC165Checker {
     function _supportsERC165(address account) internal view returns (bool) {
     function _supportsERC165(address account) internal view returns (bool) {
         // Any contract that implements ERC165 must explicitly indicate support of
         // Any contract that implements ERC165 must explicitly indicate support of
         // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
         // 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
      * indicates support of the interface with identifier interfaceId, false otherwise
      */
      */
     function _callERC165SupportsInterface(address account, bytes4 interfaceId)
     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 {
         assembly {
             let encodedParams_data := add(0x20, encodedParams)
             let encodedParams_data := add(0x20, encodedParams)
             let encodedParams_size := mload(encodedParams)
             let encodedParams_size := mload(encodedParams)

+ 3 - 1
contracts/mocks/AllowanceCrowdsaleImpl.sol

@@ -8,5 +8,7 @@ contract AllowanceCrowdsaleImpl is AllowanceCrowdsale {
         public
         public
         Crowdsale(rate, wallet, token)
         Crowdsale(rate, wallet, token)
         AllowanceCrowdsale(tokenWallet)
         AllowanceCrowdsale(tokenWallet)
-    {}
+    {
+        // solhint-disable-previous-line no-empty-blocks
+    }
 }
 }

+ 3 - 1
contracts/mocks/CappedCrowdsaleImpl.sol

@@ -8,5 +8,7 @@ contract CappedCrowdsaleImpl is CappedCrowdsale {
         public
         public
         Crowdsale(rate, wallet, token)
         Crowdsale(rate, wallet, token)
         CappedCrowdsale(cap)
         CappedCrowdsale(cap)
-    {}
+    {
+        // solhint-disable-previous-line no-empty-blocks
+    }
 }
 }

+ 1 - 0
contracts/mocks/CapperRoleMock.sol

@@ -8,6 +8,7 @@ contract CapperRoleMock is CapperRole {
     }
     }
 
 
     function onlyCapperMock() public view onlyCapper {
     function onlyCapperMock() public view onlyCapper {
+        // solhint-disable-previous-line no-empty-blocks
     }
     }
 
 
     // Causes a compilation error if super._removeCapper is not internal
     // Causes a compilation error if super._removeCapper is not internal

+ 3 - 1
contracts/mocks/CrowdsaleMock.sol

@@ -3,5 +3,7 @@ pragma solidity ^0.5.0;
 import "../crowdsale/Crowdsale.sol";
 import "../crowdsale/Crowdsale.sol";
 
 
 contract CrowdsaleMock is Crowdsale {
 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
+    }
 }
 }

+ 6 - 1
contracts/mocks/DetailedERC20Mock.sol

@@ -4,5 +4,10 @@ import "../token/ERC20/ERC20.sol";
 import "../token/ERC20/ERC20Detailed.sol";
 import "../token/ERC20/ERC20Detailed.sol";
 
 
 contract ERC20DetailedMock is ERC20, ERC20Detailed {
 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
+    }
 }
 }

+ 4 - 3
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
  * 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, [...]
  * > 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)
  * 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
  * solidity-coverage ignores the /mocks folder, so we duplicate its implementation here to avoid instrumenting it
  */
  */
 contract SupportsInterfaceWithLookupMock is IERC165 {
 contract SupportsInterfaceWithLookupMock is IERC165 {
-    bytes4 public constant InterfaceId_ERC165 = 0x01ffc9a7;
+    bytes4 public constant INTERFACE_ID_ERC165 = 0x01ffc9a7;
     /**
     /**
      * 0x01ffc9a7 ===
      * 0x01ffc9a7 ===
      *     bytes4(keccak256('supportsInterface(bytes4)'))
      *     bytes4(keccak256('supportsInterface(bytes4)'))
@@ -27,7 +28,7 @@ contract SupportsInterfaceWithLookupMock is IERC165 {
      * implement ERC165 itself
      * implement ERC165 itself
      */
      */
     constructor () public {
     constructor () public {
-        _registerInterface(InterfaceId_ERC165);
+        _registerInterface(INTERFACE_ID_ERC165);
     }
     }
 
 
     /**
     /**

+ 3 - 1
contracts/mocks/ERC165/ERC165NotSupported.sol

@@ -1,3 +1,5 @@
 pragma solidity ^0.5.0;
 pragma solidity ^0.5.0;
 
 
-contract ERC165NotSupported {}
+contract ERC165NotSupported {
+    // solhint-disable-previous-line no-empty-blocks
+}

+ 1 - 0
contracts/mocks/ERC20MintableMock.sol

@@ -4,4 +4,5 @@ import "../token/ERC20/ERC20Mintable.sol";
 import "./MinterRoleMock.sol";
 import "./MinterRoleMock.sol";
 
 
 contract ERC20MintableMock is ERC20Mintable, MinterRoleMock {
 contract ERC20MintableMock is ERC20Mintable, MinterRoleMock {
+    // solhint-disable-previous-line no-empty-blocks
 }
 }

+ 3 - 1
contracts/mocks/ERC20WithMetadataMock.sol

@@ -4,5 +4,7 @@ import "../token/ERC20/ERC20.sol";
 import "../drafts/ERC1046/TokenMetadata.sol";
 import "../drafts/ERC1046/TokenMetadata.sol";
 
 
 contract ERC20WithMetadataMock is ERC20, ERC20WithMetadata {
 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
+    }
 }
 }

+ 3 - 1
contracts/mocks/ERC721FullMock.sol

@@ -11,7 +11,9 @@ import "../token/ERC721/ERC721Burnable.sol";
  * checking token existence, removal of a token from an address
  * checking token existence, removal of a token from an address
  */
  */
 contract ERC721FullMock is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable {
 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) {
     function exists(uint256 tokenId) public view returns (bool) {
         return _exists(tokenId);
         return _exists(tokenId);

+ 3 - 1
contracts/mocks/ERC721MintableBurnableImpl.sol

@@ -9,5 +9,7 @@ import "../token/ERC721/ERC721Burnable.sol";
  * @title ERC721MintableBurnableImpl
  * @title ERC721MintableBurnableImpl
  */
  */
 contract ERC721MintableBurnableImpl is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable {
 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
+    }
 }
 }

+ 3 - 1
contracts/mocks/ERC721ReceiverMock.sol

@@ -13,7 +13,9 @@ contract ERC721ReceiverMock is IERC721Receiver {
         _reverts = reverts;
         _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);
         require(!_reverts);
         emit Received(operator, from, tokenId, data, gasleft());
         emit Received(operator, from, tokenId, data, gasleft());
         return _retval;
         return _retval;

+ 1 - 0
contracts/mocks/Failer.sol

@@ -4,6 +4,7 @@ contract Failer {
     uint256[] private array;
     uint256[] private array;
 
 
     function dontFail() public pure {
     function dontFail() public pure {
+        // solhint-disable-previous-line no-empty-blocks
     }
     }
 
 
     function failWithRevert() public pure {
     function failWithRevert() public pure {

+ 3 - 2
contracts/mocks/FinalizableCrowdsaleImpl.sol

@@ -4,10 +4,11 @@ import "../token/ERC20/IERC20.sol";
 import "../crowdsale/distribution/FinalizableCrowdsale.sol";
 import "../crowdsale/distribution/FinalizableCrowdsale.sol";
 
 
 contract FinalizableCrowdsaleImpl is FinalizableCrowdsale {
 contract FinalizableCrowdsaleImpl is FinalizableCrowdsale {
-
     constructor (uint256 openingTime, uint256 closingTime, uint256 rate, address payable wallet, IERC20 token)
     constructor (uint256 openingTime, uint256 closingTime, uint256 rate, address payable wallet, IERC20 token)
         public
         public
         Crowdsale(rate, wallet, token)
         Crowdsale(rate, wallet, token)
         TimedCrowdsale(openingTime, closingTime)
         TimedCrowdsale(openingTime, closingTime)
-    {}
+    {
+        // solhint-disable-previous-line no-empty-blocks
+    }
 }
 }

+ 3 - 1
contracts/mocks/IncreasingPriceCrowdsaleImpl.sol

@@ -16,5 +16,7 @@ contract IncreasingPriceCrowdsaleImpl is IncreasingPriceCrowdsale {
         Crowdsale(initialRate, wallet, token)
         Crowdsale(initialRate, wallet, token)
         TimedCrowdsale(openingTime, closingTime)
         TimedCrowdsale(openingTime, closingTime)
         IncreasingPriceCrowdsale(initialRate, finalRate)
         IncreasingPriceCrowdsale(initialRate, finalRate)
-    {}
+    {
+        // solhint-disable-previous-line no-empty-blocks
+    }
 }
 }

+ 3 - 2
contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol

@@ -5,6 +5,7 @@ import "../crowdsale/validation/IndividuallyCappedCrowdsale.sol";
 import "./CapperRoleMock.sol";
 import "./CapperRoleMock.sol";
 
 
 contract IndividuallyCappedCrowdsaleImpl is IndividuallyCappedCrowdsale, CapperRoleMock {
 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
+    }
 }
 }

+ 3 - 1
contracts/mocks/MintedCrowdsaleImpl.sol

@@ -4,5 +4,7 @@ import "../token/ERC20/ERC20Mintable.sol";
 import "../crowdsale/emission/MintedCrowdsale.sol";
 import "../crowdsale/emission/MintedCrowdsale.sol";
 
 
 contract MintedCrowdsaleImpl is MintedCrowdsale {
 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
+    }
 }
 }

+ 1 - 0
contracts/mocks/MinterRoleMock.sol

@@ -8,6 +8,7 @@ contract MinterRoleMock is MinterRole {
     }
     }
 
 
     function onlyMinterMock() public view onlyMinter {
     function onlyMinterMock() public view onlyMinter {
+        // solhint-disable-previous-line no-empty-blocks
     }
     }
 
 
     // Causes a compilation error if super._removeMinter is not internal
     // Causes a compilation error if super._removeMinter is not internal

+ 3 - 1
contracts/mocks/OwnableMock.sol

@@ -2,4 +2,6 @@ pragma solidity ^0.5.0;
 
 
 import "../ownership/Ownable.sol";
 import "../ownership/Ownable.sol";
 
 
-contract OwnableMock is Ownable {}
+contract OwnableMock is Ownable {
+    // solhint-disable-previous-line no-empty-blocks
+}

+ 1 - 0
contracts/mocks/PausableCrowdsaleImpl.sol

@@ -5,5 +5,6 @@ import "../crowdsale/validation/PausableCrowdsale.sol";
 
 
 contract PausableCrowdsaleImpl is PausableCrowdsale {
 contract PausableCrowdsaleImpl is PausableCrowdsale {
     constructor (uint256 _rate, address payable _wallet, ERC20 _token) public Crowdsale(_rate, _wallet, _token) {
     constructor (uint256 _rate, address payable _wallet, ERC20 _token) public Crowdsale(_rate, _wallet, _token) {
+        // solhint-disable-previous-line no-empty-blocks
     }
     }
 }
 }

+ 1 - 0
contracts/mocks/PauserRoleMock.sol

@@ -8,6 +8,7 @@ contract PauserRoleMock is PauserRole {
     }
     }
 
 
     function onlyPauserMock() public view onlyPauser {
     function onlyPauserMock() public view onlyPauser {
+        // solhint-disable-previous-line no-empty-blocks
     }
     }
 
 
     // Causes a compilation error if super._removePauser is not internal
     // Causes a compilation error if super._removePauser is not internal

+ 3 - 1
contracts/mocks/PostDeliveryCrowdsaleImpl.sol

@@ -8,5 +8,7 @@ contract PostDeliveryCrowdsaleImpl is PostDeliveryCrowdsale {
         public
         public
         TimedCrowdsale(openingTime, closingTime)
         TimedCrowdsale(openingTime, closingTime)
         Crowdsale(rate, wallet, token)
         Crowdsale(rate, wallet, token)
-    {}
+    {
+        // solhint-disable-previous-line no-empty-blocks
+    }
 }
 }

+ 3 - 1
contracts/mocks/PullPaymentMock.sol

@@ -4,7 +4,9 @@ import "../payment/PullPayment.sol";
 
 
 // mock class using PullPayment
 // mock class using PullPayment
 contract PullPaymentMock is PullPayment {
 contract PullPaymentMock is PullPayment {
-    constructor () public payable { }
+    constructor () public payable {
+        // solhint-disable-previous-line no-empty-blocks
+    }
 
 
     // test helper function to call asyncTransfer
     // test helper function to call asyncTransfer
     function callTransfer(address dest, uint256 amount) public {
     function callTransfer(address dest, uint256 amount) public {

+ 1 - 3
contracts/mocks/ReentrancyAttack.sol

@@ -1,11 +1,9 @@
 pragma solidity ^0.5.0;
 pragma solidity ^0.5.0;
 
 
 contract ReentrancyAttack {
 contract ReentrancyAttack {
-
     function callSender(bytes4 data) public {
     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));
         (bool success,) = msg.sender.call(abi.encodeWithSelector(data));
         require(success);
         require(success);
     }
     }
-
 }
 }

+ 1 - 1
contracts/mocks/ReentrancyMock.sol

@@ -24,7 +24,7 @@ contract ReentrancyMock is ReentrancyGuard {
     function countThisRecursive(uint256 n) public nonReentrant {
     function countThisRecursive(uint256 n) public nonReentrant {
         if (n > 0) {
         if (n > 0) {
             count();
             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));
             (bool success,) = address(this).call(abi.encodeWithSignature("countThisRecursive(uint256)", n - 1));
             require(success);
             require(success);
         }
         }

+ 3 - 1
contracts/mocks/RefundableCrowdsaleImpl.sol

@@ -16,5 +16,7 @@ contract RefundableCrowdsaleImpl is RefundableCrowdsale {
         Crowdsale(rate, wallet, token)
         Crowdsale(rate, wallet, token)
         TimedCrowdsale(openingTime, closingTime)
         TimedCrowdsale(openingTime, closingTime)
         RefundableCrowdsale(goal)
         RefundableCrowdsale(goal)
-    {}
+    {
+        // solhint-disable-previous-line no-empty-blocks
+    }
 }
 }

+ 3 - 1
contracts/mocks/RefundablePostDeliveryCrowdsaleImpl.sol

@@ -16,5 +16,7 @@ contract RefundablePostDeliveryCrowdsaleImpl is RefundablePostDeliveryCrowdsale
         Crowdsale(rate, wallet, token)
         Crowdsale(rate, wallet, token)
         TimedCrowdsale(openingTime, closingTime)
         TimedCrowdsale(openingTime, closingTime)
         RefundableCrowdsale(goal)
         RefundableCrowdsale(goal)
-    {}
+    {
+        // solhint-disable-previous-line no-empty-blocks
+    }
 }
 }

+ 0 - 4
contracts/mocks/SafeERC20Helper.sol

@@ -58,8 +58,6 @@ contract SafeERC20Helper {
         _succeeding = IERC20(address(new ERC20SucceedingMock()));
         _succeeding = IERC20(address(new ERC20SucceedingMock()));
     }
     }
 
 
-    // Using _failing
-
     function doFailingTransfer() public {
     function doFailingTransfer() public {
         _failing.safeTransfer(address(0), 0);
         _failing.safeTransfer(address(0), 0);
     }
     }
@@ -80,8 +78,6 @@ contract SafeERC20Helper {
         _failing.safeDecreaseAllowance(address(0), 0);
         _failing.safeDecreaseAllowance(address(0), 0);
     }
     }
 
 
-    // Using _succeeding
-
     function doSucceedingTransfer() public {
     function doSucceedingTransfer() public {
         _succeeding.safeTransfer(address(0), 0);
         _succeeding.safeTransfer(address(0), 0);
     }
     }

+ 3 - 1
contracts/mocks/SecondaryMock.sol

@@ -3,5 +3,7 @@ pragma solidity ^0.5.0;
 import "../ownership/Secondary.sol";
 import "../ownership/Secondary.sol";
 
 
 contract SecondaryMock is Secondary {
 contract SecondaryMock is Secondary {
-    function onlyPrimaryMock() public view onlyPrimary {}
+    function onlyPrimaryMock() public view onlyPrimary {
+        // solhint-disable-previous-line no-empty-blocks
+    }
 }
 }

+ 30 - 8
contracts/mocks/SignatureBouncerMock.sol

@@ -4,25 +4,47 @@ import "../drafts/SignatureBouncer.sol";
 import "./SignerRoleMock.sol";
 import "./SignerRoleMock.sol";
 
 
 contract SignatureBouncerMock is SignatureBouncer, SignerRoleMock {
 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);
         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);
         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);
         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
+    }
 }
 }

+ 1 - 0
contracts/mocks/SignerRoleMock.sol

@@ -8,6 +8,7 @@ contract SignerRoleMock is SignerRole {
     }
     }
 
 
     function onlySignerMock() public view onlySigner {
     function onlySignerMock() public view onlySigner {
+        // solhint-disable-previous-line no-empty-blocks
     }
     }
 
 
     // Causes a compilation error if super._removeSigner is not internal
     // Causes a compilation error if super._removeSigner is not internal

+ 3 - 1
contracts/mocks/TimedCrowdsaleImpl.sol

@@ -8,5 +8,7 @@ contract TimedCrowdsaleImpl is TimedCrowdsale {
         public
         public
         Crowdsale(rate, wallet, token)
         Crowdsale(rate, wallet, token)
         TimedCrowdsale(openingTime, closingTime)
         TimedCrowdsale(openingTime, closingTime)
-    {}
+    {
+        // solhint-disable-previous-line no-empty-blocks
+    }
 }
 }

+ 1 - 0
contracts/mocks/WhitelistAdminRoleMock.sol

@@ -8,6 +8,7 @@ contract WhitelistAdminRoleMock is WhitelistAdminRole {
     }
     }
 
 
     function onlyWhitelistAdminMock() public view onlyWhitelistAdmin {
     function onlyWhitelistAdminMock() public view onlyWhitelistAdmin {
+        // solhint-disable-previous-line no-empty-blocks
     }
     }
 
 
     // Causes a compilation error if super._removeWhitelistAdmin is not internal
     // Causes a compilation error if super._removeWhitelistAdmin is not internal

+ 3 - 1
contracts/mocks/WhitelistCrowdsaleImpl.sol

@@ -6,5 +6,7 @@ import "../crowdsale/Crowdsale.sol";
 
 
 
 
 contract WhitelistCrowdsaleImpl is Crowdsale, WhitelistCrowdsale {
 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
+    }
 }
 }

+ 1 - 0
contracts/mocks/WhitelistedRoleMock.sol

@@ -4,5 +4,6 @@ import "../access/roles/WhitelistedRole.sol";
 
 
 contract WhitelistedRoleMock is WhitelistedRole {
 contract WhitelistedRoleMock is WhitelistedRole {
     function onlyWhitelistedMock() public view onlyWhitelisted {
     function onlyWhitelistedMock() public view onlyWhitelisted {
+        // solhint-disable-previous-line no-empty-blocks
     }
     }
 }
 }

+ 3 - 2
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;
         return _state == State.Refunding;
     }
     }
 }
 }

+ 2 - 1
contracts/token/ERC20/ERC20.sol

@@ -8,7 +8,8 @@ import "../../math/SafeMath.sol";
  *
  *
  * @dev Implementation of the basic standard token.
  * @dev Implementation of the basic standard token.
  * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
  * 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
  * 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
  * all accounts just by listening to said events. Note that this isn't required by the specification, and other

+ 1 - 1
contracts/token/ERC20/ERC20Pausable.sol

@@ -12,7 +12,7 @@ contract ERC20Pausable is ERC20, Pausable {
         return super.transfer(to, value);
         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);
         return super.transferFrom(from, to, value);
     }
     }
 
 

+ 6 - 6
contracts/token/ERC20/IERC20.sol

@@ -5,18 +5,18 @@ pragma solidity ^0.5.0;
  * @dev see https://github.com/ethereum/EIPs/issues/20
  * @dev see https://github.com/ethereum/EIPs/issues/20
  */
  */
 interface IERC20 {
 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 transfer(address to, uint256 value) external returns (bool);
 
 
     function approve(address spender, 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 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 Transfer(address indexed from, address indexed to, uint256 value);
 
 
     event Approval(address indexed owner, address indexed spender, uint256 value);
     event Approval(address indexed owner, address indexed spender, uint256 value);

+ 2 - 2
contracts/token/ERC20/TokenTimelock.sol

@@ -20,7 +20,7 @@ contract TokenTimelock {
     uint256 private _releaseTime;
     uint256 private _releaseTime;
 
 
     constructor (IERC20 token, address beneficiary, uint256 releaseTime) public {
     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);
         require(releaseTime > block.timestamp);
         _token = token;
         _token = token;
         _beneficiary = beneficiary;
         _beneficiary = beneficiary;
@@ -52,7 +52,7 @@ contract TokenTimelock {
      * @notice Transfers tokens held by timelock to beneficiary.
      * @notice Transfers tokens held by timelock to beneficiary.
      */
      */
     function release() public {
     function release() public {
-        // solium-disable-next-line security/no-block-members
+        // solhint-disable-next-line not-rely-on-time
         require(block.timestamp >= _releaseTime);
         require(block.timestamp >= _releaseTime);
 
 
         uint256 amount = _token.balanceOf(address(this));
         uint256 amount = _token.balanceOf(address(this));

+ 5 - 8
contracts/token/ERC721/ERC721.sol

@@ -30,7 +30,7 @@ contract ERC721 is ERC165, IERC721 {
     // Mapping from owner to operator approvals
     // Mapping from owner to operator approvals
     mapping (address => mapping (address => bool)) private _operatorApprovals;
     mapping (address => mapping (address => bool)) private _operatorApprovals;
 
 
-    bytes4 private constant _InterfaceId_ERC721 = 0x80ac58cd;
+    bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
     /*
     /*
      * 0x80ac58cd ===
      * 0x80ac58cd ===
      *     bytes4(keccak256('balanceOf(address)')) ^
      *     bytes4(keccak256('balanceOf(address)')) ^
@@ -46,7 +46,7 @@ contract ERC721 is ERC165, IERC721 {
 
 
     constructor () public {
     constructor () public {
         // register the supported interfaces to conform to ERC721 via ERC165
         // 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
      * @param tokenId uint256 ID of the token to be transferred
     */
     */
     function safeTransferFrom(address from, address to, uint256 tokenId) public {
     function safeTransferFrom(address from, address to, uint256 tokenId) public {
-        // solium-disable-next-line arg-overflow
         safeTransferFrom(from, to, tokenId, "");
         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 {
     function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
         transferFrom(from, to, tokenId);
         transferFrom(from, to, tokenId);
-        // solium-disable-next-line arg-overflow
         require(_checkOnERC721Received(from, to, tokenId, _data));
         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) {
     function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
         address owner = ownerOf(tokenId);
         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));
         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
      * @param _data bytes optional data to send along with the call
      * @return whether the call correctly returned the expected magic value
      * @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()) {
         if (!to.isContract()) {
             return true;
             return true;
         }
         }

+ 2 - 2
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 from token id to position in the allTokens array
     mapping(uint256 => uint256) private _allTokensIndex;
     mapping(uint256 => uint256) private _allTokensIndex;
 
 
-    bytes4 private constant _InterfaceId_ERC721Enumerable = 0x780e9d63;
+    bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;
     /**
     /**
      * 0x780e9d63 ===
      * 0x780e9d63 ===
      *     bytes4(keccak256('totalSupply()')) ^
      *     bytes4(keccak256('totalSupply()')) ^
@@ -34,7 +34,7 @@ contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable {
      */
      */
     constructor () public {
     constructor () public {
         // register the supported interface to conform to ERC721 via ERC165
         // register the supported interface to conform to ERC721 via ERC165
-        _registerInterface(_InterfaceId_ERC721Enumerable);
+        _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
     }
     }
 
 
     /**
     /**

+ 3 - 1
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
  * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
  */
  */
 contract ERC721Full is ERC721, ERC721Enumerable, ERC721Metadata {
 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
+    }
 }
 }

+ 2 - 2
contracts/token/ERC721/ERC721Metadata.sol

@@ -14,7 +14,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata {
     // Optional mapping for token URIs
     // Optional mapping for token URIs
     mapping(uint256 => string) private _tokenURIs;
     mapping(uint256 => string) private _tokenURIs;
 
 
-    bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f;
+    bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
     /**
     /**
      * 0x5b5e139f ===
      * 0x5b5e139f ===
      *     bytes4(keccak256('name()')) ^
      *     bytes4(keccak256('name()')) ^
@@ -30,7 +30,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata {
         _symbol = symbol;
         _symbol = symbol;
 
 
         // register the supported interfaces to conform to ERC721 via ERC165
         // register the supported interfaces to conform to ERC721 via ERC165
-        _registerInterface(InterfaceId_ERC721Metadata);
+        _registerInterface(_INTERFACE_ID_ERC721_METADATA);
     }
     }
 
 
     /**
     /**

+ 1 - 0
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
  * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
  */
  */
 contract IERC721Full is IERC721, IERC721Enumerable, IERC721Metadata {
 contract IERC721Full is IERC721, IERC721Enumerable, IERC721Metadata {
+    // solhint-disable-previous-line no-empty-blocks
 }
 }

+ 2 - 1
contracts/token/ERC721/IERC721Receiver.sol

@@ -20,5 +20,6 @@ contract IERC721Receiver {
      * @param data Additional data with no specified format
      * @param data Additional data with no specified format
      * @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
      * @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);
 }
 }

+ 1 - 1
contracts/utils/Address.sol

@@ -19,7 +19,7 @@ library Address {
         // for more details about how this works.
         // for more details about how this works.
         // TODO Check this again before the Serenity release, because all addresses will be
         // TODO Check this again before the Serenity release, because all addresses will be
         // contracts then.
         // contracts then.
-        // solium-disable-next-line security/no-inline-assembly
+        // solhint-disable-next-line no-inline-assembly
         assembly { size := extcodesize(account) }
         assembly { size := extcodesize(account) }
         return size > 0;
         return size > 0;
     }
     }

File diff suppressed because it is too large
+ 227 - 697
package-lock.json


+ 5 - 6
package.json

@@ -13,14 +13,13 @@
     "console": "truffle console",
     "console": "truffle console",
     "coverage": "scripts/coverage.sh",
     "coverage": "scripts/coverage.sh",
     "lint": "npm run lint:js && npm run lint:sol",
     "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": "eslint .",
     "lint:js:fix": "eslint . --fix",
     "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",
     "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": {
   "repository": {
     "type": "git",
     "type": "git",
@@ -55,8 +54,8 @@
     "ethjs-abi": "^0.2.1",
     "ethjs-abi": "^0.2.1",
     "ganache-cli": "6.1.8",
     "ganache-cli": "6.1.8",
     "pify": "^4.0.1",
     "pify": "^4.0.1",
+    "solhint": "^1.5.0",
     "solidity-coverage": "^0.5.4",
     "solidity-coverage": "^0.5.4",
-    "solium": "^1.1.8",
     "truffle": "^4.1.13",
     "truffle": "^4.1.13",
     "web3-utils": "^1.0.0-beta.34"
     "web3-utils": "^1.0.0-beta.34"
   },
   },

Some files were not shown because too many files changed in this diff