Browse Source

Merge pull request #573 from ajsantander/master

Update to truffle 4.0.0 and solc 0.4.18
Alejandro Santander 7 years ago
parent
commit
0bcf0a2001
67 changed files with 127 additions and 127 deletions
  1. 0 7
      .travis.yml
  2. 1 1
      contracts/Bounty.sol
  3. 2 2
      contracts/DayLimit.sol
  4. 2 2
      contracts/ECRecovery.sol
  5. 1 1
      contracts/LimitBalance.sol
  6. 2 2
      contracts/MerkleProof.sol
  7. 1 1
      contracts/ReentrancyGuard.sol
  8. 3 3
      contracts/crowdsale/CappedCrowdsale.sol
  9. 3 3
      contracts/crowdsale/Crowdsale.sol
  10. 1 1
      contracts/crowdsale/FinalizableCrowdsale.sol
  11. 1 1
      contracts/crowdsale/RefundVault.sol
  12. 2 2
      contracts/crowdsale/RefundableCrowdsale.sol
  13. 1 1
      contracts/examples/SampleCrowdsale.sol
  14. 1 1
      contracts/examples/SimpleToken.sol
  15. 1 1
      contracts/lifecycle/Destructible.sol
  16. 1 1
      contracts/lifecycle/Migrations.sol
  17. 1 1
      contracts/lifecycle/Pausable.sol
  18. 1 1
      contracts/lifecycle/TokenDestructible.sol
  19. 5 5
      contracts/math/Math.sol
  20. 5 5
      contracts/math/SafeMath.sol
  21. 1 1
      contracts/ownership/CanReclaimToken.sol
  22. 1 1
      contracts/ownership/Claimable.sol
  23. 1 1
      contracts/ownership/Contactable.sol
  24. 1 1
      contracts/ownership/DelayedClaimable.sol
  25. 1 1
      contracts/ownership/HasNoContracts.sol
  26. 1 1
      contracts/ownership/HasNoEther.sol
  27. 1 1
      contracts/ownership/HasNoTokens.sol
  28. 1 1
      contracts/ownership/NoOwner.sol
  29. 1 1
      contracts/ownership/Ownable.sol
  30. 1 1
      contracts/payment/PullPayment.sol
  31. 1 1
      contracts/payment/SplitPayment.sol
  32. 2 2
      contracts/token/BasicToken.sol
  33. 1 1
      contracts/token/BurnableToken.sol
  34. 1 1
      contracts/token/DetailedERC20.sol
  35. 2 2
      contracts/token/ERC20.sol
  36. 2 2
      contracts/token/ERC20Basic.sol
  37. 1 1
      contracts/token/MintableToken.sol
  38. 1 1
      contracts/token/PausableToken.sol
  39. 1 1
      contracts/token/SafeERC20.sol
  40. 2 2
      contracts/token/StandardToken.sol
  41. 1 1
      contracts/token/TokenTimelock.sol
  42. 3 3
      contracts/token/TokenVesting.sol
  43. 40 33
      package-lock.json
  44. 1 1
      package.json
  45. 1 1
      scripts/test.sh
  46. 1 1
      test/helpers/BasicTokenMock.sol
  47. 1 1
      test/helpers/BurnableTokenMock.sol
  48. 1 1
      test/helpers/CappedCrowdsaleImpl.sol
  49. 1 1
      test/helpers/DayLimitMock.sol
  50. 1 1
      test/helpers/DetailedERC20Mock.sol
  51. 1 1
      test/helpers/ERC23TokenMock.sol
  52. 1 1
      test/helpers/FinalizableCrowdsaleImpl.sol
  53. 1 1
      test/helpers/ForceEther.sol
  54. 1 1
      test/helpers/HasNoEtherTest.sol
  55. 1 1
      test/helpers/InsecureTargetBounty.sol
  56. 1 1
      test/helpers/LimitBalanceMock.sol
  57. 1 1
      test/helpers/PausableMock.sol
  58. 1 1
      test/helpers/PausableTokenMock.sol
  59. 1 1
      test/helpers/PullPaymentMock.sol
  60. 1 1
      test/helpers/ReentrancyAttack.sol
  61. 1 1
      test/helpers/ReentrancyMock.sol
  62. 1 1
      test/helpers/RefundableCrowdsaleImpl.sol
  63. 1 1
      test/helpers/SafeERC20Helper.sol
  64. 1 1
      test/helpers/SafeMathMock.sol
  65. 1 1
      test/helpers/SecureTargetBounty.sol
  66. 1 1
      test/helpers/SplitPaymentMock.sol
  67. 1 1
      test/helpers/StandardTokenMock.sol

