From 38536f42f44c8869f2383bdf3e82d28de875aee3 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 18 Apr 2018 13:39:41 -0300 Subject: [PATCH 1/8] delete contracts and tests not yet in zos --- contracts/Bounty.sol | 72 ---- contracts/DayLimit.sol | 75 ---- contracts/ECRecovery.sol | 76 ---- contracts/LimitBalance.sol | 31 -- contracts/MerkleProof.sol | 35 -- contracts/ReentrancyGuard.sol | 32 -- contracts/access/SignatureBouncer.sol | 90 ----- contracts/crowdsale/Crowdsale.sol | 163 -------- .../distribution/FinalizableCrowdsale.sol | 42 -- .../distribution/PostDeliveryCrowdsale.sol | 37 -- .../distribution/RefundableCrowdsale.sol | 72 ---- .../distribution/utils/RefundVault.sol | 66 ---- .../crowdsale/emission/AllowanceCrowdsale.sol | 42 -- .../crowdsale/emission/MintedCrowdsale.sol | 22 -- .../price/IncreasingPriceCrowdsale.sol | 54 --- .../crowdsale/validation/CappedCrowdsale.sol | 43 -- .../IndividuallyCappedCrowdsale.sol | 76 ---- .../crowdsale/validation/TimedCrowdsale.sol | 58 --- .../validation/WhitelistedCrowdsale.sol | 58 --- contracts/examples/SampleCrowdsale.sol | 55 --- contracts/examples/SimpleSavingsWallet.sol | 40 -- contracts/examples/SimpleToken.sol | 30 -- contracts/lifecycle/Destructible.sol | 25 -- contracts/lifecycle/TokenDestructible.sol | 36 -- contracts/math/Math.sol | 24 -- contracts/mocks/AllowanceCrowdsaleImpl.sol | 21 - contracts/mocks/BouncerMock.sol | 22 -- contracts/mocks/CappedCrowdsaleImpl.sol | 21 - contracts/mocks/DayLimitMock.sol | 25 -- contracts/mocks/ECRecoveryMock.sol | 25 -- contracts/mocks/ERC223TokenMock.sol | 34 -- contracts/mocks/ERC827TokenMock.sol | 15 - contracts/mocks/FinalizableCrowdsaleImpl.sol | 22 -- contracts/mocks/ForceEther.sol | 16 - contracts/mocks/HasNoEtherTest.sol | 12 - .../mocks/IncreasingPriceCrowdsaleImpl.sol | 24 -- .../mocks/IndividuallyCappedCrowdsaleImpl.sol | 19 - contracts/mocks/InsecureTargetBounty.sol | 17 - contracts/mocks/LimitBalanceMock.sol | 13 - contracts/mocks/MerkleProofWrapper.sol | 11 - contracts/mocks/MessageHelper.sol | 25 -- contracts/mocks/MintedCrowdsaleImpl.sol | 19 - contracts/mocks/PostDeliveryCrowdsaleImpl.sol | 22 -- contracts/mocks/PullPaymentMock.sol | 17 - contracts/mocks/RBACMock.sol | 69 ---- contracts/mocks/ReentrancyAttack.sol | 11 - contracts/mocks/ReentrancyMock.sol | 46 --- contracts/mocks/RefundableCrowdsaleImpl.sol | 24 -- contracts/mocks/SecureTargetBounty.sol | 17 - contracts/mocks/TimedCrowdsaleImpl.sol | 22 -- contracts/mocks/WhitelistMock.sol | 14 - contracts/mocks/WhitelistedCrowdsaleImpl.sol | 19 - contracts/ownership/CanReclaimToken.sol | 26 -- contracts/ownership/Claimable.sol | 39 -- contracts/ownership/Contactable.sol | 22 -- contracts/ownership/DelayedClaimable.sol | 40 -- contracts/ownership/HasNoContracts.sol | 22 -- contracts/ownership/HasNoEther.sol | 42 -- contracts/ownership/HasNoTokens.sol | 28 -- contracts/ownership/Heritable.sol | 117 ------ contracts/ownership/NoOwner.sol | 15 - contracts/ownership/Whitelist.sol | 81 ---- contracts/ownership/rbac/RBAC.sol | 108 ----- contracts/ownership/rbac/RBACWithAdmin.sol | 60 --- contracts/ownership/rbac/Roles.sol | 55 --- contracts/payment/PullPayment.sol | 43 -- contracts/payment/SplitPayment.sol | 71 ---- contracts/token/ERC20/CappedToken.sol | 31 -- contracts/token/ERC721/DeprecatedERC721.sol | 15 - contracts/token/ERC827/ERC827.sol | 25 -- contracts/token/ERC827/ERC827Token.sol | 139 ------- test/Bounty.test.js | 111 ------ test/DayLimit.test.js | 88 ----- test/Heritable.test.js | 136 ------- test/LimitBalance.test.js | 47 --- test/ReentrancyGuard.test.js | 31 -- test/SimpleSavingsWallet.test.js | 33 -- test/access/SignatureBouncer.test.js | 119 ------ test/crowdsale/AllowanceCrowdsale.test.js | 77 ---- test/crowdsale/CappedCrowdsale.test.js | 69 ---- test/crowdsale/Crowdsale.test.js | 81 ---- test/crowdsale/FinalizableCrowdsale.test.js | 62 --- .../IncreasingPriceCrowdsale.test.js | 92 ----- .../IndividuallyCappedCrowdsale.test.js | 107 ----- test/crowdsale/MintedCrowdsale.test.js | 61 --- test/crowdsale/PostDeliveryCrowdsale.test.js | 67 ---- test/crowdsale/RefundVault.test.js | 59 --- test/crowdsale/RefundableCrowdsale.test.js | 82 ---- test/crowdsale/TimedCrowdsale.test.js | 62 --- test/crowdsale/WhitelistedCrowdsale.test.js | 93 ----- test/examples/SampleCrowdsale.test.js | 126 ------ test/examples/SimpleToken.test.js | 41 -- test/library/ECRecovery.test.js | 77 ---- test/library/Math.test.js | 43 -- test/library/MerkleProof.test.js | 61 --- test/lifecycle/Destructible.test.js | 23 -- test/lifecycle/TokenDestructible.test.js | 37 -- test/mocks/MathMock.sol | 26 -- test/ownership/CanReclaimToken.test.js | 35 -- test/ownership/Claimable.test.js | 53 --- test/ownership/Contactable.test.js | 28 -- test/ownership/DelayedClaimable.test.js | 55 --- test/ownership/HasNoContracts.test.js | 33 -- test/ownership/HasNoEther.test.js | 64 --- test/ownership/HasNoTokens.test.js | 40 -- test/ownership/Whitelist.test.js | 103 ----- test/ownership/rbac/RBAC.test.js | 98 ----- test/payment/PullPayment.test.js | 71 ---- test/payment/SplitPayment.test.js | 78 ---- test/token/ERC20/CappedToken.test.js | 36 -- test/token/ERC827/ERC827Token.js | 374 ------------------ 111 files changed, 5914 deletions(-) delete mode 100644 contracts/Bounty.sol delete mode 100644 contracts/DayLimit.sol delete mode 100644 contracts/ECRecovery.sol delete mode 100644 contracts/LimitBalance.sol delete mode 100644 contracts/MerkleProof.sol delete mode 100644 contracts/ReentrancyGuard.sol delete mode 100644 contracts/access/SignatureBouncer.sol delete mode 100644 contracts/crowdsale/Crowdsale.sol delete mode 100644 contracts/crowdsale/distribution/FinalizableCrowdsale.sol delete mode 100644 contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol delete mode 100644 contracts/crowdsale/distribution/RefundableCrowdsale.sol delete mode 100644 contracts/crowdsale/distribution/utils/RefundVault.sol delete mode 100644 contracts/crowdsale/emission/AllowanceCrowdsale.sol delete mode 100644 contracts/crowdsale/emission/MintedCrowdsale.sol delete mode 100644 contracts/crowdsale/price/IncreasingPriceCrowdsale.sol delete mode 100644 contracts/crowdsale/validation/CappedCrowdsale.sol delete mode 100644 contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol delete mode 100644 contracts/crowdsale/validation/TimedCrowdsale.sol delete mode 100644 contracts/crowdsale/validation/WhitelistedCrowdsale.sol delete mode 100644 contracts/examples/SampleCrowdsale.sol delete mode 100644 contracts/examples/SimpleSavingsWallet.sol delete mode 100644 contracts/examples/SimpleToken.sol delete mode 100644 contracts/lifecycle/Destructible.sol delete mode 100644 contracts/lifecycle/TokenDestructible.sol delete mode 100644 contracts/math/Math.sol delete mode 100644 contracts/mocks/AllowanceCrowdsaleImpl.sol delete mode 100644 contracts/mocks/BouncerMock.sol delete mode 100644 contracts/mocks/CappedCrowdsaleImpl.sol delete mode 100644 contracts/mocks/DayLimitMock.sol delete mode 100644 contracts/mocks/ECRecoveryMock.sol delete mode 100644 contracts/mocks/ERC223TokenMock.sol delete mode 100644 contracts/mocks/ERC827TokenMock.sol delete mode 100644 contracts/mocks/FinalizableCrowdsaleImpl.sol delete mode 100644 contracts/mocks/ForceEther.sol delete mode 100644 contracts/mocks/HasNoEtherTest.sol delete mode 100644 contracts/mocks/IncreasingPriceCrowdsaleImpl.sol delete mode 100644 contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol delete mode 100644 contracts/mocks/InsecureTargetBounty.sol delete mode 100644 contracts/mocks/LimitBalanceMock.sol delete mode 100644 contracts/mocks/MerkleProofWrapper.sol delete mode 100644 contracts/mocks/MessageHelper.sol delete mode 100644 contracts/mocks/MintedCrowdsaleImpl.sol delete mode 100644 contracts/mocks/PostDeliveryCrowdsaleImpl.sol delete mode 100644 contracts/mocks/PullPaymentMock.sol delete mode 100644 contracts/mocks/RBACMock.sol delete mode 100644 contracts/mocks/ReentrancyAttack.sol delete mode 100644 contracts/mocks/ReentrancyMock.sol delete mode 100644 contracts/mocks/RefundableCrowdsaleImpl.sol delete mode 100644 contracts/mocks/SecureTargetBounty.sol delete mode 100644 contracts/mocks/TimedCrowdsaleImpl.sol delete mode 100644 contracts/mocks/WhitelistMock.sol delete mode 100644 contracts/mocks/WhitelistedCrowdsaleImpl.sol delete mode 100644 contracts/ownership/CanReclaimToken.sol delete mode 100644 contracts/ownership/Claimable.sol delete mode 100644 contracts/ownership/Contactable.sol delete mode 100644 contracts/ownership/DelayedClaimable.sol delete mode 100644 contracts/ownership/HasNoContracts.sol delete mode 100644 contracts/ownership/HasNoEther.sol delete mode 100644 contracts/ownership/HasNoTokens.sol delete mode 100644 contracts/ownership/Heritable.sol delete mode 100644 contracts/ownership/NoOwner.sol delete mode 100644 contracts/ownership/Whitelist.sol delete mode 100644 contracts/ownership/rbac/RBAC.sol delete mode 100644 contracts/ownership/rbac/RBACWithAdmin.sol delete mode 100644 contracts/ownership/rbac/Roles.sol delete mode 100644 contracts/payment/PullPayment.sol delete mode 100644 contracts/payment/SplitPayment.sol delete mode 100644 contracts/token/ERC20/CappedToken.sol delete mode 100644 contracts/token/ERC721/DeprecatedERC721.sol delete mode 100644 contracts/token/ERC827/ERC827.sol delete mode 100644 contracts/token/ERC827/ERC827Token.sol delete mode 100644 test/Bounty.test.js delete mode 100644 test/DayLimit.test.js delete mode 100644 test/Heritable.test.js delete mode 100644 test/LimitBalance.test.js delete mode 100644 test/ReentrancyGuard.test.js delete mode 100644 test/SimpleSavingsWallet.test.js delete mode 100644 test/access/SignatureBouncer.test.js delete mode 100644 test/crowdsale/AllowanceCrowdsale.test.js delete mode 100644 test/crowdsale/CappedCrowdsale.test.js delete mode 100644 test/crowdsale/Crowdsale.test.js delete mode 100644 test/crowdsale/FinalizableCrowdsale.test.js delete mode 100644 test/crowdsale/IncreasingPriceCrowdsale.test.js delete mode 100644 test/crowdsale/IndividuallyCappedCrowdsale.test.js delete mode 100644 test/crowdsale/MintedCrowdsale.test.js delete mode 100644 test/crowdsale/PostDeliveryCrowdsale.test.js delete mode 100644 test/crowdsale/RefundVault.test.js delete mode 100644 test/crowdsale/RefundableCrowdsale.test.js delete mode 100644 test/crowdsale/TimedCrowdsale.test.js delete mode 100644 test/crowdsale/WhitelistedCrowdsale.test.js delete mode 100644 test/examples/SampleCrowdsale.test.js delete mode 100644 test/examples/SimpleToken.test.js delete mode 100644 test/library/ECRecovery.test.js delete mode 100644 test/library/Math.test.js delete mode 100644 test/library/MerkleProof.test.js delete mode 100644 test/lifecycle/Destructible.test.js delete mode 100644 test/lifecycle/TokenDestructible.test.js delete mode 100644 test/mocks/MathMock.sol delete mode 100644 test/ownership/CanReclaimToken.test.js delete mode 100644 test/ownership/Claimable.test.js delete mode 100644 test/ownership/Contactable.test.js delete mode 100644 test/ownership/DelayedClaimable.test.js delete mode 100644 test/ownership/HasNoContracts.test.js delete mode 100644 test/ownership/HasNoEther.test.js delete mode 100644 test/ownership/HasNoTokens.test.js delete mode 100644 test/ownership/Whitelist.test.js delete mode 100644 test/ownership/rbac/RBAC.test.js delete mode 100644 test/payment/PullPayment.test.js delete mode 100644 test/payment/SplitPayment.test.js delete mode 100644 test/token/ERC20/CappedToken.test.js delete mode 100644 test/token/ERC827/ERC827Token.js diff --git a/contracts/Bounty.sol b/contracts/Bounty.sol deleted file mode 100644 index 2f9879d96..000000000 --- a/contracts/Bounty.sol +++ /dev/null @@ -1,72 +0,0 @@ -pragma solidity ^0.4.21; - - -import "./payment/PullPayment.sol"; -import "./lifecycle/Destructible.sol"; - - -/** - * @title Bounty - * @dev This bounty will pay out to a researcher if they break invariant logic of the contract. - */ -contract Bounty is PullPayment, Destructible { - bool public claimed; - mapping(address => address) public researchers; - - event TargetCreated(address createdAddress); - - /** - * @dev Fallback function allowing the contract to receive funds, if they haven't already been claimed. - */ - function() external payable { - require(!claimed); - } - - /** - * @dev Create and deploy the target contract (extension of Target contract), and sets the - * msg.sender as a researcher - * @return A target contract - */ - function createTarget() public returns(Target) { - Target target = Target(deployContract()); - researchers[target] = msg.sender; - emit TargetCreated(target); - return target; - } - - /** - * @dev Sends the contract funds to the researcher that proved the contract is broken. - * @param target contract - */ - function claim(Target target) public { - address researcher = researchers[target]; - require(researcher != 0); - // Check Target contract invariants - require(!target.checkInvariant()); - asyncSend(researcher, address(this).balance); - claimed = true; - } - - /** - * @dev Internal function to deploy the target contract. - * @return A target contract address - */ - function deployContract() internal returns(address); - -} - - -/** - * @title Target - * @dev Your main contract should inherit from this class and implement the checkInvariant method. - */ -contract Target { - - /** - * @dev Checks all values a contract assumes to be true all the time. If this function returns - * false, the contract is broken in some way and is in an inconsistent state. - * In order to win the bounty, security researchers will try to cause this broken state. - * @return True if all invariant values are correct, false otherwise. - */ - function checkInvariant() public returns(bool); -} diff --git a/contracts/DayLimit.sol b/contracts/DayLimit.sol deleted file mode 100644 index 0bfa9b6d0..000000000 --- a/contracts/DayLimit.sol +++ /dev/null @@ -1,75 +0,0 @@ -pragma solidity ^0.4.21; - - -/** - * @title DayLimit - * @dev Base contract that enables methods to be protected by placing a linear limit (specifiable) - * on a particular resource per calendar day. Is multiowned to allow the limit to be altered. - */ -contract DayLimit { - - uint256 public dailyLimit; - uint256 public spentToday; - uint256 public lastDay; - - /** - * @dev Constructor that sets the passed value as a dailyLimit. - * @param _limit uint256 to represent the daily limit. - */ - function DayLimit(uint256 _limit) public { - dailyLimit = _limit; - lastDay = today(); - } - - /** - * @dev sets the daily limit. Does not alter the amount already spent today. - * @param _newLimit uint256 to represent the new limit. - */ - function _setDailyLimit(uint256 _newLimit) internal { - dailyLimit = _newLimit; - } - - /** - * @dev Resets the amount already spent today. - */ - function _resetSpentToday() internal { - spentToday = 0; - } - - /** - * @dev Checks to see if there is enough resource to spend today. If true, the resource may be expended. - * @param _value uint256 representing the amount of resource to spend. - * @return A boolean that is True if the resource was spent and false otherwise. - */ - function underLimit(uint256 _value) internal returns (bool) { - // reset the spend limit if we're on a different day to last time. - if (today() > lastDay) { - spentToday = 0; - lastDay = today(); - } - // check to see if there's enough left - if so, subtract and return true. - // overflow protection // dailyLimit check - if (spentToday + _value >= spentToday && spentToday + _value <= dailyLimit) { - spentToday += _value; - return true; - } - return false; - } - - /** - * @dev Private function to determine today's index - * @return uint256 of today's index. - */ - function today() private view returns (uint256) { - // solium-disable-next-line security/no-block-members - return block.timestamp / 1 days; - } - - /** - * @dev Simple modifier for daily limit. - */ - modifier limitedDaily(uint256 _value) { - require(underLimit(_value)); - _; - } -} diff --git a/contracts/ECRecovery.sol b/contracts/ECRecovery.sol deleted file mode 100644 index b2076f0e3..000000000 --- a/contracts/ECRecovery.sol +++ /dev/null @@ -1,76 +0,0 @@ -pragma solidity ^0.4.21; - - -/** - * @title Eliptic curve signature operations - * - * @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d - * - * TODO Remove this library once solidity supports passing a signature to ecrecover. - * See https://github.com/ethereum/solidity/issues/864 - * - */ - -library ECRecovery { - - /** - * @dev Recover signer address from a message by using their signature - * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. - * @param sig bytes signature, the signature is generated using web3.eth.sign() - */ - function recover(bytes32 hash, bytes sig) - internal - pure - returns (address) - { - bytes32 r; - bytes32 s; - uint8 v; - - // Check the signature length - if (sig.length != 65) { - return (address(0)); - } - - // Divide the signature in r, s and v variables - // ecrecover takes the signature parameters, and the only way to get them - // currently is to use assembly. - // solium-disable-next-line security/no-inline-assembly - assembly { - r := mload(add(sig, 32)) - s := mload(add(sig, 64)) - v := byte(0, mload(add(sig, 96))) - } - - // Version of signature should be 27 or 28, but 0 and 1 are also possible versions - if (v < 27) { - v += 27; - } - - // If the version is correct return the signer address - if (v != 27 && v != 28) { - return (address(0)); - } else { - // solium-disable-next-line arg-overflow - return ecrecover(hash, v, r, s); - } - } - - /** - * toEthSignedMessageHash - * @dev prefix a bytes32 value with "\x19Ethereum Signed Message:" - * @dev and hash the result - */ - function toEthSignedMessageHash(bytes32 hash) - internal - pure - returns (bytes32) - { - // 32 is the length in bytes of hash, - // enforced by the type signature above - return keccak256( - "\x19Ethereum Signed Message:\n32", - hash - ); - } -} diff --git a/contracts/LimitBalance.sol b/contracts/LimitBalance.sol deleted file mode 100644 index e3f28cac1..000000000 --- a/contracts/LimitBalance.sol +++ /dev/null @@ -1,31 +0,0 @@ -pragma solidity ^0.4.21; - - -/** - * @title LimitBalance - * @dev Simple contract to limit the balance of child contract. - * @dev Note this doesn't prevent other contracts to send funds by using selfdestruct(address); - * @dev See: https://github.com/ConsenSys/smart-contract-best-practices#remember-that-ether-can-be-forcibly-sent-to-an-account - */ -contract LimitBalance { - - uint256 public limit; - - /** - * @dev Constructor that sets the passed value as a limit. - * @param _limit uint256 to represent the limit. - */ - function LimitBalance(uint256 _limit) public { - limit = _limit; - } - - /** - * @dev Checks if limit was reached. Case true, it throws. - */ - modifier limitedPayable() { - require(address(this).balance <= limit); - _; - - } - -} diff --git a/contracts/MerkleProof.sol b/contracts/MerkleProof.sol deleted file mode 100644 index a7000c6f2..000000000 --- a/contracts/MerkleProof.sol +++ /dev/null @@ -1,35 +0,0 @@ -pragma solidity ^0.4.21; - - -/* - * @title MerkleProof - * @dev Merkle proof verification - * @note Based on https://github.com/ameensol/merkle-tree-solidity/blob/master/src/MerkleProof.sol - */ -library MerkleProof { - /* - * @dev Verifies a Merkle proof proving the existence of a leaf in a Merkle tree. Assumes that each pair of leaves - * and each pair of pre-images is sorted. - * @param _proof Merkle proof containing sibling hashes on the branch from the leaf to the root of the Merkle tree - * @param _root Merkle root - * @param _leaf Leaf of Merkle tree - */ - function verifyProof(bytes32[] _proof, bytes32 _root, bytes32 _leaf) internal pure returns (bool) { - bytes32 computedHash = _leaf; - - for (uint256 i = 0; i < _proof.length; i++) { - bytes32 proofElement = _proof[i]; - - if (computedHash < proofElement) { - // Hash(current computed hash + current element of the proof) - computedHash = keccak256(computedHash, proofElement); - } else { - // Hash(current element of the proof + current computed hash) - computedHash = keccak256(proofElement, computedHash); - } - } - - // Check if the computed hash (root) is equal to the provided root - return computedHash == _root; - } -} diff --git a/contracts/ReentrancyGuard.sol b/contracts/ReentrancyGuard.sol deleted file mode 100644 index 1b55ceebc..000000000 --- a/contracts/ReentrancyGuard.sol +++ /dev/null @@ -1,32 +0,0 @@ -pragma solidity ^0.4.21; - - -/** - * @title Helps contracts guard agains reentrancy attacks. - * @author Remco Bloemen - * @notice If you mark a function `nonReentrant`, you should also - * mark it `external`. - */ -contract ReentrancyGuard { - - /** - * @dev We use a single lock for the whole contract. - */ - bool private reentrancyLock = false; - - /** - * @dev Prevents a contract from calling itself, directly or indirectly. - * @notice If you mark a function `nonReentrant`, you should also - * mark it `external`. Calling one nonReentrant function from - * another is not supported. Instead, you can implement a - * `private` function doing the actual work, and a `external` - * wrapper marked as `nonReentrant`. - */ - modifier nonReentrant() { - require(!reentrancyLock); - reentrancyLock = true; - _; - reentrancyLock = false; - } - -} diff --git a/contracts/access/SignatureBouncer.sol b/contracts/access/SignatureBouncer.sol deleted file mode 100644 index ad0267de1..000000000 --- a/contracts/access/SignatureBouncer.sol +++ /dev/null @@ -1,90 +0,0 @@ -pragma solidity ^0.4.18; - -import "../ownership/Ownable.sol"; -import "../ownership/rbac/RBAC.sol"; -import "../ECRecovery.sol"; - -/** - * @title SignatureBouncer - * @author PhABC and Shrugs - * @dev Bouncer allows users to submit a signature as a permission to do an action. - * @dev If the signature is from one of the authorized bouncer addresses, the signature - * @dev is valid. The owner of the contract adds/removes bouncers. - * @dev Bouncer addresses can be individual servers signing grants or different - * @dev users within a decentralized club that have permission to invite other members. - * @dev - * @dev This technique is useful for whitelists and airdrops; instead of putting all - * @dev valid addresses on-chain, simply sign a grant of the form - * @dev keccak256(`:contractAddress` + `:granteeAddress`) using a valid bouncer address. - * @dev Then restrict access to your crowdsale/whitelist/airdrop using the - * @dev `onlyValidSignature` modifier (or implement your own using isValidSignature). - * @dev - * @dev See the tests Bouncer.test.js for specific usage examples. - */ -contract SignatureBouncer is Ownable, RBAC { - using ECRecovery for bytes32; - - string public constant ROLE_BOUNCER = "bouncer"; - - /** - * @dev requires that a valid signature of a bouncer was provided - */ - modifier onlyValidSignature(bytes _sig) - { - require(isValidSignature(msg.sender, _sig)); - _; - } - - /** - * @dev allows the owner to add additional bouncer addresses - */ - function addBouncer(address _bouncer) - onlyOwner - public - { - require(_bouncer != address(0)); - addRole(_bouncer, ROLE_BOUNCER); - } - - /** - * @dev allows the owner to remove bouncer addresses - */ - function removeBouncer(address _bouncer) - onlyOwner - public - { - require(_bouncer != address(0)); - removeRole(_bouncer, ROLE_BOUNCER); - } - - /** - * @dev is the signature of `this + sender` from a bouncer? - * @return bool - */ - function isValidSignature(address _address, bytes _sig) - internal - view - returns (bool) - { - return isValidDataHash( - keccak256(address(this), _address), - _sig - ); - } - - /** - * @dev internal function to convert a hash to an eth signed message - * @dev and then recover the signature and check it against the bouncer role - * @return bool - */ - function isValidDataHash(bytes32 hash, bytes _sig) - internal - view - returns (bool) - { - address signer = hash - .toEthSignedMessageHash() - .recover(_sig); - return hasRole(signer, ROLE_BOUNCER); - } -} diff --git a/contracts/crowdsale/Crowdsale.sol b/contracts/crowdsale/Crowdsale.sol deleted file mode 100644 index cbb59eabc..000000000 --- a/contracts/crowdsale/Crowdsale.sol +++ /dev/null @@ -1,163 +0,0 @@ -pragma solidity ^0.4.21; - -import "../token/ERC20/ERC20.sol"; -import "../math/SafeMath.sol"; - - -/** - * @title Crowdsale - * @dev Crowdsale is a base contract for managing a token crowdsale, - * allowing investors to purchase tokens with ether. This contract implements - * such functionality in its most fundamental form and can be extended to provide additional - * functionality and/or custom behavior. - * The external interface represents the basic interface for purchasing tokens, and conform - * the base architecture for crowdsales. They are *not* intended to be modified / overriden. - * The internal interface conforms the extensible and modifiable surface of crowdsales. Override - * the methods to add functionality. Consider using 'super' where appropiate to concatenate - * behavior. - */ -contract Crowdsale { - using SafeMath for uint256; - - // The token being sold - ERC20 public token; - - // Address where funds are collected - address public wallet; - - // How many token units a buyer gets per wei - uint256 public rate; - - // Amount of wei raised - uint256 public weiRaised; - - /** - * Event for token purchase logging - * @param purchaser who paid for the tokens - * @param beneficiary who got the tokens - * @param value weis paid for purchase - * @param amount amount of tokens purchased - */ - event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); - - /** - * @param _rate Number of token units a buyer gets per wei - * @param _wallet Address where collected funds will be forwarded to - * @param _token Address of the token being sold - */ - function Crowdsale(uint256 _rate, address _wallet, ERC20 _token) public { - require(_rate > 0); - require(_wallet != address(0)); - require(_token != address(0)); - - rate = _rate; - wallet = _wallet; - token = _token; - } - - // ----------------------------------------- - // Crowdsale external interface - // ----------------------------------------- - - /** - * @dev fallback function ***DO NOT OVERRIDE*** - */ - function () external payable { - buyTokens(msg.sender); - } - - /** - * @dev low level token purchase ***DO NOT OVERRIDE*** - * @param _beneficiary Address performing the token purchase - */ - function buyTokens(address _beneficiary) public payable { - - uint256 weiAmount = msg.value; - _preValidatePurchase(_beneficiary, weiAmount); - - // calculate token amount to be created - uint256 tokens = _getTokenAmount(weiAmount); - - // update state - weiRaised = weiRaised.add(weiAmount); - - _processPurchase(_beneficiary, tokens); - emit TokenPurchase( - msg.sender, - _beneficiary, - weiAmount, - tokens - ); - - _updatePurchasingState(_beneficiary, weiAmount); - - _forwardFunds(); - _postValidatePurchase(_beneficiary, weiAmount); - } - - // ----------------------------------------- - // Internal interface (extensible) - // ----------------------------------------- - - /** - * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations. - * @param _beneficiary Address performing the token purchase - * @param _weiAmount Value in wei involved in the purchase - */ - function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { - require(_beneficiary != address(0)); - require(_weiAmount != 0); - } - - /** - * @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met. - * @param _beneficiary Address performing the token purchase - * @param _weiAmount Value in wei involved in the purchase - */ - function _postValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { - // optional override - } - - /** - * @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens. - * @param _beneficiary Address performing the token purchase - * @param _tokenAmount Number of tokens to be emitted - */ - function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal { - token.transfer(_beneficiary, _tokenAmount); - } - - /** - * @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens. - * @param _beneficiary Address receiving the tokens - * @param _tokenAmount Number of tokens to be purchased - */ - function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal { - _deliverTokens(_beneficiary, _tokenAmount); - } - - /** - * @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.) - * @param _beneficiary Address receiving the tokens - * @param _weiAmount Value in wei involved in the purchase - */ - function _updatePurchasingState(address _beneficiary, uint256 _weiAmount) internal { - // optional override - } - - /** - * @dev Override to extend the way in which ether is converted to tokens. - * @param _weiAmount Value in wei to be converted into tokens - * @return Number of tokens that can be purchased with the specified _weiAmount - */ - function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) { - return _weiAmount.mul(rate); - } - - /** - * @dev Determines how ETH is stored/forwarded on purchases. - */ - function _forwardFunds() internal { - wallet.transfer(msg.value); - } -} diff --git a/contracts/crowdsale/distribution/FinalizableCrowdsale.sol b/contracts/crowdsale/distribution/FinalizableCrowdsale.sol deleted file mode 100644 index d15d4f62b..000000000 --- a/contracts/crowdsale/distribution/FinalizableCrowdsale.sol +++ /dev/null @@ -1,42 +0,0 @@ -pragma solidity ^0.4.21; - -import "../../math/SafeMath.sol"; -import "../../ownership/Ownable.sol"; -import "../validation/TimedCrowdsale.sol"; - - -/** - * @title FinalizableCrowdsale - * @dev Extension of Crowdsale where an owner can do extra work - * after finishing. - */ -contract FinalizableCrowdsale is TimedCrowdsale, Ownable { - using SafeMath for uint256; - - bool public isFinalized = false; - - event Finalized(); - - /** - * @dev Must be called after crowdsale ends, to do some extra finalization - * work. Calls the contract's finalization function. - */ - function finalize() onlyOwner public { - require(!isFinalized); - require(hasClosed()); - - finalization(); - emit Finalized(); - - isFinalized = true; - } - - /** - * @dev Can be overridden to add finalization logic. The overriding function - * should call super.finalization() to ensure the chain of finalization is - * executed entirely. - */ - function finalization() internal { - } - -} diff --git a/contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol b/contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol deleted file mode 100644 index ac5daff99..000000000 --- a/contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol +++ /dev/null @@ -1,37 +0,0 @@ -pragma solidity ^0.4.21; - -import "../validation/TimedCrowdsale.sol"; -import "../../token/ERC20/ERC20.sol"; -import "../../math/SafeMath.sol"; - - -/** - * @title PostDeliveryCrowdsale - * @dev Crowdsale that locks tokens from withdrawal until it ends. - */ -contract PostDeliveryCrowdsale is TimedCrowdsale { - using SafeMath for uint256; - - mapping(address => uint256) public balances; - - /** - * @dev Withdraw tokens only after crowdsale ends. - */ - function withdrawTokens() public { - require(hasClosed()); - uint256 amount = balances[msg.sender]; - require(amount > 0); - balances[msg.sender] = 0; - _deliverTokens(msg.sender, amount); - } - - /** - * @dev Overrides parent by storing balances instead of issuing tokens right away. - * @param _beneficiary Token purchaser - * @param _tokenAmount Amount of tokens purchased - */ - function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal { - balances[_beneficiary] = balances[_beneficiary].add(_tokenAmount); - } - -} diff --git a/contracts/crowdsale/distribution/RefundableCrowdsale.sol b/contracts/crowdsale/distribution/RefundableCrowdsale.sol deleted file mode 100644 index 9b3819ea4..000000000 --- a/contracts/crowdsale/distribution/RefundableCrowdsale.sol +++ /dev/null @@ -1,72 +0,0 @@ -pragma solidity ^0.4.21; - - -import "../../math/SafeMath.sol"; -import "./FinalizableCrowdsale.sol"; -import "./utils/RefundVault.sol"; - - -/** - * @title RefundableCrowdsale - * @dev Extension of Crowdsale contract that adds a funding goal, and - * the possibility of users getting a refund if goal is not met. - * Uses a RefundVault as the crowdsale's vault. - */ -contract RefundableCrowdsale is FinalizableCrowdsale { - using SafeMath for uint256; - - // minimum amount of funds to be raised in weis - uint256 public goal; - - // refund vault used to hold funds while crowdsale is running - RefundVault public vault; - - /** - * @dev Constructor, creates RefundVault. - * @param _goal Funding goal - */ - function RefundableCrowdsale(uint256 _goal) public { - require(_goal > 0); - vault = new RefundVault(wallet); - goal = _goal; - } - - /** - * @dev Investors can claim refunds here if crowdsale is unsuccessful - */ - function claimRefund() public { - require(isFinalized); - require(!goalReached()); - - vault.refund(msg.sender); - } - - /** - * @dev Checks whether funding goal was reached. - * @return Whether funding goal was reached - */ - function goalReached() public view returns (bool) { - return weiRaised >= goal; - } - - /** - * @dev vault finalization task, called when owner calls finalize() - */ - function finalization() internal { - if (goalReached()) { - vault.close(); - } else { - vault.enableRefunds(); - } - - super.finalization(); - } - - /** - * @dev Overrides Crowdsale fund forwarding, sending funds to vault. - */ - function _forwardFunds() internal { - vault.deposit.value(msg.value)(msg.sender); - } - -} diff --git a/contracts/crowdsale/distribution/utils/RefundVault.sol b/contracts/crowdsale/distribution/utils/RefundVault.sol deleted file mode 100644 index 17a69b08c..000000000 --- a/contracts/crowdsale/distribution/utils/RefundVault.sol +++ /dev/null @@ -1,66 +0,0 @@ -pragma solidity ^0.4.21; - -import "../../../math/SafeMath.sol"; -import "../../../ownership/Ownable.sol"; - - -/** - * @title RefundVault - * @dev This contract is used for storing funds while a crowdsale - * is in progress. Supports refunding the money if crowdsale fails, - * and forwarding it if crowdsale is successful. - */ -contract RefundVault is Ownable { - using SafeMath for uint256; - - enum State { Active, Refunding, Closed } - - mapping (address => uint256) public deposited; - address public wallet; - State public state; - - event Closed(); - event RefundsEnabled(); - event Refunded(address indexed beneficiary, uint256 weiAmount); - - /** - * @param _wallet Vault address - */ - function RefundVault(address _wallet) public { - require(_wallet != address(0)); - wallet = _wallet; - state = State.Active; - } - - /** - * @param investor Investor address - */ - function deposit(address investor) onlyOwner public payable { - require(state == State.Active); - deposited[investor] = deposited[investor].add(msg.value); - } - - function close() onlyOwner public { - require(state == State.Active); - state = State.Closed; - emit Closed(); - wallet.transfer(address(this).balance); - } - - function enableRefunds() onlyOwner public { - require(state == State.Active); - state = State.Refunding; - emit RefundsEnabled(); - } - - /** - * @param investor Investor address - */ - function refund(address investor) public { - require(state == State.Refunding); - uint256 depositedValue = deposited[investor]; - deposited[investor] = 0; - investor.transfer(depositedValue); - emit Refunded(investor, depositedValue); - } -} diff --git a/contracts/crowdsale/emission/AllowanceCrowdsale.sol b/contracts/crowdsale/emission/AllowanceCrowdsale.sol deleted file mode 100644 index ae8fe5992..000000000 --- a/contracts/crowdsale/emission/AllowanceCrowdsale.sol +++ /dev/null @@ -1,42 +0,0 @@ -pragma solidity ^0.4.21; - -import "../Crowdsale.sol"; -import "../../token/ERC20/ERC20.sol"; -import "../../math/SafeMath.sol"; - - -/** - * @title AllowanceCrowdsale - * @dev Extension of Crowdsale where tokens are held by a wallet, which approves an allowance to the crowdsale. - */ -contract AllowanceCrowdsale is Crowdsale { - using SafeMath for uint256; - - address public tokenWallet; - - /** - * @dev Constructor, takes token wallet address. - * @param _tokenWallet Address holding the tokens, which has approved allowance to the crowdsale - */ - function AllowanceCrowdsale(address _tokenWallet) public { - require(_tokenWallet != address(0)); - tokenWallet = _tokenWallet; - } - - /** - * @dev Checks the amount of tokens left in the allowance. - * @return Amount of tokens left in the allowance - */ - function remainingTokens() public view returns (uint256) { - return token.allowance(tokenWallet, this); - } - - /** - * @dev Overrides parent behavior by transferring tokens from wallet. - * @param _beneficiary Token purchaser - * @param _tokenAmount Amount of tokens purchased - */ - function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal { - token.transferFrom(tokenWallet, _beneficiary, _tokenAmount); - } -} diff --git a/contracts/crowdsale/emission/MintedCrowdsale.sol b/contracts/crowdsale/emission/MintedCrowdsale.sol deleted file mode 100644 index 4d30de156..000000000 --- a/contracts/crowdsale/emission/MintedCrowdsale.sol +++ /dev/null @@ -1,22 +0,0 @@ -pragma solidity ^0.4.21; - -import "../Crowdsale.sol"; -import "../../token/ERC20/MintableToken.sol"; - - -/** - * @title MintedCrowdsale - * @dev Extension of Crowdsale contract whose tokens are minted in each purchase. - * Token ownership should be transferred to MintedCrowdsale for minting. - */ -contract MintedCrowdsale is Crowdsale { - - /** - * @dev Overrides delivery by minting tokens upon purchase. - * @param _beneficiary Token purchaser - * @param _tokenAmount Number of tokens to be minted - */ - function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal { - require(MintableToken(token).mint(_beneficiary, _tokenAmount)); - } -} diff --git a/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol b/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol deleted file mode 100644 index c9f773bf4..000000000 --- a/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol +++ /dev/null @@ -1,54 +0,0 @@ -pragma solidity ^0.4.21; - -import "../validation/TimedCrowdsale.sol"; -import "../../math/SafeMath.sol"; - - -/** - * @title IncreasingPriceCrowdsale - * @dev Extension of Crowdsale contract that increases the price of tokens linearly in time. - * Note that what should be provided to the constructor is the initial and final _rates_, that is, - * the amount of tokens per wei contributed. Thus, the initial rate must be greater than the final rate. - */ -contract IncreasingPriceCrowdsale is TimedCrowdsale { - using SafeMath for uint256; - - uint256 public initialRate; - uint256 public finalRate; - - /** - * @dev Constructor, takes intial and final rates of tokens received per wei contributed. - * @param _initialRate Number of tokens a buyer gets per wei at the start of the crowdsale - * @param _finalRate Number of tokens a buyer gets per wei at the end of the crowdsale - */ - function IncreasingPriceCrowdsale(uint256 _initialRate, uint256 _finalRate) public { - require(_initialRate >= _finalRate); - require(_finalRate > 0); - initialRate = _initialRate; - finalRate = _finalRate; - } - - /** - * @dev Returns the rate of tokens per wei at the present time. - * Note that, as price _increases_ with time, the rate _decreases_. - * @return The number of tokens a buyer gets per wei at a given time - */ - function getCurrentRate() public view returns (uint256) { - // solium-disable-next-line security/no-block-members - uint256 elapsedTime = block.timestamp.sub(openingTime); - uint256 timeRange = closingTime.sub(openingTime); - uint256 rateRange = initialRate.sub(finalRate); - return initialRate.sub(elapsedTime.mul(rateRange).div(timeRange)); - } - - /** - * @dev Overrides parent method taking into account variable rate. - * @param _weiAmount The value in wei to be converted into tokens - * @return The number of tokens _weiAmount wei will buy at present time - */ - function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) { - uint256 currentRate = getCurrentRate(); - return currentRate.mul(_weiAmount); - } - -} diff --git a/contracts/crowdsale/validation/CappedCrowdsale.sol b/contracts/crowdsale/validation/CappedCrowdsale.sol deleted file mode 100644 index 0b899665a..000000000 --- a/contracts/crowdsale/validation/CappedCrowdsale.sol +++ /dev/null @@ -1,43 +0,0 @@ -pragma solidity ^0.4.21; - -import "../../math/SafeMath.sol"; -import "../Crowdsale.sol"; - - -/** - * @title CappedCrowdsale - * @dev Crowdsale with a limit for total contributions. - */ -contract CappedCrowdsale is Crowdsale { - using SafeMath for uint256; - - uint256 public cap; - - /** - * @dev Constructor, takes maximum amount of wei accepted in the crowdsale. - * @param _cap Max amount of wei to be contributed - */ - function CappedCrowdsale(uint256 _cap) public { - require(_cap > 0); - cap = _cap; - } - - /** - * @dev Checks whether the cap has been reached. - * @return Whether the cap was reached - */ - function capReached() public view returns (bool) { - return weiRaised >= cap; - } - - /** - * @dev Extend parent behavior requiring purchase to respect the funding cap. - * @param _beneficiary Token purchaser - * @param _weiAmount Amount of wei contributed - */ - function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { - super._preValidatePurchase(_beneficiary, _weiAmount); - require(weiRaised.add(_weiAmount) <= cap); - } - -} diff --git a/contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol b/contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol deleted file mode 100644 index ee363deb8..000000000 --- a/contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol +++ /dev/null @@ -1,76 +0,0 @@ -pragma solidity ^0.4.21; - -import "../../math/SafeMath.sol"; -import "../Crowdsale.sol"; -import "../../ownership/Ownable.sol"; - - -/** - * @title IndividuallyCappedCrowdsale - * @dev Crowdsale with per-user caps. - */ -contract IndividuallyCappedCrowdsale is Crowdsale, Ownable { - using SafeMath for uint256; - - mapping(address => uint256) public contributions; - mapping(address => uint256) public caps; - - /** - * @dev Sets a specific user's maximum contribution. - * @param _beneficiary Address to be capped - * @param _cap Wei limit for individual contribution - */ - function setUserCap(address _beneficiary, uint256 _cap) external onlyOwner { - caps[_beneficiary] = _cap; - } - - /** - * @dev Sets a group of users' maximum contribution. - * @param _beneficiaries List of addresses to be capped - * @param _cap Wei limit for individual contribution - */ - function setGroupCap(address[] _beneficiaries, uint256 _cap) external onlyOwner { - for (uint256 i = 0; i < _beneficiaries.length; i++) { - caps[_beneficiaries[i]] = _cap; - } - } - - /** - * @dev Returns the cap of a specific user. - * @param _beneficiary Address whose cap is to be checked - * @return Current cap for individual user - */ - function getUserCap(address _beneficiary) public view returns (uint256) { - return caps[_beneficiary]; - } - - /** - * @dev Returns the amount contributed so far by a sepecific user. - * @param _beneficiary Address of contributor - * @return User contribution so far - */ - function getUserContribution(address _beneficiary) public view returns (uint256) { - return contributions[_beneficiary]; - } - - /** - * @dev Extend parent behavior requiring purchase to respect the user's funding cap. - * @param _beneficiary Token purchaser - * @param _weiAmount Amount of wei contributed - */ - function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { - super._preValidatePurchase(_beneficiary, _weiAmount); - require(contributions[_beneficiary].add(_weiAmount) <= caps[_beneficiary]); - } - - /** - * @dev Extend parent behavior to update user contributions - * @param _beneficiary Token purchaser - * @param _weiAmount Amount of wei contributed - */ - function _updatePurchasingState(address _beneficiary, uint256 _weiAmount) internal { - super._updatePurchasingState(_beneficiary, _weiAmount); - contributions[_beneficiary] = contributions[_beneficiary].add(_weiAmount); - } - -} diff --git a/contracts/crowdsale/validation/TimedCrowdsale.sol b/contracts/crowdsale/validation/TimedCrowdsale.sol deleted file mode 100644 index 9977990a7..000000000 --- a/contracts/crowdsale/validation/TimedCrowdsale.sol +++ /dev/null @@ -1,58 +0,0 @@ -pragma solidity ^0.4.21; - -import "../../math/SafeMath.sol"; -import "../Crowdsale.sol"; - - -/** - * @title TimedCrowdsale - * @dev Crowdsale accepting contributions only within a time frame. - */ -contract TimedCrowdsale is Crowdsale { - using SafeMath for uint256; - - uint256 public openingTime; - uint256 public closingTime; - - /** - * @dev Reverts if not in crowdsale time range. - */ - modifier onlyWhileOpen { - // solium-disable-next-line security/no-block-members - require(block.timestamp >= openingTime && block.timestamp <= closingTime); - _; - } - - /** - * @dev Constructor, takes crowdsale opening and closing times. - * @param _openingTime Crowdsale opening time - * @param _closingTime Crowdsale closing time - */ - function TimedCrowdsale(uint256 _openingTime, uint256 _closingTime) public { - // solium-disable-next-line security/no-block-members - require(_openingTime >= block.timestamp); - require(_closingTime >= _openingTime); - - openingTime = _openingTime; - closingTime = _closingTime; - } - - /** - * @dev Checks whether the period in which the crowdsale is open has already elapsed. - * @return Whether crowdsale period has elapsed - */ - function hasClosed() public view returns (bool) { - // solium-disable-next-line security/no-block-members - return block.timestamp > closingTime; - } - - /** - * @dev Extend parent behavior requiring to be within contributing period - * @param _beneficiary Token purchaser - * @param _weiAmount Amount of wei contributed - */ - function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal onlyWhileOpen { - super._preValidatePurchase(_beneficiary, _weiAmount); - } - -} diff --git a/contracts/crowdsale/validation/WhitelistedCrowdsale.sol b/contracts/crowdsale/validation/WhitelistedCrowdsale.sol deleted file mode 100644 index bbccd58a4..000000000 --- a/contracts/crowdsale/validation/WhitelistedCrowdsale.sol +++ /dev/null @@ -1,58 +0,0 @@ -pragma solidity ^0.4.21; - -import "../Crowdsale.sol"; -import "../../ownership/Ownable.sol"; - - -/** - * @title WhitelistedCrowdsale - * @dev Crowdsale in which only whitelisted users can contribute. - */ -contract WhitelistedCrowdsale is Crowdsale, Ownable { - - mapping(address => bool) public whitelist; - - /** - * @dev Reverts if beneficiary is not whitelisted. Can be used when extending this contract. - */ - modifier isWhitelisted(address _beneficiary) { - require(whitelist[_beneficiary]); - _; - } - - /** - * @dev Adds single address to whitelist. - * @param _beneficiary Address to be added to the whitelist - */ - function addToWhitelist(address _beneficiary) external onlyOwner { - whitelist[_beneficiary] = true; - } - - /** - * @dev Adds list of addresses to whitelist. Not overloaded due to limitations with truffle testing. - * @param _beneficiaries Addresses to be added to the whitelist - */ - function addManyToWhitelist(address[] _beneficiaries) external onlyOwner { - for (uint256 i = 0; i < _beneficiaries.length; i++) { - whitelist[_beneficiaries[i]] = true; - } - } - - /** - * @dev Removes single address from whitelist. - * @param _beneficiary Address to be removed to the whitelist - */ - function removeFromWhitelist(address _beneficiary) external onlyOwner { - whitelist[_beneficiary] = false; - } - - /** - * @dev Extend parent behavior requiring beneficiary to be in whitelist. - * @param _beneficiary Token beneficiary - * @param _weiAmount Amount of wei contributed - */ - function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal isWhitelisted(_beneficiary) { - super._preValidatePurchase(_beneficiary, _weiAmount); - } - -} diff --git a/contracts/examples/SampleCrowdsale.sol b/contracts/examples/SampleCrowdsale.sol deleted file mode 100644 index 8067a5aa9..000000000 --- a/contracts/examples/SampleCrowdsale.sol +++ /dev/null @@ -1,55 +0,0 @@ -pragma solidity ^0.4.21; - -import "../crowdsale/validation/CappedCrowdsale.sol"; -import "../crowdsale/distribution/RefundableCrowdsale.sol"; -import "../crowdsale/emission/MintedCrowdsale.sol"; -import "../token/ERC20/MintableToken.sol"; - - -/** - * @title SampleCrowdsaleToken - * @dev Very simple ERC20 Token that can be minted. - * It is meant to be used in a crowdsale contract. - */ -contract SampleCrowdsaleToken is MintableToken { - - string public constant name = "Sample Crowdsale Token"; // solium-disable-line uppercase - string public constant symbol = "SCT"; // solium-disable-line uppercase - uint8 public constant decimals = 18; // solium-disable-line uppercase - -} - - -/** - * @title SampleCrowdsale - * @dev This is an example of a fully fledged crowdsale. - * The way to add new features to a base crowdsale is by multiple inheritance. - * In this example we are providing following extensions: - * CappedCrowdsale - sets a max boundary for raised funds - * RefundableCrowdsale - set a min goal to be reached and returns funds if it's not met - * - * After adding multiple features it's good practice to run integration tests - * to ensure that subcontracts works together as intended. - */ -contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale, MintedCrowdsale { - - function SampleCrowdsale( - uint256 _openingTime, - uint256 _closingTime, - uint256 _rate, - address _wallet, - uint256 _cap, - MintableToken _token, - uint256 _goal - ) - public - Crowdsale(_rate, _wallet, _token) - CappedCrowdsale(_cap) - TimedCrowdsale(_openingTime, _closingTime) - RefundableCrowdsale(_goal) - { - //As goal needs to be met for a successful crowdsale - //the value needs to less or equal than a cap which is limit for accepted funds - require(_goal <= _cap); - } -} diff --git a/contracts/examples/SimpleSavingsWallet.sol b/contracts/examples/SimpleSavingsWallet.sol deleted file mode 100644 index ea02acec2..000000000 --- a/contracts/examples/SimpleSavingsWallet.sol +++ /dev/null @@ -1,40 +0,0 @@ -pragma solidity ^0.4.21; - -import "../ownership/Heritable.sol"; - - -/** - * @title SimpleSavingsWallet - * @dev Simplest form of savings wallet whose ownership can be claimed by a heir - * if owner dies. - * In this example, we take a very simple savings wallet providing two operations - * (to send and receive funds) and extend its capabilities by making it Heritable. - * The account that creates the contract is set as owner, who has the authority to - * choose an heir account. Heir account can reclaim the contract ownership in the - * case that the owner dies. - */ -contract SimpleSavingsWallet is Heritable { - - event Sent(address indexed payee, uint256 amount, uint256 balance); - event Received(address indexed payer, uint256 amount, uint256 balance); - - - function SimpleSavingsWallet(uint256 _heartbeatTimeout) Heritable(_heartbeatTimeout) public {} - - /** - * @dev wallet can receive funds. - */ - function () public payable { - emit Received(msg.sender, msg.value, address(this).balance); - } - - /** - * @dev wallet can send funds - */ - function sendTo(address payee, uint256 amount) public onlyOwner { - require(payee != 0 && payee != address(this)); - require(amount > 0); - payee.transfer(amount); - emit Sent(payee, amount, address(this).balance); - } -} diff --git a/contracts/examples/SimpleToken.sol b/contracts/examples/SimpleToken.sol deleted file mode 100644 index a394f9dc7..000000000 --- a/contracts/examples/SimpleToken.sol +++ /dev/null @@ -1,30 +0,0 @@ -pragma solidity ^0.4.21; - - -import "../token/ERC20/StandardToken.sol"; - - -/** - * @title SimpleToken - * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. - * Note they can later distribute these tokens as they wish using `transfer` and other - * `StandardToken` functions. - */ -contract SimpleToken is StandardToken { - - string public constant name = "SimpleToken"; // solium-disable-line uppercase - string public constant symbol = "SIM"; // solium-disable-line uppercase - uint8 public constant decimals = 18; // solium-disable-line uppercase - - uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(decimals)); - - /** - * @dev Constructor that gives msg.sender all of existing tokens. - */ - function SimpleToken() public { - totalSupply_ = INITIAL_SUPPLY; - balances[msg.sender] = INITIAL_SUPPLY; - emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); - } - -} diff --git a/contracts/lifecycle/Destructible.sol b/contracts/lifecycle/Destructible.sol deleted file mode 100644 index cfb288d4e..000000000 --- a/contracts/lifecycle/Destructible.sol +++ /dev/null @@ -1,25 +0,0 @@ -pragma solidity ^0.4.21; - - -import "../ownership/Ownable.sol"; - - -/** - * @title Destructible - * @dev Base contract that can be destroyed by owner. All funds in contract will be sent to the owner. - */ -contract Destructible is Ownable { - - function Destructible() public payable { } - - /** - * @dev Transfers the current balance to the owner and terminates the contract. - */ - function destroy() onlyOwner public { - selfdestruct(owner); - } - - function destroyAndSend(address _recipient) onlyOwner public { - selfdestruct(_recipient); - } -} diff --git a/contracts/lifecycle/TokenDestructible.sol b/contracts/lifecycle/TokenDestructible.sol deleted file mode 100644 index 6ebe9c015..000000000 --- a/contracts/lifecycle/TokenDestructible.sol +++ /dev/null @@ -1,36 +0,0 @@ -pragma solidity ^0.4.21; - -import "../ownership/Ownable.sol"; -import "../token/ERC20/ERC20Basic.sol"; - - -/** - * @title TokenDestructible: - * @author Remco Bloemen - * @dev Base contract that can be destroyed by owner. All funds in contract including - * listed tokens will be sent to the owner. - */ -contract TokenDestructible is Ownable { - - function TokenDestructible() public payable { } - - /** - * @notice Terminate contract and refund to owner - * @param tokens List of addresses of ERC20 or ERC20Basic token contracts to - refund. - * @notice The called token contracts could try to re-enter this contract. Only - supply token contracts you trust. - */ - function destroy(address[] tokens) onlyOwner public { - - // Transfer tokens to owner - for (uint256 i = 0; i < tokens.length; i++) { - ERC20Basic token = ERC20Basic(tokens[i]); - uint256 balance = token.balanceOf(this); - token.transfer(owner, balance); - } - - // Transfer Eth to owner and terminate contract - selfdestruct(owner); - } -} diff --git a/contracts/math/Math.sol b/contracts/math/Math.sol deleted file mode 100644 index 0532ecb30..000000000 --- a/contracts/math/Math.sol +++ /dev/null @@ -1,24 +0,0 @@ -pragma solidity ^0.4.21; - - -/** - * @title Math - * @dev Assorted math operations - */ -library Math { - function max64(uint64 a, uint64 b) internal pure returns (uint64) { - return a >= b ? a : b; - } - - function min64(uint64 a, uint64 b) internal pure returns (uint64) { - return a < b ? a : b; - } - - function max256(uint256 a, uint256 b) internal pure returns (uint256) { - return a >= b ? a : b; - } - - function min256(uint256 a, uint256 b) internal pure returns (uint256) { - return a < b ? a : b; - } -} diff --git a/contracts/mocks/AllowanceCrowdsaleImpl.sol b/contracts/mocks/AllowanceCrowdsaleImpl.sol deleted file mode 100644 index e3ffabed3..000000000 --- a/contracts/mocks/AllowanceCrowdsaleImpl.sol +++ /dev/null @@ -1,21 +0,0 @@ -pragma solidity ^0.4.21; - -import "../token/ERC20/ERC20.sol"; -import "../crowdsale/emission/AllowanceCrowdsale.sol"; - - -contract AllowanceCrowdsaleImpl is AllowanceCrowdsale { - - function AllowanceCrowdsaleImpl ( - uint256 _rate, - address _wallet, - ERC20 _token, - address _tokenWallet - ) - public - Crowdsale(_rate, _wallet, _token) - AllowanceCrowdsale(_tokenWallet) - { - } - -} diff --git a/contracts/mocks/BouncerMock.sol b/contracts/mocks/BouncerMock.sol deleted file mode 100644 index 2add95874..000000000 --- a/contracts/mocks/BouncerMock.sol +++ /dev/null @@ -1,22 +0,0 @@ -pragma solidity ^0.4.18; - -import "../access/SignatureBouncer.sol"; - - -contract SignatureBouncerMock is SignatureBouncer { - function checkValidSignature(address _address, bytes _sig) - public - view - returns (bool) - { - return isValidSignature(_address, _sig); - } - - function onlyWithValidSignature(bytes _sig) - onlyValidSignature(_sig) - public - view - { - - } -} diff --git a/contracts/mocks/CappedCrowdsaleImpl.sol b/contracts/mocks/CappedCrowdsaleImpl.sol deleted file mode 100644 index 5666d4fd9..000000000 --- a/contracts/mocks/CappedCrowdsaleImpl.sol +++ /dev/null @@ -1,21 +0,0 @@ -pragma solidity ^0.4.21; - -import "../token/ERC20/ERC20.sol"; -import "../crowdsale/validation/CappedCrowdsale.sol"; - - -contract CappedCrowdsaleImpl is CappedCrowdsale { - - function CappedCrowdsaleImpl ( - uint256 _rate, - address _wallet, - ERC20 _token, - uint256 _cap - ) - public - Crowdsale(_rate, _wallet, _token) - CappedCrowdsale(_cap) - { - } - -} diff --git a/contracts/mocks/DayLimitMock.sol b/contracts/mocks/DayLimitMock.sol deleted file mode 100644 index 0081966b6..000000000 --- a/contracts/mocks/DayLimitMock.sol +++ /dev/null @@ -1,25 +0,0 @@ -pragma solidity ^0.4.21; - -import "../../contracts/DayLimit.sol"; - - -contract DayLimitMock is DayLimit { - uint256 public totalSpending; - - function DayLimitMock(uint256 _value) public DayLimit(_value) { - totalSpending = 0; - } - - function attemptSpend(uint256 _value) external limitedDaily(_value) { - totalSpending += _value; - } - - function setDailyLimit(uint256 _newLimit) external { - _setDailyLimit(_newLimit); - } - - function resetSpentToday() external { - _resetSpentToday(); - } - -} diff --git a/contracts/mocks/ECRecoveryMock.sol b/contracts/mocks/ECRecoveryMock.sol deleted file mode 100644 index 091055161..000000000 --- a/contracts/mocks/ECRecoveryMock.sol +++ /dev/null @@ -1,25 +0,0 @@ -pragma solidity ^0.4.21; - - -import "../ECRecovery.sol"; - - -contract ECRecoveryMock { - using ECRecovery for bytes32; - - function recover(bytes32 hash, bytes sig) - public - pure - returns (address) - { - return hash.recover(sig); - } - - function toEthSignedMessageHash(bytes32 hash) - public - pure - returns (bytes32) - { - return hash.toEthSignedMessageHash(); - } -} diff --git a/contracts/mocks/ERC223TokenMock.sol b/contracts/mocks/ERC223TokenMock.sol deleted file mode 100644 index fbe47fcc8..000000000 --- a/contracts/mocks/ERC223TokenMock.sol +++ /dev/null @@ -1,34 +0,0 @@ -pragma solidity ^0.4.21; - -import "../token/ERC20/BasicToken.sol"; - - -contract ERC223ContractInterface { - function tokenFallback(address _from, uint256 _value, bytes _data) external; -} - - -contract ERC223TokenMock is BasicToken { - - function ERC223TokenMock(address initialAccount, uint256 initialBalance) public { - balances[initialAccount] = initialBalance; - totalSupply_ = initialBalance; - } - - // ERC223 compatible transfer function (except the name) - function transferERC223(address _to, uint256 _value, bytes _data) public - returns (bool success) - { - transfer(_to, _value); - bool isContract = false; - // solium-disable-next-line security/no-inline-assembly - assembly { - isContract := not(iszero(extcodesize(_to))) - } - if (isContract) { - ERC223ContractInterface receiver = ERC223ContractInterface(_to); - receiver.tokenFallback(msg.sender, _value, _data); - } - return true; - } -} diff --git a/contracts/mocks/ERC827TokenMock.sol b/contracts/mocks/ERC827TokenMock.sol deleted file mode 100644 index 1107a73e7..000000000 --- a/contracts/mocks/ERC827TokenMock.sol +++ /dev/null @@ -1,15 +0,0 @@ -pragma solidity ^0.4.21; - - -import "../token/ERC827/ERC827Token.sol"; - - -// mock class using ERC827 Token -contract ERC827TokenMock is ERC827Token { - - function ERC827TokenMock(address initialAccount, uint256 initialBalance) public { - balances[initialAccount] = initialBalance; - totalSupply_ = initialBalance; - } - -} diff --git a/contracts/mocks/FinalizableCrowdsaleImpl.sol b/contracts/mocks/FinalizableCrowdsaleImpl.sol deleted file mode 100644 index 82d0a5500..000000000 --- a/contracts/mocks/FinalizableCrowdsaleImpl.sol +++ /dev/null @@ -1,22 +0,0 @@ -pragma solidity ^0.4.21; - -import "../token/ERC20/MintableToken.sol"; -import "../crowdsale/distribution/FinalizableCrowdsale.sol"; - - -contract FinalizableCrowdsaleImpl is FinalizableCrowdsale { - - function FinalizableCrowdsaleImpl ( - uint256 _openingTime, - uint256 _closingTime, - uint256 _rate, - address _wallet, - MintableToken _token - ) - public - Crowdsale(_rate, _wallet, _token) - TimedCrowdsale(_openingTime, _closingTime) - { - } - -} diff --git a/contracts/mocks/ForceEther.sol b/contracts/mocks/ForceEther.sol deleted file mode 100644 index 7bbbf85fa..000000000 --- a/contracts/mocks/ForceEther.sol +++ /dev/null @@ -1,16 +0,0 @@ -pragma solidity ^0.4.21; - - -// @title Force Ether into a contract. -// @notice even -// if the contract is not payable. -// @notice To use, construct the contract with the target as argument. -// @author Remco Bloemen -contract ForceEther { - - function ForceEther() public payable { } - - function destroyAndSend(address _recipient) public { - selfdestruct(_recipient); - } -} diff --git a/contracts/mocks/HasNoEtherTest.sol b/contracts/mocks/HasNoEtherTest.sol deleted file mode 100644 index bbf9dfdb4..000000000 --- a/contracts/mocks/HasNoEtherTest.sol +++ /dev/null @@ -1,12 +0,0 @@ -pragma solidity ^0.4.21; - -import "../../contracts/ownership/HasNoEther.sol"; - - -contract HasNoEtherTest is HasNoEther { - - // Constructor with explicit payable — should still fail - function HasNoEtherTest() public payable { - } - -} diff --git a/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol b/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol deleted file mode 100644 index ea1466122..000000000 --- a/contracts/mocks/IncreasingPriceCrowdsaleImpl.sol +++ /dev/null @@ -1,24 +0,0 @@ -pragma solidity ^0.4.21; - -import "../crowdsale/price/IncreasingPriceCrowdsale.sol"; -import "../math/SafeMath.sol"; - - -contract IncreasingPriceCrowdsaleImpl is IncreasingPriceCrowdsale { - - function IncreasingPriceCrowdsaleImpl ( - uint256 _openingTime, - uint256 _closingTime, - address _wallet, - ERC20 _token, - uint256 _initialRate, - uint256 _finalRate - ) - public - Crowdsale(_initialRate, _wallet, _token) - TimedCrowdsale(_openingTime, _closingTime) - IncreasingPriceCrowdsale(_initialRate, _finalRate) - { - } - -} diff --git a/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol b/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol deleted file mode 100644 index 7ac944d0b..000000000 --- a/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol +++ /dev/null @@ -1,19 +0,0 @@ -pragma solidity ^0.4.21; - -import "../token/ERC20/ERC20.sol"; -import "../crowdsale/validation/IndividuallyCappedCrowdsale.sol"; - - -contract IndividuallyCappedCrowdsaleImpl is IndividuallyCappedCrowdsale { - - function IndividuallyCappedCrowdsaleImpl ( - uint256 _rate, - address _wallet, - ERC20 _token - ) - public - Crowdsale(_rate, _wallet, _token) - { - } - -} diff --git a/contracts/mocks/InsecureTargetBounty.sol b/contracts/mocks/InsecureTargetBounty.sol deleted file mode 100644 index 74bc531b2..000000000 --- a/contracts/mocks/InsecureTargetBounty.sol +++ /dev/null @@ -1,17 +0,0 @@ -pragma solidity ^0.4.21; - -import {Bounty, Target} from "../../contracts/Bounty.sol"; - - -contract InsecureTargetMock is Target { - function checkInvariant() public returns(bool) { - return false; - } -} - - -contract InsecureTargetBounty is Bounty { - function deployContract() internal returns (address) { - return new InsecureTargetMock(); - } -} diff --git a/contracts/mocks/LimitBalanceMock.sol b/contracts/mocks/LimitBalanceMock.sol deleted file mode 100644 index a5ed18c5c..000000000 --- a/contracts/mocks/LimitBalanceMock.sol +++ /dev/null @@ -1,13 +0,0 @@ -pragma solidity ^0.4.21; - - -import "../LimitBalance.sol"; - - -// mock class using LimitBalance -contract LimitBalanceMock is LimitBalance(1000) { - - function limitedDeposit() public payable limitedPayable { - } - -} diff --git a/contracts/mocks/MerkleProofWrapper.sol b/contracts/mocks/MerkleProofWrapper.sol deleted file mode 100644 index aa830e63a..000000000 --- a/contracts/mocks/MerkleProofWrapper.sol +++ /dev/null @@ -1,11 +0,0 @@ -pragma solidity ^0.4.21; - -import { MerkleProof } from "../MerkleProof.sol"; - - -contract MerkleProofWrapper { - - function verifyProof(bytes32[] _proof, bytes32 _root, bytes32 _leaf) public pure returns (bool) { - return MerkleProof.verifyProof(_proof, _root, _leaf); - } -} diff --git a/contracts/mocks/MessageHelper.sol b/contracts/mocks/MessageHelper.sol deleted file mode 100644 index b44b6496a..000000000 --- a/contracts/mocks/MessageHelper.sol +++ /dev/null @@ -1,25 +0,0 @@ -pragma solidity ^0.4.21; - - -contract MessageHelper { - - event Show(bytes32 b32, uint256 number, string text); - - function showMessage( bytes32 message, uint256 number, string text ) public returns (bool) { - emit Show(message, number, text); - return true; - } - - function fail() public { - require(false); - } - - function call(address to, bytes data) public returns (bool) { - // solium-disable-next-line security/no-low-level-calls - if (to.call(data)) - return true; - else - return false; - } - -} diff --git a/contracts/mocks/MintedCrowdsaleImpl.sol b/contracts/mocks/MintedCrowdsaleImpl.sol deleted file mode 100644 index f6999b021..000000000 --- a/contracts/mocks/MintedCrowdsaleImpl.sol +++ /dev/null @@ -1,19 +0,0 @@ -pragma solidity ^0.4.21; - -import "../token/ERC20/MintableToken.sol"; -import "../crowdsale/emission/MintedCrowdsale.sol"; - - -contract MintedCrowdsaleImpl is MintedCrowdsale { - - function MintedCrowdsaleImpl ( - uint256 _rate, - address _wallet, - MintableToken _token - ) - public - Crowdsale(_rate, _wallet, _token) - { - } - -} diff --git a/contracts/mocks/PostDeliveryCrowdsaleImpl.sol b/contracts/mocks/PostDeliveryCrowdsaleImpl.sol deleted file mode 100644 index 09db38067..000000000 --- a/contracts/mocks/PostDeliveryCrowdsaleImpl.sol +++ /dev/null @@ -1,22 +0,0 @@ -pragma solidity ^0.4.21; - -import "../token/ERC20/ERC20.sol"; -import "../crowdsale/distribution/PostDeliveryCrowdsale.sol"; - - -contract PostDeliveryCrowdsaleImpl is PostDeliveryCrowdsale { - - function PostDeliveryCrowdsaleImpl ( - uint256 _openingTime, - uint256 _closingTime, - uint256 _rate, - address _wallet, - ERC20 _token - ) - public - TimedCrowdsale(_openingTime, _closingTime) - Crowdsale(_rate, _wallet, _token) - { - } - -} diff --git a/contracts/mocks/PullPaymentMock.sol b/contracts/mocks/PullPaymentMock.sol deleted file mode 100644 index fb4a1231b..000000000 --- a/contracts/mocks/PullPaymentMock.sol +++ /dev/null @@ -1,17 +0,0 @@ -pragma solidity ^0.4.21; - - -import "../payment/PullPayment.sol"; - - -// mock class using PullPayment -contract PullPaymentMock is PullPayment { - - function PullPaymentMock() public payable { } - - // test helper function to call asyncSend - function callSend(address dest, uint256 amount) public { - asyncSend(dest, amount); - } - -} diff --git a/contracts/mocks/RBACMock.sol b/contracts/mocks/RBACMock.sol deleted file mode 100644 index 7dfa2a985..000000000 --- a/contracts/mocks/RBACMock.sol +++ /dev/null @@ -1,69 +0,0 @@ -pragma solidity ^0.4.21; - -import "../ownership/rbac/RBACWithAdmin.sol"; - - -contract RBACMock is RBACWithAdmin { - - string constant ROLE_ADVISOR = "advisor"; - - modifier onlyAdminOrAdvisor() - { - require( - hasRole(msg.sender, ROLE_ADMIN) || - hasRole(msg.sender, ROLE_ADVISOR) - ); - _; - } - - function RBACMock(address[] _advisors) - public - { - addRole(msg.sender, ROLE_ADVISOR); - - for (uint256 i = 0; i < _advisors.length; i++) { - addRole(_advisors[i], ROLE_ADVISOR); - } - } - - function onlyAdminsCanDoThis() - onlyAdmin - view - external - { - } - - function onlyAdvisorsCanDoThis() - onlyRole(ROLE_ADVISOR) - view - external - { - } - - function eitherAdminOrAdvisorCanDoThis() - onlyAdminOrAdvisor - view - external - { - } - - function nobodyCanDoThis() - onlyRole("unknown") - view - external - { - } - - // admins can remove advisor's role - function removeAdvisor(address _addr) - onlyAdmin - public - { - // revert if the user isn't an advisor - // (perhaps you want to soft-fail here instead?) - checkRole(_addr, ROLE_ADVISOR); - - // remove the advisor's role - removeRole(_addr, ROLE_ADVISOR); - } -} diff --git a/contracts/mocks/ReentrancyAttack.sol b/contracts/mocks/ReentrancyAttack.sol deleted file mode 100644 index 5caebb1d6..000000000 --- a/contracts/mocks/ReentrancyAttack.sol +++ /dev/null @@ -1,11 +0,0 @@ -pragma solidity ^0.4.21; - - -contract ReentrancyAttack { - - function callSender(bytes4 data) public { - // solium-disable-next-line security/no-low-level-calls - require(msg.sender.call(data)); - } - -} diff --git a/contracts/mocks/ReentrancyMock.sol b/contracts/mocks/ReentrancyMock.sol deleted file mode 100644 index 72f4a284f..000000000 --- a/contracts/mocks/ReentrancyMock.sol +++ /dev/null @@ -1,46 +0,0 @@ -pragma solidity ^0.4.21; - -import "../ReentrancyGuard.sol"; -import "./ReentrancyAttack.sol"; - - -contract ReentrancyMock is ReentrancyGuard { - - uint256 public counter; - - function ReentrancyMock() public { - counter = 0; - } - - function callback() external nonReentrant { - count(); - } - - function countLocalRecursive(uint256 n) public nonReentrant { - if (n > 0) { - count(); - countLocalRecursive(n - 1); - } - } - - function countThisRecursive(uint256 n) public nonReentrant { - bytes4 func = bytes4(keccak256("countThisRecursive(uint256)")); - if (n > 0) { - count(); - // solium-disable-next-line security/no-low-level-calls - bool result = address(this).call(func, n - 1); - require(result == true); - } - } - - function countAndCall(ReentrancyAttack attacker) public nonReentrant { - count(); - bytes4 func = bytes4(keccak256("callback()")); - attacker.callSender(func); - } - - function count() private { - counter += 1; - } - -} diff --git a/contracts/mocks/RefundableCrowdsaleImpl.sol b/contracts/mocks/RefundableCrowdsaleImpl.sol deleted file mode 100644 index 08ee14512..000000000 --- a/contracts/mocks/RefundableCrowdsaleImpl.sol +++ /dev/null @@ -1,24 +0,0 @@ -pragma solidity ^0.4.21; - -import "../token/ERC20/MintableToken.sol"; -import "../crowdsale/distribution/RefundableCrowdsale.sol"; - - -contract RefundableCrowdsaleImpl is RefundableCrowdsale { - - function RefundableCrowdsaleImpl ( - uint256 _openingTime, - uint256 _closingTime, - uint256 _rate, - address _wallet, - MintableToken _token, - uint256 _goal - ) - public - Crowdsale(_rate, _wallet, _token) - TimedCrowdsale(_openingTime, _closingTime) - RefundableCrowdsale(_goal) - { - } - -} diff --git a/contracts/mocks/SecureTargetBounty.sol b/contracts/mocks/SecureTargetBounty.sol deleted file mode 100644 index 1b69176a1..000000000 --- a/contracts/mocks/SecureTargetBounty.sol +++ /dev/null @@ -1,17 +0,0 @@ -pragma solidity ^0.4.21; - -import {Bounty, Target} from "../../contracts/Bounty.sol"; - - -contract SecureTargetMock is Target { - function checkInvariant() public returns(bool) { - return true; - } -} - - -contract SecureTargetBounty is Bounty { - function deployContract() internal returns (address) { - return new SecureTargetMock(); - } -} diff --git a/contracts/mocks/TimedCrowdsaleImpl.sol b/contracts/mocks/TimedCrowdsaleImpl.sol deleted file mode 100644 index b66566239..000000000 --- a/contracts/mocks/TimedCrowdsaleImpl.sol +++ /dev/null @@ -1,22 +0,0 @@ -pragma solidity ^0.4.21; - -import "../token/ERC20/ERC20.sol"; -import "../crowdsale/validation/TimedCrowdsale.sol"; - - -contract TimedCrowdsaleImpl is TimedCrowdsale { - - function TimedCrowdsaleImpl ( - uint256 _openingTime, - uint256 _closingTime, - uint256 _rate, - address _wallet, - ERC20 _token - ) - public - Crowdsale(_rate, _wallet, _token) - TimedCrowdsale(_openingTime, _closingTime) - { - } - -} diff --git a/contracts/mocks/WhitelistMock.sol b/contracts/mocks/WhitelistMock.sol deleted file mode 100644 index 9c50405b0..000000000 --- a/contracts/mocks/WhitelistMock.sol +++ /dev/null @@ -1,14 +0,0 @@ -pragma solidity ^0.4.21; - -import "../ownership/Whitelist.sol"; - - -contract WhitelistMock is Whitelist { - - function onlyWhitelistedCanDoThis() - onlyWhitelisted - view - external - { - } -} diff --git a/contracts/mocks/WhitelistedCrowdsaleImpl.sol b/contracts/mocks/WhitelistedCrowdsaleImpl.sol deleted file mode 100644 index 16dc45434..000000000 --- a/contracts/mocks/WhitelistedCrowdsaleImpl.sol +++ /dev/null @@ -1,19 +0,0 @@ -pragma solidity ^0.4.21; - -import "../token/ERC20/ERC20.sol"; -import "../crowdsale/validation/WhitelistedCrowdsale.sol"; - - -contract WhitelistedCrowdsaleImpl is WhitelistedCrowdsale { - - function WhitelistedCrowdsaleImpl ( - uint256 _rate, - address _wallet, - ERC20 _token - ) - public - Crowdsale(_rate, _wallet, _token) - { - } - -} diff --git a/contracts/ownership/CanReclaimToken.sol b/contracts/ownership/CanReclaimToken.sol deleted file mode 100644 index 474baae4e..000000000 --- a/contracts/ownership/CanReclaimToken.sol +++ /dev/null @@ -1,26 +0,0 @@ -pragma solidity ^0.4.21; - -import "./Ownable.sol"; -import "../token/ERC20/ERC20Basic.sol"; -import "../token/ERC20/SafeERC20.sol"; - - -/** - * @title Contracts that should be able to recover tokens - * @author SylTi - * @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner. - * This will prevent any accidental loss of tokens. - */ -contract CanReclaimToken is Ownable { - using SafeERC20 for ERC20Basic; - - /** - * @dev Reclaim all ERC20Basic compatible tokens - * @param token ERC20Basic The address of the token contract - */ - function reclaimToken(ERC20Basic token) external onlyOwner { - uint256 balance = token.balanceOf(this); - token.safeTransfer(owner, balance); - } - -} diff --git a/contracts/ownership/Claimable.sol b/contracts/ownership/Claimable.sol deleted file mode 100644 index f1ebd76dd..000000000 --- a/contracts/ownership/Claimable.sol +++ /dev/null @@ -1,39 +0,0 @@ -pragma solidity ^0.4.21; - - -import "./Ownable.sol"; - - -/** - * @title Claimable - * @dev Extension for the Ownable contract, where the ownership needs to be claimed. - * This allows the new owner to accept the transfer. - */ -contract Claimable is Ownable { - address public pendingOwner; - - /** - * @dev Modifier throws if called by any account other than the pendingOwner. - */ - modifier onlyPendingOwner() { - require(msg.sender == pendingOwner); - _; - } - - /** - * @dev Allows the current owner to set the pendingOwner address. - * @param newOwner The address to transfer ownership to. - */ - function transferOwnership(address newOwner) onlyOwner public { - pendingOwner = newOwner; - } - - /** - * @dev Allows the pendingOwner address to finalize the transfer. - */ - function claimOwnership() onlyPendingOwner public { - emit OwnershipTransferred(owner, pendingOwner); - owner = pendingOwner; - pendingOwner = address(0); - } -} diff --git a/contracts/ownership/Contactable.sol b/contracts/ownership/Contactable.sol deleted file mode 100644 index adeeaa02a..000000000 --- a/contracts/ownership/Contactable.sol +++ /dev/null @@ -1,22 +0,0 @@ -pragma solidity ^0.4.21; - -import "./Ownable.sol"; - - -/** - * @title Contactable token - * @dev Basic version of a contactable contract, allowing the owner to provide a string with their - * contact information. - */ -contract Contactable is Ownable { - - string public contactInformation; - - /** - * @dev Allows the owner to set a string with their contact information. - * @param info The contact information to attach to the contract. - */ - function setContactInformation(string info) onlyOwner public { - contactInformation = info; - } -} diff --git a/contracts/ownership/DelayedClaimable.sol b/contracts/ownership/DelayedClaimable.sol deleted file mode 100644 index f221afb56..000000000 --- a/contracts/ownership/DelayedClaimable.sol +++ /dev/null @@ -1,40 +0,0 @@ -pragma solidity ^0.4.21; - -import "./Claimable.sol"; - - -/** - * @title DelayedClaimable - * @dev Extension for the Claimable contract, where the ownership needs to be claimed before/after - * a certain block number. - */ -contract DelayedClaimable is Claimable { - - uint256 public end; - uint256 public start; - - /** - * @dev Used to specify the time period during which a pending - * owner can claim ownership. - * @param _start The earliest time ownership can be claimed. - * @param _end The latest time ownership can be claimed. - */ - function setLimits(uint256 _start, uint256 _end) onlyOwner public { - require(_start <= _end); - end = _end; - start = _start; - } - - /** - * @dev Allows the pendingOwner address to finalize the transfer, as long as it is called within - * the specified start and end time. - */ - function claimOwnership() onlyPendingOwner public { - require((block.number <= end) && (block.number >= start)); - emit OwnershipTransferred(owner, pendingOwner); - owner = pendingOwner; - pendingOwner = address(0); - end = 0; - } - -} diff --git a/contracts/ownership/HasNoContracts.sol b/contracts/ownership/HasNoContracts.sol deleted file mode 100644 index 19e8d0ff9..000000000 --- a/contracts/ownership/HasNoContracts.sol +++ /dev/null @@ -1,22 +0,0 @@ -pragma solidity ^0.4.21; - -import "./Ownable.sol"; - - -/** - * @title Contracts that should not own Contracts - * @author Remco Bloemen - * @dev Should contracts (anything Ownable) end up being owned by this contract, it allows the owner - * of this contract to reclaim ownership of the contracts. - */ -contract HasNoContracts is Ownable { - - /** - * @dev Reclaim ownership of Ownable contracts - * @param contractAddr The address of the Ownable to be reclaimed. - */ - function reclaimContract(address contractAddr) external onlyOwner { - Ownable contractInst = Ownable(contractAddr); - contractInst.transferOwnership(owner); - } -} diff --git a/contracts/ownership/HasNoEther.sol b/contracts/ownership/HasNoEther.sol deleted file mode 100644 index 6cce9858c..000000000 --- a/contracts/ownership/HasNoEther.sol +++ /dev/null @@ -1,42 +0,0 @@ -pragma solidity ^0.4.21; - -import "./Ownable.sol"; - - -/** - * @title Contracts that should not own Ether - * @author Remco Bloemen - * @dev This tries to block incoming ether to prevent accidental loss of Ether. Should Ether end up - * in the contract, it will allow the owner to reclaim this ether. - * @notice Ether can still be send to this contract by: - * calling functions labeled `payable` - * `selfdestruct(contract_address)` - * mining directly to the contract address -*/ -contract HasNoEther is Ownable { - - /** - * @dev Constructor that rejects incoming Ether - * @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we - * leave out payable, then Solidity will allow inheriting contracts to implement a payable - * constructor. By doing it this way we prevent a payable constructor from working. Alternatively - * we could use assembly to access msg.value. - */ - function HasNoEther() public payable { - require(msg.value == 0); - } - - /** - * @dev Disallows direct send by settings a default function without the `payable` flag. - */ - function() external { - } - - /** - * @dev Transfer all Ether held by the contract to the owner. - */ - function reclaimEther() external onlyOwner { - // solium-disable-next-line security/no-send - assert(owner.send(address(this).balance)); - } -} diff --git a/contracts/ownership/HasNoTokens.sol b/contracts/ownership/HasNoTokens.sol deleted file mode 100644 index eaede63ae..000000000 --- a/contracts/ownership/HasNoTokens.sol +++ /dev/null @@ -1,28 +0,0 @@ -pragma solidity ^0.4.21; - -import "./CanReclaimToken.sol"; - - -/** - * @title Contracts that should not own Tokens - * @author Remco Bloemen - * @dev This blocks incoming ERC223 tokens to prevent accidental loss of tokens. - * Should tokens (any ERC20Basic compatible) end up in the contract, it allows the - * owner to reclaim the tokens. - */ -contract HasNoTokens is CanReclaimToken { - - /** - * @dev Reject all ERC223 compatible tokens - * @param from_ address The address that is transferring the tokens - * @param value_ uint256 the amount of the specified token - * @param data_ Bytes The data passed from the caller. - */ - function tokenFallback(address from_, uint256 value_, bytes data_) external { - from_; - value_; - data_; - revert(); - } - -} diff --git a/contracts/ownership/Heritable.sol b/contracts/ownership/Heritable.sol deleted file mode 100644 index 3b592a0a5..000000000 --- a/contracts/ownership/Heritable.sol +++ /dev/null @@ -1,117 +0,0 @@ -pragma solidity ^0.4.21; - - -import "./Ownable.sol"; - - -/** - * @title Heritable - * @dev The Heritable contract provides ownership transfer capabilities, in the - * case that the current owner stops "heartbeating". Only the heir can pronounce the - * owner's death. - */ -contract Heritable is Ownable { - address private heir_; - - // Time window the owner has to notify they are alive. - uint256 private heartbeatTimeout_; - - // Timestamp of the owner's death, as pronounced by the heir. - uint256 private timeOfDeath_; - - event HeirChanged(address indexed owner, address indexed newHeir); - event OwnerHeartbeated(address indexed owner); - event OwnerProclaimedDead(address indexed owner, address indexed heir, uint256 timeOfDeath); - event HeirOwnershipClaimed(address indexed previousOwner, address indexed newOwner); - - - /** - * @dev Throw an exception if called by any account other than the heir's. - */ - modifier onlyHeir() { - require(msg.sender == heir_); - _; - } - - - /** - * @notice Create a new Heritable Contract with heir address 0x0. - * @param _heartbeatTimeout time available for the owner to notify they are alive, - * before the heir can take ownership. - */ - function Heritable(uint256 _heartbeatTimeout) public { - setHeartbeatTimeout(_heartbeatTimeout); - } - - function setHeir(address newHeir) public onlyOwner { - require(newHeir != owner); - heartbeat(); - emit HeirChanged(owner, newHeir); - heir_ = newHeir; - } - - /** - * @dev Use these getter functions to access the internal variables in - * an inherited contract. - */ - function heir() public view returns(address) { - return heir_; - } - - function heartbeatTimeout() public view returns(uint256) { - return heartbeatTimeout_; - } - - function timeOfDeath() public view returns(uint256) { - return timeOfDeath_; - } - - /** - * @dev set heir = 0x0 - */ - function removeHeir() public onlyOwner { - heartbeat(); - heir_ = 0; - } - - /** - * @dev Heir can pronounce the owners death. To claim the ownership, they will - * have to wait for `heartbeatTimeout` seconds. - */ - function proclaimDeath() public onlyHeir { - require(ownerLives()); - emit OwnerProclaimedDead(owner, heir_, timeOfDeath_); - // solium-disable-next-line security/no-block-members - timeOfDeath_ = block.timestamp; - } - - /** - * @dev Owner can send a heartbeat if they were mistakenly pronounced dead. - */ - function heartbeat() public onlyOwner { - emit OwnerHeartbeated(owner); - timeOfDeath_ = 0; - } - - /** - * @dev Allows heir to transfer ownership only if heartbeat has timed out. - */ - function claimHeirOwnership() public onlyHeir { - require(!ownerLives()); - // solium-disable-next-line security/no-block-members - require(block.timestamp >= timeOfDeath_ + heartbeatTimeout_); - emit OwnershipTransferred(owner, heir_); - emit HeirOwnershipClaimed(owner, heir_); - owner = heir_; - timeOfDeath_ = 0; - } - - function setHeartbeatTimeout(uint256 newHeartbeatTimeout) internal onlyOwner { - require(ownerLives()); - heartbeatTimeout_ = newHeartbeatTimeout; - } - - function ownerLives() internal view returns (bool) { - return timeOfDeath_ == 0; - } -} diff --git a/contracts/ownership/NoOwner.sol b/contracts/ownership/NoOwner.sol deleted file mode 100644 index 9b4c7c93b..000000000 --- a/contracts/ownership/NoOwner.sol +++ /dev/null @@ -1,15 +0,0 @@ -pragma solidity ^0.4.21; - -import "./HasNoEther.sol"; -import "./HasNoTokens.sol"; -import "./HasNoContracts.sol"; - - -/** - * @title Base contract for contracts that should not own things. - * @author Remco Bloemen - * @dev Solves a class of errors where a contract accidentally becomes owner of Ether, Tokens or - * Owned contracts. See respective base contracts for details. - */ -contract NoOwner is HasNoEther, HasNoTokens, HasNoContracts { -} diff --git a/contracts/ownership/Whitelist.sol b/contracts/ownership/Whitelist.sol deleted file mode 100644 index 4d6e2a70a..000000000 --- a/contracts/ownership/Whitelist.sol +++ /dev/null @@ -1,81 +0,0 @@ -pragma solidity ^0.4.21; - - -import "./Ownable.sol"; - - -/** - * @title Whitelist - * @dev The Whitelist contract has a whitelist of addresses, and provides basic authorization control functions. - * @dev This simplifies the implementation of "user permissions". - */ -contract Whitelist is Ownable { - mapping(address => bool) public whitelist; - - event WhitelistedAddressAdded(address addr); - event WhitelistedAddressRemoved(address addr); - - /** - * @dev Throws if called by any account that's not whitelisted. - */ - modifier onlyWhitelisted() { - require(whitelist[msg.sender]); - _; - } - - /** - * @dev add an address to the whitelist - * @param addr address - * @return true if the address was added to the whitelist, false if the address was already in the whitelist - */ - function addAddressToWhitelist(address addr) onlyOwner public returns(bool success) { - if (!whitelist[addr]) { - whitelist[addr] = true; - emit WhitelistedAddressAdded(addr); - success = true; - } - } - - /** - * @dev add addresses to the whitelist - * @param addrs addresses - * @return true if at least one address was added to the whitelist, - * false if all addresses were already in the whitelist - */ - function addAddressesToWhitelist(address[] addrs) onlyOwner public returns(bool success) { - for (uint256 i = 0; i < addrs.length; i++) { - if (addAddressToWhitelist(addrs[i])) { - success = true; - } - } - } - - /** - * @dev remove an address from the whitelist - * @param addr address - * @return true if the address was removed from the whitelist, - * false if the address wasn't in the whitelist in the first place - */ - function removeAddressFromWhitelist(address addr) onlyOwner public returns(bool success) { - if (whitelist[addr]) { - whitelist[addr] = false; - emit WhitelistedAddressRemoved(addr); - success = true; - } - } - - /** - * @dev remove addresses from the whitelist - * @param addrs addresses - * @return true if at least one address was removed from the whitelist, - * false if all addresses weren't in the whitelist in the first place - */ - function removeAddressesFromWhitelist(address[] addrs) onlyOwner public returns(bool success) { - for (uint256 i = 0; i < addrs.length; i++) { - if (removeAddressFromWhitelist(addrs[i])) { - success = true; - } - } - } - -} diff --git a/contracts/ownership/rbac/RBAC.sol b/contracts/ownership/rbac/RBAC.sol deleted file mode 100644 index 998d334f8..000000000 --- a/contracts/ownership/rbac/RBAC.sol +++ /dev/null @@ -1,108 +0,0 @@ -pragma solidity ^0.4.21; - -import "./Roles.sol"; - - -/** - * @title RBAC (Role-Based Access Control) - * @author Matt Condon (@Shrugs) - * @dev Stores and provides setters and getters for roles and addresses. - * @dev Supports unlimited numbers of roles and addresses. - * @dev See //contracts/mocks/RBACMock.sol for an example of usage. - * This RBAC method uses strings to key roles. It may be beneficial - * for you to write your own implementation of this interface using Enums or similar. - * It's also recommended that you define constants in the contract, like ROLE_ADMIN below, - * to avoid typos. - */ -contract RBAC { - using Roles for Roles.Role; - - mapping (string => Roles.Role) private roles; - - event RoleAdded(address addr, string roleName); - event RoleRemoved(address addr, string roleName); - - /** - * @dev reverts if addr does not have role - * @param addr address - * @param roleName the name of the role - * // reverts - */ - function checkRole(address addr, string roleName) - view - public - { - roles[roleName].check(addr); - } - - /** - * @dev determine if addr has role - * @param addr address - * @param roleName the name of the role - * @return bool - */ - function hasRole(address addr, string roleName) - view - public - returns (bool) - { - return roles[roleName].has(addr); - } - - /** - * @dev add a role to an address - * @param addr address - * @param roleName the name of the role - */ - function addRole(address addr, string roleName) - internal - { - roles[roleName].add(addr); - emit RoleAdded(addr, roleName); - } - - /** - * @dev remove a role from an address - * @param addr address - * @param roleName the name of the role - */ - function removeRole(address addr, string roleName) - internal - { - roles[roleName].remove(addr); - emit RoleRemoved(addr, roleName); - } - - /** - * @dev modifier to scope access to a single role (uses msg.sender as addr) - * @param roleName the name of the role - * // reverts - */ - modifier onlyRole(string roleName) - { - checkRole(msg.sender, roleName); - _; - } - - /** - * @dev modifier to scope access to a set of roles (uses msg.sender as addr) - * @param roleNames the names of the roles to scope access to - * // reverts - * - * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this - * see: https://github.com/ethereum/solidity/issues/2467 - */ - // modifier onlyRoles(string[] roleNames) { - // bool hasAnyRole = false; - // for (uint8 i = 0; i < roleNames.length; i++) { - // if (hasRole(msg.sender, roleNames[i])) { - // hasAnyRole = true; - // break; - // } - // } - - // require(hasAnyRole); - - // _; - // } -} diff --git a/contracts/ownership/rbac/RBACWithAdmin.sol b/contracts/ownership/rbac/RBACWithAdmin.sol deleted file mode 100644 index 90eb187a1..000000000 --- a/contracts/ownership/rbac/RBACWithAdmin.sol +++ /dev/null @@ -1,60 +0,0 @@ -pragma solidity ^0.4.21; - -import "./RBAC.sol"; - - -/** - * @title RBACWithAdmin - * @author Matt Condon (@Shrugs) - * @dev It's recommended that you define constants in the contract, - * @dev like ROLE_ADMIN below, to avoid typos. - */ -contract RBACWithAdmin is RBAC { - /** - * A constant role name for indicating admins. - */ - string public constant ROLE_ADMIN = "admin"; - - /** - * @dev modifier to scope access to admins - * // reverts - */ - modifier onlyAdmin() - { - checkRole(msg.sender, ROLE_ADMIN); - _; - } - - /** - * @dev constructor. Sets msg.sender as admin by default - */ - function RBACWithAdmin() - public - { - addRole(msg.sender, ROLE_ADMIN); - } - - /** - * @dev add a role to an address - * @param addr address - * @param roleName the name of the role - */ - function adminAddRole(address addr, string roleName) - onlyAdmin - public - { - addRole(addr, roleName); - } - - /** - * @dev remove a role from an address - * @param addr address - * @param roleName the name of the role - */ - function adminRemoveRole(address addr, string roleName) - onlyAdmin - public - { - removeRole(addr, roleName); - } -} diff --git a/contracts/ownership/rbac/Roles.sol b/contracts/ownership/rbac/Roles.sol deleted file mode 100644 index c9dbd73af..000000000 --- a/contracts/ownership/rbac/Roles.sol +++ /dev/null @@ -1,55 +0,0 @@ -pragma solidity ^0.4.21; - - -/** - * @title Roles - * @author Francisco Giordano (@frangio) - * @dev Library for managing addresses assigned to a Role. - * See RBAC.sol for example usage. - */ -library Roles { - struct Role { - mapping (address => bool) bearer; - } - - /** - * @dev give an address access to this role - */ - function add(Role storage role, address addr) - internal - { - role.bearer[addr] = true; - } - - /** - * @dev remove an address' access to this role - */ - function remove(Role storage role, address addr) - internal - { - role.bearer[addr] = false; - } - - /** - * @dev check if an address has this role - * // reverts - */ - function check(Role storage role, address addr) - view - internal - { - require(has(role, addr)); - } - - /** - * @dev check if an address has this role - * @return bool - */ - function has(Role storage role, address addr) - view - internal - returns (bool) - { - return role.bearer[addr]; - } -} diff --git a/contracts/payment/PullPayment.sol b/contracts/payment/PullPayment.sol deleted file mode 100644 index 030e971b3..000000000 --- a/contracts/payment/PullPayment.sol +++ /dev/null @@ -1,43 +0,0 @@ -pragma solidity ^0.4.21; - - -import "../math/SafeMath.sol"; - - -/** - * @title PullPayment - * @dev Base contract supporting async send for pull payments. Inherit from this - * contract and use asyncSend instead of send or transfer. - */ -contract PullPayment { - using SafeMath for uint256; - - mapping(address => uint256) public payments; - uint256 public totalPayments; - - /** - * @dev Withdraw accumulated balance, called by payee. - */ - function withdrawPayments() public { - address payee = msg.sender; - uint256 payment = payments[payee]; - - require(payment != 0); - require(address(this).balance >= payment); - - totalPayments = totalPayments.sub(payment); - payments[payee] = 0; - - payee.transfer(payment); - } - - /** - * @dev Called by the payer to store the sent amount as credit to be pulled. - * @param dest The destination address of the funds. - * @param amount The amount to transfer. - */ - function asyncSend(address dest, uint256 amount) internal { - payments[dest] = payments[dest].add(amount); - totalPayments = totalPayments.add(amount); - } -} diff --git a/contracts/payment/SplitPayment.sol b/contracts/payment/SplitPayment.sol deleted file mode 100644 index 019eba694..000000000 --- a/contracts/payment/SplitPayment.sol +++ /dev/null @@ -1,71 +0,0 @@ -pragma solidity ^0.4.21; - -import "../math/SafeMath.sol"; - - -/** - * @title SplitPayment - * @dev Base contract that supports multiple payees claiming funds sent to this contract - * according to the proportion they own. - */ -contract SplitPayment { - using SafeMath for uint256; - - uint256 public totalShares = 0; - uint256 public totalReleased = 0; - - mapping(address => uint256) public shares; - mapping(address => uint256) public released; - address[] public payees; - - /** - * @dev Constructor - */ - function SplitPayment(address[] _payees, uint256[] _shares) public payable { - require(_payees.length == _shares.length); - - for (uint256 i = 0; i < _payees.length; i++) { - addPayee(_payees[i], _shares[i]); - } - } - - /** - * @dev payable fallback - */ - function () public payable {} - - /** - * @dev Claim your share of the balance. - */ - function claim() public { - address payee = msg.sender; - - require(shares[payee] > 0); - - uint256 totalReceived = address(this).balance.add(totalReleased); - uint256 payment = totalReceived.mul(shares[payee]).div(totalShares).sub(released[payee]); - - require(payment != 0); - require(address(this).balance >= payment); - - released[payee] = released[payee].add(payment); - totalReleased = totalReleased.add(payment); - - payee.transfer(payment); - } - - /** - * @dev Add a new payee to the contract. - * @param _payee The address of the payee to add. - * @param _shares The number of shares owned by the payee. - */ - function addPayee(address _payee, uint256 _shares) internal { - require(_payee != address(0)); - require(_shares > 0); - require(shares[_payee] == 0); - - payees.push(_payee); - shares[_payee] = _shares; - totalShares = totalShares.add(_shares); - } -} diff --git a/contracts/token/ERC20/CappedToken.sol b/contracts/token/ERC20/CappedToken.sol deleted file mode 100644 index 47cd4fb4d..000000000 --- a/contracts/token/ERC20/CappedToken.sol +++ /dev/null @@ -1,31 +0,0 @@ -pragma solidity ^0.4.21; - -import "./MintableToken.sol"; - - -/** - * @title Capped token - * @dev Mintable token with a token cap. - */ -contract CappedToken is MintableToken { - - uint256 public cap; - - function CappedToken(uint256 _cap) public { - require(_cap > 0); - cap = _cap; - } - - /** - * @dev Function to mint tokens - * @param _to The address that will receive the minted tokens. - * @param _amount The amount of tokens to mint. - * @return A boolean that indicates if the operation was successful. - */ - function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { - require(totalSupply_.add(_amount) <= cap); - - return super.mint(_to, _amount); - } - -} diff --git a/contracts/token/ERC721/DeprecatedERC721.sol b/contracts/token/ERC721/DeprecatedERC721.sol deleted file mode 100644 index fa9d9a3d3..000000000 --- a/contracts/token/ERC721/DeprecatedERC721.sol +++ /dev/null @@ -1,15 +0,0 @@ -pragma solidity ^0.4.21; - -import "./ERC721.sol"; - - -/** - * @title ERC-721 methods shipped in OpenZeppelin v1.7.0, removed in the latest version of the standard - * @dev Only use this interface for compatibility with previously deployed contracts - * @dev Use ERC721 for interacting with new contracts which are standard-compliant - */ -contract DeprecatedERC721 is ERC721 { - function takeOwnership(uint256 _tokenId) public; - function transfer(address _to, uint256 _tokenId) public; - function tokensOf(address _owner) public view returns (uint256[]); -} diff --git a/contracts/token/ERC827/ERC827.sol b/contracts/token/ERC827/ERC827.sol deleted file mode 100644 index a0ee18036..000000000 --- a/contracts/token/ERC827/ERC827.sol +++ /dev/null @@ -1,25 +0,0 @@ -pragma solidity ^0.4.21; - - -import "../ERC20/ERC20.sol"; - - -/** - * @title ERC827 interface, an extension of ERC20 token standard - * - * @dev Interface of a ERC827 token, following the ERC20 standard with extra - * @dev methods to transfer value and data and execute calls in transfers and - * @dev approvals. - */ -contract ERC827 is ERC20 { - function approve(address _spender, uint256 _value, bytes _data) public returns (bool); - function transfer(address _to, uint256 _value, bytes _data) public returns (bool); - function transferFrom( - address _from, - address _to, - uint256 _value, - bytes _data - ) - public - returns (bool); -} diff --git a/contracts/token/ERC827/ERC827Token.sol b/contracts/token/ERC827/ERC827Token.sol deleted file mode 100644 index 28dbfceea..000000000 --- a/contracts/token/ERC827/ERC827Token.sol +++ /dev/null @@ -1,139 +0,0 @@ -/* solium-disable security/no-low-level-calls */ - -pragma solidity ^0.4.21; - -import "./ERC827.sol"; -import "../ERC20/StandardToken.sol"; - - -/** - * @title ERC827, an extension of ERC20 token standard - * - * @dev Implementation the ERC827, following the ERC20 standard with extra - * @dev methods to transfer value and data and execute calls in transfers and - * @dev approvals. - * - * @dev Uses OpenZeppelin StandardToken. - */ -contract ERC827Token is ERC827, StandardToken { - - /** - * @dev Addition to ERC20 token methods. It allows to - * @dev approve the transfer of value and execute a call with the sent data. - * - * @dev Beware that changing an allowance with this method brings the risk that - * @dev someone may use both the old and the new allowance by unfortunate - * @dev transaction ordering. One possible solution to mitigate this race condition - * @dev is to first reduce the spender's allowance to 0 and set the desired value - * @dev afterwards: - * @dev https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - * - * @param _spender The address that will spend the funds. - * @param _value The amount of tokens to be spent. - * @param _data ABI-encoded contract call to call `_to` address. - * - * @return true if the call function was executed successfully - */ - function approve(address _spender, uint256 _value, bytes _data) public returns (bool) { - require(_spender != address(this)); - - super.approve(_spender, _value); - - require(_spender.call(_data)); - - return true; - } - - /** - * @dev Addition to ERC20 token methods. Transfer tokens to a specified - * @dev address and execute a call with the sent data on the same transaction - * - * @param _to address The address which you want to transfer to - * @param _value uint256 the amout of tokens to be transfered - * @param _data ABI-encoded contract call to call `_to` address. - * - * @return true if the call function was executed successfully - */ - function transfer(address _to, uint256 _value, bytes _data) public returns (bool) { - require(_to != address(this)); - - super.transfer(_to, _value); - - require(_to.call(_data)); - return true; - } - - /** - * @dev Addition to ERC20 token methods. Transfer tokens from one address to - * @dev another and make a contract call on the same transaction - * - * @param _from The address which you want to send tokens from - * @param _to The address which you want to transfer to - * @param _value The amout of tokens to be transferred - * @param _data ABI-encoded contract call to call `_to` address. - * - * @return true if the call function was executed successfully - */ - function transferFrom( - address _from, - address _to, - uint256 _value, - bytes _data - ) - public returns (bool) - { - require(_to != address(this)); - - super.transferFrom(_from, _to, _value); - - require(_to.call(_data)); - return true; - } - - /** - * @dev Addition to StandardToken methods. Increase the amount of tokens that - * @dev an owner allowed to a spender and execute a call with the sent data. - * - * @dev approve should be called when allowed[_spender] == 0. To increment - * @dev allowed value is better to use this function to avoid 2 calls (and wait until - * @dev the first transaction is mined) - * @dev From MonolithDAO Token.sol - * - * @param _spender The address which will spend the funds. - * @param _addedValue The amount of tokens to increase the allowance by. - * @param _data ABI-encoded contract call to call `_spender` address. - */ - function increaseApproval(address _spender, uint _addedValue, bytes _data) public returns (bool) { - require(_spender != address(this)); - - super.increaseApproval(_spender, _addedValue); - - require(_spender.call(_data)); - - return true; - } - - /** - * @dev Addition to StandardToken methods. Decrease the amount of tokens that - * @dev an owner allowed to a spender and execute a call with the sent data. - * - * @dev approve should be called when allowed[_spender] == 0. To decrement - * @dev allowed value is better to use this function to avoid 2 calls (and wait until - * @dev the first transaction is mined) - * @dev From MonolithDAO Token.sol - * - * @param _spender The address which will spend the funds. - * @param _subtractedValue The amount of tokens to decrease the allowance by. - * @param _data ABI-encoded contract call to call `_spender` address. - */ - function decreaseApproval(address _spender, uint _subtractedValue, bytes _data) public returns (bool) { - require(_spender != address(this)); - - super.decreaseApproval(_spender, _subtractedValue); - - require(_spender.call(_data)); - - return true; - } - -} diff --git a/test/Bounty.test.js b/test/Bounty.test.js deleted file mode 100644 index b440f399c..000000000 --- a/test/Bounty.test.js +++ /dev/null @@ -1,111 +0,0 @@ - -let sendReward = function (sender, receiver, value) { - web3.eth.sendTransaction({ - from: sender, - to: receiver, - value: value, - }); -}; -var SecureTargetBounty = artifacts.require('SecureTargetBounty'); -var InsecureTargetBounty = artifacts.require('InsecureTargetBounty'); - -function awaitEvent (event, handler) { - return new Promise((resolve, reject) => { - function wrappedHandler (...args) { - Promise.resolve(handler(...args)).then(resolve).catch(reject); - } - - event.watch(wrappedHandler); - }); -} - -contract('Bounty', function (accounts) { - it('sets reward', async function () { - let owner = accounts[0]; - let reward = web3.toWei(1, 'ether'); - let bounty = await SecureTargetBounty.new(); - sendReward(owner, bounty.address, reward); - - assert.equal(reward, web3.eth.getBalance(bounty.address).toNumber()); - }); - - it('empties itself when destroyed', async function () { - let owner = accounts[0]; - let reward = web3.toWei(1, 'ether'); - let bounty = await SecureTargetBounty.new(); - sendReward(owner, bounty.address, reward); - - assert.equal(reward, web3.eth.getBalance(bounty.address).toNumber()); - - await bounty.destroy(); - assert.equal(0, web3.eth.getBalance(bounty.address).toNumber()); - }); - - describe('Against secure contract', function () { - it('cannot claim reward', async function () { - let owner = accounts[0]; - let researcher = accounts[1]; - let reward = web3.toWei(1, 'ether'); - let bounty = await SecureTargetBounty.new(); - let event = bounty.TargetCreated({}); - - let watcher = async function (err, result) { - event.stopWatching(); - if (err) { throw err; } - - var targetAddress = result.args.createdAddress; - sendReward(owner, bounty.address, reward); - - assert.equal(reward, - web3.eth.getBalance(bounty.address).toNumber()); - - try { - await bounty.claim(targetAddress, { from: researcher }); - assert.isTrue(false); // should never reach here - } catch (error) { - let reClaimedBounty = await bounty.claimed.call(); - assert.isFalse(reClaimedBounty); - } - try { - await bounty.withdrawPayments({ from: researcher }); - assert.isTrue(false); // should never reach here - } catch (err) { - assert.equal(reward, - web3.eth.getBalance(bounty.address).toNumber()); - } - }; - await bounty.createTarget({ from: researcher }); - await awaitEvent(event, watcher); - }); - }); - - describe('Against broken contract', function () { - it('claims reward', async function () { - let owner = accounts[0]; - let researcher = accounts[1]; - let reward = web3.toWei(1, 'ether'); - let bounty = await InsecureTargetBounty.new(); - let event = bounty.TargetCreated({}); - - let watcher = async function (err, result) { - event.stopWatching(); - if (err) { throw err; } - let targetAddress = result.args.createdAddress; - sendReward(owner, bounty.address, reward); - - assert.equal(reward, web3.eth.getBalance(bounty.address).toNumber()); - - await bounty.claim(targetAddress, { from: researcher }); - let claim = await bounty.claimed.call(); - - assert.isTrue(claim); - - await bounty.withdrawPayments({ from: researcher }); - - assert.equal(0, web3.eth.getBalance(bounty.address).toNumber()); - }; - await bounty.createTarget({ from: researcher }); - await awaitEvent(event, watcher); - }); - }); -}); diff --git a/test/DayLimit.test.js b/test/DayLimit.test.js deleted file mode 100644 index ab2aa903f..000000000 --- a/test/DayLimit.test.js +++ /dev/null @@ -1,88 +0,0 @@ - -import latestTime from './helpers/latestTime'; -import { increaseTimeTo, duration } from './helpers/increaseTime'; - -import assertRevert from './helpers/assertRevert'; - -const DayLimitMock = artifacts.require('DayLimitMock'); - -contract('DayLimit', function (accounts) { - let dayLimit; - let initLimit = 10; - - beforeEach(async function () { - this.startTime = latestTime(); - dayLimit = await DayLimitMock.new(initLimit); - }); - - it('should construct with the passed daily limit', async function () { - let dailyLimit = await dayLimit.dailyLimit(); - assert.equal(initLimit, dailyLimit); - }); - - it('should be able to spend if daily limit is not reached', async function () { - await dayLimit.attemptSpend(8); - let spentToday = await dayLimit.spentToday(); - assert.equal(spentToday, 8); - - await dayLimit.attemptSpend(2); - spentToday = await dayLimit.spentToday(); - assert.equal(spentToday, 10); - }); - - it('should prevent spending if daily limit is reached', async function () { - await dayLimit.attemptSpend(8); - let spentToday = await dayLimit.spentToday(); - assert.equal(spentToday, 8); - await assertRevert(dayLimit.attemptSpend(3)); - }); - - it('should allow spending if daily limit is reached and then set higher', async function () { - await dayLimit.attemptSpend(8); - let spentToday = await dayLimit.spentToday(); - assert.equal(spentToday, 8); - - await assertRevert(dayLimit.attemptSpend(3)); - spentToday = await dayLimit.spentToday(); - assert.equal(spentToday, 8); - - await dayLimit.setDailyLimit(15); - await dayLimit.attemptSpend(3); - spentToday = await dayLimit.spentToday(); - assert.equal(spentToday, 11); - }); - - it('should allow spending if daily limit is reached and then amount spent is reset', async function () { - await dayLimit.attemptSpend(8); - let spentToday = await dayLimit.spentToday(); - assert.equal(spentToday, 8); - - await assertRevert(dayLimit.attemptSpend(3)); - spentToday = await dayLimit.spentToday(); - assert.equal(spentToday, 8); - - await dayLimit.resetSpentToday(); - await dayLimit.attemptSpend(3); - spentToday = await dayLimit.spentToday(); - assert.equal(spentToday, 3); - }); - - it('should allow spending if daily limit is reached and then the next has come', async function () { - let limit = 10; - let dayLimit = await DayLimitMock.new(limit); - - await dayLimit.attemptSpend(8); - let spentToday = await dayLimit.spentToday(); - assert.equal(spentToday, 8); - - await assertRevert(dayLimit.attemptSpend(3)); - spentToday = await dayLimit.spentToday(); - assert.equal(spentToday, 8); - - await increaseTimeTo(this.startTime + duration.days(1)); - - await dayLimit.attemptSpend(3); - spentToday = await dayLimit.spentToday(); - assert.equal(spentToday, 3); - }); -}); diff --git a/test/Heritable.test.js b/test/Heritable.test.js deleted file mode 100644 index 2124a5279..000000000 --- a/test/Heritable.test.js +++ /dev/null @@ -1,136 +0,0 @@ -import increaseTime from './helpers/increaseTime'; -import expectThrow from './helpers/expectThrow'; -import assertRevert from './helpers/assertRevert'; - -const NULL_ADDRESS = '0x0000000000000000000000000000000000000000'; - -const Heritable = artifacts.require('Heritable'); - -contract('Heritable', function (accounts) { - let heritable; - let owner; - - beforeEach(async function () { - heritable = await Heritable.new(4141); - owner = await heritable.owner(); - }); - - it('should start off with an owner, but without heir', async function () { - const heir = await heritable.heir(); - - assert.equal(typeof (owner), 'string'); - assert.equal(typeof (heir), 'string'); - assert.notStrictEqual( - owner, NULL_ADDRESS, - 'Owner shouldn\'t be the null address' - ); - assert.isTrue( - heir === NULL_ADDRESS, - 'Heir should be the null address' - ); - }); - - it('only owner should set heir', async function () { - const newHeir = accounts[1]; - const someRandomAddress = accounts[2]; - assert.isTrue(owner !== someRandomAddress); - - await heritable.setHeir(newHeir, { from: owner }); - await expectThrow(heritable.setHeir(newHeir, { from: someRandomAddress })); - }); - - it('owner can\'t be heir', async function () { - await assertRevert(heritable.setHeir(owner, { from: owner })); - }); - - it('owner can remove heir', async function () { - const newHeir = accounts[1]; - await heritable.setHeir(newHeir, { from: owner }); - let heir = await heritable.heir(); - - assert.notStrictEqual(heir, NULL_ADDRESS); - await heritable.removeHeir(); - heir = await heritable.heir(); - assert.isTrue(heir === NULL_ADDRESS); - }); - - it('heir can claim ownership only if owner is dead and timeout was reached', async function () { - const heir = accounts[1]; - await heritable.setHeir(heir, { from: owner }); - await expectThrow(heritable.claimHeirOwnership({ from: heir })); - - await heritable.proclaimDeath({ from: heir }); - await increaseTime(1); - await expectThrow(heritable.claimHeirOwnership({ from: heir })); - - await increaseTime(4141); - await heritable.claimHeirOwnership({ from: heir }); - assert.isTrue(await heritable.heir() === heir); - }); - - it('only heir can proclaim death', async function () { - const someRandomAddress = accounts[2]; - await assertRevert(heritable.proclaimDeath({ from: owner })); - await assertRevert(heritable.proclaimDeath({ from: someRandomAddress })); - }); - - it('heir can\'t proclaim death if owner is death', async function () { - const heir = accounts[1]; - await heritable.setHeir(heir, { from: owner }); - await heritable.proclaimDeath({ from: heir }); - await assertRevert(heritable.proclaimDeath({ from: heir })); - }); - - it('heir can\'t claim ownership if owner heartbeats', async function () { - const heir = accounts[1]; - await heritable.setHeir(heir, { from: owner }); - - await heritable.proclaimDeath({ from: heir }); - await heritable.heartbeat({ from: owner }); - await expectThrow(heritable.claimHeirOwnership({ from: heir })); - - await heritable.proclaimDeath({ from: heir }); - await increaseTime(4141); - await heritable.heartbeat({ from: owner }); - await expectThrow(heritable.claimHeirOwnership({ from: heir })); - }); - - it('should log events appropriately', async function () { - const heir = accounts[1]; - - const setHeirLogs = (await heritable.setHeir(heir, { from: owner })).logs; - const setHeirEvent = setHeirLogs.find(e => e.event === 'HeirChanged'); - - assert.isTrue(setHeirEvent.args.owner === owner); - assert.isTrue(setHeirEvent.args.newHeir === heir); - - const heartbeatLogs = (await heritable.heartbeat({ from: owner })).logs; - const heartbeatEvent = heartbeatLogs.find(e => e.event === 'OwnerHeartbeated'); - - assert.isTrue(heartbeatEvent.args.owner === owner); - - const proclaimDeathLogs = (await heritable.proclaimDeath({ from: heir })).logs; - const ownerDeadEvent = proclaimDeathLogs.find(e => e.event === 'OwnerProclaimedDead'); - - assert.isTrue(ownerDeadEvent.args.owner === owner); - assert.isTrue(ownerDeadEvent.args.heir === heir); - - await increaseTime(4141); - const claimHeirOwnershipLogs = (await heritable.claimHeirOwnership({ from: heir })).logs; - const ownershipTransferredEvent = claimHeirOwnershipLogs.find(e => e.event === 'OwnershipTransferred'); - const heirOwnershipClaimedEvent = claimHeirOwnershipLogs.find(e => e.event === 'HeirOwnershipClaimed'); - - assert.isTrue(ownershipTransferredEvent.args.previousOwner === owner); - assert.isTrue(ownershipTransferredEvent.args.newOwner === heir); - assert.isTrue(heirOwnershipClaimedEvent.args.previousOwner === owner); - assert.isTrue(heirOwnershipClaimedEvent.args.newOwner === heir); - }); - - it('timeOfDeath can be queried', async function () { - assert.equal(await heritable.timeOfDeath(), 0); - }); - - it('heartbeatTimeout can be queried', async function () { - assert.equal(await heritable.heartbeatTimeout(), 4141); - }); -}); diff --git a/test/LimitBalance.test.js b/test/LimitBalance.test.js deleted file mode 100644 index 9df8b0dc8..000000000 --- a/test/LimitBalance.test.js +++ /dev/null @@ -1,47 +0,0 @@ -import assertRevert from './helpers/assertRevert'; -var LimitBalanceMock = artifacts.require('LimitBalanceMock'); - -contract('LimitBalance', function (accounts) { - let lb; - - beforeEach(async function () { - lb = await LimitBalanceMock.new(); - }); - - let LIMIT = 1000; - - it('should expose limit', async function () { - let limit = await lb.limit(); - assert.equal(limit, LIMIT); - }); - - it('should allow sending below limit', async function () { - let amount = 1; - await lb.limitedDeposit({ value: amount }); - - assert.equal(web3.eth.getBalance(lb.address), amount); - }); - - it('shouldnt allow sending above limit', async function () { - let amount = 1110; - await assertRevert(lb.limitedDeposit({ value: amount })); - }); - - it('should allow multiple sends below limit', async function () { - let amount = 500; - await lb.limitedDeposit({ value: amount }); - - assert.equal(web3.eth.getBalance(lb.address), amount); - - await lb.limitedDeposit({ value: amount }); - assert.equal(web3.eth.getBalance(lb.address), amount * 2); - }); - - it('shouldnt allow multiple sends above limit', async function () { - let amount = 500; - await lb.limitedDeposit({ value: amount }); - - assert.equal(web3.eth.getBalance(lb.address), amount); - await assertRevert(lb.limitedDeposit({ value: amount + 1 })); - }); -}); diff --git a/test/ReentrancyGuard.test.js b/test/ReentrancyGuard.test.js deleted file mode 100644 index 0e32cf369..000000000 --- a/test/ReentrancyGuard.test.js +++ /dev/null @@ -1,31 +0,0 @@ - -import expectThrow from './helpers/expectThrow'; -const ReentrancyMock = artifacts.require('ReentrancyMock'); -const ReentrancyAttack = artifacts.require('ReentrancyAttack'); - -contract('ReentrancyGuard', function (accounts) { - let reentrancyMock; - - beforeEach(async function () { - reentrancyMock = await ReentrancyMock.new(); - let initialCounter = await reentrancyMock.counter(); - assert.equal(initialCounter, 0); - }); - - it('should not allow remote callback', async function () { - let attacker = await ReentrancyAttack.new(); - await expectThrow(reentrancyMock.countAndCall(attacker.address)); - }); - - // The following are more side-effects than intended behaviour: - // I put them here as documentation, and to monitor any changes - // in the side-effects. - - it('should not allow local recursion', async function () { - await expectThrow(reentrancyMock.countLocalRecursive(10)); - }); - - it('should not allow indirect local recursion', async function () { - await expectThrow(reentrancyMock.countThisRecursive(10)); - }); -}); diff --git a/test/SimpleSavingsWallet.test.js b/test/SimpleSavingsWallet.test.js deleted file mode 100644 index 07787c2de..000000000 --- a/test/SimpleSavingsWallet.test.js +++ /dev/null @@ -1,33 +0,0 @@ - -import expectThrow from './helpers/expectThrow'; - -const SimpleSavingsWallet = artifacts.require('SimpleSavingsWallet'); - -contract('SimpleSavingsWallet', function (accounts) { - let savingsWallet; - let owner; - - const paymentAmount = 4242; - - beforeEach(async function () { - savingsWallet = await SimpleSavingsWallet.new(4141); - owner = await savingsWallet.owner(); - }); - - it('should receive funds', async function () { - await web3.eth.sendTransaction({ from: owner, to: savingsWallet.address, value: paymentAmount }); - assert.isTrue((new web3.BigNumber(paymentAmount)).equals(web3.eth.getBalance(savingsWallet.address))); - }); - - it('owner can send funds', async function () { - // Receive payment so we have some money to spend. - await web3.eth.sendTransaction({ from: accounts[9], to: savingsWallet.address, value: 1000000 }); - await expectThrow(savingsWallet.sendTo(0, paymentAmount, { from: owner })); - await expectThrow(savingsWallet.sendTo(savingsWallet.address, paymentAmount, { from: owner })); - await expectThrow(savingsWallet.sendTo(accounts[1], 0, { from: owner })); - - const balance = web3.eth.getBalance(accounts[1]); - await savingsWallet.sendTo(accounts[1], paymentAmount, { from: owner }); - assert.isTrue(balance.plus(paymentAmount).equals(web3.eth.getBalance(accounts[1]))); - }); -}); diff --git a/test/access/SignatureBouncer.test.js b/test/access/SignatureBouncer.test.js deleted file mode 100644 index 472a41226..000000000 --- a/test/access/SignatureBouncer.test.js +++ /dev/null @@ -1,119 +0,0 @@ - -import assertRevert from '../helpers/assertRevert'; -import { signHex } from '../helpers/sign'; - -const Bouncer = artifacts.require('SignatureBouncerMock'); - -require('chai') - .use(require('chai-as-promised')) - .should(); - -export const getSigner = (contract, signer, data = '') => (addr) => { - // via: https://github.com/OpenZeppelin/zeppelin-solidity/pull/812/files - const message = contract.address.substr(2) + addr.substr(2) + data; - // ^ substr to remove `0x` because in solidity the address is a set of byes, not a string `0xabcd` - return signHex(signer, message); -}; - -contract('Bouncer', ([_, owner, authorizedUser, anyone, bouncerAddress, newBouncer]) => { - before(async function () { - this.bouncer = await Bouncer.new({ from: owner }); - this.roleBouncer = await this.bouncer.ROLE_BOUNCER(); - this.genSig = getSigner(this.bouncer, bouncerAddress); - }); - - it('should have a default owner of self', async function () { - const theOwner = await this.bouncer.owner(); - theOwner.should.eq(owner); - }); - - it('should allow owner to add a bouncer', async function () { - await this.bouncer.addBouncer(bouncerAddress, { from: owner }); - const hasRole = await this.bouncer.hasRole(bouncerAddress, this.roleBouncer); - hasRole.should.eq(true); - }); - - it('should not allow anyone to add a bouncer', async function () { - await assertRevert( - this.bouncer.addBouncer(bouncerAddress, { from: anyone }) - ); - }); - - context('modifiers', () => { - it('should allow valid signature for sender', async function () { - await this.bouncer.onlyWithValidSignature( - this.genSig(authorizedUser), - { from: authorizedUser } - ); - }); - it('should not allow invalid signature for sender', async function () { - await assertRevert( - this.bouncer.onlyWithValidSignature( - 'abcd', - { from: authorizedUser } - ) - ); - }); - }); - - context('signatures', () => { - it('should accept valid message for valid user', async function () { - const isValid = await this.bouncer.checkValidSignature( - authorizedUser, - this.genSig(authorizedUser) - ); - isValid.should.eq(true); - }); - it('should not accept invalid message for valid user', async function () { - const isValid = await this.bouncer.checkValidSignature( - authorizedUser, - this.genSig(anyone) - ); - isValid.should.eq(false); - }); - it('should not accept invalid message for invalid user', async function () { - const isValid = await this.bouncer.checkValidSignature( - anyone, - 'abcd' - ); - isValid.should.eq(false); - }); - it('should not accept valid message for invalid user', async function () { - const isValid = await this.bouncer.checkValidSignature( - anyone, - this.genSig(authorizedUser) - ); - isValid.should.eq(false); - }); - }); - - context('management', () => { - it('should not allow anyone to add bouncers', async function () { - await assertRevert( - this.bouncer.addBouncer(newBouncer, { from: anyone }) - ); - }); - - it('should be able to add bouncers', async function () { - await this.bouncer.addBouncer(newBouncer, { from: owner }) - .should.be.fulfilled; - }); - - it('should not allow adding invalid address', async function () { - await assertRevert( - this.bouncer.addBouncer('0x0', { from: owner }) - ); - }); - - it('should not allow anyone to remove bouncer', async function () { - await assertRevert( - this.bouncer.removeBouncer(newBouncer, { from: anyone }) - ); - }); - - it('should be able to remove bouncers', async function () { - await this.bouncer.removeBouncer(newBouncer, { from: owner }) - .should.be.fulfilled; - }); - }); -}); diff --git a/test/crowdsale/AllowanceCrowdsale.test.js b/test/crowdsale/AllowanceCrowdsale.test.js deleted file mode 100644 index 44799010a..000000000 --- a/test/crowdsale/AllowanceCrowdsale.test.js +++ /dev/null @@ -1,77 +0,0 @@ -import ether from '../helpers/ether'; -import assertRevert from '../helpers/assertRevert'; - -const BigNumber = web3.BigNumber; - -const should = require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -const AllowanceCrowdsale = artifacts.require('AllowanceCrowdsaleImpl'); -const SimpleToken = artifacts.require('SimpleToken'); - -contract('AllowanceCrowdsale', function ([_, investor, wallet, purchaser, tokenWallet]) { - const rate = new BigNumber(1); - const value = ether(0.42); - const expectedTokenAmount = rate.mul(value); - const tokenAllowance = new BigNumber('1e22'); - const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; - - beforeEach(async function () { - this.token = await SimpleToken.new({ from: tokenWallet }); - this.crowdsale = await AllowanceCrowdsale.new(rate, wallet, this.token.address, tokenWallet); - await this.token.approve(this.crowdsale.address, tokenAllowance, { from: tokenWallet }); - }); - - describe('accepting payments', function () { - it('should accept sends', async function () { - await this.crowdsale.send(value).should.be.fulfilled; - }); - - it('should accept payments', async function () { - await this.crowdsale.buyTokens(investor, { value: value, from: purchaser }).should.be.fulfilled; - }); - }); - - describe('high-level purchase', function () { - it('should log purchase', async function () { - const { logs } = await this.crowdsale.sendTransaction({ value: value, from: investor }); - const event = logs.find(e => e.event === 'TokenPurchase'); - should.exist(event); - event.args.purchaser.should.equal(investor); - event.args.beneficiary.should.equal(investor); - event.args.value.should.be.bignumber.equal(value); - event.args.amount.should.be.bignumber.equal(expectedTokenAmount); - }); - - it('should assign tokens to sender', async function () { - await this.crowdsale.sendTransaction({ value: value, from: investor }); - let balance = await this.token.balanceOf(investor); - balance.should.be.bignumber.equal(expectedTokenAmount); - }); - - it('should forward funds to wallet', async function () { - const pre = web3.eth.getBalance(wallet); - await this.crowdsale.sendTransaction({ value, from: investor }); - const post = web3.eth.getBalance(wallet); - post.minus(pre).should.be.bignumber.equal(value); - }); - }); - - describe('check remaining allowance', function () { - it('should report correct allowace left', async function () { - let remainingAllowance = tokenAllowance - expectedTokenAmount; - await this.crowdsale.buyTokens(investor, { value: value, from: purchaser }); - let tokensRemaining = await this.crowdsale.remainingTokens(); - tokensRemaining.should.be.bignumber.equal(remainingAllowance); - }); - }); - - describe('when token wallet is different from token address', function () { - it('creation reverts', async function () { - this.token = await SimpleToken.new({ from: tokenWallet }); - await assertRevert(AllowanceCrowdsale.new(rate, wallet, this.token.address, ZERO_ADDRESS)); - }); - }); -}); diff --git a/test/crowdsale/CappedCrowdsale.test.js b/test/crowdsale/CappedCrowdsale.test.js deleted file mode 100644 index a3dd9660f..000000000 --- a/test/crowdsale/CappedCrowdsale.test.js +++ /dev/null @@ -1,69 +0,0 @@ -import ether from '../helpers/ether'; -import EVMRevert from '../helpers/EVMRevert'; - -const BigNumber = web3.BigNumber; - -require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -const CappedCrowdsale = artifacts.require('CappedCrowdsaleImpl'); -const SimpleToken = artifacts.require('SimpleToken'); - -contract('CappedCrowdsale', function ([_, wallet]) { - const rate = new BigNumber(1); - const cap = ether(100); - const lessThanCap = ether(60); - const tokenSupply = new BigNumber('1e22'); - - beforeEach(async function () { - this.token = await SimpleToken.new(); - this.crowdsale = await CappedCrowdsale.new(rate, wallet, this.token.address, cap); - await this.token.transfer(this.crowdsale.address, tokenSupply); - }); - - describe('creating a valid crowdsale', function () { - it('should fail with zero cap', async function () { - await CappedCrowdsale.new(rate, wallet, 0, this.token.address).should.be.rejectedWith(EVMRevert); - }); - }); - - describe('accepting payments', function () { - it('should accept payments within cap', async function () { - await this.crowdsale.send(cap.minus(lessThanCap)).should.be.fulfilled; - await this.crowdsale.send(lessThanCap).should.be.fulfilled; - }); - - it('should reject payments outside cap', async function () { - await this.crowdsale.send(cap); - await this.crowdsale.send(1).should.be.rejectedWith(EVMRevert); - }); - - it('should reject payments that exceed cap', async function () { - await this.crowdsale.send(cap.plus(1)).should.be.rejectedWith(EVMRevert); - }); - }); - - describe('ending', function () { - it('should not reach cap if sent under cap', async function () { - let capReached = await this.crowdsale.capReached(); - capReached.should.equal(false); - await this.crowdsale.send(lessThanCap); - capReached = await this.crowdsale.capReached(); - capReached.should.equal(false); - }); - - it('should not reach cap if sent just under cap', async function () { - await this.crowdsale.send(cap.minus(1)); - let capReached = await this.crowdsale.capReached(); - capReached.should.equal(false); - }); - - it('should reach cap if cap sent', async function () { - await this.crowdsale.send(cap); - let capReached = await this.crowdsale.capReached(); - capReached.should.equal(true); - }); - }); -}); diff --git a/test/crowdsale/Crowdsale.test.js b/test/crowdsale/Crowdsale.test.js deleted file mode 100644 index 4053dca37..000000000 --- a/test/crowdsale/Crowdsale.test.js +++ /dev/null @@ -1,81 +0,0 @@ -import ether from '../helpers/ether'; - -const BigNumber = web3.BigNumber; - -const should = require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -const Crowdsale = artifacts.require('Crowdsale'); -const SimpleToken = artifacts.require('SimpleToken'); - -contract('Crowdsale', function ([_, investor, wallet, purchaser]) { - const rate = new BigNumber(1); - const value = ether(42); - const tokenSupply = new BigNumber('1e22'); - const expectedTokenAmount = rate.mul(value); - - beforeEach(async function () { - this.token = await SimpleToken.new(); - this.crowdsale = await Crowdsale.new(rate, wallet, this.token.address); - await this.token.transfer(this.crowdsale.address, tokenSupply); - }); - - describe('accepting payments', function () { - it('should accept payments', async function () { - await this.crowdsale.send(value).should.be.fulfilled; - await this.crowdsale.buyTokens(investor, { value: value, from: purchaser }).should.be.fulfilled; - }); - }); - - describe('high-level purchase', function () { - it('should log purchase', async function () { - const { logs } = await this.crowdsale.sendTransaction({ value: value, from: investor }); - const event = logs.find(e => e.event === 'TokenPurchase'); - should.exist(event); - event.args.purchaser.should.equal(investor); - event.args.beneficiary.should.equal(investor); - event.args.value.should.be.bignumber.equal(value); - event.args.amount.should.be.bignumber.equal(expectedTokenAmount); - }); - - it('should assign tokens to sender', async function () { - await this.crowdsale.sendTransaction({ value: value, from: investor }); - let balance = await this.token.balanceOf(investor); - balance.should.be.bignumber.equal(expectedTokenAmount); - }); - - it('should forward funds to wallet', async function () { - const pre = web3.eth.getBalance(wallet); - await this.crowdsale.sendTransaction({ value, from: investor }); - const post = web3.eth.getBalance(wallet); - post.minus(pre).should.be.bignumber.equal(value); - }); - }); - - describe('low-level purchase', function () { - it('should log purchase', async function () { - const { logs } = await this.crowdsale.buyTokens(investor, { value: value, from: purchaser }); - const event = logs.find(e => e.event === 'TokenPurchase'); - should.exist(event); - event.args.purchaser.should.equal(purchaser); - event.args.beneficiary.should.equal(investor); - event.args.value.should.be.bignumber.equal(value); - event.args.amount.should.be.bignumber.equal(expectedTokenAmount); - }); - - it('should assign tokens to beneficiary', async function () { - await this.crowdsale.buyTokens(investor, { value, from: purchaser }); - const balance = await this.token.balanceOf(investor); - balance.should.be.bignumber.equal(expectedTokenAmount); - }); - - it('should forward funds to wallet', async function () { - const pre = web3.eth.getBalance(wallet); - await this.crowdsale.buyTokens(investor, { value, from: purchaser }); - const post = web3.eth.getBalance(wallet); - post.minus(pre).should.be.bignumber.equal(value); - }); - }); -}); diff --git a/test/crowdsale/FinalizableCrowdsale.test.js b/test/crowdsale/FinalizableCrowdsale.test.js deleted file mode 100644 index 9a6c16a6f..000000000 --- a/test/crowdsale/FinalizableCrowdsale.test.js +++ /dev/null @@ -1,62 +0,0 @@ -import { advanceBlock } from '../helpers/advanceToBlock'; -import { increaseTimeTo, duration } from '../helpers/increaseTime'; -import latestTime from '../helpers/latestTime'; -import EVMRevert from '../helpers/EVMRevert'; - -const BigNumber = web3.BigNumber; - -const should = require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -const FinalizableCrowdsale = artifacts.require('FinalizableCrowdsaleImpl'); -const MintableToken = artifacts.require('MintableToken'); - -contract('FinalizableCrowdsale', function ([_, owner, wallet, thirdparty]) { - const rate = new BigNumber(1000); - - before(async function () { - // Advance to the next block to correctly read time in the solidity "now" function interpreted by ganache - await advanceBlock(); - }); - - beforeEach(async function () { - this.openingTime = latestTime() + duration.weeks(1); - this.closingTime = this.openingTime + duration.weeks(1); - this.afterClosingTime = this.closingTime + duration.seconds(1); - - this.token = await MintableToken.new(); - this.crowdsale = await FinalizableCrowdsale.new( - this.openingTime, this.closingTime, rate, wallet, this.token.address, { from: owner } - ); - await this.token.transferOwnership(this.crowdsale.address); - }); - - it('cannot be finalized before ending', async function () { - await this.crowdsale.finalize({ from: owner }).should.be.rejectedWith(EVMRevert); - }); - - it('cannot be finalized by third party after ending', async function () { - await increaseTimeTo(this.afterClosingTime); - await this.crowdsale.finalize({ from: thirdparty }).should.be.rejectedWith(EVMRevert); - }); - - it('can be finalized by owner after ending', async function () { - await increaseTimeTo(this.afterClosingTime); - await this.crowdsale.finalize({ from: owner }).should.be.fulfilled; - }); - - it('cannot be finalized twice', async function () { - await increaseTimeTo(this.afterClosingTime); - await this.crowdsale.finalize({ from: owner }); - await this.crowdsale.finalize({ from: owner }).should.be.rejectedWith(EVMRevert); - }); - - it('logs finalized', async function () { - await increaseTimeTo(this.afterClosingTime); - const { logs } = await this.crowdsale.finalize({ from: owner }); - const event = logs.find(e => e.event === 'Finalized'); - should.exist(event); - }); -}); diff --git a/test/crowdsale/IncreasingPriceCrowdsale.test.js b/test/crowdsale/IncreasingPriceCrowdsale.test.js deleted file mode 100644 index 76f82ab02..000000000 --- a/test/crowdsale/IncreasingPriceCrowdsale.test.js +++ /dev/null @@ -1,92 +0,0 @@ -import ether from '../helpers/ether'; -import { advanceBlock } from '../helpers/advanceToBlock'; -import { increaseTimeTo, duration } from '../helpers/increaseTime'; -import latestTime from '../helpers/latestTime'; - -const BigNumber = web3.BigNumber; - -require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -const IncreasingPriceCrowdsale = artifacts.require('IncreasingPriceCrowdsaleImpl'); -const SimpleToken = artifacts.require('SimpleToken'); - -contract('IncreasingPriceCrowdsale', function ([_, investor, wallet, purchaser]) { - const value = ether(1); - const tokenSupply = new BigNumber('1e22'); - - describe('rate during crowdsale should change at a fixed step every block', async function () { - let balance; - const initialRate = new BigNumber(9166); - const finalRate = new BigNumber(5500); - const rateAtTime150 = new BigNumber(9166); - const rateAtTime300 = new BigNumber(9165); - const rateAtTime1500 = new BigNumber(9157); - const rateAtTime30 = new BigNumber(9166); - const rateAtTime150000 = new BigNumber(8257); - const rateAtTime450000 = new BigNumber(6439); - - beforeEach(async function () { - await advanceBlock(); - this.startTime = latestTime() + duration.weeks(1); - this.closingTime = this.startTime + duration.weeks(1); - this.afterClosingTime = this.closingTime + duration.seconds(1); - this.token = await SimpleToken.new(); - this.crowdsale = await IncreasingPriceCrowdsale.new( - this.startTime, this.closingTime, wallet, this.token.address, initialRate, finalRate - ); - await this.token.transfer(this.crowdsale.address, tokenSupply); - }); - - it('at start', async function () { - await increaseTimeTo(this.startTime); - await this.crowdsale.buyTokens(investor, { value, from: purchaser }); - balance = await this.token.balanceOf(investor); - balance.should.be.bignumber.equal(value.mul(initialRate)); - }); - - it('at time 150', async function () { - await increaseTimeTo(this.startTime + 150); - await this.crowdsale.buyTokens(investor, { value, from: purchaser }); - balance = await this.token.balanceOf(investor); - balance.should.be.bignumber.equal(value.mul(rateAtTime150)); - }); - - it('at time 300', async function () { - await increaseTimeTo(this.startTime + 300); - await this.crowdsale.buyTokens(investor, { value, from: purchaser }); - balance = await this.token.balanceOf(investor); - balance.should.be.bignumber.equal(value.mul(rateAtTime300)); - }); - - it('at time 1500', async function () { - await increaseTimeTo(this.startTime + 1500); - await this.crowdsale.buyTokens(investor, { value, from: purchaser }); - balance = await this.token.balanceOf(investor); - balance.should.be.bignumber.equal(value.mul(rateAtTime1500)); - }); - - it('at time 30', async function () { - await increaseTimeTo(this.startTime + 30); - await this.crowdsale.buyTokens(investor, { value, from: purchaser }); - balance = await this.token.balanceOf(investor); - balance.should.be.bignumber.equal(value.mul(rateAtTime30)); - }); - - it('at time 150000', async function () { - await increaseTimeTo(this.startTime + 150000); - await this.crowdsale.buyTokens(investor, { value, from: purchaser }); - balance = await this.token.balanceOf(investor); - balance.should.be.bignumber.equal(value.mul(rateAtTime150000)); - }); - - it('at time 450000', async function () { - await increaseTimeTo(this.startTime + 450000); - await this.crowdsale.buyTokens(investor, { value, from: purchaser }); - balance = await this.token.balanceOf(investor); - balance.should.be.bignumber.equal(value.mul(rateAtTime450000)); - }); - }); -}); diff --git a/test/crowdsale/IndividuallyCappedCrowdsale.test.js b/test/crowdsale/IndividuallyCappedCrowdsale.test.js deleted file mode 100644 index e8585ad6d..000000000 --- a/test/crowdsale/IndividuallyCappedCrowdsale.test.js +++ /dev/null @@ -1,107 +0,0 @@ -import ether from '../helpers/ether'; -import EVMRevert from '../helpers/EVMRevert'; - -const BigNumber = web3.BigNumber; - -require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -const CappedCrowdsale = artifacts.require('IndividuallyCappedCrowdsaleImpl'); -const SimpleToken = artifacts.require('SimpleToken'); - -contract('IndividuallyCappedCrowdsale', function ([_, wallet, alice, bob, charlie]) { - const rate = new BigNumber(1); - const capAlice = ether(10); - const capBob = ether(2); - const lessThanCapAlice = ether(6); - const lessThanCapBoth = ether(1); - const tokenSupply = new BigNumber('1e22'); - - describe('individual capping', function () { - beforeEach(async function () { - this.token = await SimpleToken.new(); - this.crowdsale = await CappedCrowdsale.new(rate, wallet, this.token.address); - await this.crowdsale.setUserCap(alice, capAlice); - await this.crowdsale.setUserCap(bob, capBob); - await this.token.transfer(this.crowdsale.address, tokenSupply); - }); - - describe('accepting payments', function () { - it('should accept payments within cap', async function () { - await this.crowdsale.buyTokens(alice, { value: lessThanCapAlice }).should.be.fulfilled; - await this.crowdsale.buyTokens(bob, { value: lessThanCapBoth }).should.be.fulfilled; - }); - - it('should reject payments outside cap', async function () { - await this.crowdsale.buyTokens(alice, { value: capAlice }); - await this.crowdsale.buyTokens(alice, { value: 1 }).should.be.rejectedWith(EVMRevert); - }); - - it('should reject payments that exceed cap', async function () { - await this.crowdsale.buyTokens(alice, { value: capAlice.plus(1) }).should.be.rejectedWith(EVMRevert); - await this.crowdsale.buyTokens(bob, { value: capBob.plus(1) }).should.be.rejectedWith(EVMRevert); - }); - - it('should manage independent caps', async function () { - await this.crowdsale.buyTokens(alice, { value: lessThanCapAlice }).should.be.fulfilled; - await this.crowdsale.buyTokens(bob, { value: lessThanCapAlice }).should.be.rejectedWith(EVMRevert); - }); - - it('should default to a cap of zero', async function () { - await this.crowdsale.buyTokens(charlie, { value: lessThanCapBoth }).should.be.rejectedWith(EVMRevert); - }); - }); - - describe('reporting state', function () { - it('should report correct cap', async function () { - let retrievedCap = await this.crowdsale.getUserCap(alice); - retrievedCap.should.be.bignumber.equal(capAlice); - }); - - it('should report actual contribution', async function () { - await this.crowdsale.buyTokens(alice, { value: lessThanCapAlice }); - let retrievedContribution = await this.crowdsale.getUserContribution(alice); - retrievedContribution.should.be.bignumber.equal(lessThanCapAlice); - }); - }); - }); - - describe('group capping', function () { - beforeEach(async function () { - this.token = await SimpleToken.new(); - this.crowdsale = await CappedCrowdsale.new(rate, wallet, this.token.address); - await this.crowdsale.setGroupCap([bob, charlie], capBob); - await this.token.transfer(this.crowdsale.address, tokenSupply); - }); - - describe('accepting payments', function () { - it('should accept payments within cap', async function () { - await this.crowdsale.buyTokens(bob, { value: lessThanCapBoth }).should.be.fulfilled; - await this.crowdsale.buyTokens(charlie, { value: lessThanCapBoth }).should.be.fulfilled; - }); - - it('should reject payments outside cap', async function () { - await this.crowdsale.buyTokens(bob, { value: capBob }); - await this.crowdsale.buyTokens(bob, { value: 1 }).should.be.rejectedWith(EVMRevert); - await this.crowdsale.buyTokens(charlie, { value: capBob }); - await this.crowdsale.buyTokens(charlie, { value: 1 }).should.be.rejectedWith(EVMRevert); - }); - - it('should reject payments that exceed cap', async function () { - await this.crowdsale.buyTokens(bob, { value: capBob.plus(1) }).should.be.rejectedWith(EVMRevert); - await this.crowdsale.buyTokens(charlie, { value: capBob.plus(1) }).should.be.rejectedWith(EVMRevert); - }); - }); - - describe('reporting state', function () { - it('should report correct cap', async function () { - let retrievedCapBob = await this.crowdsale.getUserCap(bob); - retrievedCapBob.should.be.bignumber.equal(capBob); - let retrievedCapCharlie = await this.crowdsale.getUserCap(charlie); - retrievedCapCharlie.should.be.bignumber.equal(capBob); - }); - }); - }); -}); diff --git a/test/crowdsale/MintedCrowdsale.test.js b/test/crowdsale/MintedCrowdsale.test.js deleted file mode 100644 index 362dc23af..000000000 --- a/test/crowdsale/MintedCrowdsale.test.js +++ /dev/null @@ -1,61 +0,0 @@ -import ether from '../helpers/ether'; - -const BigNumber = web3.BigNumber; - -const should = require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -const MintedCrowdsale = artifacts.require('MintedCrowdsaleImpl'); -const MintableToken = artifacts.require('MintableToken'); - -contract('MintedCrowdsale', function ([_, investor, wallet, purchaser]) { - const rate = new BigNumber(1000); - const value = ether(42); - - const expectedTokenAmount = rate.mul(value); - - beforeEach(async function () { - this.token = await MintableToken.new(); - this.crowdsale = await MintedCrowdsale.new(rate, wallet, this.token.address); - await this.token.transferOwnership(this.crowdsale.address); - }); - - describe('accepting payments', function () { - it('should be token owner', async function () { - const owner = await this.token.owner(); - owner.should.equal(this.crowdsale.address); - }); - - it('should accept payments', async function () { - await this.crowdsale.send(value).should.be.fulfilled; - await this.crowdsale.buyTokens(investor, { value: value, from: purchaser }).should.be.fulfilled; - }); - }); - - describe('high-level purchase', function () { - it('should log purchase', async function () { - const { logs } = await this.crowdsale.sendTransaction({ value: value, from: investor }); - const event = logs.find(e => e.event === 'TokenPurchase'); - should.exist(event); - event.args.purchaser.should.equal(investor); - event.args.beneficiary.should.equal(investor); - event.args.value.should.be.bignumber.equal(value); - event.args.amount.should.be.bignumber.equal(expectedTokenAmount); - }); - - it('should assign tokens to sender', async function () { - await this.crowdsale.sendTransaction({ value: value, from: investor }); - let balance = await this.token.balanceOf(investor); - balance.should.be.bignumber.equal(expectedTokenAmount); - }); - - it('should forward funds to wallet', async function () { - const pre = web3.eth.getBalance(wallet); - await this.crowdsale.sendTransaction({ value, from: investor }); - const post = web3.eth.getBalance(wallet); - post.minus(pre).should.be.bignumber.equal(value); - }); - }); -}); diff --git a/test/crowdsale/PostDeliveryCrowdsale.test.js b/test/crowdsale/PostDeliveryCrowdsale.test.js deleted file mode 100644 index 1860a8dea..000000000 --- a/test/crowdsale/PostDeliveryCrowdsale.test.js +++ /dev/null @@ -1,67 +0,0 @@ -import { advanceBlock } from '../helpers/advanceToBlock'; -import { increaseTimeTo, duration } from '../helpers/increaseTime'; -import latestTime from '../helpers/latestTime'; -import EVMRevert from '../helpers/EVMRevert'; -import ether from '../helpers/ether'; - -const BigNumber = web3.BigNumber; - -require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -const PostDeliveryCrowdsale = artifacts.require('PostDeliveryCrowdsaleImpl'); -const SimpleToken = artifacts.require('SimpleToken'); - -contract('PostDeliveryCrowdsale', function ([_, investor, wallet, purchaser]) { - const rate = new BigNumber(1); - const value = ether(42); - const tokenSupply = new BigNumber('1e22'); - - before(async function () { - // Advance to the next block to correctly read time in the solidity "now" function interpreted by ganache - await advanceBlock(); - }); - - beforeEach(async function () { - this.openingTime = latestTime() + duration.weeks(1); - this.closingTime = this.openingTime + duration.weeks(1); - this.beforeEndTime = this.closingTime - duration.hours(1); - this.afterClosingTime = this.closingTime + duration.seconds(1); - this.token = await SimpleToken.new(); - this.crowdsale = await PostDeliveryCrowdsale.new( - this.openingTime, this.closingTime, rate, wallet, this.token.address - ); - await this.token.transfer(this.crowdsale.address, tokenSupply); - }); - - it('should not immediately assign tokens to beneficiary', async function () { - await increaseTimeTo(this.openingTime); - await this.crowdsale.buyTokens(investor, { value: value, from: purchaser }); - const balance = await this.token.balanceOf(investor); - balance.should.be.bignumber.equal(0); - }); - - it('should not allow beneficiaries to withdraw tokens before crowdsale ends', async function () { - await increaseTimeTo(this.beforeEndTime); - await this.crowdsale.buyTokens(investor, { value: value, from: purchaser }); - await this.crowdsale.withdrawTokens({ from: investor }).should.be.rejectedWith(EVMRevert); - }); - - it('should allow beneficiaries to withdraw tokens after crowdsale ends', async function () { - await increaseTimeTo(this.openingTime); - await this.crowdsale.buyTokens(investor, { value: value, from: purchaser }); - await increaseTimeTo(this.afterClosingTime); - await this.crowdsale.withdrawTokens({ from: investor }).should.be.fulfilled; - }); - - it('should return the amount of tokens bought', async function () { - await increaseTimeTo(this.openingTime); - await this.crowdsale.buyTokens(investor, { value: value, from: purchaser }); - await increaseTimeTo(this.afterClosingTime); - await this.crowdsale.withdrawTokens({ from: investor }); - const balance = await this.token.balanceOf(investor); - balance.should.be.bignumber.equal(value); - }); -}); diff --git a/test/crowdsale/RefundVault.test.js b/test/crowdsale/RefundVault.test.js deleted file mode 100644 index e3b88dfce..000000000 --- a/test/crowdsale/RefundVault.test.js +++ /dev/null @@ -1,59 +0,0 @@ -import ether from '../helpers/ether'; -import EVMRevert from '../helpers/EVMRevert'; - -const BigNumber = web3.BigNumber; - -require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -const RefundVault = artifacts.require('RefundVault'); - -contract('RefundVault', function ([_, owner, wallet, investor]) { - const value = ether(42); - - beforeEach(async function () { - this.vault = await RefundVault.new(wallet, { from: owner }); - }); - - it('should accept contributions', async function () { - await this.vault.deposit(investor, { value, from: owner }).should.be.fulfilled; - }); - - it('should not refund contribution during active state', async function () { - await this.vault.deposit(investor, { value, from: owner }); - await this.vault.refund(investor).should.be.rejectedWith(EVMRevert); - }); - - it('only owner can enter refund mode', async function () { - await this.vault.enableRefunds({ from: _ }).should.be.rejectedWith(EVMRevert); - await this.vault.enableRefunds({ from: owner }).should.be.fulfilled; - }); - - it('should refund contribution after entering refund mode', async function () { - await this.vault.deposit(investor, { value, from: owner }); - await this.vault.enableRefunds({ from: owner }); - - const pre = web3.eth.getBalance(investor); - await this.vault.refund(investor); - const post = web3.eth.getBalance(investor); - - post.minus(pre).should.be.bignumber.equal(value); - }); - - it('only owner can close', async function () { - await this.vault.close({ from: _ }).should.be.rejectedWith(EVMRevert); - await this.vault.close({ from: owner }).should.be.fulfilled; - }); - - it('should forward funds to wallet after closing', async function () { - await this.vault.deposit(investor, { value, from: owner }); - - const pre = web3.eth.getBalance(wallet); - await this.vault.close({ from: owner }); - const post = web3.eth.getBalance(wallet); - - post.minus(pre).should.be.bignumber.equal(value); - }); -}); diff --git a/test/crowdsale/RefundableCrowdsale.test.js b/test/crowdsale/RefundableCrowdsale.test.js deleted file mode 100644 index 551e65c98..000000000 --- a/test/crowdsale/RefundableCrowdsale.test.js +++ /dev/null @@ -1,82 +0,0 @@ -import ether from '../helpers/ether'; -import { advanceBlock } from '../helpers/advanceToBlock'; -import { increaseTimeTo, duration } from '../helpers/increaseTime'; -import latestTime from '../helpers/latestTime'; -import EVMRevert from '../helpers/EVMRevert'; - -const BigNumber = web3.BigNumber; - -require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -const RefundableCrowdsale = artifacts.require('RefundableCrowdsaleImpl'); -const SimpleToken = artifacts.require('SimpleToken'); - -contract('RefundableCrowdsale', function ([_, owner, wallet, investor, purchaser]) { - const rate = new BigNumber(1); - const goal = ether(50); - const lessThanGoal = ether(45); - const tokenSupply = new BigNumber('1e22'); - - before(async function () { - // Advance to the next block to correctly read time in the solidity "now" function interpreted by ganache - await advanceBlock(); - }); - - beforeEach(async function () { - this.openingTime = latestTime() + duration.weeks(1); - this.closingTime = this.openingTime + duration.weeks(1); - this.afterClosingTime = this.closingTime + duration.seconds(1); - - this.token = await SimpleToken.new(); - this.crowdsale = await RefundableCrowdsale.new( - this.openingTime, this.closingTime, rate, wallet, this.token.address, goal, { from: owner } - ); - await this.token.transfer(this.crowdsale.address, tokenSupply); - }); - - describe('creating a valid crowdsale', function () { - it('should fail with zero goal', async function () { - await RefundableCrowdsale.new( - this.openingTime, this.closingTime, rate, wallet, this.token.address, 0, { from: owner } - ).should.be.rejectedWith(EVMRevert); - }); - }); - - it('should deny refunds before end', async function () { - await this.crowdsale.claimRefund({ from: investor }).should.be.rejectedWith(EVMRevert); - await increaseTimeTo(this.openingTime); - await this.crowdsale.claimRefund({ from: investor }).should.be.rejectedWith(EVMRevert); - }); - - it('should deny refunds after end if goal was reached', async function () { - await increaseTimeTo(this.openingTime); - await this.crowdsale.sendTransaction({ value: goal, from: investor }); - await increaseTimeTo(this.afterClosingTime); - await this.crowdsale.claimRefund({ from: investor }).should.be.rejectedWith(EVMRevert); - }); - - it('should allow refunds after end if goal was not reached', async function () { - await increaseTimeTo(this.openingTime); - await this.crowdsale.sendTransaction({ value: lessThanGoal, from: investor }); - await increaseTimeTo(this.afterClosingTime); - await this.crowdsale.finalize({ from: owner }); - const pre = web3.eth.getBalance(investor); - await this.crowdsale.claimRefund({ from: investor, gasPrice: 0 }) - .should.be.fulfilled; - const post = web3.eth.getBalance(investor); - post.minus(pre).should.be.bignumber.equal(lessThanGoal); - }); - - it('should forward funds to wallet after end if goal was reached', async function () { - await increaseTimeTo(this.openingTime); - await this.crowdsale.sendTransaction({ value: goal, from: investor }); - await increaseTimeTo(this.afterClosingTime); - const pre = web3.eth.getBalance(wallet); - await this.crowdsale.finalize({ from: owner }); - const post = web3.eth.getBalance(wallet); - post.minus(pre).should.be.bignumber.equal(goal); - }); -}); diff --git a/test/crowdsale/TimedCrowdsale.test.js b/test/crowdsale/TimedCrowdsale.test.js deleted file mode 100644 index ad54792a4..000000000 --- a/test/crowdsale/TimedCrowdsale.test.js +++ /dev/null @@ -1,62 +0,0 @@ -import ether from '../helpers/ether'; -import { advanceBlock } from '../helpers/advanceToBlock'; -import { increaseTimeTo, duration } from '../helpers/increaseTime'; -import latestTime from '../helpers/latestTime'; -import EVMRevert from '../helpers/EVMRevert'; - -const BigNumber = web3.BigNumber; - -require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -const TimedCrowdsale = artifacts.require('TimedCrowdsaleImpl'); -const SimpleToken = artifacts.require('SimpleToken'); - -contract('TimedCrowdsale', function ([_, investor, wallet, purchaser]) { - const rate = new BigNumber(1); - const value = ether(42); - const tokenSupply = new BigNumber('1e22'); - - before(async function () { - // Advance to the next block to correctly read time in the solidity "now" function interpreted by ganache - await advanceBlock(); - }); - - beforeEach(async function () { - this.openingTime = latestTime() + duration.weeks(1); - this.closingTime = this.openingTime + duration.weeks(1); - this.afterClosingTime = this.closingTime + duration.seconds(1); - this.token = await SimpleToken.new(); - this.crowdsale = await TimedCrowdsale.new(this.openingTime, this.closingTime, rate, wallet, this.token.address); - await this.token.transfer(this.crowdsale.address, tokenSupply); - }); - - it('should be ended only after end', async function () { - let ended = await this.crowdsale.hasClosed(); - ended.should.equal(false); - await increaseTimeTo(this.afterClosingTime); - ended = await this.crowdsale.hasClosed(); - ended.should.equal(true); - }); - - describe('accepting payments', function () { - it('should reject payments before start', async function () { - await this.crowdsale.send(value).should.be.rejectedWith(EVMRevert); - await this.crowdsale.buyTokens(investor, { from: purchaser, value: value }).should.be.rejectedWith(EVMRevert); - }); - - it('should accept payments after start', async function () { - await increaseTimeTo(this.openingTime); - await this.crowdsale.send(value).should.be.fulfilled; - await this.crowdsale.buyTokens(investor, { value: value, from: purchaser }).should.be.fulfilled; - }); - - it('should reject payments after end', async function () { - await increaseTimeTo(this.afterClosingTime); - await this.crowdsale.send(value).should.be.rejectedWith(EVMRevert); - await this.crowdsale.buyTokens(investor, { value: value, from: purchaser }).should.be.rejectedWith(EVMRevert); - }); - }); -}); diff --git a/test/crowdsale/WhitelistedCrowdsale.test.js b/test/crowdsale/WhitelistedCrowdsale.test.js deleted file mode 100644 index e62016ace..000000000 --- a/test/crowdsale/WhitelistedCrowdsale.test.js +++ /dev/null @@ -1,93 +0,0 @@ -import ether from '../helpers/ether'; - -const BigNumber = web3.BigNumber; - -require('chai') - .use(require('chai-as-promised')) - .should(); - -const WhitelistedCrowdsale = artifacts.require('WhitelistedCrowdsaleImpl'); -const SimpleToken = artifacts.require('SimpleToken'); - -contract('WhitelistedCrowdsale', function ([_, wallet, authorized, unauthorized, anotherAuthorized]) { - const rate = 1; - const value = ether(42); - const tokenSupply = new BigNumber('1e22'); - - describe('single user whitelisting', function () { - beforeEach(async function () { - this.token = await SimpleToken.new(); - this.crowdsale = await WhitelistedCrowdsale.new(rate, wallet, this.token.address); - await this.token.transfer(this.crowdsale.address, tokenSupply); - await this.crowdsale.addToWhitelist(authorized); - }); - - describe('accepting payments', function () { - it('should accept payments to whitelisted (from whichever buyers)', async function () { - await this.crowdsale.buyTokens(authorized, { value: value, from: authorized }).should.be.fulfilled; - await this.crowdsale.buyTokens(authorized, { value: value, from: unauthorized }).should.be.fulfilled; - }); - - it('should reject payments to not whitelisted (from whichever buyers)', async function () { - await this.crowdsale.send(value).should.be.rejected; - await this.crowdsale.buyTokens(unauthorized, { value: value, from: unauthorized }).should.be.rejected; - await this.crowdsale.buyTokens(unauthorized, { value: value, from: authorized }).should.be.rejected; - }); - - it('should reject payments to addresses removed from whitelist', async function () { - await this.crowdsale.removeFromWhitelist(authorized); - await this.crowdsale.buyTokens(authorized, { value: value, from: authorized }).should.be.rejected; - }); - }); - - describe('reporting whitelisted', function () { - it('should correctly report whitelisted addresses', async function () { - let isAuthorized = await this.crowdsale.whitelist(authorized); - isAuthorized.should.equal(true); - let isntAuthorized = await this.crowdsale.whitelist(unauthorized); - isntAuthorized.should.equal(false); - }); - }); - }); - - describe('many user whitelisting', function () { - beforeEach(async function () { - this.token = await SimpleToken.new(); - this.crowdsale = await WhitelistedCrowdsale.new(rate, wallet, this.token.address); - await this.token.transfer(this.crowdsale.address, tokenSupply); - await this.crowdsale.addManyToWhitelist([authorized, anotherAuthorized]); - }); - - describe('accepting payments', function () { - it('should accept payments to whitelisted (from whichever buyers)', async function () { - await this.crowdsale.buyTokens(authorized, { value: value, from: authorized }).should.be.fulfilled; - await this.crowdsale.buyTokens(authorized, { value: value, from: unauthorized }).should.be.fulfilled; - await this.crowdsale.buyTokens(anotherAuthorized, { value: value, from: authorized }).should.be.fulfilled; - await this.crowdsale.buyTokens(anotherAuthorized, { value: value, from: unauthorized }).should.be.fulfilled; - }); - - it('should reject payments to not whitelisted (with whichever buyers)', async function () { - await this.crowdsale.send(value).should.be.rejected; - await this.crowdsale.buyTokens(unauthorized, { value: value, from: unauthorized }).should.be.rejected; - await this.crowdsale.buyTokens(unauthorized, { value: value, from: authorized }).should.be.rejected; - }); - - it('should reject payments to addresses removed from whitelist', async function () { - await this.crowdsale.removeFromWhitelist(anotherAuthorized); - await this.crowdsale.buyTokens(authorized, { value: value, from: authorized }).should.be.fulfilled; - await this.crowdsale.buyTokens(anotherAuthorized, { value: value, from: authorized }).should.be.rejected; - }); - }); - - describe('reporting whitelisted', function () { - it('should correctly report whitelisted addresses', async function () { - let isAuthorized = await this.crowdsale.whitelist(authorized); - isAuthorized.should.equal(true); - let isAnotherAuthorized = await this.crowdsale.whitelist(anotherAuthorized); - isAnotherAuthorized.should.equal(true); - let isntAuthorized = await this.crowdsale.whitelist(unauthorized); - isntAuthorized.should.equal(false); - }); - }); - }); -}); diff --git a/test/examples/SampleCrowdsale.test.js b/test/examples/SampleCrowdsale.test.js deleted file mode 100644 index 45d0c216e..000000000 --- a/test/examples/SampleCrowdsale.test.js +++ /dev/null @@ -1,126 +0,0 @@ -import ether from '../helpers/ether'; -import { advanceBlock } from '../helpers/advanceToBlock'; -import { increaseTimeTo, duration } from '../helpers/increaseTime'; -import latestTime from '../helpers/latestTime'; -import EVMRevert from '../helpers/EVMRevert'; -import assertRevert from '../helpers/assertRevert'; - -const BigNumber = web3.BigNumber; - -require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -const SampleCrowdsale = artifacts.require('SampleCrowdsale'); -const SampleCrowdsaleToken = artifacts.require('SampleCrowdsaleToken'); -const RefundVault = artifacts.require('RefundVault'); - -contract('SampleCrowdsale', function ([owner, wallet, investor]) { - const RATE = new BigNumber(10); - const GOAL = ether(10); - const CAP = ether(20); - - before(async function () { - // Advance to the next block to correctly read time in the solidity "now" function interpreted by ganache - await advanceBlock(); - }); - - beforeEach(async function () { - this.openingTime = latestTime() + duration.weeks(1); - this.closingTime = this.openingTime + duration.weeks(1); - this.afterClosingTime = this.closingTime + duration.seconds(1); - - this.token = await SampleCrowdsaleToken.new({ from: owner }); - this.vault = await RefundVault.new(wallet, { from: owner }); - this.crowdsale = await SampleCrowdsale.new( - this.openingTime, this.closingTime, RATE, wallet, CAP, this.token.address, GOAL - ); - await this.token.transferOwnership(this.crowdsale.address); - await this.vault.transferOwnership(this.crowdsale.address); - }); - - it('should create crowdsale with correct parameters', async function () { - this.crowdsale.should.exist; - this.token.should.exist; - - const openingTime = await this.crowdsale.openingTime(); - const closingTime = await this.crowdsale.closingTime(); - const rate = await this.crowdsale.rate(); - const walletAddress = await this.crowdsale.wallet(); - const goal = await this.crowdsale.goal(); - const cap = await this.crowdsale.cap(); - - openingTime.should.be.bignumber.equal(this.openingTime); - closingTime.should.be.bignumber.equal(this.closingTime); - rate.should.be.bignumber.equal(RATE); - walletAddress.should.be.equal(wallet); - goal.should.be.bignumber.equal(GOAL); - cap.should.be.bignumber.equal(CAP); - }); - - it('should not accept payments before start', async function () { - await this.crowdsale.send(ether(1)).should.be.rejectedWith(EVMRevert); - await this.crowdsale.buyTokens(investor, { from: investor, value: ether(1) }).should.be.rejectedWith(EVMRevert); - }); - - it('should accept payments during the sale', async function () { - const investmentAmount = ether(1); - const expectedTokenAmount = RATE.mul(investmentAmount); - - await increaseTimeTo(this.openingTime); - await this.crowdsale.buyTokens(investor, { value: investmentAmount, from: investor }).should.be.fulfilled; - - (await this.token.balanceOf(investor)).should.be.bignumber.equal(expectedTokenAmount); - (await this.token.totalSupply()).should.be.bignumber.equal(expectedTokenAmount); - }); - - it('should reject payments after end', async function () { - await increaseTimeTo(this.afterEnd); - await this.crowdsale.send(ether(1)).should.be.rejectedWith(EVMRevert); - await this.crowdsale.buyTokens(investor, { value: ether(1), from: investor }).should.be.rejectedWith(EVMRevert); - }); - - it('should reject payments over cap', async function () { - await increaseTimeTo(this.openingTime); - await this.crowdsale.send(CAP); - await this.crowdsale.send(1).should.be.rejectedWith(EVMRevert); - }); - - it('should allow finalization and transfer funds to wallet if the goal is reached', async function () { - await increaseTimeTo(this.openingTime); - await this.crowdsale.send(GOAL); - - const beforeFinalization = web3.eth.getBalance(wallet); - await increaseTimeTo(this.afterClosingTime); - await this.crowdsale.finalize({ from: owner }); - const afterFinalization = web3.eth.getBalance(wallet); - - afterFinalization.minus(beforeFinalization).should.be.bignumber.equal(GOAL); - }); - - it('should allow refunds if the goal is not reached', async function () { - const balanceBeforeInvestment = web3.eth.getBalance(investor); - - await increaseTimeTo(this.openingTime); - await this.crowdsale.sendTransaction({ value: ether(1), from: investor, gasPrice: 0 }); - await increaseTimeTo(this.afterClosingTime); - - await this.crowdsale.finalize({ from: owner }); - await this.crowdsale.claimRefund({ from: investor, gasPrice: 0 }).should.be.fulfilled; - - const balanceAfterRefund = web3.eth.getBalance(investor); - balanceBeforeInvestment.should.be.bignumber.equal(balanceAfterRefund); - }); - - describe('when goal > cap', function () { - // goal > cap - const HIGH_GOAL = ether(30); - - it('creation reverts', async function () { - await assertRevert(SampleCrowdsale.new( - this.openingTime, this.closingTime, RATE, wallet, CAP, this.token.address, HIGH_GOAL - )); - }); - }); -}); diff --git a/test/examples/SimpleToken.test.js b/test/examples/SimpleToken.test.js deleted file mode 100644 index 3d173ca35..000000000 --- a/test/examples/SimpleToken.test.js +++ /dev/null @@ -1,41 +0,0 @@ -import decodeLogs from '../helpers/decodeLogs'; -const SimpleToken = artifacts.require('SimpleToken'); - -contract('SimpleToken', accounts => { - let token; - const creator = accounts[0]; - - beforeEach(async function () { - token = await SimpleToken.new({ from: creator }); - }); - - it('has a name', async function () { - const name = await token.name(); - assert.equal(name, 'SimpleToken'); - }); - - it('has a symbol', async function () { - const symbol = await token.symbol(); - assert.equal(symbol, 'SIM'); - }); - - it('has 18 decimals', async function () { - const decimals = await token.decimals(); - assert(decimals.eq(18)); - }); - - it('assigns the initial total supply to the creator', async function () { - const totalSupply = await token.totalSupply(); - const creatorBalance = await token.balanceOf(creator); - - assert(creatorBalance.eq(totalSupply)); - - const receipt = web3.eth.getTransactionReceipt(token.transactionHash); - const logs = decodeLogs(receipt.logs, SimpleToken, token.address); - assert.equal(logs.length, 1); - assert.equal(logs[0].event, 'Transfer'); - assert.equal(logs[0].args.from.valueOf(), 0x0); - assert.equal(logs[0].args.to.valueOf(), creator); - assert(logs[0].args.value.eq(totalSupply)); - }); -}); diff --git a/test/library/ECRecovery.test.js b/test/library/ECRecovery.test.js deleted file mode 100644 index 7ea55823f..000000000 --- a/test/library/ECRecovery.test.js +++ /dev/null @@ -1,77 +0,0 @@ - -import { - hashMessage, - signMessage, -} from '../helpers/sign'; -const ECRecoveryMock = artifacts.require('ECRecoveryMock'); - -require('chai') - .use(require('chai-as-promised')) - .should(); - -contract('ECRecovery', function (accounts) { - let ecrecovery; - const TEST_MESSAGE = 'OpenZeppelin'; - - before(async function () { - ecrecovery = await ECRecoveryMock.new(); - }); - - it('recover v0', async function () { - // Signature generated outside ganache with method web3.eth.sign(signer, message) - let signer = '0x2cc1166f6212628a0deef2b33befb2187d35b86c'; - let message = web3.sha3(TEST_MESSAGE); - // eslint-disable-next-line max-len - let signature = '0x5d99b6f7f6d1f73d1a26497f2b1c89b24c0993913f86e9a2d02cd69887d9c94f3c880358579d811b21dd1b7fd9bb01c1d81d10e69f0384e675c32b39643be89200'; - const addrRecovered = await ecrecovery.recover(message, signature); - addrRecovered.should.eq(signer); - }); - - it('recover v1', async function () { - // Signature generated outside ganache with method web3.eth.sign(signer, message) - let signer = '0x1e318623ab09fe6de3c9b8672098464aeda9100e'; - let message = web3.sha3(TEST_MESSAGE); - // eslint-disable-next-line max-len - let signature = '0x331fe75a821c982f9127538858900d87d3ec1f9f737338ad67cad133fa48feff48e6fa0c18abc62e42820f05943e47af3e9fbe306ce74d64094bdf1691ee53e001'; - const addrRecovered = await ecrecovery.recover(message, signature); - addrRecovered.should.eq(signer); - }); - - it('recover using web3.eth.sign()', async function () { - // Create the signature using account[0] - const signature = signMessage(accounts[0], TEST_MESSAGE); - - // Recover the signer address from the generated message and signature. - const addrRecovered = await ecrecovery.recover( - hashMessage(TEST_MESSAGE), - signature - ); - addrRecovered.should.eq(accounts[0]); - }); - - it('recover using web3.eth.sign() should return wrong signer', async function () { - // Create the signature using account[0] - const signature = signMessage(accounts[0], TEST_MESSAGE); - - // Recover the signer address from the generated message and wrong signature. - const addrRecovered = await ecrecovery.recover(hashMessage('Test'), signature); - assert.notEqual(accounts[0], addrRecovered); - }); - - it('recover should fail when a wrong hash is sent', async function () { - // Create the signature using account[0] - let signature = signMessage(accounts[0], TEST_MESSAGE); - - // Recover the signer address from the generated message and wrong signature. - const addrRecovered = await ecrecovery.recover(hashMessage(TEST_MESSAGE).substring(2), signature); - addrRecovered.should.eq('0x0000000000000000000000000000000000000000'); - }); - - context('toEthSignedMessage', () => { - it('should prefix hashes correctly', async function () { - const hashedMessage = web3.sha3(TEST_MESSAGE); - const ethMessage = await ecrecovery.toEthSignedMessageHash(hashedMessage); - ethMessage.should.eq(hashMessage(TEST_MESSAGE)); - }); - }); -}); diff --git a/test/library/Math.test.js b/test/library/Math.test.js deleted file mode 100644 index c671bc85f..000000000 --- a/test/library/Math.test.js +++ /dev/null @@ -1,43 +0,0 @@ -var MathMock = artifacts.require('MathMock'); - -contract('Math', function (accounts) { - let math; - - before(async function () { - math = await MathMock.new(); - }); - - it('returns max64 correctly', async function () { - let a = 5678; - let b = 1234; - await math.max64(a, b); - let result = await math.result64(); - assert.equal(result, a); - }); - - it('returns min64 correctly', async function () { - let a = 5678; - let b = 1234; - await math.min64(a, b); - let result = await math.result64(); - - assert.equal(result, b); - }); - - it('returns max256 correctly', async function () { - let a = 5678; - let b = 1234; - await math.max256(a, b); - let result = await math.result256(); - assert.equal(result, a); - }); - - it('returns min256 correctly', async function () { - let a = 5678; - let b = 1234; - await math.min256(a, b); - let result = await math.result256(); - - assert.equal(result, b); - }); -}); diff --git a/test/library/MerkleProof.test.js b/test/library/MerkleProof.test.js deleted file mode 100644 index 1e8da3c8f..000000000 --- a/test/library/MerkleProof.test.js +++ /dev/null @@ -1,61 +0,0 @@ - -import MerkleTree from '../helpers/merkleTree.js'; -import { sha3, bufferToHex } from 'ethereumjs-util'; - -var MerkleProofWrapper = artifacts.require('MerkleProofWrapper'); - -contract('MerkleProof', function (accounts) { - let merkleProof; - - before(async function () { - merkleProof = await MerkleProofWrapper.new(); - }); - - describe('verifyProof', function () { - it('should return true for a valid Merkle proof', async function () { - const elements = ['a', 'b', 'c', 'd']; - const merkleTree = new MerkleTree(elements); - - const root = merkleTree.getHexRoot(); - - const proof = merkleTree.getHexProof(elements[0]); - - const leaf = bufferToHex(sha3(elements[0])); - - const result = await merkleProof.verifyProof(proof, root, leaf); - assert.isOk(result, 'verifyProof did not return true for a valid proof'); - }); - - it('should return false for an invalid Merkle proof', async function () { - const correctElements = ['a', 'b', 'c']; - const correctMerkleTree = new MerkleTree(correctElements); - - const correctRoot = correctMerkleTree.getHexRoot(); - - const correctLeaf = bufferToHex(sha3(correctElements[0])); - - const badElements = ['d', 'e', 'f']; - const badMerkleTree = new MerkleTree(badElements); - - const badProof = badMerkleTree.getHexProof(badElements[0]); - - const result = await merkleProof.verifyProof(badProof, correctRoot, correctLeaf); - assert.isNotOk(result, 'verifyProof did not return false for an invalid proof'); - }); - - it('should return false for a Merkle proof of invalid length', async function () { - const elements = ['a', 'b', 'c']; - const merkleTree = new MerkleTree(elements); - - const root = merkleTree.getHexRoot(); - - const proof = merkleTree.getHexProof(elements[0]); - const badProof = proof.slice(0, proof.length - 5); - - const leaf = bufferToHex(sha3(elements[0])); - - const result = await merkleProof.verifyProof(badProof, root, leaf); - assert.isNotOk(result, 'verifyProof did not return false for proof of invalid length'); - }); - }); -}); diff --git a/test/lifecycle/Destructible.test.js b/test/lifecycle/Destructible.test.js deleted file mode 100644 index 2757d76cd..000000000 --- a/test/lifecycle/Destructible.test.js +++ /dev/null @@ -1,23 +0,0 @@ - -var Destructible = artifacts.require('Destructible'); -require('../helpers/transactionMined.js'); - -contract('Destructible', function (accounts) { - it('should send balance to owner after destruction', async function () { - let destructible = await Destructible.new({ from: accounts[0], value: web3.toWei('10', 'ether') }); - let owner = await destructible.owner(); - let initBalance = web3.eth.getBalance(owner); - await destructible.destroy({ from: owner }); - let newBalance = web3.eth.getBalance(owner); - assert.isTrue(newBalance > initBalance); - }); - - it('should send balance to recepient after destruction', async function () { - let destructible = await Destructible.new({ from: accounts[0], value: web3.toWei('10', 'ether') }); - let owner = await destructible.owner(); - let initBalance = web3.eth.getBalance(accounts[1]); - await destructible.destroyAndSend(accounts[1], { from: owner }); - let newBalance = web3.eth.getBalance(accounts[1]); - assert.isTrue(newBalance.greaterThan(initBalance)); - }); -}); diff --git a/test/lifecycle/TokenDestructible.test.js b/test/lifecycle/TokenDestructible.test.js deleted file mode 100644 index 8566bf190..000000000 --- a/test/lifecycle/TokenDestructible.test.js +++ /dev/null @@ -1,37 +0,0 @@ - -var TokenDestructible = artifacts.require('TokenDestructible'); -var StandardTokenMock = artifacts.require('StandardTokenMock'); -require('../helpers/transactionMined.js'); - -contract('TokenDestructible', function (accounts) { - let destructible; - - beforeEach(async function () { - destructible = await TokenDestructible.new({ - from: accounts[0], - value: web3.toWei('10', 'ether'), - }); - }); - - it('should send balance to owner after destruction', async function () { - let owner = await destructible.owner(); - let initBalance = web3.eth.getBalance(owner); - await destructible.destroy([], { from: owner }); - let newBalance = web3.eth.getBalance(owner); - assert.isTrue(newBalance > initBalance); - }); - - it('should send tokens to owner after destruction', async function () { - let owner = await destructible.owner(); - let token = await StandardTokenMock.new(destructible.address, 100); - let initContractBalance = await token.balanceOf(destructible.address); - let initOwnerBalance = await token.balanceOf(owner); - assert.equal(initContractBalance, 100); - assert.equal(initOwnerBalance, 0); - await destructible.destroy([token.address], { from: owner }); - let newContractBalance = await token.balanceOf(destructible.address); - let newOwnerBalance = await token.balanceOf(owner); - assert.equal(newContractBalance, 0); - assert.equal(newOwnerBalance, 100); - }); -}); diff --git a/test/mocks/MathMock.sol b/test/mocks/MathMock.sol deleted file mode 100644 index c2c9f3fba..000000000 --- a/test/mocks/MathMock.sol +++ /dev/null @@ -1,26 +0,0 @@ -pragma solidity ^0.4.21; - - -import "../../contracts/math/Math.sol"; - - -contract MathMock { - uint64 public result64; - uint256 public result256; - - function max64(uint64 a, uint64 b) public { - result64 = Math.max64(a, b); - } - - function min64(uint64 a, uint64 b) public { - result64 = Math.min64(a, b); - } - - function max256(uint256 a, uint256 b) public { - result256 = Math.max256(a, b); - } - - function min256(uint256 a, uint256 b) public { - result256 = Math.min256(a, b); - } -} diff --git a/test/ownership/CanReclaimToken.test.js b/test/ownership/CanReclaimToken.test.js deleted file mode 100644 index 6f0f2c671..000000000 --- a/test/ownership/CanReclaimToken.test.js +++ /dev/null @@ -1,35 +0,0 @@ - -import expectThrow from '../helpers/expectThrow'; - -const CanReclaimToken = artifacts.require('CanReclaimToken'); -const BasicTokenMock = artifacts.require('BasicTokenMock'); - -contract('CanReclaimToken', function (accounts) { - let token = null; - let canReclaimToken = null; - - beforeEach(async function () { - // Create contract and token - token = await BasicTokenMock.new(accounts[0], 100); - canReclaimToken = await CanReclaimToken.new(); - // Force token into contract - await token.transfer(canReclaimToken.address, 10); - const startBalance = await token.balanceOf(canReclaimToken.address); - assert.equal(startBalance, 10); - }); - - it('should allow owner to reclaim tokens', async function () { - const ownerStartBalance = await token.balanceOf(accounts[0]); - await canReclaimToken.reclaimToken(token.address); - const ownerFinalBalance = await token.balanceOf(accounts[0]); - const finalBalance = await token.balanceOf(canReclaimToken.address); - assert.equal(finalBalance, 0); - assert.equal(ownerFinalBalance - ownerStartBalance, 10); - }); - - it('should allow only owner to reclaim tokens', async function () { - await expectThrow( - canReclaimToken.reclaimToken(token.address, { from: accounts[1] }), - ); - }); -}); diff --git a/test/ownership/Claimable.test.js b/test/ownership/Claimable.test.js deleted file mode 100644 index 52340fb94..000000000 --- a/test/ownership/Claimable.test.js +++ /dev/null @@ -1,53 +0,0 @@ - -import assertRevert from '../helpers/assertRevert'; - -var Claimable = artifacts.require('Claimable'); - -contract('Claimable', function (accounts) { - let claimable; - - beforeEach(async function () { - claimable = await Claimable.new(); - }); - - it('should have an owner', async function () { - let owner = await claimable.owner(); - assert.isTrue(owner !== 0); - }); - - it('changes pendingOwner after transfer', async function () { - let newOwner = accounts[1]; - await claimable.transferOwnership(newOwner); - let pendingOwner = await claimable.pendingOwner(); - - assert.isTrue(pendingOwner === newOwner); - }); - - it('should prevent to claimOwnership from no pendingOwner', async function () { - await assertRevert(claimable.claimOwnership({ from: accounts[2] })); - }); - - it('should prevent non-owners from transfering', async function () { - const other = accounts[2]; - const owner = await claimable.owner.call(); - - assert.isTrue(owner !== other); - await assertRevert(claimable.transferOwnership(other, { from: other })); - }); - - describe('after initiating a transfer', function () { - let newOwner; - - beforeEach(async function () { - newOwner = accounts[1]; - await claimable.transferOwnership(newOwner); - }); - - it('changes allow pending owner to claim ownership', async function () { - await claimable.claimOwnership({ from: newOwner }); - let owner = await claimable.owner(); - - assert.isTrue(owner === newOwner); - }); - }); -}); diff --git a/test/ownership/Contactable.test.js b/test/ownership/Contactable.test.js deleted file mode 100644 index 901ba4824..000000000 --- a/test/ownership/Contactable.test.js +++ /dev/null @@ -1,28 +0,0 @@ - -var Contactable = artifacts.require('Contactable'); - -contract('Contactable', function (accounts) { - let contactable; - - beforeEach(async function () { - contactable = await Contactable.new(); - }); - - it('should have an empty contact info', async function () { - let info = await contactable.contactInformation(); - assert.isTrue(info === ''); - }); - - describe('after setting the contact information', function () { - let contactInfo = 'contact information'; - - beforeEach(async function () { - await contactable.setContactInformation(contactInfo); - }); - - it('should return the setted contact information', async function () { - let info = await contactable.contactInformation(); - assert.isTrue(info === contactInfo); - }); - }); -}); diff --git a/test/ownership/DelayedClaimable.test.js b/test/ownership/DelayedClaimable.test.js deleted file mode 100644 index 90be7fbc9..000000000 --- a/test/ownership/DelayedClaimable.test.js +++ /dev/null @@ -1,55 +0,0 @@ -import assertRevert from '../helpers/assertRevert'; - -var DelayedClaimable = artifacts.require('DelayedClaimable'); - -contract('DelayedClaimable', function (accounts) { - var delayedClaimable; - - beforeEach(function () { - return DelayedClaimable.new().then(function (deployed) { - delayedClaimable = deployed; - }); - }); - - it('can set claim blocks', async function () { - await delayedClaimable.transferOwnership(accounts[2]); - await delayedClaimable.setLimits(0, 1000); - let end = await delayedClaimable.end(); - assert.equal(end, 1000); - let start = await delayedClaimable.start(); - assert.equal(start, 0); - }); - - it('changes pendingOwner after transfer successful', async function () { - await delayedClaimable.transferOwnership(accounts[2]); - await delayedClaimable.setLimits(0, 1000); - let end = await delayedClaimable.end(); - assert.equal(end, 1000); - let start = await delayedClaimable.start(); - assert.equal(start, 0); - let pendingOwner = await delayedClaimable.pendingOwner(); - assert.equal(pendingOwner, accounts[2]); - await delayedClaimable.claimOwnership({ from: accounts[2] }); - let owner = await delayedClaimable.owner(); - assert.equal(owner, accounts[2]); - }); - - it('changes pendingOwner after transfer fails', async function () { - await delayedClaimable.transferOwnership(accounts[1]); - await delayedClaimable.setLimits(100, 110); - let end = await delayedClaimable.end(); - assert.equal(end, 110); - let start = await delayedClaimable.start(); - assert.equal(start, 100); - let pendingOwner = await delayedClaimable.pendingOwner(); - assert.equal(pendingOwner, accounts[1]); - await assertRevert(delayedClaimable.claimOwnership({ from: accounts[1] })); - let owner = await delayedClaimable.owner(); - assert.isTrue(owner !== accounts[1]); - }); - - it('set end and start invalid values fail', async function () { - await delayedClaimable.transferOwnership(accounts[1]); - await assertRevert(delayedClaimable.setLimits(1001, 1000)); - }); -}); diff --git a/test/ownership/HasNoContracts.test.js b/test/ownership/HasNoContracts.test.js deleted file mode 100644 index f2020a173..000000000 --- a/test/ownership/HasNoContracts.test.js +++ /dev/null @@ -1,33 +0,0 @@ - -import expectThrow from '../helpers/expectThrow'; - -const Ownable = artifacts.require('Ownable'); -const HasNoContracts = artifacts.require('HasNoContracts'); - -contract('HasNoContracts', function (accounts) { - let hasNoContracts = null; - let ownable = null; - - beforeEach(async () => { - // Create contract and token - hasNoContracts = await HasNoContracts.new(); - ownable = await Ownable.new(); - - // Force ownership into contract - await ownable.transferOwnership(hasNoContracts.address); - const owner = await ownable.owner(); - assert.equal(owner, hasNoContracts.address); - }); - - it('should allow owner to reclaim contracts', async function () { - await hasNoContracts.reclaimContract(ownable.address); - const owner = await ownable.owner(); - assert.equal(owner, accounts[0]); - }); - - it('should allow only owner to reclaim contracts', async function () { - await expectThrow( - hasNoContracts.reclaimContract(ownable.address, { from: accounts[1] }), - ); - }); -}); diff --git a/test/ownership/HasNoEther.test.js b/test/ownership/HasNoEther.test.js deleted file mode 100644 index ff95e998f..000000000 --- a/test/ownership/HasNoEther.test.js +++ /dev/null @@ -1,64 +0,0 @@ - -import expectThrow from '../helpers/expectThrow'; -import toPromise from '../helpers/toPromise'; -const HasNoEtherTest = artifacts.require('HasNoEtherTest'); -const ForceEther = artifacts.require('ForceEther'); - -contract('HasNoEther', function (accounts) { - const amount = web3.toWei('1', 'ether'); - - it('should be constructorable', async function () { - await HasNoEtherTest.new(); - }); - - it('should not accept ether in constructor', async function () { - await expectThrow(HasNoEtherTest.new({ value: amount })); - }); - - it('should not accept ether', async function () { - let hasNoEther = await HasNoEtherTest.new(); - - await expectThrow( - toPromise(web3.eth.sendTransaction)({ - from: accounts[1], - to: hasNoEther.address, - value: amount, - }), - ); - }); - - it('should allow owner to reclaim ether', async function () { - // Create contract - let hasNoEther = await HasNoEtherTest.new(); - const startBalance = await web3.eth.getBalance(hasNoEther.address); - assert.equal(startBalance, 0); - - // Force ether into it - let forceEther = await ForceEther.new({ value: amount }); - await forceEther.destroyAndSend(hasNoEther.address); - const forcedBalance = await web3.eth.getBalance(hasNoEther.address); - assert.equal(forcedBalance, amount); - - // Reclaim - const ownerStartBalance = await web3.eth.getBalance(accounts[0]); - await hasNoEther.reclaimEther(); - const ownerFinalBalance = await web3.eth.getBalance(accounts[0]); - const finalBalance = await web3.eth.getBalance(hasNoEther.address); - assert.equal(finalBalance, 0); - assert.isAbove(ownerFinalBalance, ownerStartBalance); - }); - - it('should allow only owner to reclaim ether', async function () { - // Create contract - let hasNoEther = await HasNoEtherTest.new({ from: accounts[0] }); - - // Force ether into it - let forceEther = await ForceEther.new({ value: amount }); - await forceEther.destroyAndSend(hasNoEther.address); - const forcedBalance = await web3.eth.getBalance(hasNoEther.address); - assert.equal(forcedBalance, amount); - - // Reclaim - await expectThrow(hasNoEther.reclaimEther({ from: accounts[1] })); - }); -}); diff --git a/test/ownership/HasNoTokens.test.js b/test/ownership/HasNoTokens.test.js deleted file mode 100644 index e9c14a7f5..000000000 --- a/test/ownership/HasNoTokens.test.js +++ /dev/null @@ -1,40 +0,0 @@ - -import expectThrow from '../helpers/expectThrow'; - -const HasNoTokens = artifacts.require('HasNoTokens'); -const ERC223TokenMock = artifacts.require('ERC223TokenMock'); - -contract('HasNoTokens', function (accounts) { - let hasNoTokens = null; - let token = null; - - beforeEach(async () => { - // Create contract and token - hasNoTokens = await HasNoTokens.new(); - token = await ERC223TokenMock.new(accounts[0], 100); - - // Force token into contract - await token.transfer(hasNoTokens.address, 10); - const startBalance = await token.balanceOf(hasNoTokens.address); - assert.equal(startBalance, 10); - }); - - it('should not accept ERC223 tokens', async function () { - await expectThrow(token.transferERC223(hasNoTokens.address, 10, '')); - }); - - it('should allow owner to reclaim tokens', async function () { - const ownerStartBalance = await token.balanceOf(accounts[0]); - await hasNoTokens.reclaimToken(token.address); - const ownerFinalBalance = await token.balanceOf(accounts[0]); - const finalBalance = await token.balanceOf(hasNoTokens.address); - assert.equal(finalBalance, 0); - assert.equal(ownerFinalBalance - ownerStartBalance, 10); - }); - - it('should allow only owner to reclaim tokens', async function () { - await expectThrow( - hasNoTokens.reclaimToken(token.address, { from: accounts[1] }), - ); - }); -}); diff --git a/test/ownership/Whitelist.test.js b/test/ownership/Whitelist.test.js deleted file mode 100644 index e0ae29f96..000000000 --- a/test/ownership/Whitelist.test.js +++ /dev/null @@ -1,103 +0,0 @@ -import expectThrow from '../helpers/expectThrow'; -import expectEvent from '../helpers/expectEvent'; - -const WhitelistMock = artifacts.require('WhitelistMock'); - -require('chai') - .use(require('chai-as-promised')) - .should(); - -contract('Whitelist', function (accounts) { - let mock; - - const [ - owner, - whitelistedAddress1, - whitelistedAddress2, - anyone, - ] = accounts; - - const whitelistedAddresses = [whitelistedAddress1, whitelistedAddress2]; - - before(async function () { - mock = await WhitelistMock.new(); - }); - - context('in normal conditions', () => { - it('should add address to the whitelist', async function () { - await expectEvent.inTransaction( - mock.addAddressToWhitelist(whitelistedAddress1, { from: owner }), - 'WhitelistedAddressAdded' - ); - const isWhitelisted = await mock.whitelist(whitelistedAddress1); - isWhitelisted.should.be.equal(true); - }); - - it('should add addresses to the whitelist', async function () { - await expectEvent.inTransaction( - mock.addAddressesToWhitelist(whitelistedAddresses, { from: owner }), - 'WhitelistedAddressAdded' - ); - for (let addr of whitelistedAddresses) { - const isWhitelisted = await mock.whitelist(addr); - isWhitelisted.should.be.equal(true); - } - }); - - it('should not announce WhitelistedAddressAdded event if address is already in the whitelist', async function () { - const { logs } = await mock.addAddressToWhitelist(whitelistedAddress1, { from: owner }); - logs.should.be.empty; - }); - - it('should remove address from the whitelist', async function () { - await expectEvent.inTransaction( - mock.removeAddressFromWhitelist(whitelistedAddress1, { from: owner }), - 'WhitelistedAddressRemoved' - ); - let isWhitelisted = await mock.whitelist(whitelistedAddress1); - isWhitelisted.should.be.equal(false); - }); - - it('should remove addresses from the the whitelist', async function () { - await expectEvent.inTransaction( - mock.removeAddressesFromWhitelist(whitelistedAddresses, { from: owner }), - 'WhitelistedAddressRemoved' - ); - for (let addr of whitelistedAddresses) { - const isWhitelisted = await mock.whitelist(addr); - isWhitelisted.should.be.equal(false); - } - }); - - it('should not announce WhitelistedAddressRemoved event if address is not in the whitelist', async function () { - const { logs } = await mock.removeAddressFromWhitelist(whitelistedAddress1, { from: owner }); - logs.should.be.empty; - }); - - it('should allow whitelisted address to call #onlyWhitelistedCanDoThis', async () => { - await mock.addAddressToWhitelist(whitelistedAddress1, { from: owner }); - await mock.onlyWhitelistedCanDoThis({ from: whitelistedAddress1 }) - .should.be.fulfilled; - }); - }); - - context('in adversarial conditions', () => { - it('should not allow "anyone" to add to the whitelist', async () => { - await expectThrow( - mock.addAddressToWhitelist(whitelistedAddress1, { from: anyone }) - ); - }); - - it('should not allow "anyone" to remove from the whitelist', async () => { - await expectThrow( - mock.removeAddressFromWhitelist(whitelistedAddress1, { from: anyone }) - ); - }); - - it('should not allow "anyone" to call #onlyWhitelistedCanDoThis', async () => { - await expectThrow( - mock.onlyWhitelistedCanDoThis({ from: anyone }) - ); - }); - }); -}); diff --git a/test/ownership/rbac/RBAC.test.js b/test/ownership/rbac/RBAC.test.js deleted file mode 100644 index e748efba5..000000000 --- a/test/ownership/rbac/RBAC.test.js +++ /dev/null @@ -1,98 +0,0 @@ -import expectThrow from '../../helpers/expectThrow'; -import expectEvent from '../../helpers/expectEvent'; - -const RBACMock = artifacts.require('RBACMock'); - -require('chai') - .use(require('chai-as-promised')) - .should(); - -const ROLE_ADVISOR = 'advisor'; - -contract('RBAC', function (accounts) { - let mock; - - const [ - admin, - anyone, - futureAdvisor, - ...advisors - ] = accounts; - - before(async () => { - mock = await RBACMock.new(advisors, { from: admin }); - }); - - context('in normal conditions', () => { - it('allows admin to call #onlyAdminsCanDoThis', async () => { - await mock.onlyAdminsCanDoThis({ from: admin }) - .should.be.fulfilled; - }); - it('allows admin to call #onlyAdvisorsCanDoThis', async () => { - await mock.onlyAdvisorsCanDoThis({ from: admin }) - .should.be.fulfilled; - }); - it('allows advisors to call #onlyAdvisorsCanDoThis', async () => { - await mock.onlyAdvisorsCanDoThis({ from: advisors[0] }) - .should.be.fulfilled; - }); - it('allows admin to call #eitherAdminOrAdvisorCanDoThis', async () => { - await mock.eitherAdminOrAdvisorCanDoThis({ from: admin }) - .should.be.fulfilled; - }); - it('allows advisors to call #eitherAdminOrAdvisorCanDoThis', async () => { - await mock.eitherAdminOrAdvisorCanDoThis({ from: advisors[0] }) - .should.be.fulfilled; - }); - it('does not allow admins to call #nobodyCanDoThis', async () => { - await expectThrow( - mock.nobodyCanDoThis({ from: admin }) - ); - }); - it('does not allow advisors to call #nobodyCanDoThis', async () => { - await expectThrow( - mock.nobodyCanDoThis({ from: advisors[0] }) - ); - }); - it('does not allow anyone to call #nobodyCanDoThis', async () => { - await expectThrow( - mock.nobodyCanDoThis({ from: anyone }) - ); - }); - it('allows an admin to remove an advisor\'s role', async () => { - await mock.removeAdvisor(advisors[0], { from: admin }) - .should.be.fulfilled; - }); - it('allows admins to #adminRemoveRole', async () => { - await mock.adminRemoveRole(advisors[3], ROLE_ADVISOR, { from: admin }) - .should.be.fulfilled; - }); - - it('announces a RoleAdded event on addRole', async () => { - await expectEvent.inTransaction( - mock.adminAddRole(futureAdvisor, ROLE_ADVISOR, { from: admin }), - 'RoleAdded' - ); - }); - - it('announces a RoleRemoved event on removeRole', async () => { - await expectEvent.inTransaction( - mock.adminRemoveRole(futureAdvisor, ROLE_ADVISOR, { from: admin }), - 'RoleRemoved' - ); - }); - }); - - context('in adversarial conditions', () => { - it('does not allow an advisor to remove another advisor', async () => { - await expectThrow( - mock.removeAdvisor(advisors[1], { from: advisors[0] }) - ); - }); - it('does not allow "anyone" to remove an advisor', async () => { - await expectThrow( - mock.removeAdvisor(advisors[0], { from: anyone }) - ); - }); - }); -}); diff --git a/test/payment/PullPayment.test.js b/test/payment/PullPayment.test.js deleted file mode 100644 index 8f5a4e41a..000000000 --- a/test/payment/PullPayment.test.js +++ /dev/null @@ -1,71 +0,0 @@ -var PullPaymentMock = artifacts.require('PullPaymentMock'); - -contract('PullPayment', function (accounts) { - let ppce; - let amount = 17 * 1e18; - - beforeEach(async function () { - ppce = await PullPaymentMock.new({ value: amount }); - }); - - it('can\'t call asyncSend externally', async function () { - assert.isUndefined(ppce.asyncSend); - }); - - it('can record an async payment correctly', async function () { - let AMOUNT = 100; - await ppce.callSend(accounts[0], AMOUNT); - let paymentsToAccount0 = await ppce.payments(accounts[0]); - let totalPayments = await ppce.totalPayments(); - - assert.equal(totalPayments, AMOUNT); - assert.equal(paymentsToAccount0, AMOUNT); - }); - - it('can add multiple balances on one account', async function () { - await ppce.callSend(accounts[0], 200); - await ppce.callSend(accounts[0], 300); - let paymentsToAccount0 = await ppce.payments(accounts[0]); - let totalPayments = await ppce.totalPayments(); - - assert.equal(totalPayments, 500); - assert.equal(paymentsToAccount0, 500); - }); - - it('can add balances on multiple accounts', async function () { - await ppce.callSend(accounts[0], 200); - await ppce.callSend(accounts[1], 300); - - let paymentsToAccount0 = await ppce.payments(accounts[0]); - assert.equal(paymentsToAccount0, 200); - - let paymentsToAccount1 = await ppce.payments(accounts[1]); - assert.equal(paymentsToAccount1, 300); - - let totalPayments = await ppce.totalPayments(); - assert.equal(totalPayments, 500); - }); - - it('can withdraw payment', async function () { - let payee = accounts[1]; - let initialBalance = web3.eth.getBalance(payee); - - await ppce.callSend(payee, amount); - - let payment1 = await ppce.payments(payee); - assert.equal(payment1, amount); - - let totalPayments = await ppce.totalPayments(); - assert.equal(totalPayments, amount); - - await ppce.withdrawPayments({ from: payee }); - let payment2 = await ppce.payments(payee); - assert.equal(payment2, 0); - - totalPayments = await ppce.totalPayments(); - assert.equal(totalPayments, 0); - - let balance = web3.eth.getBalance(payee); - assert(Math.abs(balance - initialBalance - amount) < 1e16); - }); -}); diff --git a/test/payment/SplitPayment.test.js b/test/payment/SplitPayment.test.js deleted file mode 100644 index dd18eaeac..000000000 --- a/test/payment/SplitPayment.test.js +++ /dev/null @@ -1,78 +0,0 @@ -const BigNumber = web3.BigNumber; - -require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -const EVMThrow = require('../helpers/EVMThrow.js'); -const SplitPayment = artifacts.require('SplitPayment'); - -contract('SplitPayment', function ([owner, payee1, payee2, payee3, nonpayee1, payer1]) { - const amount = web3.toWei(1.0, 'ether'); - - beforeEach(async function () { - this.payees = [payee1, payee2, payee3]; - this.shares = [20, 10, 70]; - - this.contract = await SplitPayment.new(this.payees, this.shares); - }); - - it('should accept payments', async function () { - await web3.eth.sendTransaction({ from: owner, to: this.contract.address, value: amount }); - - const balance = web3.eth.getBalance(this.contract.address); - balance.should.be.bignumber.equal(amount); - }); - - it('should store shares if address is payee', async function () { - const shares = await this.contract.shares.call(payee1); - shares.should.be.bignumber.not.equal(0); - }); - - it('should not store shares if address is not payee', async function () { - const shares = await this.contract.shares.call(nonpayee1); - shares.should.be.bignumber.equal(0); - }); - - it('should throw if no funds to claim', async function () { - await this.contract.claim({ from: payee1 }).should.be.rejectedWith(EVMThrow); - }); - - it('should throw if non-payee want to claim', async function () { - await web3.eth.sendTransaction({ from: payer1, to: this.contract.address, value: amount }); - await this.contract.claim({ from: nonpayee1 }).should.be.rejectedWith(EVMThrow); - }); - - it('should distribute funds to payees', async function () { - await web3.eth.sendTransaction({ from: payer1, to: this.contract.address, value: amount }); - - // receive funds - const initBalance = web3.eth.getBalance(this.contract.address); - initBalance.should.be.bignumber.equal(amount); - - // distribute to payees - const initAmount1 = web3.eth.getBalance(payee1); - await this.contract.claim({ from: payee1 }); - const profit1 = web3.eth.getBalance(payee1) - initAmount1; - assert(Math.abs(profit1 - web3.toWei(0.20, 'ether')) < 1e16); - - const initAmount2 = web3.eth.getBalance(payee2); - await this.contract.claim({ from: payee2 }); - const profit2 = web3.eth.getBalance(payee2) - initAmount2; - assert(Math.abs(profit2 - web3.toWei(0.10, 'ether')) < 1e16); - - const initAmount3 = web3.eth.getBalance(payee3); - await this.contract.claim({ from: payee3 }); - const profit3 = web3.eth.getBalance(payee3) - initAmount3; - assert(Math.abs(profit3 - web3.toWei(0.70, 'ether')) < 1e16); - - // end balance should be zero - const endBalance = web3.eth.getBalance(this.contract.address); - endBalance.should.be.bignumber.equal(0); - - // check correct funds released accounting - const totalReleased = await this.contract.totalReleased.call(); - totalReleased.should.be.bignumber.equal(initBalance); - }); -}); diff --git a/test/token/ERC20/CappedToken.test.js b/test/token/ERC20/CappedToken.test.js deleted file mode 100644 index c3fa5af6b..000000000 --- a/test/token/ERC20/CappedToken.test.js +++ /dev/null @@ -1,36 +0,0 @@ - -import expectThrow from '../../helpers/expectThrow'; -import ether from '../../helpers/ether'; - -var CappedToken = artifacts.require('CappedToken'); - -contract('Capped', function (accounts) { - const cap = ether(1000); - - let token; - - beforeEach(async function () { - token = await CappedToken.new(cap); - }); - - it('should start with the correct cap', async function () { - let _cap = await token.cap(); - - assert(cap.eq(_cap)); - }); - - it('should mint when amount is less than cap', async function () { - const result = await token.mint(accounts[0], 100); - assert.equal(result.logs[0].event, 'Mint'); - }); - - it('should fail to mint if the ammount exceeds the cap', async function () { - await token.mint(accounts[0], cap.sub(1)); - await expectThrow(token.mint(accounts[0], 100)); - }); - - it('should fail to mint after cap is reached', async function () { - await token.mint(accounts[0], cap); - await expectThrow(token.mint(accounts[0], 1)); - }); -}); diff --git a/test/token/ERC827/ERC827Token.js b/test/token/ERC827/ERC827Token.js deleted file mode 100644 index f82f3fdf0..000000000 --- a/test/token/ERC827/ERC827Token.js +++ /dev/null @@ -1,374 +0,0 @@ - -import EVMRevert from '../../helpers/EVMRevert'; -var Message = artifacts.require('MessageHelper'); -var ERC827TokenMock = artifacts.require('ERC827TokenMock'); - -var BigNumber = web3.BigNumber; -var _ = require('lodash'); -var ethjsABI = require('ethjs-abi'); -require('chai') - .use(require('chai-as-promised')) - .use(require('chai-bignumber')(BigNumber)) - .should(); - -contract('ERC827 Token', function (accounts) { - let token; - - function findMethod (abi, name, args) { - for (var i = 0; i < abi.length; i++) { - const methodArgs = _.map(abi[i].inputs, 'type').join(','); - if ((abi[i].name === name) && (methodArgs === args)) { - return abi[i]; - } - } - } - - beforeEach(async function () { - token = await ERC827TokenMock.new(accounts[0], 100); - }); - - it('should return the correct totalSupply after construction', async function () { - let totalSupply = await token.totalSupply(); - - assert.equal(totalSupply, 100); - }); - - it('should return the correct allowance amount after approval', async function () { - let token = await ERC827TokenMock.new(accounts[0], 100); - await token.approve(accounts[1], 100); - let allowance = await token.allowance(accounts[0], accounts[1]); - - assert.equal(allowance, 100); - }); - - it('should return correct balances after transfer', async function () { - await token.transfer(accounts[1], 100); - let balance0 = await token.balanceOf(accounts[0]); - assert.equal(balance0, 0); - - let balance1 = await token.balanceOf(accounts[1]); - assert.equal(balance1, 100); - }); - - it('should throw an error when trying to transfer more than balance', async function () { - await token.transfer(accounts[1], 101).should.be.rejectedWith(EVMRevert); - }); - - it('should return correct balances after transfering from another account', async function () { - await token.approve(accounts[1], 100); - await token.transferFrom(accounts[0], accounts[2], 100, { from: accounts[1] }); - - let balance0 = await token.balanceOf(accounts[0]); - assert.equal(balance0, 0); - - let balance1 = await token.balanceOf(accounts[2]); - assert.equal(balance1, 100); - - let balance2 = await token.balanceOf(accounts[1]); - assert.equal(balance2, 0); - }); - - it('should throw an error when trying to transfer more than allowed', async function () { - await token.approve(accounts[1], 99); - await token.transferFrom( - accounts[0], accounts[2], 100, - { from: accounts[1] } - ).should.be.rejectedWith(EVMRevert); - }); - - it('should throw an error when trying to transferFrom more than _from has', async function () { - let balance0 = await token.balanceOf(accounts[0]); - await token.approve(accounts[1], 99); - await token.transferFrom( - accounts[0], accounts[2], balance0 + 1, - { from: accounts[1] } - ).should.be.rejectedWith(EVMRevert); - }); - - describe('validating allowance updates to spender', function () { - let preApproved; - - it('should start with zero', async function () { - preApproved = await token.allowance(accounts[0], accounts[1]); - assert.equal(preApproved, 0); - }); - - it('should increase by 50 then decrease by 10', async function () { - const abiMethod = findMethod(token.abi, 'increaseApproval', 'address,uint256'); - const increaseApprovalData = ethjsABI.encodeMethod(abiMethod, - [accounts[1], 50] - ); - await token.sendTransaction( - { from: accounts[0], data: increaseApprovalData } - ); - let postIncrease = await token.allowance(accounts[0], accounts[1]); - preApproved.plus(50).should.be.bignumber.equal(postIncrease); - await token.decreaseApproval(accounts[1], 10); - let postDecrease = await token.allowance(accounts[0], accounts[1]); - postIncrease.minus(10).should.be.bignumber.equal(postDecrease); - }); - }); - - it('should increase by 50 then set to 0 when decreasing by more than 50', async function () { - await token.approve(accounts[1], 50); - await token.decreaseApproval(accounts[1], 60); - let postDecrease = await token.allowance(accounts[0], accounts[1]); - postDecrease.should.be.bignumber.equal(0); - }); - - it('should throw an error when trying to transfer to 0x0', async function () { - await token.transfer(0x0, 100).should.be.rejectedWith(EVMRevert); - }); - - it('should throw an error when trying to transferFrom to 0x0', async function () { - await token.approve(accounts[1], 100); - await token.transferFrom(accounts[0], 0x0, 100, { from: accounts[1] }) - .should.be.rejectedWith(EVMRevert); - }); - - describe('Test ERC827 methods', function () { - it( - 'should return correct balances after transfer (with data) and show the event on receiver contract' - , async function () { - const message = await Message.new(); - - const extraData = message.contract.showMessage.getData( - web3.toHex(123456), 666, 'Transfer Done' - ); - const abiMethod = findMethod(token.abi, 'transfer', 'address,uint256,bytes'); - const transferData = ethjsABI.encodeMethod(abiMethod, - [message.contract.address, 100, extraData] - ); - const transaction = await token.sendTransaction( - { from: accounts[0], data: transferData } - ); - - assert.equal(2, transaction.receipt.logs.length); - - new BigNumber(100).should.be.bignumber.equal( - await token.balanceOf(message.contract.address) - ); - }); - - it( - 'should return correct allowance after approve (with data) and show the event on receiver contract' - , async function () { - const message = await Message.new(); - - const extraData = message.contract.showMessage.getData( - web3.toHex(123456), 666, 'Transfer Done' - ); - - const abiMethod = findMethod(token.abi, 'approve', 'address,uint256,bytes'); - const approveData = ethjsABI.encodeMethod(abiMethod, - [message.contract.address, 100, extraData] - ); - const transaction = await token.sendTransaction( - { from: accounts[0], data: approveData } - ); - - assert.equal(2, transaction.receipt.logs.length); - - new BigNumber(100).should.be.bignumber.equal( - await token.allowance(accounts[0], message.contract.address) - ); - }); - - it( - 'should return correct allowance after increaseApproval (with data) and show the event on receiver contract' - , async function () { - const message = await Message.new(); - - const extraData = message.contract.showMessage.getData( - web3.toHex(123456), 666, 'Transfer Done' - ); - - await token.approve(message.contract.address, 10); - new BigNumber(10).should.be.bignumber.equal( - await token.allowance(accounts[0], message.contract.address) - ); - - const abiMethod = findMethod(token.abi, 'increaseApproval', 'address,uint256,bytes'); - const increaseApprovalData = ethjsABI.encodeMethod(abiMethod, - [message.contract.address, 50, extraData] - ); - const transaction = await token.sendTransaction( - { from: accounts[0], data: increaseApprovalData } - ); - - assert.equal(2, transaction.receipt.logs.length); - - new BigNumber(60).should.be.bignumber.equal( - await token.allowance(accounts[0], message.contract.address) - ); - }); - - it( - 'should return correct allowance after decreaseApproval (with data) and show the event on receiver contract' - , async function () { - const message = await Message.new(); - - await token.approve(message.contract.address, 100); - - new BigNumber(100).should.be.bignumber.equal( - await token.allowance(accounts[0], message.contract.address) - ); - - const extraData = message.contract.showMessage.getData( - web3.toHex(123456), 666, 'Transfer Done' - ); - - const abiMethod = findMethod(token.abi, 'decreaseApproval', 'address,uint256,bytes'); - const decreaseApprovalData = ethjsABI.encodeMethod(abiMethod, - [message.contract.address, 60, extraData] - ); - const transaction = await token.sendTransaction( - { from: accounts[0], data: decreaseApprovalData } - ); - - assert.equal(2, transaction.receipt.logs.length); - - new BigNumber(40).should.be.bignumber.equal( - await token.allowance(accounts[0], message.contract.address) - ); - }); - - it( - 'should return correct balances after transferFrom (with data) and show the event on receiver contract' - , async function () { - const message = await Message.new(); - - const extraData = message.contract.showMessage.getData( - web3.toHex(123456), 666, 'Transfer Done' - ); - - await token.approve(accounts[1], 100, { from: accounts[0] }); - - new BigNumber(100).should.be.bignumber.equal( - await token.allowance(accounts[0], accounts[1]) - ); - - const abiMethod = findMethod(token.abi, 'transferFrom', 'address,address,uint256,bytes'); - const transferFromData = ethjsABI.encodeMethod(abiMethod, - [accounts[0], message.contract.address, 100, extraData] - ); - const transaction = await token.sendTransaction( - { from: accounts[1], data: transferFromData } - ); - - assert.equal(2, transaction.receipt.logs.length); - - new BigNumber(100).should.be.bignumber.equal( - await token.balanceOf(message.contract.address) - ); - }); - - it('should fail inside approve (with data)', async function () { - const message = await Message.new(); - - const extraData = message.contract.fail.getData(); - - const abiMethod = findMethod(token.abi, 'approve', 'address,uint256,bytes'); - const approveData = ethjsABI.encodeMethod(abiMethod, - [message.contract.address, 10, extraData] - ); - await token.sendTransaction( - { from: accounts[0], data: approveData } - ).should.be.rejectedWith(EVMRevert); - - // approval should not have gone through so allowance is still 0 - new BigNumber(0).should.be.bignumber - .equal(await token.allowance(accounts[1], message.contract.address)); - }); - - it('should fail inside transfer (with data)', async function () { - const message = await Message.new(); - - const extraData = message.contract.fail.getData(); - - const abiMethod = findMethod(token.abi, 'transfer', 'address,uint256,bytes'); - const transferData = ethjsABI.encodeMethod(abiMethod, - [message.contract.address, 10, extraData] - ); - await token.sendTransaction( - { from: accounts[0], data: transferData } - ).should.be.rejectedWith(EVMRevert); - - // transfer should not have gone through, so balance is still 0 - new BigNumber(0).should.be.bignumber - .equal(await token.balanceOf(message.contract.address)); - }); - - it('should fail inside transferFrom (with data)', async function () { - const message = await Message.new(); - - const extraData = message.contract.fail.getData(); - - await token.approve(accounts[1], 10, { from: accounts[2] }); - - const abiMethod = findMethod(token.abi, 'transferFrom', 'address,address,uint256,bytes'); - const transferFromData = ethjsABI.encodeMethod(abiMethod, - [accounts[2], message.contract.address, 10, extraData] - ); - await token.sendTransaction( - { from: accounts[1], data: transferFromData } - ).should.be.rejectedWith(EVMRevert); - - // transferFrom should have failed so balance is still 0 but allowance is 10 - new BigNumber(10).should.be.bignumber - .equal(await token.allowance(accounts[2], accounts[1])); - new BigNumber(0).should.be.bignumber - .equal(await token.balanceOf(message.contract.address)); - }); - - it('should fail approve (with data) when using token contract address as receiver', async function () { - const message = await Message.new(); - - const extraData = message.contract.showMessage.getData( - web3.toHex(123456), 666, 'Transfer Done' - ); - - const abiMethod = findMethod(token.abi, 'approve', 'address,uint256,bytes'); - const approveData = ethjsABI.encodeMethod(abiMethod, - [token.contract.address, 100, extraData] - ); - await token.sendTransaction( - { from: accounts[0], data: approveData } - ).should.be.rejectedWith(EVMRevert); - }); - - it('should fail transfer (with data) when using token contract address as receiver', async function () { - const message = await Message.new(); - - const extraData = message.contract.showMessage.getData( - web3.toHex(123456), 666, 'Transfer Done' - ); - - const abiMethod = findMethod(token.abi, 'transfer', 'address,uint256,bytes'); - const transferData = ethjsABI.encodeMethod(abiMethod, - [token.contract.address, 100, extraData] - ); - await token.sendTransaction( - { from: accounts[0], data: transferData } - ).should.be.rejectedWith(EVMRevert); - }); - - it('should fail transferFrom (with data) when using token contract address as receiver', async function () { - const message = await Message.new(); - - const extraData = message.contract.showMessage.getData( - web3.toHex(123456), 666, 'Transfer Done' - ); - - await token.approve(accounts[1], 1, { from: accounts[0] }); - - const abiMethod = findMethod(token.abi, 'transferFrom', 'address,address,uint256,bytes'); - const transferFromData = ethjsABI.encodeMethod(abiMethod, - [accounts[0], token.contract.address, 1, extraData] - ); - await token.sendTransaction( - { from: accounts[1], data: transferFromData } - ).should.be.rejectedWith(EVMRevert); - }); - }); -}); From d0ec491b1f5dc517f82addd5afdd65100738ec78 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 18 Apr 2018 18:10:26 -0300 Subject: [PATCH 2/8] adapt contracts for upgradeability --- contracts/lifecycle/Migrations.sol | 4 ++++ contracts/mocks/DetailedERC20Mock.sol | 4 +++- contracts/mocks/ERC721TokenMock.sol | 6 ++--- contracts/mocks/PausableMock.sol | 2 ++ contracts/mocks/PausableTokenMock.sol | 2 ++ contracts/ownership/Ownable.sol | 8 +++---- contracts/token/ERC20/DetailedERC20.sol | 6 ++--- contracts/token/ERC20/TokenTimelock.sol | 6 ++--- contracts/token/ERC20/TokenVesting.sol | 9 ++++++-- contracts/token/ERC721/ERC721Token.sol | 5 +++-- package-lock.json | 30 ++++++++++++++++--------- package.json | 3 ++- test/ownership/Ownable.test.js | 1 + test/token/ERC20/MintableToken.test.js | 3 ++- test/token/ERC20/TokenTimelock.test.js | 6 +++-- test/token/ERC20/TokenVesting.test.js | 6 +++-- 16 files changed, 66 insertions(+), 35 deletions(-) diff --git a/contracts/lifecycle/Migrations.sol b/contracts/lifecycle/Migrations.sol index b12a39b2d..caf1fd56b 100644 --- a/contracts/lifecycle/Migrations.sol +++ b/contracts/lifecycle/Migrations.sol @@ -10,6 +10,10 @@ import "../ownership/Ownable.sol"; contract Migrations is Ownable { uint256 public lastCompletedMigration; + function Migrations() public { + Ownable.initialize(msg.sender); + } + function setCompleted(uint256 completed) onlyOwner public { lastCompletedMigration = completed; } diff --git a/contracts/mocks/DetailedERC20Mock.sol b/contracts/mocks/DetailedERC20Mock.sol index eb0f8cee0..9ead14d70 100644 --- a/contracts/mocks/DetailedERC20Mock.sol +++ b/contracts/mocks/DetailedERC20Mock.sol @@ -5,5 +5,7 @@ import "../token/ERC20/DetailedERC20.sol"; contract DetailedERC20Mock is StandardToken, DetailedERC20 { - function DetailedERC20Mock(string _name, string _symbol, uint8 _decimals) DetailedERC20(_name, _symbol, _decimals) public {} + function DetailedERC20Mock(string _name, string _symbol, uint8 _decimals) public { + DetailedERC20.initialize(_name, _symbol, _decimals); + } } diff --git a/contracts/mocks/ERC721TokenMock.sol b/contracts/mocks/ERC721TokenMock.sol index 5fe3668ef..29bfe7439 100644 --- a/contracts/mocks/ERC721TokenMock.sol +++ b/contracts/mocks/ERC721TokenMock.sol @@ -9,9 +9,9 @@ import "../token/ERC721/ERC721Token.sol"; * and a public setter for metadata URI */ contract ERC721TokenMock is ERC721Token { - function ERC721TokenMock(string name, string symbol) public - ERC721Token(name, symbol) - { } + function ERC721TokenMock(string name, string symbol) public { + ERC721Token.initialize(name, symbol); + } function mint(address _to, uint256 _tokenId) public { super._mint(_to, _tokenId); diff --git a/contracts/mocks/PausableMock.sol b/contracts/mocks/PausableMock.sol index e28576b89..2e9022e60 100644 --- a/contracts/mocks/PausableMock.sol +++ b/contracts/mocks/PausableMock.sol @@ -10,6 +10,8 @@ contract PausableMock is Pausable { uint256 public count; function PausableMock() public { + Ownable.initialize(msg.sender); + drasticMeasureTaken = false; count = 0; } diff --git a/contracts/mocks/PausableTokenMock.sol b/contracts/mocks/PausableTokenMock.sol index 24aa6c891..66d79ae3a 100644 --- a/contracts/mocks/PausableTokenMock.sol +++ b/contracts/mocks/PausableTokenMock.sol @@ -7,6 +7,8 @@ import "../token/ERC20/PausableToken.sol"; contract PausableTokenMock is PausableToken { function PausableTokenMock(address initialAccount, uint initialBalance) public { + Ownable.initialize(msg.sender); + balances[initialAccount] = initialBalance; } diff --git a/contracts/ownership/Ownable.sol b/contracts/ownership/Ownable.sol index 0d08f73dd..28ca7e7e2 100644 --- a/contracts/ownership/Ownable.sol +++ b/contracts/ownership/Ownable.sol @@ -1,24 +1,24 @@ pragma solidity ^0.4.21; +import 'zos-upgradeability/contracts/migrations/Initializable.sol'; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ -contract Ownable { +contract Ownable is Initializable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); - /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ - function Ownable() public { - owner = msg.sender; + function initialize(address sender) public isInitializer { + owner = sender; } /** diff --git a/contracts/token/ERC20/DetailedERC20.sol b/contracts/token/ERC20/DetailedERC20.sol index a4807fea7..382cf64d3 100644 --- a/contracts/token/ERC20/DetailedERC20.sol +++ b/contracts/token/ERC20/DetailedERC20.sol @@ -1,14 +1,14 @@ pragma solidity ^0.4.21; import "./ERC20.sol"; +import 'zos-upgradeability/contracts/migrations/Initializable.sol'; - -contract DetailedERC20 is ERC20 { +contract DetailedERC20 is Initializable, ERC20 { string public name; string public symbol; uint8 public decimals; - function DetailedERC20(string _name, string _symbol, uint8 _decimals) public { + function initialize(string _name, string _symbol, uint8 _decimals) public isInitializer { name = _name; symbol = _symbol; decimals = _decimals; diff --git a/contracts/token/ERC20/TokenTimelock.sol b/contracts/token/ERC20/TokenTimelock.sol index a14d904b5..643dd367d 100644 --- a/contracts/token/ERC20/TokenTimelock.sol +++ b/contracts/token/ERC20/TokenTimelock.sol @@ -1,14 +1,14 @@ pragma solidity ^0.4.21; import "./SafeERC20.sol"; - +import "zos-upgradeability/contracts/migrations/Initializable.sol"; /** * @title TokenTimelock * @dev TokenTimelock is a token holder contract that will allow a * beneficiary to extract the tokens after a given release time */ -contract TokenTimelock { +contract TokenTimelock is Initializable { using SafeERC20 for ERC20Basic; // ERC20 basic token contract being held @@ -20,7 +20,7 @@ contract TokenTimelock { // timestamp when token release is enabled uint256 public releaseTime; - function TokenTimelock(ERC20Basic _token, address _beneficiary, uint256 _releaseTime) public { + function initialize(ERC20Basic _token, address _beneficiary, uint256 _releaseTime) public isInitializer { // solium-disable-next-line security/no-block-members require(_releaseTime > block.timestamp); token = _token; diff --git a/contracts/token/ERC20/TokenVesting.sol b/contracts/token/ERC20/TokenVesting.sol index 8e902eac7..8dcfa3178 100644 --- a/contracts/token/ERC20/TokenVesting.sol +++ b/contracts/token/ERC20/TokenVesting.sol @@ -6,6 +6,7 @@ import "./ERC20Basic.sol"; import "./SafeERC20.sol"; import "../../ownership/Ownable.sol"; import "../../math/SafeMath.sol"; +import 'zos-upgradeability/contracts/migrations/Initializable.sol'; /** @@ -14,7 +15,7 @@ import "../../math/SafeMath.sol"; * typical vesting scheme, with a cliff and vesting period. Optionally revocable by the * owner. */ -contract TokenVesting is Ownable { +contract TokenVesting is Initializable, Ownable { using SafeMath for uint256; using SafeERC20 for ERC20Basic; @@ -42,7 +43,8 @@ contract TokenVesting is Ownable { * @param _duration duration in seconds of the period in which the tokens will vest * @param _revocable whether the vesting is revocable or not */ - function TokenVesting( + function initialize( + address _sender, address _beneficiary, uint256 _start, uint256 _cliff, @@ -50,7 +52,10 @@ contract TokenVesting is Ownable { bool _revocable ) public + isInitializer { + Ownable.initialize(_sender); + require(_beneficiary != address(0)); require(_cliff <= _duration); diff --git a/contracts/token/ERC721/ERC721Token.sol b/contracts/token/ERC721/ERC721Token.sol index 7e43ec7e9..6d6a7bbb2 100644 --- a/contracts/token/ERC721/ERC721Token.sol +++ b/contracts/token/ERC721/ERC721Token.sol @@ -2,6 +2,7 @@ pragma solidity ^0.4.21; import "./ERC721.sol"; import "./ERC721BasicToken.sol"; +import "zos-upgradeability/contracts/migrations/Initializable.sol"; /** @@ -10,7 +11,7 @@ import "./ERC721BasicToken.sol"; * Moreover, it includes approve all functionality using operator terminology * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ -contract ERC721Token is ERC721, ERC721BasicToken { +contract ERC721Token is Initializable, ERC721, ERC721BasicToken { // Token name string internal name_; @@ -35,7 +36,7 @@ contract ERC721Token is ERC721, ERC721BasicToken { /** * @dev Constructor function */ - function ERC721Token(string _name, string _symbol) public { + function initialize(string _name, string _symbol) public isInitializer { name_ = _name; symbol_ = _symbol; } diff --git a/package-lock.json b/package-lock.json index 9e56a7db8..c32a5de49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2755,7 +2755,6 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/ethjs-abi/-/ethjs-abi-0.2.1.tgz", "integrity": "sha1-4KepOn6BFjqUR3utVu3lJKtt5TM=", - "dev": true, "requires": { "bn.js": "4.11.6", "js-sha3": "0.5.5", @@ -2765,14 +2764,12 @@ "bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", - "dev": true + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" }, "js-sha3": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.5.tgz", - "integrity": "sha1-uvDA6MVK1ZA0R9+Wreekobynmko=", - "dev": true + "integrity": "sha1-uvDA6MVK1ZA0R9+Wreekobynmko=" } } }, @@ -4824,8 +4821,7 @@ "is-hex-prefixed": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", - "dev": true + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, "is-my-json-valid": { "version": "2.16.0", @@ -6394,7 +6390,6 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", "integrity": "sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA=", - "dev": true, "requires": { "bn.js": "4.11.6", "strip-hex-prefix": "1.0.0" @@ -6403,8 +6398,7 @@ "bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", - "dev": true + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" } } }, @@ -8025,7 +8019,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", - "dev": true, "requires": { "is-hex-prefixed": "1.0.0" } @@ -9452,6 +9445,21 @@ } } } + }, + "zeppelin-solidity": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/zeppelin-solidity/-/zeppelin-solidity-1.8.0.tgz", + "integrity": "sha512-7Mxq6Y7EES0PSLrRF6v0EVYqBVRRo8hFrr7m3jEs69VbbQ5kpANzizeEdbP1/PWKSOmBOg208qP2vSA0FlzFLA==", + "requires": { + "dotenv": "4.0.0", + "ethjs-abi": "0.2.1" + } + }, + "zos-upgradeability": { + "version": "git://github.com/zeppelinos/upgradeability-lib.git#68cd61fb48d0e4eec7142241448efa40c395bf33", + "requires": { + "zeppelin-solidity": "1.8.0" + } } } } diff --git a/package.json b/package.json index 613b38c8a..ed35a1696 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "truffle-hdwallet-provider": "0.0.3" }, "dependencies": { - "dotenv": "^4.0.0" + "dotenv": "^4.0.0", + "zos-upgradeability": "git://github.com/zeppelinos/upgradeability-lib.git" } } diff --git a/test/ownership/Ownable.test.js b/test/ownership/Ownable.test.js index 209a209b1..23f454289 100644 --- a/test/ownership/Ownable.test.js +++ b/test/ownership/Ownable.test.js @@ -8,6 +8,7 @@ contract('Ownable', function (accounts) { beforeEach(async function () { ownable = await Ownable.new(); + await ownable.initialize(accounts[0]); }); it('should have an owner', async function () { diff --git a/test/token/ERC20/MintableToken.test.js b/test/token/ERC20/MintableToken.test.js index a6b2d268e..8e169e58f 100644 --- a/test/token/ERC20/MintableToken.test.js +++ b/test/token/ERC20/MintableToken.test.js @@ -3,7 +3,8 @@ const MintableToken = artifacts.require('MintableToken'); contract('Mintable', function ([owner, anotherAccount]) { beforeEach(async function () { - this.token = await MintableToken.new({ from: owner }); + this.token = await MintableToken.new(); + await this.token.initialize(owner); }); describe('minting finished', function () { diff --git a/test/token/ERC20/TokenTimelock.test.js b/test/token/ERC20/TokenTimelock.test.js index d99c4b247..a8f2e20d8 100644 --- a/test/token/ERC20/TokenTimelock.test.js +++ b/test/token/ERC20/TokenTimelock.test.js @@ -15,9 +15,11 @@ contract('TokenTimelock', function ([_, owner, beneficiary]) { const amount = new BigNumber(100); beforeEach(async function () { - this.token = await MintableToken.new({ from: owner }); + this.token = await MintableToken.new(); + await this.token.initialize(owner); this.releaseTime = latestTime() + duration.years(1); - this.timelock = await TokenTimelock.new(this.token.address, beneficiary, this.releaseTime); + this.timelock = await TokenTimelock.new(); + await this.timelock.initialize(this.token.address, beneficiary, this.releaseTime); await this.token.mint(this.timelock.address, amount, { from: owner }); }); diff --git a/test/token/ERC20/TokenVesting.test.js b/test/token/ERC20/TokenVesting.test.js index e6ce5c177..82101e4c8 100644 --- a/test/token/ERC20/TokenVesting.test.js +++ b/test/token/ERC20/TokenVesting.test.js @@ -16,13 +16,15 @@ contract('TokenVesting', function ([_, owner, beneficiary]) { const amount = new BigNumber(1000); beforeEach(async function () { - this.token = await MintableToken.new({ from: owner }); + this.token = await MintableToken.new(); + await this.token.initialize(owner); this.start = latestTime() + duration.minutes(1); // +1 minute so it starts after contract instantiation this.cliff = duration.years(1); this.duration = duration.years(2); - this.vesting = await TokenVesting.new(beneficiary, this.start, this.cliff, this.duration, true, { from: owner }); + this.vesting = await TokenVesting.new(); + await this.vesting.initialize(owner, beneficiary, this.start, this.cliff, this.duration, true); await this.token.mint(this.vesting.address, amount, { from: owner }); }); From 03891b00a73d560d59054a463184f19dc70ff277 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 19 Apr 2018 12:26:12 -0300 Subject: [PATCH 3/8] ignore everything but official contracts for npm --- contracts/.npmignore | 2 ++ package.json | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 contracts/.npmignore diff --git a/contracts/.npmignore b/contracts/.npmignore new file mode 100644 index 000000000..e792d8bc6 --- /dev/null +++ b/contracts/.npmignore @@ -0,0 +1,2 @@ +mocks +examples diff --git a/package.json b/package.json index ed35a1696..84a8eb425 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,9 @@ "name": "zeppelin-solidity", "version": "1.8.0", "description": "Secure Smart Contract library for Solidity", + "files": [ + "contracts" + ], "scripts": { "test": "scripts/test.sh", "lint": "eslint .", From 2010c6b464777118234ca0d0ff2cf64f6dc29411 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 19 Apr 2018 12:32:56 -0300 Subject: [PATCH 4/8] add prepack step to build contracts --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 84a8eb425..5f210e28c 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,11 @@ "version": "1.8.0", "description": "Secure Smart Contract library for Solidity", "files": [ - "contracts" + "contracts", + "build" ], "scripts": { + "prepack": "truffle compile", "test": "scripts/test.sh", "lint": "eslint .", "lint:fix": "eslint . --fix", From 85225ef6ae7d5057240dab1eedbc9b03803ada8b Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Fri, 20 Apr 2018 11:21:53 -0300 Subject: [PATCH 5/8] add mintable erc721 token --- contracts/token/ERC721/MintableERC721Token.sol | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 contracts/token/ERC721/MintableERC721Token.sol diff --git a/contracts/token/ERC721/MintableERC721Token.sol b/contracts/token/ERC721/MintableERC721Token.sol new file mode 100644 index 000000000..6c936f777 --- /dev/null +++ b/contracts/token/ERC721/MintableERC721Token.sol @@ -0,0 +1,13 @@ +pragma solidity ^0.4.21; + +import "./ERC721Token.sol"; +import "../../ownership/Ownable.sol"; + +/** + * @title Mintable ERC721 Token + */ +contract MintableERC721Token is Ownable, ERC721Token { + function mint(address _to, uint256 _tokenId) onlyOwner public { + _mint(_to, _tokenId); + } +} From eff3d7ca8e2791f82046f07b948592edebb6d7c2 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Fri, 20 Apr 2018 11:28:56 -0300 Subject: [PATCH 6/8] bump version --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5f210e28c..16eead5ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "zeppelin-solidity", - "version": "1.8.0", + "name": "openzeppelin-zos", + "version": "1.9.0-beta", "description": "Secure Smart Contract library for Solidity", "files": [ "contracts", From 95fdc7bd8ae01a401d2aa9aef4425c25963c2245 Mon Sep 17 00:00:00 2001 From: Alejo Salles Date: Fri, 20 Apr 2018 19:58:16 -0300 Subject: [PATCH 7/8] update contracts and config --- contracts/ownership/Ownable.sol | 2 +- contracts/token/ERC20/DetailedERC20.sol | 2 +- contracts/token/ERC20/TokenTimelock.sol | 2 +- contracts/token/ERC20/TokenVesting.sol | 2 +- contracts/token/ERC721/ERC721Token.sol | 2 +- package-lock.json | 1195 +++++++++++++---------- package.json | 3 +- truffle-config.js | 7 +- 8 files changed, 699 insertions(+), 516 deletions(-) diff --git a/contracts/ownership/Ownable.sol b/contracts/ownership/Ownable.sol index 28ca7e7e2..b1bfd54cf 100644 --- a/contracts/ownership/Ownable.sol +++ b/contracts/ownership/Ownable.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.21; -import 'zos-upgradeability/contracts/migrations/Initializable.sol'; +import 'zos-lib/contracts/migrations/Initializable.sol'; /** * @title Ownable diff --git a/contracts/token/ERC20/DetailedERC20.sol b/contracts/token/ERC20/DetailedERC20.sol index 382cf64d3..8bcedba34 100644 --- a/contracts/token/ERC20/DetailedERC20.sol +++ b/contracts/token/ERC20/DetailedERC20.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.21; import "./ERC20.sol"; -import 'zos-upgradeability/contracts/migrations/Initializable.sol'; +import 'zos-lib/contracts/migrations/Initializable.sol'; contract DetailedERC20 is Initializable, ERC20 { string public name; diff --git a/contracts/token/ERC20/TokenTimelock.sol b/contracts/token/ERC20/TokenTimelock.sol index 643dd367d..6e82a1a2f 100644 --- a/contracts/token/ERC20/TokenTimelock.sol +++ b/contracts/token/ERC20/TokenTimelock.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.21; import "./SafeERC20.sol"; -import "zos-upgradeability/contracts/migrations/Initializable.sol"; +import "zos-lib/contracts/migrations/Initializable.sol"; /** * @title TokenTimelock diff --git a/contracts/token/ERC20/TokenVesting.sol b/contracts/token/ERC20/TokenVesting.sol index 8dcfa3178..652bd4ae7 100644 --- a/contracts/token/ERC20/TokenVesting.sol +++ b/contracts/token/ERC20/TokenVesting.sol @@ -6,7 +6,7 @@ import "./ERC20Basic.sol"; import "./SafeERC20.sol"; import "../../ownership/Ownable.sol"; import "../../math/SafeMath.sol"; -import 'zos-upgradeability/contracts/migrations/Initializable.sol'; +import 'zos-lib/contracts/migrations/Initializable.sol'; /** diff --git a/contracts/token/ERC721/ERC721Token.sol b/contracts/token/ERC721/ERC721Token.sol index 6d6a7bbb2..49a066587 100644 --- a/contracts/token/ERC721/ERC721Token.sol +++ b/contracts/token/ERC721/ERC721Token.sol @@ -2,7 +2,7 @@ pragma solidity ^0.4.21; import "./ERC721.sol"; import "./ERC721BasicToken.sol"; -import "zos-upgradeability/contracts/migrations/Initializable.sol"; +import "zos-lib/contracts/migrations/Initializable.sol"; /** diff --git a/package-lock.json b/package-lock.json index c32a5de49..fafb40d16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "zeppelin-solidity", - "version": "1.8.0", + "name": "openzeppelin-zos", + "version": "1.9.0-beta", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -52,7 +52,6 @@ "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "dev": true, "requires": { "co": "4.6.0", "fast-deep-equal": "1.0.0", @@ -92,14 +91,12 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" }, "any-observable": { "version": "0.2.0", @@ -111,7 +108,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", - "dev": true, "requires": { "micromatch": "2.3.11", "normalize-path": "2.1.1" @@ -120,14 +116,12 @@ "aproba": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.1.2.tgz", - "integrity": "sha512-ZpYajIfO0j2cOFTO955KUMIKNmj6zhX8kVztMAxFsDaMwz+9Z9SV0uou2pC9HJqcfpffOsjnbrDMvkNy+9RXPw==", - "dev": true + "integrity": "sha512-ZpYajIfO0j2cOFTO955KUMIKNmj6zhX8kVztMAxFsDaMwz+9Z9SV0uou2pC9HJqcfpffOsjnbrDMvkNy+9RXPw==" }, "are-we-there-yet": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", - "dev": true, "requires": { "delegates": "1.0.0", "readable-stream": "2.3.3" @@ -146,7 +140,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, "requires": { "arr-flatten": "1.1.0" } @@ -154,8 +147,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" }, "array-differ": { "version": "1.0.0", @@ -181,8 +173,7 @@ "array-unique": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" }, "arrify": { "version": "1.0.1", @@ -223,8 +214,7 @@ "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" }, "async-eventemitter": { "version": "0.2.3", @@ -264,11 +254,186 @@ "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", "dev": true }, + "babel-cli": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz", + "integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=", + "requires": { + "babel-core": "6.26.0", + "babel-polyfill": "6.26.0", + "babel-register": "6.26.0", + "babel-runtime": "6.26.0", + "chokidar": "1.7.0", + "commander": "2.11.0", + "convert-source-map": "1.5.0", + "fs-readdir-recursive": "1.1.0", + "glob": "7.1.2", + "lodash": "4.17.4", + "output-file-sync": "1.1.2", + "path-is-absolute": "1.0.1", + "slash": "1.0.0", + "source-map": "0.5.6", + "v8flags": "2.1.1" + }, + "dependencies": { + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "babel-core": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz", + "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", + "requires": { + "babel-code-frame": "6.26.0", + "babel-generator": "6.26.1", + "babel-helpers": "6.24.1", + "babel-messages": "6.23.0", + "babel-register": "6.26.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "convert-source-map": "1.5.0", + "debug": "2.6.8", + "json5": "0.5.1", + "lodash": "4.17.4", + "minimatch": "3.0.4", + "path-is-absolute": "1.0.1", + "private": "0.1.7", + "slash": "1.0.0", + "source-map": "0.5.6" + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "requires": { + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.4", + "source-map": "0.5.7", + "trim-right": "1.0.1" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "babel-polyfill": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "requires": { + "babel-runtime": "6.26.0", + "core-js": "2.5.0", + "regenerator-runtime": "0.10.5" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" + } + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "requires": { + "babel-core": "6.26.0", + "babel-runtime": "6.26.0", + "core-js": "2.5.0", + "home-or-tmp": "2.0.0", + "lodash": "4.17.4", + "mkdirp": "0.5.1", + "source-map-support": "0.4.15" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "2.5.0", + "regenerator-runtime": "0.11.1" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "lodash": "4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "requires": { + "babel-code-frame": "6.26.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "debug": "2.6.8", + "globals": "9.18.0", + "invariant": "2.2.2", + "lodash": "4.17.4" + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "requires": { + "babel-runtime": "6.26.0", + "esutils": "2.0.2", + "lodash": "4.17.4", + "to-fast-properties": "1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" + }, + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=" + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + } + } + }, "babel-code-frame": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", "integrity": "sha1-AnYgvuVnqIwyVhV05/0IAdMxGOQ=", - "dev": true, "requires": { "chalk": "1.1.3", "esutils": "2.0.2", @@ -480,7 +645,6 @@ "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", - "dev": true, "requires": { "babel-runtime": "6.25.0", "babel-template": "6.25.0" @@ -490,7 +654,6 @@ "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "dev": true, "requires": { "babel-runtime": "6.25.0" } @@ -1020,7 +1183,6 @@ "version": "6.25.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.25.0.tgz", "integrity": "sha1-M7mOql1IK7AajRqmtDetKwGuxBw=", - "dev": true, "requires": { "core-js": "2.5.0", "regenerator-runtime": "0.10.5" @@ -1030,7 +1192,6 @@ "version": "6.25.0", "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.25.0.tgz", "integrity": "sha1-ZlJBFmt8KqTGGdceGSlpVSsQwHE=", - "dev": true, "requires": { "babel-runtime": "6.25.0", "babel-traverse": "6.25.0", @@ -1043,7 +1204,6 @@ "version": "6.25.0", "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.25.0.tgz", "integrity": "sha1-IldJfi/NGbie3BPEyROB+VEklvE=", - "dev": true, "requires": { "babel-code-frame": "6.22.0", "babel-messages": "6.23.0", @@ -1060,7 +1220,6 @@ "version": "6.25.0", "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.25.0.tgz", "integrity": "sha1-cK+ySNVmDl0Y+BHZHIMDtUE0oY4=", - "dev": true, "requires": { "babel-runtime": "6.25.0", "esutils": "2.0.2", @@ -1081,14 +1240,12 @@ "babylon": { "version": "6.17.4", "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.17.4.tgz", - "integrity": "sha512-kChlV+0SXkjE0vUn9OZ7pBMWRFd8uq3mZe8x1K6jhuNcAFAtEnjchFAqB+dYEXKyd+JpT6eppRR78QAr5gTsUw==", - "dev": true + "integrity": "sha512-kChlV+0SXkjE0vUn9OZ7pBMWRFd8uq3mZe8x1K6jhuNcAFAtEnjchFAqB+dYEXKyd+JpT6eppRR78QAr5gTsUw==" }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base-x": { "version": "1.1.0", @@ -1119,8 +1276,7 @@ "binary-extensions": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", - "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", - "dev": true + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=" }, "binaryextensions": { "version": "2.1.1", @@ -1131,8 +1287,7 @@ "bindings": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", - "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==", - "dev": true + "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==" }, "bip39": { "version": "2.2.0", @@ -1150,7 +1305,6 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", - "dev": true, "requires": { "safe-buffer": "5.1.1" } @@ -1159,16 +1313,19 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.1.tgz", "integrity": "sha1-ysMo977kVzDUBLaSID/LWQ4XLV4=", - "dev": true, "requires": { "readable-stream": "2.3.3" } }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" + }, "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", - "dev": true + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, "boom": { "version": "2.10.1", @@ -1183,7 +1340,6 @@ "version": "1.1.8", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", - "dev": true, "requires": { "balanced-match": "1.0.0", "concat-map": "0.0.1" @@ -1193,7 +1349,6 @@ "version": "1.8.5", "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, "requires": { "expand-range": "1.8.2", "preserve": "0.2.0", @@ -1203,20 +1358,17 @@ "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, "browser-stdout": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", - "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", - "dev": true + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=" }, "browserify-aes": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz", "integrity": "sha1-Xncl297x/Vkw1OurSFZ85FHEigo=", - "dev": true, "requires": { "buffer-xor": "1.0.3", "cipher-base": "1.0.4", @@ -1229,7 +1381,6 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.1.tgz", "integrity": "sha1-P/NKMAbvFcD7NWflQbkaI0ASPRE=", - "dev": true, "requires": { "js-sha3": "0.3.1" } @@ -1256,14 +1407,12 @@ "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" }, "cacheable-request": { "version": "2.1.4", @@ -1306,8 +1455,7 @@ "camelcase": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", - "dev": true + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" }, "caseless": { "version": "0.11.0", @@ -1359,7 +1507,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, "requires": { "ansi-styles": "2.2.1", "escape-string-regexp": "1.0.5", @@ -1393,7 +1540,6 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", - "dev": true, "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", @@ -1409,14 +1555,12 @@ "chownr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", - "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", - "dev": true + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=" }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, "requires": { "inherits": "2.0.3", "safe-buffer": "5.1.1" @@ -1488,7 +1632,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, "requires": { "string-width": "1.0.2", "strip-ansi": "3.0.1", @@ -1568,14 +1711,12 @@ "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "coinstring": { "version": "2.3.0", @@ -1628,8 +1769,7 @@ "commander": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", - "dev": true + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==" }, "commondir": { "version": "1.0.1", @@ -1640,8 +1780,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "concat-stream": { "version": "1.6.0", @@ -1657,8 +1796,7 @@ "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, "contains-path": { "version": "0.1.0", @@ -1669,20 +1807,17 @@ "convert-source-map": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", - "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", - "dev": true + "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=" }, "core-js": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.0.tgz", - "integrity": "sha1-VpwFCRi+ZIazg3VSAorgRmtxcIY=", - "dev": true + "integrity": "sha1-VpwFCRi+ZIazg3VSAorgRmtxcIY=" }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "coveralls": { "version": "2.13.1", @@ -1709,7 +1844,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", - "dev": true, "requires": { "cipher-base": "1.0.4", "inherits": "2.0.3", @@ -1721,7 +1855,6 @@ "version": "1.1.6", "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", - "dev": true, "requires": { "cipher-base": "1.0.4", "create-hash": "1.1.3", @@ -1766,8 +1899,7 @@ "crypto-js": { "version": "3.1.8", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.8.tgz", - "integrity": "sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU=", - "dev": true + "integrity": "sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU=" }, "dargs": { "version": "5.1.0", @@ -1814,7 +1946,6 @@ "version": "2.6.8", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", - "dev": true, "requires": { "ms": "2.0.0" } @@ -1822,8 +1953,7 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, "decode-uri-component": { "version": "0.2.0", @@ -1866,8 +1996,7 @@ "deep-extend": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", - "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", - "dev": true + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=" }, "deep-is": { "version": "0.1.3", @@ -1932,8 +2061,7 @@ "delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "dev": true + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" }, "detect-conflict": { "version": "1.0.1", @@ -1945,7 +2073,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", - "dev": true, "requires": { "repeating": "2.0.1" } @@ -1980,7 +2107,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", - "dev": true, "requires": { "browserify-aes": "1.0.6", "create-hash": "1.1.3", @@ -2025,7 +2151,6 @@ "version": "6.4.0", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", - "dev": true, "requires": { "bn.js": "4.11.8", "brorand": "1.1.0", @@ -2055,7 +2180,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz", "integrity": "sha1-epDYM+/abPpurA9JSduw+tOmMgY=", - "dev": true, "requires": { "once": "1.4.0" } @@ -2097,7 +2221,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", - "dev": true, "requires": { "is-arrayish": "0.2.1" } @@ -2129,8 +2252,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "escodegen": { "version": "1.8.1", @@ -2534,8 +2656,7 @@ "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, "ethereum-common": { "version": "0.0.16", @@ -2543,6 +2664,29 @@ "integrity": "sha1-mh4Wnq00q3XgifUMpRK/0PvRJlU=", "dev": true }, + "ethereumjs-abi": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz", + "integrity": "sha1-WmN+8Wq0NHP6cqKa2QhxQFs/UkE=", + "requires": { + "bn.js": "4.11.8", + "ethereumjs-util": "4.5.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz", + "integrity": "sha1-PpQosxfuvaPXJg2FT93alUsfG8Y=", + "requires": { + "bn.js": "4.11.8", + "create-hash": "1.1.3", + "keccakjs": "0.2.1", + "rlp": "2.0.0", + "secp256k1": "3.3.0" + } + } + } + }, "ethereumjs-account": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.4.tgz", @@ -2787,7 +2931,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz", "integrity": "sha1-SXtmrZ/vZc18CKYYCCS6FHa2blM=", - "dev": true, "requires": { "create-hash": "1.1.3" } @@ -2817,7 +2960,6 @@ "version": "0.1.5", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, "requires": { "is-posix-bracket": "0.1.1" } @@ -2826,7 +2968,6 @@ "version": "1.8.2", "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, "requires": { "fill-range": "2.2.3" } @@ -2834,8 +2975,7 @@ "expand-template": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-1.0.3.tgz", - "integrity": "sha1-bDAzIxd6YrGyLAcCefeGEoe2mxo=", - "dev": true + "integrity": "sha1-bDAzIxd6YrGyLAcCefeGEoe2mxo=" }, "expand-tilde": { "version": "2.0.2", @@ -2867,7 +3007,6 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, "requires": { "is-extglob": "1.0.0" } @@ -2890,14 +3029,12 @@ "fast-deep-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", - "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", - "dev": true + "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=" }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, "fast-levenshtein": { "version": "2.0.6", @@ -2927,14 +3064,12 @@ "filename-regex": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" }, "fill-range": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", - "dev": true, "requires": { "is-number": "2.1.0", "isobject": "2.1.0", @@ -2947,7 +3082,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, "requires": { "path-exists": "2.1.0", "pinkie-promise": "2.0.1" @@ -2992,14 +3126,12 @@ "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" }, "for-own": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, "requires": { "for-in": "1.0.2" } @@ -3041,7 +3173,6 @@ "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", - "dev": true, "requires": { "graceful-fs": "4.1.11", "jsonfile": "2.4.0", @@ -3050,17 +3181,20 @@ "rimraf": "2.6.1" } }, + "fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==" + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", - "dev": true, "optional": true, "requires": { "nan": "2.6.2", @@ -3070,13 +3204,11 @@ "abbrev": { "version": "1.1.0", "bundled": true, - "dev": true, "optional": true }, "ajv": { "version": "4.11.8", "bundled": true, - "dev": true, "optional": true, "requires": { "co": "4.6.0", @@ -3085,19 +3217,16 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true, - "dev": true + "bundled": true }, "aproba": { "version": "1.1.1", "bundled": true, - "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.4", "bundled": true, - "dev": true, "optional": true, "requires": { "delegates": "1.0.0", @@ -3107,42 +3236,35 @@ "asn1": { "version": "0.2.3", "bundled": true, - "dev": true, "optional": true }, "assert-plus": { "version": "0.2.0", "bundled": true, - "dev": true, "optional": true }, "asynckit": { "version": "0.4.0", "bundled": true, - "dev": true, "optional": true }, "aws-sign2": { "version": "0.6.0", "bundled": true, - "dev": true, "optional": true }, "aws4": { "version": "1.6.0", "bundled": true, - "dev": true, "optional": true }, "balanced-match": { "version": "0.4.2", - "bundled": true, - "dev": true + "bundled": true }, "bcrypt-pbkdf": { "version": "1.0.1", "bundled": true, - "dev": true, "optional": true, "requires": { "tweetnacl": "0.14.5" @@ -3151,7 +3273,6 @@ "block-stream": { "version": "0.0.9", "bundled": true, - "dev": true, "requires": { "inherits": "2.0.3" } @@ -3159,7 +3280,6 @@ "boom": { "version": "2.10.1", "bundled": true, - "dev": true, "requires": { "hoek": "2.16.3" } @@ -3167,7 +3287,6 @@ "brace-expansion": { "version": "1.1.7", "bundled": true, - "dev": true, "requires": { "balanced-match": "0.4.2", "concat-map": "0.0.1" @@ -3175,53 +3294,44 @@ }, "buffer-shims": { "version": "1.0.0", - "bundled": true, - "dev": true + "bundled": true }, "caseless": { "version": "0.12.0", "bundled": true, - "dev": true, "optional": true }, "co": { "version": "4.6.0", "bundled": true, - "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "dev": true + "bundled": true }, "combined-stream": { "version": "1.0.5", "bundled": true, - "dev": true, "requires": { "delayed-stream": "1.0.0" } }, "concat-map": { "version": "0.0.1", - "bundled": true, - "dev": true + "bundled": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "dev": true + "bundled": true }, "core-util-is": { "version": "1.0.2", - "bundled": true, - "dev": true + "bundled": true }, "cryptiles": { "version": "2.0.5", "bundled": true, - "dev": true, "requires": { "boom": "2.10.1" } @@ -3229,7 +3339,6 @@ "dashdash": { "version": "1.14.1", "bundled": true, - "dev": true, "optional": true, "requires": { "assert-plus": "1.0.0" @@ -3238,7 +3347,6 @@ "assert-plus": { "version": "1.0.0", "bundled": true, - "dev": true, "optional": true } } @@ -3246,7 +3354,6 @@ "debug": { "version": "2.6.8", "bundled": true, - "dev": true, "optional": true, "requires": { "ms": "2.0.0" @@ -3255,30 +3362,25 @@ "deep-extend": { "version": "0.4.2", "bundled": true, - "dev": true, "optional": true }, "delayed-stream": { "version": "1.0.0", - "bundled": true, - "dev": true + "bundled": true }, "delegates": { "version": "1.0.0", "bundled": true, - "dev": true, "optional": true }, "detect-libc": { "version": "1.0.2", "bundled": true, - "dev": true, "optional": true }, "ecc-jsbn": { "version": "0.1.1", "bundled": true, - "dev": true, "optional": true, "requires": { "jsbn": "0.1.1" @@ -3287,24 +3389,20 @@ "extend": { "version": "3.0.1", "bundled": true, - "dev": true, "optional": true }, "extsprintf": { "version": "1.0.2", - "bundled": true, - "dev": true + "bundled": true }, "forever-agent": { "version": "0.6.1", "bundled": true, - "dev": true, "optional": true }, "form-data": { "version": "2.1.4", "bundled": true, - "dev": true, "optional": true, "requires": { "asynckit": "0.4.0", @@ -3314,13 +3412,11 @@ }, "fs.realpath": { "version": "1.0.0", - "bundled": true, - "dev": true + "bundled": true }, "fstream": { "version": "1.0.11", "bundled": true, - "dev": true, "requires": { "graceful-fs": "4.1.11", "inherits": "2.0.3", @@ -3331,7 +3427,6 @@ "fstream-ignore": { "version": "1.0.5", "bundled": true, - "dev": true, "optional": true, "requires": { "fstream": "1.0.11", @@ -3342,7 +3437,6 @@ "gauge": { "version": "2.7.4", "bundled": true, - "dev": true, "optional": true, "requires": { "aproba": "1.1.1", @@ -3358,7 +3452,6 @@ "getpass": { "version": "0.1.7", "bundled": true, - "dev": true, "optional": true, "requires": { "assert-plus": "1.0.0" @@ -3367,7 +3460,6 @@ "assert-plus": { "version": "1.0.0", "bundled": true, - "dev": true, "optional": true } } @@ -3375,7 +3467,6 @@ "glob": { "version": "7.1.2", "bundled": true, - "dev": true, "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", @@ -3387,19 +3478,16 @@ }, "graceful-fs": { "version": "4.1.11", - "bundled": true, - "dev": true + "bundled": true }, "har-schema": { "version": "1.0.5", "bundled": true, - "dev": true, "optional": true }, "har-validator": { "version": "4.2.1", "bundled": true, - "dev": true, "optional": true, "requires": { "ajv": "4.11.8", @@ -3409,13 +3497,11 @@ "has-unicode": { "version": "2.0.1", "bundled": true, - "dev": true, "optional": true }, "hawk": { "version": "3.1.3", "bundled": true, - "dev": true, "requires": { "boom": "2.10.1", "cryptiles": "2.0.5", @@ -3425,13 +3511,11 @@ }, "hoek": { "version": "2.16.3", - "bundled": true, - "dev": true + "bundled": true }, "http-signature": { "version": "1.1.1", "bundled": true, - "dev": true, "optional": true, "requires": { "assert-plus": "0.2.0", @@ -3442,7 +3526,6 @@ "inflight": { "version": "1.0.6", "bundled": true, - "dev": true, "requires": { "once": "1.4.0", "wrappy": "1.0.2" @@ -3450,19 +3533,16 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, - "dev": true + "bundled": true }, "ini": { "version": "1.3.4", "bundled": true, - "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, - "dev": true, "requires": { "number-is-nan": "1.0.1" } @@ -3470,24 +3550,20 @@ "is-typedarray": { "version": "1.0.0", "bundled": true, - "dev": true, "optional": true }, "isarray": { "version": "1.0.0", - "bundled": true, - "dev": true + "bundled": true }, "isstream": { "version": "0.1.2", "bundled": true, - "dev": true, "optional": true }, "jodid25519": { "version": "1.0.2", "bundled": true, - "dev": true, "optional": true, "requires": { "jsbn": "0.1.1" @@ -3496,19 +3572,16 @@ "jsbn": { "version": "0.1.1", "bundled": true, - "dev": true, "optional": true }, "json-schema": { "version": "0.2.3", "bundled": true, - "dev": true, "optional": true }, "json-stable-stringify": { "version": "1.0.1", "bundled": true, - "dev": true, "optional": true, "requires": { "jsonify": "0.0.0" @@ -3517,19 +3590,16 @@ "json-stringify-safe": { "version": "5.0.1", "bundled": true, - "dev": true, "optional": true }, "jsonify": { "version": "0.0.0", "bundled": true, - "dev": true, "optional": true }, "jsprim": { "version": "1.4.0", "bundled": true, - "dev": true, "optional": true, "requires": { "assert-plus": "1.0.0", @@ -3541,20 +3611,17 @@ "assert-plus": { "version": "1.0.0", "bundled": true, - "dev": true, "optional": true } } }, "mime-db": { "version": "1.27.0", - "bundled": true, - "dev": true + "bundled": true }, "mime-types": { "version": "2.1.15", "bundled": true, - "dev": true, "requires": { "mime-db": "1.27.0" } @@ -3562,20 +3629,17 @@ "minimatch": { "version": "3.0.4", "bundled": true, - "dev": true, "requires": { "brace-expansion": "1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true, - "dev": true + "bundled": true }, "mkdirp": { "version": "0.5.1", "bundled": true, - "dev": true, "requires": { "minimist": "0.0.8" } @@ -3583,13 +3647,11 @@ "ms": { "version": "2.0.0", "bundled": true, - "dev": true, "optional": true }, "node-pre-gyp": { "version": "0.6.39", "bundled": true, - "dev": true, "optional": true, "requires": { "detect-libc": "1.0.2", @@ -3608,7 +3670,6 @@ "nopt": { "version": "4.0.1", "bundled": true, - "dev": true, "optional": true, "requires": { "abbrev": "1.1.0", @@ -3618,7 +3679,6 @@ "npmlog": { "version": "4.1.0", "bundled": true, - "dev": true, "optional": true, "requires": { "are-we-there-yet": "1.1.4", @@ -3629,25 +3689,21 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "dev": true + "bundled": true }, "oauth-sign": { "version": "0.8.2", "bundled": true, - "dev": true, "optional": true }, "object-assign": { "version": "4.1.1", "bundled": true, - "dev": true, "optional": true }, "once": { "version": "1.4.0", "bundled": true, - "dev": true, "requires": { "wrappy": "1.0.2" } @@ -3655,19 +3711,16 @@ "os-homedir": { "version": "1.0.2", "bundled": true, - "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", "bundled": true, - "dev": true, "optional": true }, "osenv": { "version": "0.1.4", "bundled": true, - "dev": true, "optional": true, "requires": { "os-homedir": "1.0.2", @@ -3676,36 +3729,30 @@ }, "path-is-absolute": { "version": "1.0.1", - "bundled": true, - "dev": true + "bundled": true }, "performance-now": { "version": "0.2.0", "bundled": true, - "dev": true, "optional": true }, "process-nextick-args": { "version": "1.0.7", - "bundled": true, - "dev": true + "bundled": true }, "punycode": { "version": "1.4.1", "bundled": true, - "dev": true, "optional": true }, "qs": { "version": "6.4.0", "bundled": true, - "dev": true, "optional": true }, "rc": { "version": "1.2.1", "bundled": true, - "dev": true, "optional": true, "requires": { "deep-extend": "0.4.2", @@ -3717,7 +3764,6 @@ "minimist": { "version": "1.2.0", "bundled": true, - "dev": true, "optional": true } } @@ -3725,7 +3771,6 @@ "readable-stream": { "version": "2.2.9", "bundled": true, - "dev": true, "requires": { "buffer-shims": "1.0.0", "core-util-is": "1.0.2", @@ -3739,7 +3784,6 @@ "request": { "version": "2.81.0", "bundled": true, - "dev": true, "optional": true, "requires": { "aws-sign2": "0.6.0", @@ -3769,38 +3813,32 @@ "rimraf": { "version": "2.6.1", "bundled": true, - "dev": true, "requires": { "glob": "7.1.2" } }, "safe-buffer": { "version": "5.0.1", - "bundled": true, - "dev": true + "bundled": true }, "semver": { "version": "5.3.0", "bundled": true, - "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", "bundled": true, - "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", "bundled": true, - "dev": true, "optional": true }, "sntp": { "version": "1.0.9", "bundled": true, - "dev": true, "requires": { "hoek": "2.16.3" } @@ -3808,7 +3846,6 @@ "sshpk": { "version": "1.13.0", "bundled": true, - "dev": true, "optional": true, "requires": { "asn1": "0.2.3", @@ -3825,7 +3862,6 @@ "assert-plus": { "version": "1.0.0", "bundled": true, - "dev": true, "optional": true } } @@ -3833,7 +3869,6 @@ "string-width": { "version": "1.0.2", "bundled": true, - "dev": true, "requires": { "code-point-at": "1.1.0", "is-fullwidth-code-point": "1.0.0", @@ -3843,7 +3878,6 @@ "string_decoder": { "version": "1.0.1", "bundled": true, - "dev": true, "requires": { "safe-buffer": "5.0.1" } @@ -3851,13 +3885,11 @@ "stringstream": { "version": "0.0.5", "bundled": true, - "dev": true, "optional": true }, "strip-ansi": { "version": "3.0.1", "bundled": true, - "dev": true, "requires": { "ansi-regex": "2.1.1" } @@ -3865,13 +3897,11 @@ "strip-json-comments": { "version": "2.0.1", "bundled": true, - "dev": true, "optional": true }, "tar": { "version": "2.2.1", "bundled": true, - "dev": true, "requires": { "block-stream": "0.0.9", "fstream": "1.0.11", @@ -3881,7 +3911,6 @@ "tar-pack": { "version": "3.4.0", "bundled": true, - "dev": true, "optional": true, "requires": { "debug": "2.6.8", @@ -3897,7 +3926,6 @@ "tough-cookie": { "version": "2.3.2", "bundled": true, - "dev": true, "optional": true, "requires": { "punycode": "1.4.1" @@ -3906,7 +3934,6 @@ "tunnel-agent": { "version": "0.6.0", "bundled": true, - "dev": true, "optional": true, "requires": { "safe-buffer": "5.0.1" @@ -3915,30 +3942,25 @@ "tweetnacl": { "version": "0.14.5", "bundled": true, - "dev": true, "optional": true }, "uid-number": { "version": "0.0.6", "bundled": true, - "dev": true, "optional": true }, "util-deprecate": { "version": "1.0.2", - "bundled": true, - "dev": true + "bundled": true }, "uuid": { "version": "3.0.1", "bundled": true, - "dev": true, "optional": true }, "verror": { "version": "1.3.6", "bundled": true, - "dev": true, "optional": true, "requires": { "extsprintf": "1.0.2" @@ -3947,7 +3969,6 @@ "wide-align": { "version": "1.1.2", "bundled": true, - "dev": true, "optional": true, "requires": { "string-width": "1.0.2" @@ -3955,8 +3976,7 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, - "dev": true + "bundled": true } } }, @@ -4003,7 +4023,6 @@ "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, "requires": { "aproba": "1.1.2", "console-control-strings": "1.1.0", @@ -4033,8 +4052,7 @@ "get-caller-file": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", - "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", - "dev": true + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=" }, "get-func-name": { "version": "2.0.0", @@ -4132,8 +4150,7 @@ "github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=", - "dev": true + "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" }, "github-username": { "version": "4.1.0", @@ -4148,7 +4165,6 @@ "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", @@ -4189,7 +4205,6 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, "requires": { "glob-parent": "2.0.0", "is-glob": "2.0.1" @@ -4199,7 +4214,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, "requires": { "is-glob": "2.0.1" } @@ -4241,8 +4255,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" }, "globby": { "version": "5.0.0", @@ -4294,14 +4307,12 @@ "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" }, "graceful-readlink": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", - "dev": true + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" }, "grouped-queue": { "version": "0.3.3", @@ -4315,8 +4326,7 @@ "growl": { "version": "1.9.2", "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", - "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", - "dev": true + "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=" }, "handlebars": { "version": "4.0.11", @@ -4366,7 +4376,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, "requires": { "ansi-regex": "2.1.1" } @@ -4380,8 +4389,7 @@ "has-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=" }, "has-symbol-support-x": { "version": "1.4.2", @@ -4401,14 +4409,12 @@ "has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" }, "hash-base": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", - "dev": true, "requires": { "inherits": "2.0.3" } @@ -4417,7 +4423,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", - "dev": true, "requires": { "inherits": "2.0.3", "minimalistic-assert": "1.0.0" @@ -4448,14 +4453,12 @@ "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=" }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, "requires": { "hash.js": "1.1.3", "minimalistic-assert": "1.0.0", @@ -4472,7 +4475,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", - "dev": true, "requires": { "os-homedir": "1.0.2", "os-tmpdir": "1.0.2" @@ -4490,8 +4492,7 @@ "hosted-git-info": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", - "dev": true + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==" }, "http-cache-semantics": { "version": "3.8.1", @@ -4577,7 +4578,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "1.4.0", "wrappy": "1.0.2" @@ -4586,14 +4586,12 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", - "dev": true + "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=" }, "inquirer": { "version": "3.3.0", @@ -4688,8 +4686,7 @@ "interpret": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz", - "integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=", - "dev": true + "integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=" }, "into-stream": { "version": "3.1.0", @@ -4705,7 +4702,6 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", - "dev": true, "requires": { "loose-envify": "1.3.1" } @@ -4713,20 +4709,17 @@ "invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, "is-binary-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, "requires": { "binary-extensions": "1.11.0" } @@ -4734,14 +4727,12 @@ "is-buffer": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", - "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", - "dev": true + "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=" }, "is-builtin-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, "requires": { "builtin-modules": "1.1.1" } @@ -4761,14 +4752,12 @@ "is-dotfile": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" }, "is-equal-shallow": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, "requires": { "is-primitive": "2.0.0" } @@ -4776,20 +4765,17 @@ "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" }, "is-extglob": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" }, "is-finite": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, "requires": { "number-is-nan": "1.0.1" } @@ -4798,7 +4784,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, "requires": { "number-is-nan": "1.0.1" } @@ -4813,7 +4798,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, "requires": { "is-extglob": "1.0.0" } @@ -4839,7 +4823,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, "requires": { "kind-of": "3.2.2" } @@ -4900,14 +4883,12 @@ "is-posix-bracket": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" }, "is-primitive": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" }, "is-promise": { "version": "2.1.0", @@ -4975,8 +4956,7 @@ "is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" }, "is-windows": { "version": "1.0.2", @@ -4987,8 +4967,7 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "isexe": { "version": "2.0.0", @@ -5000,7 +4979,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, "requires": { "isarray": "1.0.0" } @@ -5121,8 +5099,7 @@ "js-sha3": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.3.1.tgz", - "integrity": "sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM=", - "dev": true + "integrity": "sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM=" }, "js-string-escape": { "version": "1.0.1", @@ -5133,8 +5110,7 @@ "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" }, "js-yaml": { "version": "3.6.1", @@ -5211,8 +5187,7 @@ "json-schema-traverse": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", - "dev": true + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -5229,20 +5204,17 @@ "json3": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", - "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", - "dev": true + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=" }, "json5": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" }, "jsonfile": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "dev": true, "requires": { "graceful-fs": "4.1.11" } @@ -5290,7 +5262,6 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.1.tgz", "integrity": "sha1-HWM6+QfvMFu/ny+mFtVsRFYd+k0=", - "dev": true, "requires": { "browserify-sha3": "0.0.1", "sha3": "1.2.0" @@ -5309,7 +5280,6 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, "requires": { "is-buffer": "1.1.5" } @@ -5318,7 +5288,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "dev": true, "requires": { "graceful-fs": "4.1.11" } @@ -5334,7 +5303,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, "requires": { "invert-kv": "1.0.0" } @@ -5616,7 +5584,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, "requires": { "graceful-fs": "4.1.11", "parse-json": "2.2.0", @@ -5657,14 +5624,12 @@ "lodash": { "version": "4.17.4", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", - "dev": true + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" }, "lodash._baseassign": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", - "dev": true, "requires": { "lodash._basecopy": "3.0.1", "lodash.keys": "3.1.2" @@ -5673,32 +5638,27 @@ "lodash._basecopy": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", - "dev": true + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=" }, "lodash._basecreate": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", - "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", - "dev": true + "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=" }, "lodash._getnative": { "version": "3.9.1", "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", - "dev": true + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=" }, "lodash._isiterateecall": { "version": "3.0.9", "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", - "dev": true + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=" }, "lodash.assign": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", - "dev": true + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" }, "lodash.cond": { "version": "4.5.2", @@ -5710,7 +5670,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", - "dev": true, "requires": { "lodash._baseassign": "3.2.0", "lodash._basecreate": "3.0.3", @@ -5720,20 +5679,17 @@ "lodash.isarguments": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", - "dev": true + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" }, "lodash.isarray": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", - "dev": true + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=" }, "lodash.keys": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", - "dev": true, "requires": { "lodash._getnative": "3.9.1", "lodash.isarguments": "3.1.0", @@ -5845,7 +5801,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", - "dev": true, "requires": { "js-tokens": "3.0.2" } @@ -6001,8 +5956,7 @@ "memorystream": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", - "dev": true + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=" }, "merkle-patricia-tree": { "version": "2.1.2", @@ -6039,7 +5993,6 @@ "version": "2.3.11", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, "requires": { "arr-diff": "2.0.0", "array-unique": "0.2.1", @@ -6095,20 +6048,17 @@ "minimalistic-assert": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", - "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=", - "dev": true + "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=" }, "minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "1.1.8" } @@ -6116,14 +6066,12 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, "requires": { "minimist": "0.0.8" } @@ -6210,8 +6158,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "multimatch": { "version": "2.1.0", @@ -6234,8 +6181,7 @@ "nan": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz", - "integrity": "sha1-5P805slf37WuzAjeZZb0NgWn20U=", - "dev": true + "integrity": "sha1-5P805slf37WuzAjeZZb0NgWn20U=" }, "natural-compare": { "version": "1.4.0", @@ -6258,8 +6204,7 @@ "node-abi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.1.0.tgz", - "integrity": "sha512-AbW35CPRE4vdieOse46V+16dKispLNv3PQwgqlcfg7GQeQHcLu3gvp3fbU2gTh7d8NfGjp5CJh+j4Hpyb0XzaA==", - "dev": true + "integrity": "sha512-AbW35CPRE4vdieOse46V+16dKispLNv3PQwgqlcfg7GQeQHcLu3gvp3fbU2gTh7d8NfGjp5CJh+j4Hpyb0XzaA==" }, "node-dir": { "version": "0.1.8", @@ -6315,8 +6260,7 @@ "noop-logger": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", - "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=", - "dev": true + "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" }, "nopt": { "version": "3.0.6", @@ -6331,7 +6275,6 @@ "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", - "dev": true, "requires": { "hosted-git-info": "2.5.0", "is-builtin-module": "1.0.0", @@ -6343,7 +6286,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, "requires": { "remove-trailing-separator": "1.0.2" } @@ -6359,6 +6301,14 @@ "sort-keys": "2.0.0" } }, + "npm-programmatic": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/npm-programmatic/-/npm-programmatic-0.0.10.tgz", + "integrity": "sha512-SklCZ26RRGi7hLIz/oaSnHy8ZT0gh8r6N3FMuKRye3ZcRo4HI/saldc8b7OqlY/Ov8FXnA1+I+Od+WtesWEp2Q==", + "requires": { + "bluebird": "3.5.1" + } + }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -6372,7 +6322,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dev": true, "requires": { "are-we-there-yet": "1.1.4", "console-control-strings": "1.1.0", @@ -6383,8 +6332,7 @@ "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "number-to-bn": { "version": "1.7.0", @@ -6411,8 +6359,7 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, "object-inspect": { "version": "1.3.0", @@ -6430,7 +6377,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, "requires": { "for-own": "0.1.5", "is-extendable": "0.1.1" @@ -6440,7 +6386,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1.0.2" } @@ -6528,20 +6473,17 @@ "original-require": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/original-require/-/original-require-1.0.1.tgz", - "integrity": "sha1-DxMEcVhM0zURxew4yNWSE/msXiA=", - "dev": true + "integrity": "sha1-DxMEcVhM0zURxew4yNWSE/msXiA=" }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" }, "os-locale": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, "requires": { "lcid": "1.0.0" } @@ -6549,8 +6491,17 @@ "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "output-file-sync": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", + "integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=", + "requires": { + "graceful-fs": "4.1.11", + "mkdirp": "0.5.1", + "object-assign": "4.1.1" + } }, "p-cancelable": { "version": "0.4.1", @@ -6625,7 +6576,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, "requires": { "glob-base": "0.3.0", "is-dotfile": "1.0.3", @@ -6647,7 +6597,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, "requires": { "error-ex": "1.3.1" } @@ -6662,7 +6611,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, "requires": { "pinkie-promise": "2.0.1" } @@ -6670,8 +6618,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { "version": "1.0.2", @@ -6688,14 +6635,12 @@ "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", - "dev": true + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" }, "path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, "requires": { "graceful-fs": "4.1.11", "pify": "2.3.0", @@ -6730,20 +6675,17 @@ "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" }, "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, "requires": { "pinkie": "2.0.4" } @@ -6767,7 +6709,6 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-2.2.2.tgz", "integrity": "sha512-F46pcvDxtQhbV3B+dm+exHuKxIyJK26fVNiJRmbTW/5D7o0Z2yzc8CKeu7UWbo9XxQZoVOC88aKgySAsza+cWw==", - "dev": true, "requires": { "expand-template": "1.0.3", "github-from-package": "0.0.0", @@ -6788,14 +6729,12 @@ "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, "requires": { "safe-buffer": "5.1.1" } @@ -6817,8 +6756,7 @@ "preserve": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" }, "prettier": { "version": "1.11.1", @@ -6835,8 +6773,7 @@ "private": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=", - "dev": true + "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=" }, "process": { "version": "0.5.2", @@ -6847,8 +6784,7 @@ "process-nextick-args": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" }, "progress": { "version": "2.0.0", @@ -6872,7 +6808,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.2.tgz", "integrity": "sha1-Oz7mUS+U8OV1U4wXmV+fFpkKXVE=", - "dev": true, "requires": { "end-of-stream": "1.4.0", "once": "1.4.0" @@ -6905,7 +6840,6 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", - "dev": true, "requires": { "is-number": "3.0.0", "kind-of": "4.0.0" @@ -6915,7 +6849,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, "requires": { "kind-of": "3.2.2" }, @@ -6924,7 +6857,6 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, "requires": { "is-buffer": "1.1.5" } @@ -6935,7 +6867,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, "requires": { "is-buffer": "1.1.5" } @@ -6955,7 +6886,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.1.tgz", "integrity": "sha1-LgPo5C7kULjLPc5lvhv4l04d/ZU=", - "dev": true, "requires": { "deep-extend": "0.4.2", "ini": "1.3.4", @@ -6966,8 +6896,7 @@ "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" } } }, @@ -6993,7 +6922,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, "requires": { "load-json-file": "1.1.0", "normalize-package-data": "2.4.0", @@ -7004,7 +6932,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, "requires": { "find-up": "1.1.2", "read-pkg": "1.1.0" @@ -7014,7 +6941,6 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", - "dev": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", @@ -7029,7 +6955,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", - "dev": true, "requires": { "graceful-fs": "4.1.11", "minimatch": "3.0.4", @@ -7067,7 +6992,6 @@ "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, "requires": { "resolve": "1.4.0" } @@ -7081,8 +7005,7 @@ "regenerator-runtime": { "version": "0.10.5", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", - "dev": true + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" }, "regenerator-transform": { "version": "0.9.11", @@ -7099,7 +7022,6 @@ "version": "0.4.3", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", - "dev": true, "requires": { "is-equal-shallow": "0.1.3", "is-primitive": "2.0.0" @@ -7134,26 +7056,22 @@ "remove-trailing-separator": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz", - "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE=", - "dev": true + "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE=" }, "repeat-element": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", - "dev": true + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" }, "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, "repeating": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, "requires": { "is-finite": "1.0.2" } @@ -7213,20 +7131,17 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "require-from-string": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", - "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=", - "dev": true + "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=" }, "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" }, "require-uncached": { "version": "1.0.3", @@ -7250,7 +7165,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", - "dev": true, "requires": { "path-parse": "1.0.5" } @@ -7330,7 +7244,6 @@ "version": "2.6.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", - "dev": true, "requires": { "glob": "7.1.2" } @@ -7339,7 +7252,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", - "dev": true, "requires": { "hash-base": "2.0.2", "inherits": "2.0.3" @@ -7348,8 +7260,7 @@ "rlp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.0.0.tgz", - "integrity": "sha1-nbOE/0uJqPYVY9kjldhiWxjzr7A=", - "dev": true + "integrity": "sha1-nbOE/0uJqPYVY9kjldhiWxjzr7A=" }, "run-async": { "version": "2.3.0", @@ -7387,8 +7298,7 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", - "dev": true + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" }, "scoped-regex": { "version": "1.0.0", @@ -7428,7 +7338,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.3.0.tgz", "integrity": "sha512-CbrQoeGG5V0kQ1ohEMGI+J7oKerapLTpivLICBaXR0R4HyQcN3kM9itLsV5fdpV1UR1bD14tOkJ1xughmlDIiQ==", - "dev": true, "requires": { "bindings": "1.3.0", "bip66": "1.1.5", @@ -7450,26 +7359,22 @@ "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", - "dev": true + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "set-immediate-shim": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" }, "sha.js": { "version": "2.4.8", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.8.tgz", "integrity": "sha1-NwaMLEdra69ALRSknGf1l5IfY08=", - "dev": true, "requires": { "inherits": "2.0.3" } @@ -7478,7 +7383,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.0.tgz", "integrity": "sha1-aYnxtwpJhwWHajc+LGKs6WqpOZo=", - "dev": true, "requires": { "nan": "2.6.2" } @@ -7518,14 +7422,12 @@ "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "simple-get": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-1.4.3.tgz", "integrity": "sha1-6XVe2kB+ltpAxeUVjJ6jezO+y+s=", - "dev": true, "requires": { "once": "1.4.0", "unzip-response": "1.0.2", @@ -7535,8 +7437,7 @@ "slash": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", - "dev": true + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" }, "slice-ansi": { "version": "1.0.0", @@ -7860,14 +7761,12 @@ "source-map": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", - "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", - "dev": true + "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=" }, "source-map-support": { "version": "0.4.15", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.15.tgz", "integrity": "sha1-AyAt9lwG0r2MfsI2KhkwVv7407E=", - "dev": true, "requires": { "source-map": "0.5.6" } @@ -7876,7 +7775,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", - "dev": true, "requires": { "spdx-license-ids": "1.2.2" } @@ -7884,14 +7782,12 @@ "spdx-expression-parse": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", - "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", - "dev": true + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=" }, "spdx-license-ids": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", - "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", - "dev": true + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=" }, "sprintf-js": { "version": "1.0.3", @@ -7948,7 +7844,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, "requires": { "code-point-at": "1.1.0", "is-fullwidth-code-point": "1.0.0", @@ -7970,7 +7865,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, "requires": { "safe-buffer": "5.1.1" } @@ -7985,7 +7879,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, "requires": { "ansi-regex": "2.1.1" } @@ -7994,7 +7887,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, "requires": { "is-utf8": "0.2.1" } @@ -8026,14 +7918,12 @@ "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" }, "symbol-observable": { "version": "1.0.1", @@ -8168,7 +8058,6 @@ "version": "1.15.3", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.15.3.tgz", "integrity": "sha1-7M+TXpQUk9gVECjmNuUc5MPKfyA=", - "dev": true, "requires": { "chownr": "1.0.1", "mkdirp": "0.5.1", @@ -8180,7 +8069,6 @@ "version": "1.5.4", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.5.4.tgz", "integrity": "sha1-NlSc8E7RrumyowwBQyUiONr5QBY=", - "dev": true, "requires": { "bl": "1.2.1", "end-of-stream": "1.4.0", @@ -8252,8 +8140,7 @@ "to-fast-properties": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", - "dev": true + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=" }, "to-iso-string": { "version": "0.0.2", @@ -8279,8 +8166,7 @@ "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" }, "truffle": { "version": "4.1.5", @@ -8366,6 +8252,95 @@ } } }, + "truffle-blockchain-utils": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/truffle-blockchain-utils/-/truffle-blockchain-utils-0.0.4.tgz", + "integrity": "sha512-wgRrhwqh0aea08Hz28hUV4tuF2uTVQH/e9kBou+WK04cqrutB5cxQVQ6HGjeZLltxBYOFvhrGOOq4l3WJFnPEA==" + }, + "truffle-contract": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/truffle-contract/-/truffle-contract-3.0.5.tgz", + "integrity": "sha512-lRayhvX73OrLJ6TDvc0iYbzcB+Y1F9FCj9N1FXQ2EKOkqyIjmgZNMZFHGjvfTws1gsmonYd6sND0ahipiUYy8g==", + "requires": { + "ethjs-abi": "0.1.8", + "truffle-blockchain-utils": "0.0.4", + "truffle-contract-schema": "2.0.0", + "truffle-error": "0.0.2", + "web3": "0.20.6" + }, + "dependencies": { + "bignumber.js": { + "version": "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934" + }, + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" + }, + "ethjs-abi": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/ethjs-abi/-/ethjs-abi-0.1.8.tgz", + "integrity": "sha1-zSiFg+1ijN+tr4re+juh28vKbBg=", + "requires": { + "bn.js": "4.11.6", + "js-sha3": "0.5.5", + "number-to-bn": "1.7.0" + } + }, + "js-sha3": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.5.tgz", + "integrity": "sha1-uvDA6MVK1ZA0R9+Wreekobynmko=" + }, + "web3": { + "version": "0.20.6", + "resolved": "https://registry.npmjs.org/web3/-/web3-0.20.6.tgz", + "integrity": "sha1-PpcwauAk+yThCj11yIQwJWIhUSA=", + "requires": { + "bignumber.js": "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934", + "crypto-js": "3.1.8", + "utf8": "2.1.2", + "xhr2": "0.1.4", + "xmlhttprequest": "1.8.0" + } + } + } + }, + "truffle-contract-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/truffle-contract-schema/-/truffle-contract-schema-2.0.0.tgz", + "integrity": "sha512-nLlspmu1GKDaluWksBwitHi/7Z3IpRjmBYeO9N+T1nVJD2V4IWJaptCKP1NqnPiJA+FChB7+F7pI6Br51/FtXQ==", + "requires": { + "ajv": "5.5.2", + "crypto-js": "3.1.9-1", + "debug": "3.1.0" + }, + "dependencies": { + "crypto-js": { + "version": "3.1.9-1", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz", + "integrity": "sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg=" + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "truffle-error": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/truffle-error/-/truffle-error-0.0.2.tgz", + "integrity": "sha1-AbGJt4UFVmrhaJwjnHyi3RIc/kw=" + }, + "truffle-expect": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/truffle-expect/-/truffle-expect-0.0.3.tgz", + "integrity": "sha1-m3XO80O9WW5+XbyHj18bLjGKlEw=" + }, "truffle-hdwallet-provider": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/truffle-hdwallet-provider/-/truffle-hdwallet-provider-0.0.3.tgz", @@ -8462,6 +8437,32 @@ } } }, + "truffle-provisioner": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/truffle-provisioner/-/truffle-provisioner-0.1.0.tgz", + "integrity": "sha1-Ap5SScEBUwBzhTXgT97ZMaU8T2I=" + }, + "truffle-resolver": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/truffle-resolver/-/truffle-resolver-4.0.3.tgz", + "integrity": "sha512-CXzfXcG6LxQm5cWXH/HJE85pnvHvPDB16l2pzk9/q1F9Y4BWD2xS4rYzvrXGjkPNGrYTkNY+baF5YN/6eIGGgQ==", + "requires": { + "async": "2.6.0", + "truffle-contract": "3.0.5", + "truffle-expect": "0.0.3", + "truffle-provisioner": "0.1.0" + }, + "dependencies": { + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "requires": { + "lodash": "4.17.4" + } + } + } + }, "tryit": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", @@ -8590,8 +8591,7 @@ "unzip-response": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-1.0.2.tgz", - "integrity": "sha1-uYTwh3/AqJwsdzzB73tbIytbBv4=", - "dev": true + "integrity": "sha1-uYTwh3/AqJwsdzzB73tbIytbBv4=" }, "url-parse-lax": { "version": "3.0.0", @@ -8608,17 +8608,20 @@ "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", "dev": true }, + "user-home": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=" + }, "utf8": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz", - "integrity": "sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY=", - "dev": true + "integrity": "sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY=" }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "uuid": { "version": "3.1.0", @@ -8632,11 +8635,18 @@ "integrity": "sha512-ejdrifsIydN1XDH7EuR2hn8ZrkRKUYF7tUcBjBy/lhrCvs2K+zRlbW9UHc0IQ9RsYFZJFqJrieoIHfkCa0DBRA==", "dev": true }, + "v8flags": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", + "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "requires": { + "user-home": "1.1.1" + } + }, "validate-npm-package-license": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", - "dev": true, "requires": { "spdx-correct": "1.0.2", "spdx-expression-parse": "1.0.4" @@ -9039,14 +9049,12 @@ "which-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", - "dev": true + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" }, "wide-align": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", - "dev": true, "requires": { "string-width": "1.0.2" } @@ -9054,8 +9062,7 @@ "window-size": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=", - "dev": true + "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=" }, "wordwrap": { "version": "1.0.0", @@ -9067,7 +9074,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, "requires": { "string-width": "1.0.2", "strip-ansi": "3.0.1" @@ -9076,8 +9082,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write": { "version": "0.2.1", @@ -9114,26 +9119,22 @@ "xhr2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.1.4.tgz", - "integrity": "sha1-f4dliEdxbbUCYyOBL4GMras4el8=", - "dev": true + "integrity": "sha1-f4dliEdxbbUCYyOBL4GMras4el8=" }, "xmlhttprequest": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", - "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=", - "dev": true + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" }, "y18n": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" }, "yallist": { "version": "2.1.2", @@ -9145,7 +9146,6 @@ "version": "4.8.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", - "dev": true, "requires": { "cliui": "3.2.0", "decamelize": "1.2.0", @@ -9167,7 +9167,6 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", - "dev": true, "requires": { "camelcase": "3.0.0", "lodash.assign": "4.2.0" @@ -9455,8 +9454,188 @@ "ethjs-abi": "0.2.1" } }, - "zos-upgradeability": { - "version": "git://github.com/zeppelinos/upgradeability-lib.git#68cd61fb48d0e4eec7142241448efa40c395bf33", + "zos": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/zos/-/zos-0.3.7.tgz", + "integrity": "sha512-V17wDh5fsOZ33+qkeE/x7K+/hYnCvzZW57RhrrbeVilmUwXgK26NF+E1hAzcqSzLN57ecsSH+aASjtzOZQsZxg==", + "requires": { + "babel-cli": "6.26.0", + "babel-polyfill": "6.26.0", + "colors": "1.2.1", + "commander": "2.15.1", + "ethereumjs-abi": "0.6.5", + "lodash": "4.17.5", + "npm-programmatic": "0.0.10", + "shelljs": "0.8.1", + "truffle": "4.1.7", + "truffle-contract": "3.0.5", + "truffle-provisioner": "0.1.0", + "truffle-resolver": "4.0.3", + "zos-kernel": "0.1.1", + "zos-lib": "0.0.3" + }, + "dependencies": { + "babel-polyfill": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "requires": { + "babel-runtime": "6.26.0", + "core-js": "2.5.0", + "regenerator-runtime": "0.10.5" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "2.5.0", + "regenerator-runtime": "0.11.1" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + } + } + }, + "colors": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.1.tgz", + "integrity": "sha512-s8+wktIuDSLffCywiwSxQOMqtPxML11a/dtHE17tMn4B1MSWw/C22EKf7M2KGUBcDaVFEGT+S8N02geDXeuNKg==" + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" + }, + "diff": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", + "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=" + }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" + }, + "mocha": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", + "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==", + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.9.0", + "debug": "2.6.8", + "diff": "3.2.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.1", + "growl": "1.9.2", + "he": "1.1.1", + "json3": "3.3.2", + "lodash.create": "3.1.1", + "mkdirp": "0.5.1", + "supports-color": "3.1.2" + }, + "dependencies": { + "commander": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "requires": { + "graceful-readlink": "1.0.1" + } + }, + "glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, + "shelljs": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.1.tgz", + "integrity": "sha512-YA/iYtZpzFe5HyWVGrb02FjPxc4EMCfpoU/Phg9fQoyMC72u9598OUBrsU8IrtwAKG0tO8IYaqbaLIw+k3IRGA==", + "requires": { + "glob": "7.1.2", + "interpret": "1.0.3", + "rechoir": "0.6.2" + } + }, + "solc": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.23.tgz", + "integrity": "sha512-AT7anLHY6uIRg2It6N0UlCHeZ7YeecIkUhnlirrCgCPCUevtnoN48BxvgigN/4jJTRljv5oFhAJtI6gvHzT5DQ==", + "requires": { + "fs-extra": "0.30.0", + "memorystream": "0.3.1", + "require-from-string": "1.2.1", + "semver": "5.4.1", + "yargs": "4.8.1" + } + }, + "supports-color": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", + "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "requires": { + "has-flag": "1.0.0" + } + }, + "truffle": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/truffle/-/truffle-4.1.7.tgz", + "integrity": "sha512-fe6BIcD9xo6iIJvV1m6ZhOk56kmB8k38kdoWOKYnPPw7ZUUSupgojeTb2K5e+4qIpIHvEvmET4yLUjSGR+hvwA==", + "requires": { + "mocha": "3.5.3", + "original-require": "1.0.1", + "solc": "0.4.23" + } + }, + "zos-lib": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/zos-lib/-/zos-lib-0.0.3.tgz", + "integrity": "sha512-OHMCw0JW1dvnKx4CNJqhaBbrBeldDJBNV74Z22irIi2Yh4kPBMc7ZVt7VSdEHD1wUL5Ez7RXPUwk9drL9QvKjQ==", + "requires": { + "zeppelin-solidity": "1.8.0" + } + } + } + }, + "zos-kernel": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/zos-kernel/-/zos-kernel-0.1.1.tgz", + "integrity": "sha512-xXoVLe08CWc9mofY4ckVBpFB5jr15/kgm2sz8VG+fFvFl4H0inC1AufGEdSwYWC4Hu9EOfc592LAg3tYjke+sQ==", + "requires": { + "zeppelin-solidity": "1.8.0", + "zos-lib": "0.0.2" + }, + "dependencies": { + "zos-lib": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/zos-lib/-/zos-lib-0.0.2.tgz", + "integrity": "sha512-wVPK3+lwguz4Bm4rWRcvQMPMa933BbtNMGqgoVNWIi6r2ZLZVYC93y1bxk19pWzBEdpcZyWDZ4yZwij2AsC9tw==", + "requires": { + "zeppelin-solidity": "1.8.0" + } + } + } + }, + "zos-lib": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/zos-lib/-/zos-lib-0.0.5.tgz", + "integrity": "sha512-UVINaUZ9WuGGlljKaTXaxzaLGW9F/5AViSsOYy/oagFyQIY6Ch9WQ1fnUx3L8O4p1XGne9rG2JXY4B9f6YPHsA==", "requires": { "zeppelin-solidity": "1.8.0" } diff --git a/package.json b/package.json index 16eead5ca..c3334b887 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ }, "dependencies": { "dotenv": "^4.0.0", - "zos-upgradeability": "git://github.com/zeppelinos/upgradeability-lib.git" + "zos": "^0.3.7", + "zos-lib": "0.0.5" } } diff --git a/truffle-config.js b/truffle-config.js index a5ca2558e..65e4bdd08 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -24,8 +24,11 @@ module.exports = { network_id: '*', // eslint-disable-line camelcase }, ropsten: { - provider: ropstenProvider, - network_id: 3, // eslint-disable-line camelcase + host: 'localhost', + network_id: '3', + port: 8555, + gas: 4700000, + gasPrice: 10e9, }, coverage: { host: 'localhost', From 18e16a5db035323ca3239c5e0728ae00ad55a86f Mon Sep 17 00:00:00 2001 From: Alejo Salles Date: Fri, 20 Apr 2018 20:38:23 -0300 Subject: [PATCH 8/8] added package.zos --- package.zos.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 package.zos.json diff --git a/package.zos.json b/package.zos.json new file mode 100644 index 000000000..c190c4e42 --- /dev/null +++ b/package.zos.json @@ -0,0 +1,10 @@ +{ + "contracts": { + "DetailedMintableToken": "DetailedMintableToken", + "DetailedPremintedToken": "DetailedPremintedToken", + "MintableERC721Token": "MintableERC721Token", + "TokenTimelock": "TokenTimelock", + "TokenVesting": "TokenVesting" + }, + "name": "openzeppelin-zos" +}