diff --git a/.soliumrc.json b/.soliumrc.json index b26114fed..1ce82712e 100644 --- a/.soliumrc.json +++ b/.soliumrc.json @@ -2,9 +2,11 @@ "extends": "solium:recommended", "plugins": ["security"], "rules": { + "no-experimental": ["off"], "quotes": ["error", "double"], "indentation": ["error", 4], "linebreak-style": ["error", "unix"], - "security/no-inline-assembly": ["off"] + "security/no-inline-assembly": ["off"], + "security/no-low-level-calls": ["off"] } } diff --git a/contracts/GNS.sol b/contracts/GNS.sol index 00820478a..23b62371e 100644 --- a/contracts/GNS.sol +++ b/contracts/GNS.sol @@ -3,6 +3,7 @@ pragma experimental ABIEncoderV2; import "./Governed.sol"; + contract GNS is Governed { /* * @title Graph Name Service (GNS) contract @@ -41,34 +42,18 @@ contract GNS is Governed { */ /* Events */ - event DomainAdded( - bytes32 indexed topLevelDomainHash, - address indexed owner, - string domainName - ); - event DomainTransferred( - bytes32 indexed domainHash, - address indexed newOwner - ); + event DomainAdded(bytes32 indexed topLevelDomainHash, address indexed owner, string domainName); + event DomainTransferred(bytes32 indexed domainHash, address indexed newOwner); event SubgraphCreated( bytes32 indexed topLevelDomainHash, bytes32 indexed registeredHash, string subdomainName, address indexed owner ); - event SubgraphIDUpdated( - bytes32 indexed domainHash, - bytes32 indexed subgraphID - ); + event SubgraphIDUpdated(bytes32 indexed domainHash, bytes32 indexed subgraphID); event DomainDeleted(bytes32 indexed domainHash); - event AccountMetadataChanged( - address indexed account, - bytes32 indexed ipfsHash - ); - event SubgraphMetadataChanged( - bytes32 indexed domainHash, - bytes32 indexed ipfsHash - ); + event AccountMetadataChanged(address indexed account, bytes32 indexed ipfsHash); + event SubgraphMetadataChanged(bytes32 indexed domainHash, bytes32 indexed ipfsHash); /* TYPES */ struct Domain { @@ -87,10 +72,7 @@ contract GNS is Governed { /* Graph Protocol Functions */ modifier onlyDomainOwner(bytes32 _domainHash) { - require( - msg.sender == domains[_domainHash].owner, - "Only domain owner can call." - ); + require(msg.sender == domains[_domainHash].owner, "Only domain owner can call."); _; } @@ -101,10 +83,7 @@ contract GNS is Governed { function registerDomain(string calldata _domainName) external { bytes32 hashedName = keccak256(abi.encodePacked(_domainName)); // Require that this domain is not yet owned by anyone. - require( - domains[hashedName].owner == address(0), - "Domain is already owned." - ); + require(domains[hashedName].owner == address(0), "Domain is already owned."); domains[hashedName].owner = msg.sender; emit DomainAdded(hashedName, msg.sender, _domainName); } @@ -134,9 +113,7 @@ contract GNS is Governed { domainHash = _topLevelDomainHash; } else { // The domain hash becomes the subdomain concatenated with the top level domain hash. - domainHash = keccak256( - abi.encodePacked(subdomainHash, _topLevelDomainHash) - ); + domainHash = keccak256(abi.encodePacked(subdomainHash, _topLevelDomainHash)); require( domains[domainHash].owner == address(0), "Someone already owns this subdomain." @@ -147,12 +124,7 @@ contract GNS is Governed { // Note - subdomain name and IPFS hash are only emitted through the events. // Note - if the subdomain is blank, the domain hash ends up being the top level // domain hash, not the hash of a blank string. - emit SubgraphCreated( - _topLevelDomainHash, - domainHash, - _subdomainName, - msg.sender - ); + emit SubgraphCreated(_topLevelDomainHash, domainHash, _subdomainName, msg.sender); emit SubgraphMetadataChanged(domainHash, _ipfsHash); } @@ -181,10 +153,7 @@ contract GNS is Governed { * * @param _domainHash - Hash of the domain name. */ - function deleteSubdomain(bytes32 _domainHash) - external - onlyDomainOwner(_domainHash) - { + function deleteSubdomain(bytes32 _domainHash) external onlyDomainOwner(_domainHash) { delete domains[_domainHash]; emit DomainDeleted(_domainHash); } @@ -200,10 +169,7 @@ contract GNS is Governed { external onlyDomainOwner(_domainHash) { - require( - _newOwner != address(0), - "If you want to reset the owner, call deleteSubdomain." - ); + require(_newOwner != address(0), "If you want to reset the owner, call deleteSubdomain."); domains[_domainHash].owner = _newOwner; emit DomainTransferred(_domainHash, _newOwner); } diff --git a/contracts/GraphToken.sol b/contracts/GraphToken.sol index cabcbe503..3569378a5 100644 --- a/contracts/GraphToken.sol +++ b/contracts/GraphToken.sol @@ -11,14 +11,11 @@ import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol"; -// @imp 08 target _to of transfer(_to, _amount, _data) in Token must implement this interface // NOTE: This is based off of ERC777TokensRecipient interface, but does not fully implement it interface TokenReceiver { - function tokensReceived( - address _from, - uint256 _amount, - bytes calldata _data - ) external returns (bool); + function tokensReceived(address _from, uint256 _amount, bytes calldata _data) + external + returns (bool); } @@ -30,10 +27,7 @@ contract GraphToken is Governed, ERC20Detailed, ERC20Burnable { event MinterRemoved(address indexed account); modifier onlyMinter() { - require( - isMinter(msg.sender) || msg.sender == governor, - "Only minter can call" - ); + require(isMinter(msg.sender) || msg.sender == governor, "Only minter can call"); _; } @@ -70,11 +64,7 @@ contract GraphToken is Governed, ERC20Detailed, ERC20Burnable { _removeMinter(msg.sender); } - function mint(address _account, uint256 _amount) - external - onlyMinter - returns (bool) - { + function mint(address _account, uint256 _amount) external onlyMinter returns (bool) { _mint(_account, _amount); return true; } @@ -84,11 +74,10 @@ contract GraphToken is Governed, ERC20Detailed, ERC20Burnable { * @notice Interacts with Staking contract * @notice Overriding `transfer` was not working with web3.js so we renamed to `transferToTokenReceiver` */ - function transferToTokenReceiver( - address _to, - uint256 _amount, - bytes memory _data - ) public returns (bool success) { + function transferToTokenReceiver(address _to, uint256 _amount, bytes memory _data) + public + returns (bool success) + { assert(super.transfer(_to, _amount)); // Handle basic transfer functionality // @imp 08 Have staking contract receive the token and handle the data assert(TokenReceiver(_to).tokensReceived(msg.sender, _amount, _data)); diff --git a/contracts/Migrations.sol b/contracts/Migrations.sol index 5e4df5cf8..580e320b2 100644 --- a/contracts/Migrations.sol +++ b/contracts/Migrations.sol @@ -1,5 +1,6 @@ pragma solidity ^0.6.4; + contract Migrations { address public owner; uint256 public last_completed_migration; diff --git a/contracts/MultiSigWallet.sol b/contracts/MultiSigWallet.sol index 32b291bc7..cd03cd690 100644 --- a/contracts/MultiSigWallet.sol +++ b/contracts/MultiSigWallet.sol @@ -1,5 +1,6 @@ pragma solidity ^0.6.4; + // upgraded from solidity ^0.4.15 (Gnosis MultiSigWallet v1.3.7) /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. @@ -183,11 +184,10 @@ contract MultiSigWallet { /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return transactionId Returns transaction ID. - function submitTransaction( - address destination, - uint256 value, - bytes memory data - ) public returns (uint256 transactionId) { + function submitTransaction(address destination, uint256 value, bytes memory data) + public + returns (uint256 transactionId) + { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } @@ -228,14 +228,8 @@ contract MultiSigWallet { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; - if ( - external_call( - txn.destination, - txn.value, - txn.data.length, - txn.data - ) - ) emit Execution(transactionId); + if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) + emit Execution(transactionId); else { emit ExecutionFailure(transactionId); txn.executed = false; @@ -289,11 +283,11 @@ contract MultiSigWallet { /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return transactionId Returns transaction ID. - function addTransaction( - address destination, - uint256 value, - bytes memory data - ) internal notNull(destination) returns (uint256 transactionId) { + function addTransaction(address destination, uint256 value, bytes memory data) + internal + notNull(destination) + returns (uint256 transactionId) + { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, @@ -311,11 +305,7 @@ contract MultiSigWallet { /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return count Number of confirmations. - function getConfirmationCount(uint256 transactionId) - public - view - returns (uint256 count) - { + function getConfirmationCount(uint256 transactionId) public view returns (uint256 count) { for (uint256 i = 0; i < owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } @@ -324,16 +314,10 @@ contract MultiSigWallet { /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return count Total number of transactions after filters are applied. - function getTransactionCount(bool pending, bool executed) - public - view - returns (uint256 count) - { + function getTransactionCount(bool pending, bool executed) public view returns (uint256 count) { for (uint256 i = 0; i < transactionCount; i++) - if ( - (pending && !transactions[i].executed) || - (executed && transactions[i].executed) - ) count += 1; + if ((pending && !transactions[i].executed) || (executed && transactions[i].executed)) + count += 1; } /// @dev Returns list of owners. @@ -368,25 +352,20 @@ contract MultiSigWallet { /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return _transactionIds Returns array of transaction IDs. - function getTransactionIds( - uint256 from, - uint256 to, - bool pending, - bool executed - ) public view returns (uint256[] memory _transactionIds) { + function getTransactionIds(uint256 from, uint256 to, bool pending, bool executed) + public + view + returns (uint256[] memory _transactionIds) + { uint256[] memory transactionIdsTemp = new uint256[](transactionCount); uint256 count = 0; uint256 i; for (i = 0; i < transactionCount; i++) - if ( - (pending && !transactions[i].executed) || - (executed && transactions[i].executed) - ) { + if ((pending && !transactions[i].executed) || (executed && transactions[i].executed)) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint256[](to - from); - for (i = from; i < to; i++) - _transactionIds[i - from] = transactionIdsTemp[i]; + for (i = from; i < to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } } diff --git a/contracts/ServiceRegistry.sol b/contracts/ServiceRegistry.sol index fc2b96eee..74e4e3259 100644 --- a/contracts/ServiceRegistry.sol +++ b/contracts/ServiceRegistry.sol @@ -45,10 +45,7 @@ contract ServiceRegistry is Governed { * @param _indexer
- Address of the indexer * @param _url - URL of the service provider */ - function setBootstrapIndexerURL(address _indexer, string calldata _url) - external - onlyGovernor - { + function setBootstrapIndexerURL(address _indexer, string calldata _url) external onlyGovernor { bytes memory url = bytes(_url); bootstrapIndexerURLs[_indexer] = url; emit ServiceUrlSet(_indexer, _url); diff --git a/contracts/channel/funding/proxies/Proxy.sol b/contracts/channel/funding/proxies/Proxy.sol deleted file mode 100644 index efbf2197b..000000000 --- a/contracts/channel/funding/proxies/Proxy.sol +++ /dev/null @@ -1,33 +0,0 @@ -pragma solidity ^0.6.4; - - -/// @title Proxy - Generic proxy contract allows to execute all transactions applying the code of a master contract. -/// @author Stefan George - -/// @author Richard Meissner - -contract Proxy { - // masterCopy always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated. - // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt` - address internal masterCopy; - - /// @dev Constructor function sets address of master copy contract. - /// @param _masterCopy Master copy address. - constructor(address _masterCopy) public { - require(_masterCopy != address(0), "Invalid master copy address provided"); - masterCopy = _masterCopy; - } - - /// @dev Fallback function forwards all transactions and returns all received return data. - fallback() external payable { - // solium-disable-next-line security/no-inline-assembly - assembly { - let _masterCopy := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff) - calldatacopy(0, 0, calldatasize()) - let success := delegatecall(gas(), _masterCopy, 0, calldatasize(), 0, 0) - returndatacopy(0, 0, returndatasize()) - if eq(success, 0) { - revert(0, returndatasize()) - } - return(0, returndatasize()) - } - } -} diff --git a/contracts/channel/funding/proxies/ProxyFactory.sol b/contracts/channel/funding/proxies/ProxyFactory.sol deleted file mode 100644 index 23bf75281..000000000 --- a/contracts/channel/funding/proxies/ProxyFactory.sol +++ /dev/null @@ -1,97 +0,0 @@ -pragma solidity ^0.6.4; - -import "./Proxy.sol"; - - -/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction. -/// @author Stefan George - -contract ProxyFactory { - event ProxyCreation(Proxy proxy); - - /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce` - /// This method is only meant for address calculation purpose when you use an initializer that would revert, - /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory. - /// @param _mastercopy Address of master copy. - /// @param initializer Payload for message call sent to new proxy contract. - /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract. - function calculateCreateProxyWithNonceAddress( - address _mastercopy, - bytes calldata initializer, - uint256 saltNonce - ) external returns (Proxy proxy) { - proxy = deployProxyWithNonce(_mastercopy, initializer, saltNonce); - revert(string(abi.encodePacked(proxy))); - } - - /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction. - /// @param masterCopy Address of master copy. - /// @param data Payload for message call sent to new proxy contract. - function createProxy(address masterCopy, bytes memory data) public returns (Proxy proxy) { - proxy = new Proxy(masterCopy); - if (data.length > 0) { - // solium-disable-next-line security/no-inline-assembly - assembly { - if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) { - revert(0, 0) - } - } - } - emit ProxyCreation(proxy); - } - - /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed. - function proxyRuntimeCode() public pure returns (bytes memory) { - return type(Proxy).runtimeCode; - } - - /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address. - function proxyCreationCode() public pure returns (bytes memory) { - return type(Proxy).creationCode; - } - - /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction. - /// @param _mastercopy Address of master copy. - /// @param initializer Payload for message call sent to new proxy contract. - /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract. - function createProxyWithNonce(address _mastercopy, bytes memory initializer, uint256 saltNonce) - public - returns (Proxy proxy) - { - proxy = deployProxyWithNonce(_mastercopy, initializer, saltNonce); - if (initializer.length > 0) { - // solium-disable-next-line security/no-inline-assembly - assembly { - if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) { - revert(0, 0) - } - } - } - emit ProxyCreation(proxy); - } - - /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer. - /// This method is only meant as an utility to be called from other methods - /// @param _mastercopy Address of master copy. - /// @param initializer Payload for message call sent to new proxy contract. - /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract. - function deployProxyWithNonce(address _mastercopy, bytes memory initializer, uint256 saltNonce) - internal - returns (Proxy proxy) - { - // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it - bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce)); - - bytes memory deploymentData = abi.encodePacked( - type(Proxy).creationCode, - uint256(_mastercopy) - ); - // solium-disable-next-line security/no-inline-assembly - assembly { - proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt) - let codeSize := extcodesize(proxy) - if eq(codeSize, 0) { - revert(0, 0) - } - } - } -} diff --git a/contracts/channel/funding/state-deposit-holders/MinimumViableMultisig.sol b/contracts/channel/funding/state-deposit-holders/MinimumViableMultisig.sol deleted file mode 100644 index b2e92400b..000000000 --- a/contracts/channel/funding/state-deposit-holders/MinimumViableMultisig.sol +++ /dev/null @@ -1,121 +0,0 @@ -pragma solidity ^0.6.4; -pragma experimental ABIEncoderV2; - -import "./MultisigData.sol"; -import "../../shared/libs/LibCommitment.sol"; -import "../../shared/libs/LibChannelCrypto.sol"; - - -/// @title MinimumViableMultisig - A multisig wallet supporting the minimum -/// features required for state channels support -/// @author Liam Horne - -/// @notice -/// (a) Executes arbitrary transactions using `CALL` or `DELEGATECALL` -/// (b) Requires n-of-n unanimous consent -/// (c) Does not use on-chain address for signature verification -/// (d) Uses hash-based instead of nonce-based replay protection -contract MinimumViableMultisig is MultisigData, LibCommitment { - using LibChannelCrypto for bytes32; - - mapping(bytes32 => bool) isExecuted; - - address[] private _owners; - - enum Operation { Call, DelegateCall } - - fallback() external payable {} - - /// @notice Contract constructor - /// @param owners An array of unique addresses representing the multisig owners - function setup(address[] memory owners) public { - require(_owners.length == 0, "Contract has been set up before"); - _owners = owners; - } - - /// @notice Execute an n-of-n signed transaction specified by a (to, value, data, op) tuple - /// This transaction is a message call, i.e., either a CALL or a DELEGATECALL, - /// depending on the value of `op`. The arguments `to`, `value`, `data` are passed - /// as arguments to the CALL/DELEGATECALL. - /// @param to The destination address of the message call - /// @param value The amount of ETH being forwarded in the message call - /// @param data Any calldata being sent along with the message call - /// @param operation Specifies whether the message call is a `CALL` or a `DELEGATECALL` - /// @param signatures A sorted bytes string of concatenated signatures of each owner - function execTransaction( - address to, - uint256 value, - bytes memory data, - Operation operation, - bytes[] memory signatures - ) public { - bytes32 transactionHash = getTransactionHash(to, value, data, operation); - require(!isExecuted[transactionHash], "Transacation has already been executed"); - - isExecuted[transactionHash] = true; - - for (uint256 i = 0; i < _owners.length; i++) { - require( - _owners[i] == transactionHash.verifyChannelMessage(signatures[i]), - "Invalid signature" - ); - } - - execute(to, value, data, operation); - } - - /// @notice Compute a unique transaction hash for a particular (to, value, data, op) tuple - /// @return A unique hash that owners are expected to sign and submit to - /// @notice Note that two transactions with identical values of (to, value, data, op) - /// are not distinguished. - function getTransactionHash(address to, uint256 value, bytes memory data, Operation operation) - public - view - returns (bytes32) - { - return - keccak256( - abi.encodePacked( - uint8(CommitmentTarget.MULTISIG), - address(this), - to, - value, - keccak256(data), - uint8(operation) - ) - ); - } - - /// @notice A getter function for the owners of the multisig - /// @return An array of addresses representing the owners - function getOwners() public view returns (address[] memory) { - return _owners; - } - - /// @notice Execute a transaction on behalf of the multisignature wallet - function execute(address to, uint256 value, bytes memory data, Operation operation) internal { - if (operation == Operation.Call) { - require(executeCall(to, value, data), "executeCall failed"); - } else if (operation == Operation.DelegateCall) { - require(executeDelegateCall(to, data), "executeDelegateCall failed"); - } - } - - /// @notice Execute a CALL on behalf of the multisignature wallet - /// @return success A boolean indicating if the transaction was successful or not - function executeCall(address to, uint256 value, bytes memory data) - internal - returns (bool success) - { - assembly { - success := call(not(0), to, value, add(data, 0x20), mload(data), 0, 0) - } - } - - /// @notice Execute a DELEGATECALL on behalf of the multisignature wallet - /// @return success A boolean indicating if the transaction was successful or not - function executeDelegateCall(address to, bytes memory data) internal returns (bool success) { - assembly { - success := delegatecall(not(0), to, add(data, 0x20), mload(data), 0, 0) - } - } -} diff --git a/contracts/channel/funding/state-deposit-holders/MultisigData.sol b/contracts/channel/funding/state-deposit-holders/MultisigData.sol deleted file mode 100644 index 4d3766208..000000000 --- a/contracts/channel/funding/state-deposit-holders/MultisigData.sol +++ /dev/null @@ -1,15 +0,0 @@ -pragma solidity ^0.6.4; -pragma experimental ABIEncoderV2; - - -/// @title MultisigData - data that is kept in the multisig -/// and needs to be made available to contracts that the -/// multisig delegatecalls to, e.g. interpreters. -contract MultisigData { - // The masterCopy address must occupy the first slot, - // because we're using the multisig as a proxy. - // Don't move or remove the following line! - address masterCopy; - - mapping(address => uint256) public totalAmountWithdrawn; -} diff --git a/contracts/channel/shared/libs/LibChannelCrypto.sol b/contracts/channel/shared/libs/LibChannelCrypto.sol deleted file mode 100644 index a328d226d..000000000 --- a/contracts/channel/shared/libs/LibChannelCrypto.sol +++ /dev/null @@ -1,22 +0,0 @@ -pragma solidity ^0.6.4; -pragma experimental ABIEncoderV2; - -import "@openzeppelin/contracts/cryptography/ECDSA.sol"; - - -library LibChannelCrypto { - function verifyChannelMessage(bytes32 hash, bytes memory signature) - internal - pure - returns (address) - { - bytes32 digest = toChannelSignedMessage(hash); - return ECDSA.recover(digest, signature); - } - - function toChannelSignedMessage(bytes32 hash) internal pure returns (bytes32) { - // 32 is the length in bytes of hash, - // enforced by the type signature above - return keccak256(abi.encodePacked("\x15Indra Signed Message:\n32", hash)); - } -} diff --git a/contracts/channel/shared/libs/LibCommitment.sol b/contracts/channel/shared/libs/LibCommitment.sol deleted file mode 100644 index 66acc5e9e..000000000 --- a/contracts/channel/shared/libs/LibCommitment.sol +++ /dev/null @@ -1,10 +0,0 @@ -pragma solidity ^0.6.4; -pragma experimental ABIEncoderV2; - - -/// @title LibCommitment -/// @notice Contains stuff that's useful for commitments -contract LibCommitment { - // An ID for each commitment type - enum CommitmentTarget { MULTISIG, SET_STATE, CANCEL_DISPUTE } -} diff --git a/contracts/libs/Stakes.sol b/contracts/libs/Stakes.sol index a781b239c..bc50fb4b7 100644 --- a/contracts/libs/Stakes.sol +++ b/contracts/libs/Stakes.sol @@ -230,9 +230,7 @@ library Stakes { uint256 _maxEpochs ) internal view returns (uint256) { uint256 tokens = alloc.tokens; - return - (_maxEpochs > 0 && _numEpochs > _maxEpochs) - ? tokens.mul(_maxEpochs) - : tokens.mul(_numEpochs); + bool shouldCap = _maxEpochs > 0 && _numEpochs > _maxEpochs; + return (shouldCap) ? tokens.mul(_maxEpochs) : tokens.mul(_numEpochs); } } diff --git a/package-lock.json b/package-lock.json index 95ff58505..f5dbdf992 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,15 @@ "js-tokens": "^4.0.0" } }, + "@babel/runtime": { + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz", + "integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, "@openzeppelin/contract-loader": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@openzeppelin/contract-loader/-/contract-loader-0.4.0.tgz", @@ -140,6 +149,15 @@ } } }, + "@samverschueren/stream-to-observable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz", + "integrity": "sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg==", + "dev": true, + "requires": { + "any-observable": "^0.3.0" + } + }, "@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -314,6 +332,12 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.17.tgz", "integrity": "sha512-gpNnRnZP3VWzzj5k3qrpRC6Rk3H/uclhAVo1aIvwzK5p5cOrs9yEyQ8H/HBsBY0u5rrWxXEiVPQ0dEB6pkjE8Q==" }, + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, "@types/prettier": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-1.19.0.tgz", @@ -413,6 +437,16 @@ "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ajv": { "version": "6.12.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", @@ -457,6 +491,12 @@ "color-convert": "^1.9.0" } }, + "any-observable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/any-observable/-/any-observable-0.3.0.tgz", + "integrity": "sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog==", + "dev": true + }, "any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", @@ -1182,6 +1222,12 @@ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, "cids": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.4.tgz", @@ -1251,6 +1297,12 @@ } } }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", @@ -1259,6 +1311,60 @@ "restore-cursor": "^3.1.0" } }, + "cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "requires": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "slice-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + } + } + }, "cli-width": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", @@ -1440,6 +1546,12 @@ "graceful-readlink": ">= 1.0.0" } }, + "compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", + "dev": true + }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -1548,6 +1660,39 @@ "vary": "^1" } }, + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + }, + "dependencies": { + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + } + } + }, "create-ecdh": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", @@ -1741,6 +1886,12 @@ } } }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -1767,6 +1918,23 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "^1.0.2" + }, + "dependencies": { + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + } + } + }, "defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", @@ -1963,6 +2131,12 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, + "elegant-spinner": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-2.0.0.tgz", + "integrity": "sha512-5YRYHhvhYzV/FC4AiMdeSIg3jAYGq9xFvbhZMpPlJoBsfYgrw2DSCYeXfat6tYBu45PWiyRr3+flaCPPmviPaA==", + "dev": true + }, "elliptic": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", @@ -2012,6 +2186,15 @@ "once": "^1.4.0" } }, + "enquirer": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.5.tgz", + "integrity": "sha512-BNT1C08P9XD0vNg3J475yIUG+mVdp9T6towYFHUv897X0KoHBjB1shyrNmhmtHWKP17iSWgo7Gqh7BBuzLZMSA==", + "dev": true, + "requires": { + "ansi-colors": "^3.2.1" + } + }, "env-variable": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/env-variable/-/env-variable-0.0.6.tgz", @@ -3194,6 +3377,15 @@ "path-exists": "^4.0.0" } }, + "find-versions": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", + "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", + "dev": true, + "requires": { + "semver-regex": "^2.0.0" + } + }, "flat-cache": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", @@ -3878,6 +4070,12 @@ "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=" }, + "get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", + "dev": true + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -4205,6 +4403,91 @@ "sshpk": "^1.7.0" } }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true + }, + "husky": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz", + "integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "compare-versions": "^3.6.0", + "cosmiconfig": "^6.0.0", + "find-versions": "^3.2.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^4.2.0", + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", + "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -4257,6 +4540,12 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -4831,6 +5120,12 @@ "kind-of": "^3.0.2" } }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, "is-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", @@ -4889,6 +5184,12 @@ "has": "^1.0.3" } }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", + "dev": true + }, "is-retry-allowed": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", @@ -5089,6 +5390,12 @@ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -5444,6 +5751,302 @@ } } }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "lint-staged": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.2.0.tgz", + "integrity": "sha512-4Dw2XMtEOGpICl0wvicE5KT/eFlt/kmwMmpNS4v09I/ywRWuR5udbMWjdfZez24jE6r0bQmPpkLZ1+wUGE1S+w==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "commander": "^5.0.0", + "cosmiconfig": "^6.0.0", + "debug": "^4.1.1", + "dedent": "^0.7.0", + "execa": "^4.0.0", + "listr2": "1.3.8", + "log-symbols": "^3.0.0", + "micromatch": "^4.0.2", + "normalize-path": "^3.0.0", + "please-upgrade-node": "^3.2.0", + "string-argv": "0.3.1", + "stringify-object": "^3.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", + "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", + "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "execa": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.0.tgz", + "integrity": "sha512-JbDUxwV3BoT5ZVXQrSVbAiaXhXUkIwvbhPIwZ0N13kX+5yCzOhUNdocxB/UQRuYOHRYYwAxKYwJYc0T4D12pDA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "get-stream": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", + "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "listr2": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-1.3.8.tgz", + "integrity": "sha512-iRDRVTgSDz44tBeBBg/35TQz4W+EZBWsDUq7hPpqeUHm7yLPNll0rkwW3lIX9cPAK7l+x95mGWLpxjqxftNfZA==", + "dev": true, + "requires": { + "@samverschueren/stream-to-observable": "^0.3.0", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-truncate": "^2.1.0", + "elegant-spinner": "^2.0.0", + "enquirer": "^2.3.4", + "figures": "^3.2.0", + "indent-string": "^4.0.0", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "pad": "^3.2.0", + "rxjs": "^6.3.3", + "through": "^2.3.8", + "uuid": "^7.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "uuid": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", + "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==", + "dev": true + } + } + }, "load-json-file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", @@ -5484,6 +6087,91 @@ "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", "dev": true }, + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2" + } + }, + "log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + } + } + }, "logform": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/logform/-/logform-2.1.2.tgz", @@ -5662,6 +6350,12 @@ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "merkle-patricia-tree": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", @@ -6385,10 +7079,11 @@ "mimic-fn": "^2.1.0" } }, - "openzeppelin-solidity": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-2.5.0.tgz", - "integrity": "sha512-I0yRC3nff9Kn2LDWuz02fuw0EuomVQ9Z8lHzdqh8P9BiOUzIk8frQRxn/a1Kva3StF6hwPP+Dh3/SQ2ily1Pow==" + "opencollective-postinstall": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", + "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==", + "dev": true }, "optimist": { "version": "0.3.7", @@ -6459,6 +7154,15 @@ "p-limit": "^2.2.0" } }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-timeout": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", @@ -6472,6 +7176,15 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, + "pad": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/pad/-/pad-3.2.0.tgz", + "integrity": "sha512-2u0TrjcGbOjBTJpyewEl4hBO3OeX5wWue7eIFPzQTg6wFSvoaHcBTTUY5m+n0hd04gmTCPuY0kCpVIVuw5etwg==", + "dev": true, + "requires": { + "wcwidth": "^1.0.1" + } + }, "pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", @@ -6680,6 +7393,12 @@ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -6751,6 +7470,15 @@ } } }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" + } + }, "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", @@ -7418,6 +8146,12 @@ } } }, + "regenerator-runtime": { + "version": "0.13.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true + }, "regex-cache": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", @@ -7741,6 +8475,18 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "semver-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", + "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", + "dev": true + }, "send": { "version": "0.17.1", "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", @@ -7912,6 +8658,12 @@ } } }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, "slice-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", @@ -8598,6 +9350,12 @@ "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" }, + "string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true + }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -8661,6 +9419,17 @@ } } }, + "stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, + "requires": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + } + }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -8695,6 +9464,12 @@ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, "strip-hex-prefix": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", @@ -9527,6 +10302,15 @@ "extsprintf": "^1.2.0" } }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dev": true, + "requires": { + "defaults": "^1.0.3" + } + }, "web3": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.6.tgz", @@ -10495,6 +11279,32 @@ "underscore": "1.9.1", "web3-core-helpers": "1.2.1", "websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "websocket": { + "version": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e", + "from": "github:web3-js/WebSocket-Node#polyfill/globalThis", + "requires": { + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "nan": "^2.14.0", + "typedarray-to-buffer": "^3.1.5", + "yaeti": "^0.0.6" + } + } } }, "web3-shh": { @@ -10580,6 +11390,12 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, "window-size": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", @@ -10789,6 +11605,15 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, + "yaml": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.9.2.tgz", + "integrity": "sha512-HPT7cGGI0DuRcsO51qC1j9O16Dh1mZ2bnXwsi0jrSpsLz0WxOLSLXfkABVl6bZO629py3CU+OMJtpNHDLB97kg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.9.2" + } + }, "yargs": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.1.2.tgz", diff --git a/package.json b/package.json index f988e61c1..3c6f5d383 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,9 @@ }, "devDependencies": { "ethlint": "^1.2.5", + "husky": "^4.2.5", "ipfs-http-client": "34.0.0", + "lint-staged": "^10.2.0", "prettier": "^1.19.1", "truffle-abi": "^1.0.3", "truffle-assertions": "^0.9.2", @@ -35,7 +37,9 @@ }, "scripts": { "build": "npm run compile && npm run flatten && npm run abi:extract", - "compile": "truffle compile", + "clean": "rm -rf build/contracts", + "compile": "truffle compile --all", + "migrate": "truffle migrate", "test": "truffle test", "lint": "npm run lint:js && npm run lint:sol", "lint:fix": "npm run lint:js:fix && npm run lint:sol:fix", @@ -43,11 +47,27 @@ "lint:js:fix": "eslint . --fix", "lint:sol": "solium --dir ./contracts", "lint:sol:fix": "solium --dir ./contracts --fix", - "prettier": "prettier --write 'contracts/*.sol' 'test/**/*.js'", + "prettier": "npm run prettier:js && npm run prettier:sol", + "prettier:js": "prettier --write 'test/**/*.js'", + "prettier:sol": "prettier --write 'contracts/*.sol'", "flatten": "scripts/flatten.sh", "abi:extract": "truffle-abi -d ./build/contracts -o ./build/abis/ -v", "typechain": "typechain --target=ethers --outDir build/typechain/contracts/ ./build/abis/**/*.json" }, + "lint-staged": { + "contracts/*.sol": [ + "prettier --write" + ], + "test/**/*.js": [ + "prettier --write" + ] + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged", + "pre-push": "git diff HEAD --quiet && npm run lint && npm test" + } + }, "repository": { "type": "git", "url": "git+https://github.com/graphprotocol/contracts.git" diff --git a/test/gns.test.js b/test/gns.test.js index 9a3e3b8e7..a389f2e65 100644 --- a/test/gns.test.js +++ b/test/gns.test.js @@ -29,10 +29,7 @@ contract('GNS', accounts => { from: accounts[1], }) const domain = await deployedGNS.domains(topLevelDomainHash) - assert( - (await domain.owner) === accounts[1], - 'Name was not registered properly.', - ) + assert((await domain.owner) === accounts[1], 'Name was not registered properly.') expectEvent.inLogs(logs, 'DomainAdded', { topLevelDomainHash: topLevelDomainHash, @@ -50,17 +47,11 @@ contract('GNS', accounts => { }) it('...should allow a user to create a subgraph only once, and not allow a different user to do so. ', async () => { - const { logs } = await deployedGNS.createSubgraph( - topLevelDomainHash, - subdomainName, - ipfsHash, - { from: accounts[1] }, - ) + const { logs } = await deployedGNS.createSubgraph(topLevelDomainHash, subdomainName, ipfsHash, { + from: accounts[1], + }) const domain = await deployedGNS.domains(hashedSubdomain) - assert( - (await domain.owner) === accounts[1], - 'Subdomain was not created properly.', - ) + assert((await domain.owner) === accounts[1], 'Subdomain was not created properly.') expectEvent.inLogs(logs, 'SubgraphCreated', { topLevelDomainHash: topLevelDomainHash, @@ -91,11 +82,9 @@ contract('GNS', accounts => { }) it('...should allow a user to update a subgraphID, and not allow a different user to do so. ', async () => { - const { logs } = await deployedGNS.updateDomainSubgraphID( - hashedSubdomain, - subgraphID, - { from: accounts[1] }, - ) + const { logs } = await deployedGNS.updateDomainSubgraphID(hashedSubdomain, subgraphID, { + from: accounts[1], + }) const domain = await deployedGNS.domains(hashedSubdomain) assert( (await domain.subgraphID) === web3.utils.bytesToHex(subgraphID), @@ -117,11 +106,9 @@ contract('GNS', accounts => { }) it('...should allow subgraph metadata to be updated', async () => { - const { logs } = await deployedGNS.changeSubgraphMetadata( - hashedSubdomain, - ipfsHash, - { from: accounts[1] }, - ) + const { logs } = await deployedGNS.changeSubgraphMetadata(hashedSubdomain, ipfsHash, { + from: accounts[1], + }) expectEvent.inLogs(logs, 'SubgraphMetadataChanged', { domainHash: hashedSubdomain, @@ -138,11 +125,9 @@ contract('GNS', accounts => { }) it('...should allow a user to transfer a domain', async () => { - const { logs } = await deployedGNS.transferDomainOwnership( - hashedSubdomain, - accounts[2], - { from: accounts[1] }, - ) + const { logs } = await deployedGNS.transferDomainOwnership(hashedSubdomain, accounts[2], { + from: accounts[1], + }) expectEvent.inLogs(logs, 'DomainTransferred', { domainHash: hashedSubdomain, @@ -173,14 +158,8 @@ contract('GNS', accounts => { }) const deletedDomain = await deployedGNS.domains(hashedSubdomain) - assert( - deletedDomain.subgraphID === helpers.zeroHex(), - 'SubgraphID was not deleted', - ) - assert( - deletedDomain.owner === helpers.zeroAddress(), - 'Owner was not removed', - ) + assert(deletedDomain.subgraphID === helpers.zeroHex(), 'SubgraphID was not deleted') + assert(deletedDomain.owner === helpers.zeroAddress(), 'Owner was not removed') }) it('...should allow account metadata event to be emitted ', async () => { diff --git a/test/governance.test.js b/test/governance.test.js index 1b598a984..517e05f55 100644 --- a/test/governance.test.js +++ b/test/governance.test.js @@ -23,24 +23,18 @@ contract('Governance', accounts => { ) // Deploy a Governed contract with multiSigInstance1 as the `governor` - this.governedContractInstance = await ServiceRegistry.new( - multiSigInstance1.address, - ) + this.governedContractInstance = await ServiceRegistry.new(multiSigInstance1.address) }) it('...should be governed by MultiSigWallet #1', async () => { const governor = await this.governedContractInstance.governor.call() - assert( - governor === multiSigInstance1.address, - 'MultiSigWallet1 is not the governor.', - ) + assert(governor === multiSigInstance1.address, 'MultiSigWallet1 is not the governor.') }) it('...should be able to transfer governance of self to MultiSigWallet #2', async () => { - const txData = gp.abiEncode( - this.governedContractInstance.contract.methods.transferOwnership, - [multiSigInstance2.address], - ) + const txData = gp.abiEncode(this.governedContractInstance.contract.methods.transferOwnership, [ + multiSigInstance2.address, + ]) assert(txData.length, 'Transaction data was not constructed.') // Submit the transaction to the multisig for confirmation @@ -64,10 +58,7 @@ contract('Governance', accounts => { true, // include pending false, // include executed ) - assert( - pendingTransactionCount.toNumber() === 1, - 'Transaction is not pending.', - ) + assert(pendingTransactionCount.toNumber() === 1, 'Transaction is not pending.') // Confirm transaction from a second multisig owner account await multiSigInstance1.contract.methods @@ -79,24 +70,14 @@ contract('Governance', accounts => { true, // include pending false, // include executed ) - assert( - pendingTransactionCount.toNumber() === 0, - 'Transaction is not pending.', - ) + assert(pendingTransactionCount.toNumber() === 0, 'Transaction is not pending.') // Check that we now have 2 confirmations - const confirmations = await multiSigInstance1.getConfirmations( - transactionId.toNumber(), - ) - assert( - confirmations.length === 2, - 'Transaction does not have 2 confirmations.', - ) + const confirmations = await multiSigInstance1.getConfirmations(transactionId.toNumber()) + assert(confirmations.length === 2, 'Transaction does not have 2 confirmations.') // Check that transaction status is `confirmed` - const isConfirmed = await multiSigInstance1.isConfirmed( - transactionId.toNumber(), - ) + const isConfirmed = await multiSigInstance1.isConfirmed(transactionId.toNumber()) assert(isConfirmed, 'Transaction is not confirmed.') // Check that 1 transaction has been `executed` @@ -104,10 +85,7 @@ contract('Governance', accounts => { false, // include pending true, // include executed ) - assert( - executedTransactionCount.toNumber() === 1, - 'Transaction has not been executed.', - ) + assert(executedTransactionCount.toNumber() === 1, 'Transaction has not been executed.') // Governor of the upgradable contract should now be the second multisig contract assert.equal( diff --git a/test/lib/attestation.js b/test/lib/attestation.js index 085a1a9be..6c4dcf34c 100644 --- a/test/lib/attestation.js +++ b/test/lib/attestation.js @@ -35,10 +35,7 @@ function createAttestationHash(attestation) { // ABI encoded return web3.utils.sha3( - web3.eth.abi.encodeParameters( - ['bytes32', 'bytes'], - [attestationTypeHash, attestation], - ), + web3.eth.abi.encodeParameters(['bytes32', 'bytes'], [attestationTypeHash, attestation]), ) } @@ -54,21 +51,13 @@ function createDomainSeparatorHash(contractAddress) { return web3.utils.sha3( web3.eth.abi.encodeParameters( ['bytes32', 'bytes32', 'bytes32', 'uint256', 'address'], - [ - domainTypeHash, - domainNameHash, - domainVersionHash, - chainId, - contractAddress, - ], + [domainTypeHash, domainNameHash, domainVersionHash, chainId, contractAddress], ), ) } function createMessage(domainSeparatorHash, attestationHash) { - return ( - '0x1901' + domainSeparatorHash.substring(2) + attestationHash.substring(2) - ) + return '0x1901' + domainSeparatorHash.substring(2) + attestationHash.substring(2) } function createPayload(subgraphId, attestation, messageSig) { diff --git a/test/serviceRegisty.test.js b/test/serviceRegisty.test.js index 0c407c409..f65f4496a 100644 --- a/test/serviceRegisty.test.js +++ b/test/serviceRegisty.test.js @@ -52,13 +52,9 @@ contract('Service Registry', accounts => { for (let i = 0; i < 3; i++) { // Set the url, only governor can - const { - logs, - } = await deployedServiceRegistry.setBootstrapIndexerURL( - indexers[i], - url, - { from: governor }, - ) + const { logs } = await deployedServiceRegistry.setBootstrapIndexerURL(indexers[i], url, { + from: governor, + }) // Verify that the the ServiceUrlSet event is emitted expectEvent.inLogs(logs, 'ServiceUrlSet', { @@ -67,13 +63,8 @@ contract('Service Registry', accounts => { }) // Verify that the indexer URL has been updated - const indexerUrlBytes = await deployedServiceRegistry.bootstrapIndexerURLs( - indexers[i], - ) - assert( - indexerUrlBytes === urlBytes, - `Indexer ${i} URL was not set to ${url}`, - ) + const indexerUrlBytes = await deployedServiceRegistry.bootstrapIndexerURLs(indexers[i]) + assert(indexerUrlBytes === urlBytes, `Indexer ${i} URL was not set to ${url}`) } }) }) diff --git a/test/subgraph/gns.subgraph.test.js b/test/subgraph/gns.subgraph.test.js index 78ea7e60f..37c9f13cf 100644 --- a/test/subgraph/gns.subgraph.test.js +++ b/test/subgraph/gns.subgraph.test.js @@ -24,20 +24,12 @@ contract('GNS', accounts => { // if (i % 10 === 0 && i !== 0) { // accountCount++ // } - const { logs } = await deployedGNS.registerDomain( - helpers.topLevelDomainNames[i], - { - from: accounts[accountCount], - }, - ) - const topLevelDomainHash = web3.utils.soliditySha3( - helpers.topLevelDomainNames[i], - ) + const { logs } = await deployedGNS.registerDomain(helpers.topLevelDomainNames[i], { + from: accounts[accountCount], + }) + const topLevelDomainHash = web3.utils.soliditySha3(helpers.topLevelDomainNames[i]) const domain = await deployedGNS.domains(topLevelDomainHash) - assert( - domain.owner === accounts[accountCount], - 'Name was not registered properly.', - ) + assert(domain.owner === accounts[accountCount], 'Name was not registered properly.') expectEvent.inLogs(logs, 'DomainAdded', { topLevelDomainHash: topLevelDomainHash, @@ -57,9 +49,7 @@ contract('GNS', accounts => { it('...should allow multiple subdomains to be registered to tlds ', async () => { let accountCount = 0 for (let i = 0; i < 10; i++) { - const topLevelDomainHash = web3.utils.soliditySha3( - helpers.topLevelDomainNames[i], - ) + const topLevelDomainHash = web3.utils.soliditySha3(helpers.topLevelDomainNames[i]) const ipfsHash = helpers.testIPFSHashes[i] // Not in use, use when testing more than 10 in the loop @@ -82,10 +72,7 @@ contract('GNS', accounts => { topLevelDomainHash, ) const subdomain = await deployedGNS.domains(hashedSubdomain) - assert( - subdomain.owner === accounts[accountCount], - 'Subdomain was not created properly.', - ) + assert(subdomain.owner === accounts[accountCount], 'Subdomain was not created properly.') expectEvent.inLogs(logs, 'SubgraphCreated', { topLevelDomainHash: topLevelDomainHash, @@ -98,17 +85,11 @@ contract('GNS', accounts => { ipfsHash: ipfsHash, }) } else { - const { logs } = await deployedGNS.createSubgraph( - topLevelDomainHash, - '', - ipfsHash, - { from: accounts[accountCount] }, - ) + const { logs } = await deployedGNS.createSubgraph(topLevelDomainHash, '', ipfsHash, { + from: accounts[accountCount], + }) const domain = await deployedGNS.domains(topLevelDomainHash) - assert( - domain.owner === accounts[accountCount], - 'Subdomain was not created properly.', - ) + assert(domain.owner === accounts[accountCount], 'Subdomain was not created properly.') expectEvent.inLogs(logs, 'SubgraphCreated', { topLevelDomainHash: topLevelDomainHash, @@ -127,18 +108,14 @@ contract('GNS', accounts => { it('...should register 10 subgraph ids for 10 different subgraphs. ', async () => { for (let i = 0; i < 10; i++) { - const topLevelDomainHash = web3.utils.soliditySha3( - helpers.topLevelDomainNames[i], - ) + const topLevelDomainHash = web3.utils.soliditySha3(helpers.topLevelDomainNames[i]) const hashedSubdomain = web3.utils.soliditySha3( web3.utils.soliditySha3(helpers.subdomainNames[i]), topLevelDomainHash, ) if (i % 2 === 0) { - const { - logs, - } = await deployedGNS.updateDomainSubgraphID( + const { logs } = await deployedGNS.updateDomainSubgraphID( hashedSubdomain, helpers.testSubgraphIDs[i], { from: accounts[i] }, @@ -153,9 +130,7 @@ contract('GNS', accounts => { subgraphID: helpers.testSubgraphIDs[i], }) } else { - const { - logs, - } = await deployedGNS.updateDomainSubgraphID( + const { logs } = await deployedGNS.updateDomainSubgraphID( topLevelDomainHash, helpers.testSubgraphIDs[i], { from: accounts[i] }, @@ -175,9 +150,7 @@ contract('GNS', accounts => { it('...should update the 5 tlds with no data to test data from scaffold-metadata.json', async () => { for (let i = 0; i < 10; i++) { - const topLevelDomainHash = web3.utils.soliditySha3( - helpers.topLevelDomainNames[i], - ) + const topLevelDomainHash = web3.utils.soliditySha3(helpers.topLevelDomainNames[i]) if (i % 2 === 0) { const { logs } = await deployedGNS.changeSubgraphMetadata( topLevelDomainHash, @@ -187,17 +160,14 @@ contract('GNS', accounts => { expectEvent.inLogs(logs, 'SubgraphMetadataChanged', { domainHash: topLevelDomainHash, - ipfsHash: - '0xe2f321f2a488e2cae1a05229f730be3cc77b730246cc08641e515afda0fe0ba6', + ipfsHash: '0xe2f321f2a488e2cae1a05229f730be3cc77b730246cc08641e515afda0fe0ba6', }) } } }) it('...should delete the melonport subgraph', async () => { - const topLevelDomainHash = web3.utils.soliditySha3( - helpers.topLevelDomainNames[6], - ) + const topLevelDomainHash = web3.utils.soliditySha3(helpers.topLevelDomainNames[6]) const hashedSubdomain = web3.utils.soliditySha3( web3.utils.soliditySha3(helpers.subdomainNames[6]), topLevelDomainHash, @@ -211,14 +181,8 @@ contract('GNS', accounts => { }) const deletedDomain = await deployedGNS.domains(hashedSubdomain) - assert( - deletedDomain.subgraphID === helpers.zeroHex(), - 'SubgraphID was not deleted', - ) - assert( - deletedDomain.owner === helpers.zeroAddress(), - 'Owner was not removed', - ) + assert(deletedDomain.subgraphID === helpers.zeroHex(), 'SubgraphID was not deleted') + assert(deletedDomain.owner === helpers.zeroAddress(), 'Owner was not removed') }) }) diff --git a/test/transactionEncoding.test.js b/test/transactionEncoding.test.js index 5aa865ce5..875a17219 100644 --- a/test/transactionEncoding.test.js +++ b/test/transactionEncoding.test.js @@ -31,22 +31,13 @@ contract('NPM Module', ([deployment, governor, ...accounts]) => { urlToRegister, // url ) .encodeABI() - assert( - directlyEncodedAbiTxData.length, - 'Transaction data was not encoded via encodeABI.', - ) + assert(directlyEncodedAbiTxData.length, 'Transaction data was not encoded via encodeABI.') // encode transaction data using graphProtocol.js - const moduleEncodedTxData = gp.abiEncode( - deployedServiceRegistry.contract.methods.setUrl, - [ - urlToRegister, // url - ], - ) - assert( - moduleEncodedTxData.length, - 'Transaction data was not encoded via gp.abiEncode.', - ) + const moduleEncodedTxData = gp.abiEncode(deployedServiceRegistry.contract.methods.setUrl, [ + urlToRegister, // url + ]) + assert(moduleEncodedTxData.length, 'Transaction data was not encoded via gp.abiEncode.') // both methods should return the same data assert(