+ 0 - 7
.travis.yml

@@ -6,13 +6,6 @@ node_js:
   - "6"
   - "6"
 cache:
 cache:
   yarn: true
   yarn: true
-env:
-  -
-  - SOLIDITY_COVERAGE=true
-matrix:
-  fast_finish: true
-  allow_failures:
-    - env: SOLIDITY_COVERAGE=true
 before_script:
 before_script:
   - truffle version
   - truffle version
   - yarn list
   - yarn list

+ 1 - 1
contracts/Bounty.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import './payment/PullPayment.sol';
 import './payment/PullPayment.sol';

+ 2 - 2
contracts/DayLimit.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 /**
 /**
  * @title DayLimit
  * @title DayLimit
@@ -59,7 +59,7 @@ contract DayLimit {
    * @dev Private function to determine today's index
    * @dev Private function to determine today's index
    * @return uint256 of today's index.
    * @return uint256 of today's index.
    */
    */
-  function today() private constant returns (uint256) {
+  function today() private view returns (uint256) {
     return now / 1 days;
     return now / 1 days;
   }
   }
 
 

+ 2 - 2
contracts/ECRecovery.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 /**
 /**
@@ -14,7 +14,7 @@ library ECRecovery {
    * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
    * @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()
    * @param sig bytes signature, the signature is generated using web3.eth.sign()
    */
    */
