Contracts 2.0.0 were linted with solhint

This commit is contained in:
Alex Shafranovich
2018-07-05 21:01:14 +03:00
parent d8c7c9803c
commit f21b042ed1
60 changed files with 78 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
pragma solidity ^0.4.10;
// solhint-disable
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <stefan.george@consensys.net>
contract MultiSigWallet {

View File

@@ -20,6 +20,8 @@ pragma solidity ^0.4.10;
import "./MultiSigWallet.sol";
// solhint-disable
/// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed.
/// @author Amir Bandeali - <amir@0xProject.com>
contract MultiSigWalletWithTimeLock is MultiSigWallet {

View File

@@ -22,6 +22,7 @@ pragma experimental ABIEncoderV2;
import "../../utils/Ownable/Ownable.sol";
import "./mixins/MAuthorizable.sol";
contract MixinAuthorizable is
Ownable,
MAuthorizable

View File

@@ -18,15 +18,18 @@
pragma solidity ^0.4.23;
// @dev Interface of the asset proxy's assetData.
// The asset proxies take an ABI encoded `bytes assetData` as argument.
// This argument is ABI encoded as one of the methods of this interface.
interface IAssetData {
// solhint-disable-next-line func-name-mixedcase
function ERC20Token(address tokenContract)
external
pure;
// solhint-disable-next-line func-name-mixedcase
function ERC721Token(
address tokenContract,
uint256 tokenId,

View File

@@ -21,6 +21,7 @@ pragma experimental ABIEncoderV2;
import "./IAuthorizable.sol";
contract IAssetProxy is
IAuthorizable
{

View File

@@ -21,6 +21,7 @@ pragma experimental ABIEncoderV2;
import "../../../utils/Ownable/IOwnable.sol";
contract IAuthorizable is
IOwnable
{

View File

@@ -18,6 +18,7 @@
pragma solidity ^0.4.24;
/// @dev This contract documents the revert reasons used in the AssetProxy contracts.
/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.
contract LibAssetProxyErrors {

View File

@@ -21,6 +21,7 @@ pragma experimental ABIEncoderV2;
import "../interfaces/IAuthorizable.sol";
contract MAuthorizable is
IAuthorizable
{

View File

@@ -21,6 +21,7 @@ pragma solidity ^0.4.10;
import "../../multisig/MultiSigWalletWithTimeLock.sol";
import "../../utils/LibBytes/LibBytes.sol";
contract AssetProxyOwner is
MultiSigWalletWithTimeLock
{

View File

@@ -27,6 +27,7 @@ import "./MixinAssetProxyDispatcher.sol";
import "./MixinTransactions.sol";
import "./MixinMatchOrders.sol";
contract Exchange is
MixinExchangeCore,
MixinMatchOrders,

View File

@@ -23,6 +23,7 @@ import "../../utils/LibBytes/LibBytes.sol";
import "./mixins/MAssetProxyDispatcher.sol";
import "../AssetProxy/interfaces/IAssetProxy.sol";
contract MixinAssetProxyDispatcher is
Ownable,
MAssetProxyDispatcher

View File

@@ -28,6 +28,7 @@ import "./mixins/MSignatureValidator.sol";
import "./mixins/MTransactions.sol";
import "./mixins/MAssetProxyDispatcher.sol";
contract MixinExchangeCore is
LibConstants,
LibMath,

View File

@@ -23,6 +23,7 @@ import "./mixins/MMatchOrders.sol";
import "./mixins/MTransactions.sol";
import "./mixins/MAssetProxyDispatcher.sol";
contract MixinMatchOrders is
LibConstants,
LibMath,

View File

@@ -24,6 +24,7 @@ import "./mixins/MTransactions.sol";
import "./interfaces/IWallet.sol";
import "./interfaces/IValidator.sol";
contract MixinSignatureValidator is
MSignatureValidator,
MTransactions

View File

@@ -22,6 +22,7 @@ import "./mixins/MSignatureValidator.sol";
import "./mixins/MTransactions.sol";
import "./libs/LibEIP712.sol";
contract MixinTransactions is
LibEIP712,
MSignatureValidator,

View File

@@ -24,6 +24,7 @@ import "./libs/LibOrder.sol";
import "./libs/LibFillResults.sol";
import "./mixins/MExchangeCore.sol";
contract MixinWrapperFunctions is
LibMath,
LibFillResults,

View File

@@ -18,6 +18,7 @@
pragma solidity ^0.4.24;
contract IAssetProxyDispatcher {
/// @dev Registers an asset proxy to its asset proxy id.

View File

@@ -26,6 +26,7 @@ import "./ITransactions.sol";
import "./IAssetProxyDispatcher.sol";
import "./IWrapperFunctions.sol";
contract IExchange is
IExchangeCore,
IMatchOrders,

View File

@@ -22,6 +22,7 @@ pragma experimental ABIEncoderV2;
import "../libs/LibOrder.sol";
import "../libs/LibFillResults.sol";
contract IExchangeCore {
/// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch

View File

@@ -21,6 +21,7 @@ pragma experimental ABIEncoderV2;
import "../libs/LibOrder.sol";
import "../libs/LibFillResults.sol";
contract IMatchOrders {
/// @dev Match two complementary orders that have a profitable spread.

View File

@@ -18,6 +18,7 @@
pragma solidity ^0.4.24;
contract ISignatureValidator {
/// @dev Approves a hash on-chain using any valid signature type.

View File

@@ -17,6 +17,7 @@
*/
pragma solidity ^0.4.24;
contract ITransactions {
/// @dev Executes an exchange method call in the context of signer.

View File

@@ -18,6 +18,7 @@
pragma solidity ^0.4.23;
contract IValidator {
/// @dev Verifies that a signature is valid.

View File

@@ -18,6 +18,7 @@
pragma solidity ^0.4.24;
contract IWallet {
/// @dev Verifies that a signature is valid.

View File

@@ -22,6 +22,7 @@ pragma experimental ABIEncoderV2;
import "../libs/LibOrder.sol";
import "../libs/LibFillResults.sol";
contract IWrapperFunctions {
/// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.
/// @param order LibOrder.Order struct containing order specifications.

View File

@@ -18,11 +18,13 @@
pragma solidity ^0.4.24;
contract LibConstants {
// Asset data for ZRX token. Used for fee transfers.
// @TODO: Hardcode constant when we deploy. Currently
// not constant to make testing easier.
// solhint-disable-next-line var-name-mixedcase
bytes public ZRX_ASSET_DATA;
// @TODO: Remove when we deploy.

View File

@@ -18,6 +18,7 @@
pragma solidity ^0.4.24;
contract LibEIP712 {
// EIP191 header for EIP712 prefix
string constant EIP191_HEADER = "\x19\x01";
@@ -38,6 +39,7 @@ contract LibEIP712 {
));
// Hash of the EIP712 Domain Separator data
// solhint-disable-next-line var-name-mixedcase
bytes32 public EIP712_DOMAIN_HASH;
constructor ()

View File

@@ -18,6 +18,7 @@
pragma solidity ^0.4.24;
/// @dev This contract documents the revert reasons used in the Exchange contract.
/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.
contract LibExchangeErrors {

View File

@@ -20,6 +20,7 @@ pragma solidity ^0.4.24;
import "../../../utils/SafeMath/SafeMath.sol";
contract LibFillResults is
SafeMath
{

View File

@@ -20,6 +20,7 @@ pragma solidity ^0.4.24;
import "../../../utils/SafeMath/SafeMath.sol";
contract LibMath is
SafeMath
{

View File

@@ -20,6 +20,7 @@ pragma solidity ^0.4.24;
import "./LibEIP712.sol";
contract LibOrder is
LibEIP712
{
@@ -115,17 +116,20 @@ contract LibOrder is
// ));
assembly {
// Backup
// solhint-disable-next-line space-after-comma
let temp1 := mload(sub(order, 32))
let temp2 := mload(add(order, 320))
let temp3 := mload(add(order, 352))
// Hash in place
// solhint-disable-next-line space-after-comma
mstore(sub(order, 32), schemaHash)
mstore(add(order, 320), makerAssetDataHash)
mstore(add(order, 352), takerAssetDataHash)
result := keccak256(sub(order, 32), 416)
// Restore
// solhint-disable-next-line space-after-comma
mstore(sub(order, 32), temp1)
mstore(add(order, 320), temp2)
mstore(add(order, 352), temp3)

View File

@@ -21,6 +21,7 @@ pragma experimental ABIEncoderV2;
import "../interfaces/IAssetProxyDispatcher.sol";
contract MAssetProxyDispatcher is
IAssetProxyDispatcher
{

View File

@@ -23,6 +23,7 @@ import "../libs/LibOrder.sol";
import "../libs/LibFillResults.sol";
import "../interfaces/IExchangeCore.sol";
contract MExchangeCore is
IExchangeCore
{

View File

@@ -22,6 +22,7 @@ import "../libs/LibOrder.sol";
import "../libs/LibFillResults.sol";
import "../interfaces/IMatchOrders.sol";
contract MMatchOrders is
IMatchOrders
{

View File

@@ -20,6 +20,7 @@ pragma solidity ^0.4.24;
import "../interfaces/ISignatureValidator.sol";
contract MSignatureValidator is
ISignatureValidator
{

View File

@@ -19,6 +19,7 @@ pragma solidity ^0.4.24;
import "../interfaces/ITransactions.sol";
contract MTransactions is
ITransactions
{

View File

@@ -22,6 +22,7 @@ pragma experimental ABIEncoderV2;
import "../Mintable/Mintable.sol";
import "../../utils/Ownable/Ownable.sol";
contract DummyERC20Token is Mintable, Ownable {
string public name;
string public symbol;

View File

@@ -27,6 +27,7 @@ pragma solidity ^0.4.24;
import "../../tokens/ERC721Token/IERC721Receiver.sol";
contract DummyERC721Receiver is
IERC721Receiver
{

View File

@@ -22,6 +22,7 @@ pragma experimental ABIEncoderV2;
import "../../tokens/ERC721Token/ERC721Token.sol";
import "../../utils/Ownable/Ownable.sol";
contract DummyERC721Token is
Ownable,
ERC721Token

View File

@@ -22,9 +22,11 @@ pragma experimental ABIEncoderV2;
import "../../protocol/Exchange/interfaces/IExchange.sol";
import "../../protocol/Exchange/libs/LibOrder.sol";
contract ExchangeWrapper {
// Exchange contract.
// solhint-disable-next-line var-name-mixedcase
IExchange EXCHANGE;
constructor (address _exchange)

View File

@@ -22,6 +22,7 @@ pragma experimental ABIEncoderV2;
import "../../tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol";
import "../../utils/SafeMath/SafeMath.sol";
/*
* Mintable
* Base contract that creates a mintable UnlimitedAllowanceToken

View File

@@ -21,6 +21,7 @@ pragma experimental ABIEncoderV2;
import "../../protocol/Exchange/MixinAssetProxyDispatcher.sol";
contract TestAssetProxyDispatcher is MixinAssetProxyDispatcher {
function publicDispatchTransferFrom(
bytes memory assetData,

View File

@@ -20,6 +20,7 @@ pragma solidity ^0.4.24;
import "../../protocol/AssetProxyOwner/AssetProxyOwner.sol";
contract TestAssetProxyOwner is
AssetProxyOwner
{

View File

@@ -21,6 +21,7 @@ pragma experimental ABIEncoderV2;
import "../../utils/LibBytes/LibBytes.sol";
contract TestLibBytes {
using LibBytes for bytes;

View File

@@ -23,6 +23,7 @@ import "../../protocol/Exchange/libs/LibMath.sol";
import "../../protocol/Exchange/libs/LibOrder.sol";
import "../../protocol/Exchange/libs/LibFillResults.sol";
contract TestLibs is
LibMath,
LibOrder,

View File

@@ -22,6 +22,7 @@ pragma experimental ABIEncoderV2;
import "../../protocol/Exchange/MixinSignatureValidator.sol";
import "../../protocol/Exchange/MixinTransactions.sol";
contract TestSignatureValidator is
MixinSignatureValidator,
MixinTransactions

View File

@@ -20,11 +20,13 @@ pragma solidity ^0.4.24;
import "../../protocol/Exchange/interfaces/IValidator.sol";
contract TestValidator is
IValidator
{
// The single valid signer for this wallet.
// solhint-disable-next-line var-name-mixedcase
address VALID_SIGNER;
/// @dev constructs a new `TestValidator` with a single valid signer.

View File

@@ -21,6 +21,7 @@ pragma solidity ^0.4.24;
import "../../protocol/Exchange/interfaces/IWallet.sol";
import "../../utils/LibBytes/LibBytes.sol";
contract TestWallet is
IWallet
{
@@ -29,6 +30,7 @@ contract TestWallet is
string constant LENGTH_65_REQUIRED = "LENGTH_65_REQUIRED";
// The owner of this wallet.
// solhint-disable-next-line var-name-mixedcase
address WALLET_OWNER;
/// @dev constructs a new `TestWallet` with a single owner.

View File

@@ -23,6 +23,7 @@ import "../../protocol/Exchange/interfaces/IExchange.sol";
import "../../protocol/Exchange/libs/LibOrder.sol";
import "../../utils/Ownable/Ownable.sol";
contract Whitelist is
Ownable
{
@@ -35,15 +36,19 @@ contract Whitelist is
mapping (address => bool) public isWhitelisted;
// Exchange contract.
// solhint-disable-next-line var-name-mixedcase
IExchange EXCHANGE;
byte constant VALIDATOR_SIGNATURE_BYTE = "\x06";
// solhint-disable-next-line var-name-mixedcase
bytes TX_ORIGIN_SIGNATURE;
constructor (address _exchange)
public
{
// solhint-disable-next-line var-name-mixedcase
EXCHANGE = IExchange(_exchange);
// solhint-disable-next-line var-name-mixedcase
TX_ORIGIN_SIGNATURE = abi.encodePacked(address(this), VALIDATOR_SIGNATURE_BYTE);
}

View File

@@ -21,6 +21,7 @@ pragma experimental ABIEncoderV2;
import "./IERC20Token.sol";
contract ERC20Token is IERC20Token {
string constant INSUFFICIENT_BALANCE = "ERC20_INSUFFICIENT_BALANCE";

View File

@@ -19,6 +19,7 @@
pragma solidity ^0.4.24;
pragma experimental ABIEncoderV2;
contract IERC20Token {
/// @notice send `value` token to `to` from `msg.sender`

View File

@@ -29,6 +29,7 @@ import "./IERC721Token.sol";
import "./IERC721Receiver.sol";
import "../../utils/SafeMath/SafeMath.sol";
/**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md

View File

@@ -25,6 +25,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
pragma solidity ^0.4.24;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers

View File

@@ -25,6 +25,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
pragma solidity ^0.4.24;
/**
* @title ERC721 Non-Fungible Token Standard basic interface
* @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md

View File

@@ -21,6 +21,7 @@ pragma experimental ABIEncoderV2;
import "../ERC20Token/ERC20Token.sol";
contract UnlimitedAllowanceToken is ERC20Token {
uint256 constant MAX_UINT = 2**256 - 1;

View File

@@ -15,6 +15,7 @@
pragma solidity ^0.4.18;
contract WETH9 {
string public name = "Wrapped Ether";
string public symbol = "WETH";

View File

@@ -20,6 +20,8 @@ pragma solidity ^0.4.11;
import { UnlimitedAllowanceToken_v1 as UnlimitedAllowanceToken } from "../../../1.0.0/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol";
contract ZRXToken is UnlimitedAllowanceToken {
uint8 constant public decimals = 18;

View File

@@ -18,6 +18,7 @@
pragma solidity ^0.4.24;
library LibBytes {
using LibBytes for bytes;

View File

@@ -10,6 +10,7 @@ pragma experimental ABIEncoderV2;
import "./IOwnable.sol";
contract Ownable is IOwnable {
address public owner;

View File

@@ -1,6 +1,7 @@
pragma solidity ^0.4.24;
pragma experimental ABIEncoderV2;
contract SafeMath {
function safeMul(uint a, uint b)
internal