-  function recover(bytes32 hash, bytes sig) public constant returns (address) {
+  function recover(bytes32 hash, bytes sig) public pure returns (address) {
     bytes32 r;
     bytes32 r;
     bytes32 s;
     bytes32 s;
     uint8 v;
     uint8 v;

+ 1 - 1
contracts/LimitBalance.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 /**
 /**

+ 2 - 2
contracts/MerkleProof.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 /*
 /*
  * @title MerkleProof
  * @title MerkleProof
@@ -13,7 +13,7 @@ library MerkleProof {
    * @param _root Merkle root
    * @param _root Merkle root
    * @param _leaf Leaf of Merkle tree
    * @param _leaf Leaf of Merkle tree
    */
    */
-  function verifyProof(bytes _proof, bytes32 _root, bytes32 _leaf) constant returns (bool) {
+  function verifyProof(bytes _proof, bytes32 _root, bytes32 _leaf) pure returns (bool) {
     // Check if proof length is a multiple of 32
     // Check if proof length is a multiple of 32
     if (_proof.length % 32 != 0) return false;
     if (_proof.length % 32 != 0) return false;
 
 

+ 1 - 1
contracts/ReentrancyGuard.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 /**
 /**
  * @title Helps contracts guard agains rentrancy attacks.
  * @title Helps contracts guard agains rentrancy attacks.

+ 3 - 3
contracts/crowdsale/CappedCrowdsale.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import '../math/SafeMath.sol';
 import '../math/SafeMath.sol';
 import './Crowdsale.sol';
 import './Crowdsale.sol';
@@ -19,14 +19,14 @@ contract CappedCrowdsale is Crowdsale {
 
 
   // overriding Crowdsale#validPurchase to add extra cap logic
   // overriding Crowdsale#validPurchase to add extra cap logic
   // @return true if investors can buy at the moment
   // @return true if investors can buy at the moment
-  function validPurchase() internal constant returns (bool) {
+  function validPurchase() internal view returns (bool) {
     bool withinCap = weiRaised.add(msg.value) <= cap;
     bool withinCap = weiRaised.add(msg.value) <= cap;
     return super.validPurchase() && withinCap;
     return super.validPurchase() && withinCap;
   }
   }
 
 
   // overriding Crowdsale#hasEnded to add cap logic
   // overriding Crowdsale#hasEnded to add cap logic
   // @return true if crowdsale event has ended
   // @return true if crowdsale event has ended
-  function hasEnded() public constant returns (bool) {
+  function hasEnded() public view returns (bool) {
     bool capReached = weiRaised >= cap;
     bool capReached = weiRaised >= cap;
     return super.hasEnded() || capReached;
     return super.hasEnded() || capReached;
   }
   }

+ 3 - 3
contracts/crowdsale/Crowdsale.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import '../token/MintableToken.sol';
 import '../token/MintableToken.sol';
 import '../math/SafeMath.sol';
 import '../math/SafeMath.sol';
@@ -91,14 +91,14 @@ contract Crowdsale {
   }
   }
 
 
   // @return true if the transaction can buy tokens
   // @return true if the transaction can buy tokens
-  function validPurchase() internal constant returns (bool) {
+  function validPurchase() internal view returns (bool) {
     bool withinPeriod = now >= startTime && now <= endTime;
     bool withinPeriod = now >= startTime && now <= endTime;
     bool nonZeroPurchase = msg.value != 0;
     bool nonZeroPurchase = msg.value != 0;
     return withinPeriod && nonZeroPurchase;
     return withinPeriod && nonZeroPurchase;
   }
   }
 
 
   // @return true if crowdsale event has ended
   // @return true if crowdsale event has ended
-  function hasEnded() public constant returns (bool) {
+  function hasEnded() public view returns (bool) {
     return now > endTime;
     return now > endTime;
   }
   }
 
 

+ 1 - 1
contracts/crowdsale/FinalizableCrowdsale.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import '../math/SafeMath.sol';
 import '../math/SafeMath.sol';
 import '../ownership/Ownable.sol';
 import '../ownership/Ownable.sol';

+ 1 - 1
contracts/crowdsale/RefundVault.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import '../math/SafeMath.sol';
 import '../math/SafeMath.sol';
 import '../ownership/Ownable.sol';
 import '../ownership/Ownable.sol';

+ 2 - 2
contracts/crowdsale/RefundableCrowdsale.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import '../math/SafeMath.sol';
 import '../math/SafeMath.sol';
@@ -53,7 +53,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale {
     super.finalization();
     super.finalization();
   }
   }
 
 
-  function goalReached() public constant returns (bool) {
+  function goalReached() public view returns (bool) {
     return weiRaised >= goal;
     return weiRaised >= goal;
   }
   }
 
 

+ 1 - 1
contracts/examples/SampleCrowdsale.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import "../crowdsale/CappedCrowdsale.sol";
 import "../crowdsale/CappedCrowdsale.sol";
 import "../crowdsale/RefundableCrowdsale.sol";
 import "../crowdsale/RefundableCrowdsale.sol";

+ 1 - 1
contracts/examples/SimpleToken.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import "../token/StandardToken.sol";
 import "../token/StandardToken.sol";

+ 1 - 1
contracts/lifecycle/Destructible.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import "../ownership/Ownable.sol";
 import "../ownership/Ownable.sol";

+ 1 - 1
contracts/lifecycle/Migrations.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import '../ownership/Ownable.sol';
 import '../ownership/Ownable.sol';

+ 1 - 1
contracts/lifecycle/Pausable.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import "../ownership/Ownable.sol";
 import "../ownership/Ownable.sol";

+ 1 - 1
contracts/lifecycle/TokenDestructible.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import "../ownership/Ownable.sol";
 import "../ownership/Ownable.sol";

+ 5 - 5
contracts/math/Math.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 /**
 /**
  * @title Math
  * @title Math
@@ -6,19 +6,19 @@ pragma solidity ^0.4.11;
  */
  */
 
 
 library Math {
 library Math {
-  function max64(uint64 a, uint64 b) internal constant returns (uint64) {
+  function max64(uint64 a, uint64 b) internal pure returns (uint64) {
     return a >= b ? a : b;
     return a >= b ? a : b;
   }
   }
 
 
-  function min64(uint64 a, uint64 b) internal constant returns (uint64) {
+  function min64(uint64 a, uint64 b) internal pure returns (uint64) {
     return a < b ? a : b;
     return a < b ? a : b;
   }
   }
 
 
-  function max256(uint256 a, uint256 b) internal constant returns (uint256) {
+  function max256(uint256 a, uint256 b) internal pure returns (uint256) {
     return a >= b ? a : b;
     return a >= b ? a : b;
   }
   }
 
 
-  function min256(uint256 a, uint256 b) internal constant returns (uint256) {
+  function min256(uint256 a, uint256 b) internal pure returns (uint256) {
     return a < b ? a : b;
     return a < b ? a : b;
   }
   }
 }
 }

+ 5 - 5
contracts/math/SafeMath.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 /**
 /**
@@ -6,7 +6,7 @@ pragma solidity ^0.4.11;
  * @dev Math operations with safety checks that throw on error
  * @dev Math operations with safety checks that throw on error
  */
  */
 library SafeMath {
 library SafeMath {
-  function mul(uint256 a, uint256 b) internal constant returns (uint256) {
+  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
     if (a == 0) {
     if (a == 0) {
       return 0;
       return 0;
     }
     }
@@ -15,19 +15,19 @@ library SafeMath {
     return c;
     return c;
   }
   }
 
 
-  function div(uint256 a, uint256 b) internal constant returns (uint256) {
+  function div(uint256 a, uint256 b) internal pure returns (uint256) {
     // assert(b > 0); // Solidity automatically throws when dividing by 0
     // assert(b > 0); // Solidity automatically throws when dividing by 0
     uint256 c = a / b;
     uint256 c = a / b;
     // assert(a == b * c + a % b); // There is no case in which this doesn't hold
     // assert(a == b * c + a % b); // There is no case in which this doesn't hold
     return c;
     return c;
   }
   }
 
 
-  function sub(uint256 a, uint256 b) internal constant returns (uint256) {
+  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
     assert(b <= a);
     assert(b <= a);
     return a - b;
     return a - b;
   }
   }
 
 
-  function add(uint256 a, uint256 b) internal constant returns (uint256) {
+  function add(uint256 a, uint256 b) internal pure returns (uint256) {
     uint256 c = a + b;
     uint256 c = a + b;
     assert(c >= a);
     assert(c >= a);
     return c;
     return c;

+ 1 - 1
contracts/ownership/CanReclaimToken.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import "./Ownable.sol";
 import "./Ownable.sol";
 import "../token/ERC20Basic.sol";
 import "../token/ERC20Basic.sol";

+ 1 - 1
contracts/ownership/Claimable.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import './Ownable.sol';
 import './Ownable.sol';

+ 1 - 1
contracts/ownership/Contactable.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import './Ownable.sol';
 import './Ownable.sol';
 
 

+ 1 - 1
contracts/ownership/DelayedClaimable.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import './Claimable.sol';
 import './Claimable.sol';

+ 1 - 1
contracts/ownership/HasNoContracts.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import "./Ownable.sol";
 import "./Ownable.sol";
 
 

+ 1 - 1
contracts/ownership/HasNoEther.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import "./Ownable.sol";
 import "./Ownable.sol";
 
 

+ 1 - 1
contracts/ownership/HasNoTokens.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import "./CanReclaimToken.sol";
 import "./CanReclaimToken.sol";
 
 

+ 1 - 1
contracts/ownership/NoOwner.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import "./HasNoEther.sol";
 import "./HasNoEther.sol";
 import "./HasNoTokens.sol";
 import "./HasNoTokens.sol";

+ 1 - 1
contracts/ownership/Ownable.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 /**
 /**

+ 1 - 1
contracts/payment/PullPayment.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import '../math/SafeMath.sol';
 import '../math/SafeMath.sol';

+ 1 - 1
contracts/payment/SplitPayment.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import '../math/SafeMath.sol';
 import '../math/SafeMath.sol';
 
 

+ 2 - 2
contracts/token/BasicToken.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import './ERC20Basic.sol';
 import './ERC20Basic.sol';
@@ -35,7 +35,7 @@ contract BasicToken is ERC20Basic {
   * @param _owner The address to query the the balance of.
   * @param _owner The address to query the the balance of.
   * @return An uint256 representing the amount owned by the passed address.
   * @return An uint256 representing the amount owned by the passed address.
   */
   */
-  function balanceOf(address _owner) public constant returns (uint256 balance) {
+  function balanceOf(address _owner) public view returns (uint256 balance) {
     return balances[_owner];
     return balances[_owner];
   }
   }
 
 

+ 1 - 1
contracts/token/BurnableToken.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.13;
+pragma solidity ^0.4.18;
 
 
 import './StandardToken.sol';
 import './StandardToken.sol';
 
 

+ 1 - 1
contracts/token/DetailedERC20.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import './ERC20.sol';
 import './ERC20.sol';
 
 

+ 2 - 2
contracts/token/ERC20.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import './ERC20Basic.sol';
 import './ERC20Basic.sol';
@@ -9,7 +9,7 @@ import './ERC20Basic.sol';
  * @dev see https://github.com/ethereum/EIPs/issues/20
  * @dev see https://github.com/ethereum/EIPs/issues/20
  */
  */
 contract ERC20 is ERC20Basic {
 contract ERC20 is ERC20Basic {
-  function allowance(address owner, address spender) public constant returns (uint256);
+  function allowance(address owner, address spender) public view returns (uint256);
   function transferFrom(address from, address to, uint256 value) public returns (bool);
   function transferFrom(address from, address to, uint256 value) public returns (bool);
   function approve(address spender, uint256 value) public returns (bool);
   function approve(address spender, uint256 value) public returns (bool);
   event Approval(address indexed owner, address indexed spender, uint256 value);
   event Approval(address indexed owner, address indexed spender, uint256 value);

+ 2 - 2
contracts/token/ERC20Basic.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 /**
 /**
@@ -8,7 +8,7 @@ pragma solidity ^0.4.11;
  */
  */
 contract ERC20Basic {
 contract ERC20Basic {
   uint256 public totalSupply;
   uint256 public totalSupply;
-  function balanceOf(address who) public constant returns (uint256);
+  function balanceOf(address who) public view returns (uint256);
   function transfer(address to, uint256 value) public returns (bool);
   function transfer(address to, uint256 value) public returns (bool);
   event Transfer(address indexed from, address indexed to, uint256 value);
   event Transfer(address indexed from, address indexed to, uint256 value);
 }
 }

+ 1 - 1
contracts/token/MintableToken.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import './StandardToken.sol';
 import './StandardToken.sol';

+ 1 - 1
contracts/token/PausableToken.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import './StandardToken.sol';
 import './StandardToken.sol';
 import '../lifecycle/Pausable.sol';
 import '../lifecycle/Pausable.sol';

+ 1 - 1
contracts/token/SafeERC20.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import './ERC20Basic.sol';
 import './ERC20Basic.sol';
 import './ERC20.sol';
 import './ERC20.sol';

+ 2 - 2
contracts/token/StandardToken.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import './BasicToken.sol';
 import './BasicToken.sol';
@@ -57,7 +57,7 @@ contract StandardToken is ERC20, BasicToken {
    * @param _spender address The address which will spend the funds.
    * @param _spender address The address which will spend the funds.
    * @return A uint256 specifying the amount of tokens still available for the spender.
    * @return A uint256 specifying the amount of tokens still available for the spender.
    */
    */
-  function allowance(address _owner, address _spender) public constant returns (uint256) {
+  function allowance(address _owner, address _spender) public view returns (uint256) {
     return allowed[_owner][_spender];
     return allowed[_owner][_spender];
   }
   }
 
 

+ 1 - 1
contracts/token/TokenTimelock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import './ERC20Basic.sol';
 import './ERC20Basic.sol';

+ 3 - 3
contracts/token/TokenVesting.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import './ERC20Basic.sol';
 import './ERC20Basic.sol';
 import './SafeERC20.sol';
 import './SafeERC20.sol';
@@ -91,7 +91,7 @@ contract TokenVesting is Ownable {
    * @dev Calculates the amount that has already vested but hasn't been released yet.
    * @dev Calculates the amount that has already vested but hasn't been released yet.
    * @param token ERC20 token which is being vested
    * @param token ERC20 token which is being vested
    */
    */
-  function releasableAmount(ERC20Basic token) public constant returns (uint256) {
+  function releasableAmount(ERC20Basic token) public view returns (uint256) {
     return vestedAmount(token).sub(released[token]);
     return vestedAmount(token).sub(released[token]);
   }
   }
 
 
@@ -99,7 +99,7 @@ contract TokenVesting is Ownable {
    * @dev Calculates the amount that has already vested.
    * @dev Calculates the amount that has already vested.
    * @param token ERC20 token which is being vested
    * @param token ERC20 token which is being vested
    */
    */
-  function vestedAmount(ERC20Basic token) public constant returns (uint256) {
+  function vestedAmount(ERC20Basic token) public view returns (uint256) {
     uint256 currentBalance = token.balanceOf(this);
     uint256 currentBalance = token.balanceOf(this);
     uint256 totalBalance = currentBalance.add(released[token]);
     uint256 totalBalance = currentBalance.add(released[token]);
 
 

+ 40 - 33
package-lock.json

@@ -2704,6 +2704,12 @@
         "secp256k1": "3.3.0"
         "secp256k1": "3.3.0"
       }
       }
     },
     },
+    "he": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",
+      "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
+      "dev": true
+    },
     "hmac-drbg": {
     "hmac-drbg": {
       "version": "1.0.1",
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
       "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
@@ -5281,14 +5287,14 @@
       "dev": true
       "dev": true
     },
     },
     "truffle": {
     "truffle": {
-      "version": "3.4.8",
-      "resolved": "https://registry.npmjs.org/truffle/-/truffle-3.4.8.tgz",
-      "integrity": "sha512-UeMrofHcguSwfAa5Oy3+arWPWb5zd28stySKIanNhzByV1rcUy3WhxE5up4LBOxAPz+OsH1nQ02kqIcBZDwxIw==",
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/truffle/-/truffle-4.0.1.tgz",
+      "integrity": "sha512-PybO+GMq3AvsfCWfEx4sbuaJlDL19iR8Ff20cO0TtP599N5JbMLlhwlffvVInPgFjP+F11vjSOYj3hT8fONs5A==",
       "dev": true,
       "dev": true,
       "requires": {
       "requires": {
-        "mocha": "3.5.0",
+        "mocha": "3.5.3",
         "original-require": "1.0.1",
         "original-require": "1.0.1",
-        "solc": "0.4.13"
+        "solc": "0.4.18"
       },
       },
       "dependencies": {
       "dependencies": {
         "commander": {
         "commander": {
@@ -5321,9 +5327,9 @@
           }
           }
         },
         },
         "mocha": {
         "mocha": {
-          "version": "3.5.0",
-          "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.0.tgz",
-          "integrity": "sha512-pIU2PJjrPYvYRqVpjXzj76qltO9uBYI7woYAMoxbSefsa+vqAfptjoeevd6bUgwD0mPIO+hv9f7ltvsNreL2PA==",
+          "version": "3.5.3",
+          "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz",
+          "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==",
           "dev": true,
           "dev": true,
           "requires": {
           "requires": {
             "browser-stdout": "1.3.0",
             "browser-stdout": "1.3.0",
@@ -5333,6 +5339,7 @@
             "escape-string-regexp": "1.0.5",
             "escape-string-regexp": "1.0.5",
             "glob": "7.1.1",
             "glob": "7.1.1",
             "growl": "1.9.2",
             "growl": "1.9.2",
+            "he": "1.1.1",
             "json3": "3.3.2",
             "json3": "3.3.2",
             "lodash.create": "3.1.1",
             "lodash.create": "3.1.1",
             "mkdirp": "0.5.1",
             "mkdirp": "0.5.1",
@@ -5340,9 +5347,9 @@
           }
           }
         },
         },
         "solc": {
         "solc": {
-          "version": "0.4.13",
-          "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.13.tgz",
-          "integrity": "sha1-qly9zOPmrjwZDSD1/fi8iAcC7HU=",
+          "version": "0.4.18",
+          "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.18.tgz",
+          "integrity": "sha512-Kq+O3PNF9Pfq7fB+lDYAuoqRdghLmZyfngsg0h1Hj38NKAeVHeGPOGeZasn5KqdPeCzbMFvaGyTySxzGv6aXCg==",
           "dev": true,
           "dev": true,
           "requires": {
           "requires": {
             "fs-extra": "0.30.0",
             "fs-extra": "0.30.0",
@@ -5360,28 +5367,6 @@
           "requires": {
           "requires": {
             "has-flag": "1.0.0"
             "has-flag": "1.0.0"
           }
           }
-        },
-        "yargs": {
-          "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",
-            "get-caller-file": "1.0.2",
-            "lodash.assign": "4.2.0",
-            "os-locale": "1.4.0",
-            "read-pkg-up": "1.0.1",
-            "require-directory": "2.1.1",
-            "require-main-filename": "1.0.1",
-            "set-blocking": "2.0.0",
-            "string-width": "1.0.2",
-            "which-module": "1.0.0",
-            "window-size": "0.2.0",
-            "y18n": "3.2.1",
-            "yargs-parser": "2.4.1"
-          }
         }
         }
       }
       }
     },
     },
@@ -6019,6 +6004,28 @@
       "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
       "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
       "dev": true
       "dev": true
     },
     },
+    "yargs": {
+      "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",
+        "get-caller-file": "1.0.2",
+        "lodash.assign": "4.2.0",
+        "os-locale": "1.4.0",
+        "read-pkg-up": "1.0.1",
+        "require-directory": "2.1.1",
+        "require-main-filename": "1.0.1",
+        "set-blocking": "2.0.0",
+        "string-width": "1.0.2",
+        "which-module": "1.0.0",
+        "window-size": "0.2.0",
+        "y18n": "3.2.1",
+        "yargs-parser": "2.4.1"
+      }
+    },
     "yargs-parser": {
     "yargs-parser": {
       "version": "2.4.1",
       "version": "2.4.1",
       "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz",
       "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz",

+ 1 - 1
package.json

@@ -39,7 +39,7 @@
     "ethereumjs-testrpc": "^4.1.1",
     "ethereumjs-testrpc": "^4.1.1",
     "mocha-lcov-reporter": "^1.3.0",
     "mocha-lcov-reporter": "^1.3.0",
     "solidity-coverage": "^0.2.2",
     "solidity-coverage": "^0.2.2",
-    "truffle": "^3.4.6",
+    "truffle": "^4.0.0",
     "truffle-hdwallet-provider": "0.0.3"
     "truffle-hdwallet-provider": "0.0.3"
   }
   }
 }
 }

+ 1 - 1
scripts/test.sh

@@ -41,7 +41,7 @@ start_testrpc() {
   if [ "$SOLIDITY_COVERAGE" = true ]; then
   if [ "$SOLIDITY_COVERAGE" = true ]; then
     node_modules/.bin/testrpc-sc --gasLimit 0xfffffffffff --port "$testrpc_port" "${accounts[@]}" > /dev/null &
     node_modules/.bin/testrpc-sc --gasLimit 0xfffffffffff --port "$testrpc_port" "${accounts[@]}" > /dev/null &
   else
   else
-    node_modules/.bin/testrpc "${accounts[@]}" > /dev/null &
+    node_modules/.bin/testrpc --gasLimit 0xfffffffffff "${accounts[@]}" > /dev/null &
   fi
   fi
 
 
   testrpc_pid=$!
   testrpc_pid=$!

+ 1 - 1
test/helpers/BasicTokenMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import '../../contracts/token/BasicToken.sol';
 import '../../contracts/token/BasicToken.sol';

+ 1 - 1
test/helpers/BurnableTokenMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.13;
+pragma solidity ^0.4.18;
 
 
 import '../../contracts/token/BurnableToken.sol';
 import '../../contracts/token/BurnableToken.sol';
 
 

+ 1 - 1
test/helpers/CappedCrowdsaleImpl.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import '../../contracts/crowdsale/CappedCrowdsale.sol';
 import '../../contracts/crowdsale/CappedCrowdsale.sol';

+ 1 - 1
test/helpers/DayLimitMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 import "../../contracts/DayLimit.sol";
 import "../../contracts/DayLimit.sol";
 
 
 contract DayLimitMock is DayLimit {
 contract DayLimitMock is DayLimit {

+ 1 - 1
test/helpers/DetailedERC20Mock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import '../../contracts/token/StandardToken.sol';
 import '../../contracts/token/StandardToken.sol';
 import '../../contracts/token/DetailedERC20.sol';
 import '../../contracts/token/DetailedERC20.sol';

+ 1 - 1
test/helpers/ERC23TokenMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import '../../contracts/token/BasicToken.sol';
 import '../../contracts/token/BasicToken.sol';

+ 1 - 1
test/helpers/FinalizableCrowdsaleImpl.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import '../../contracts/crowdsale/FinalizableCrowdsale.sol';
 import '../../contracts/crowdsale/FinalizableCrowdsale.sol';

+ 1 - 1
test/helpers/ForceEther.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 // @title Force Ether into a contract.
 // @title Force Ether into a contract.
 // @notice  even
 // @notice  even

+ 1 - 1
test/helpers/HasNoEtherTest.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import "../../contracts/ownership/HasNoEther.sol";
 import "../../contracts/ownership/HasNoEther.sol";
 
 

+ 1 - 1
test/helpers/InsecureTargetBounty.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import {Bounty, Target} from "../../contracts/Bounty.sol";
 import {Bounty, Target} from "../../contracts/Bounty.sol";

+ 1 - 1
test/helpers/LimitBalanceMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import '../../contracts/LimitBalance.sol';
 import '../../contracts/LimitBalance.sol';

+ 1 - 1
test/helpers/PausableMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import '../../contracts/lifecycle/Pausable.sol';
 import '../../contracts/lifecycle/Pausable.sol';

+ 1 - 1
test/helpers/PausableTokenMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import '../../contracts/token/PausableToken.sol';
 import '../../contracts/token/PausableToken.sol';
 
 

+ 1 - 1
test/helpers/PullPaymentMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import '../../contracts/payment/PullPayment.sol';
 import '../../contracts/payment/PullPayment.sol';

+ 1 - 1
test/helpers/ReentrancyAttack.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 contract ReentrancyAttack {
 contract ReentrancyAttack {
 
 

+ 1 - 1
test/helpers/ReentrancyMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import '../../contracts/ReentrancyGuard.sol';
 import '../../contracts/ReentrancyGuard.sol';
 import './ReentrancyAttack.sol';
 import './ReentrancyAttack.sol';

+ 1 - 1
test/helpers/RefundableCrowdsaleImpl.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import '../../contracts/crowdsale/RefundableCrowdsale.sol';
 import '../../contracts/crowdsale/RefundableCrowdsale.sol';

+ 1 - 1
test/helpers/SafeERC20Helper.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import '../../contracts/token/ERC20.sol';
 import '../../contracts/token/ERC20.sol';
 import '../../contracts/token/SafeERC20.sol';
 import '../../contracts/token/SafeERC20.sol';

+ 1 - 1
test/helpers/SafeMathMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import '../../contracts/math/SafeMath.sol';
 import '../../contracts/math/SafeMath.sol';

+ 1 - 1
test/helpers/SecureTargetBounty.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import {Bounty, Target} from "../../contracts/Bounty.sol";
 import {Bounty, Target} from "../../contracts/Bounty.sol";

+ 1 - 1
test/helpers/SplitPaymentMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 import '../../contracts/payment/SplitPayment.sol';
 import '../../contracts/payment/SplitPayment.sol';
 
 

+ 1 - 1
test/helpers/StandardTokenMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
 
 
 
 
 import '../../contracts/token/StandardToken.sol';
 import '../../contracts/token/StandardToken.sol';