Browse Source

Update to Truffle 4.1.5 and Ganache 6.1.0 (#876)

* Update to ganache-cli v6.1.0 and truffle v4.1.0

* Update to stable version of ganache-cli

* fix: update event emission warning

- Fix event emission warnings for solidity 4.21 after truffle has been
updated to use this version

* fix pr review comments

* update to truffle v4.1.5

* update package-lock

* add additional emit keywords

* update solidity-coverage to 0.4.15

* update to solium 1.1.6

* fix MerkleProof coverage analysis by testing through wrapper

* change version pragma to ^0.4.21

* fix solium linting errors
Francisco Giordano 7 years ago
parent
commit
a7e91856f3
100 changed files with 164 additions and 153 deletions
  1. 1 1
      .github/ISSUE_TEMPLATE.md
  2. 1 1
      contracts/AddressUtils.sol
  3. 2 2
      contracts/Bounty.sol
  4. 1 1
      contracts/DayLimit.sol
  5. 1 1
      contracts/ECRecovery.sol
  6. 1 1
      contracts/LimitBalance.sol
  7. 2 2
      contracts/MerkleProof.sol
  8. 1 1
      contracts/ReentrancyGuard.sol
  9. 2 2
      contracts/crowdsale/Crowdsale.sol
  10. 2 2
      contracts/crowdsale/distribution/FinalizableCrowdsale.sol
  11. 1 1
      contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol
  12. 1 1
      contracts/crowdsale/distribution/RefundableCrowdsale.sol
  13. 4 4
      contracts/crowdsale/distribution/utils/RefundVault.sol
  14. 1 1
      contracts/crowdsale/emission/AllowanceCrowdsale.sol
  15. 1 1
      contracts/crowdsale/emission/MintedCrowdsale.sol
  16. 1 1
      contracts/crowdsale/price/IncreasingPriceCrowdsale.sol
  17. 1 1
      contracts/crowdsale/validation/CappedCrowdsale.sol
  18. 1 1
      contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol
  19. 1 1
      contracts/crowdsale/validation/TimedCrowdsale.sol
  20. 1 1
      contracts/crowdsale/validation/WhitelistedCrowdsale.sol
  21. 1 1
      contracts/examples/SampleCrowdsale.sol
  22. 4 4
      contracts/examples/SimpleSavingsWallet.sol
  23. 2 2
      contracts/examples/SimpleToken.sol
  24. 1 1
      contracts/lifecycle/Destructible.sol
  25. 1 1
      contracts/lifecycle/Migrations.sol
  26. 3 3
      contracts/lifecycle/Pausable.sol
  27. 1 1
      contracts/lifecycle/TokenDestructible.sol
  28. 1 1
      contracts/math/Math.sol
  29. 1 1
      contracts/math/SafeMath.sol
  30. 1 1
      contracts/mocks/AllowanceCrowdsaleImpl.sol
  31. 1 1
      contracts/mocks/BasicTokenMock.sol
  32. 1 1
      contracts/mocks/BurnableTokenMock.sol
  33. 1 1
      contracts/mocks/CappedCrowdsaleImpl.sol
  34. 1 1
      contracts/mocks/DayLimitMock.sol
  35. 1 1
      contracts/mocks/DetailedERC20Mock.sol
  36. 1 1
      contracts/mocks/ECRecoveryMock.sol
  37. 1 1
      contracts/mocks/ERC223TokenMock.sol
  38. 1 1
      contracts/mocks/ERC721BasicTokenMock.sol
  39. 2 2
      contracts/mocks/ERC721ReceiverMock.sol
  40. 1 1
      contracts/mocks/ERC721TokenMock.sol
  41. 1 1
      contracts/mocks/ERC827TokenMock.sol
  42. 1 1
      contracts/mocks/FinalizableCrowdsaleImpl.sol
  43. 1 1
      contracts/mocks/ForceEther.sol
  44. 1 1
      contracts/mocks/HasNoEtherTest.sol
  45. 1 1
      contracts/mocks/IncreasingPriceCrowdsaleImpl.sol
  46. 1 1
      contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol
  47. 1 1
      contracts/mocks/InsecureTargetBounty.sol
  48. 1 1
      contracts/mocks/LimitBalanceMock.sol
  49. 11 0
      contracts/mocks/MerkleProofWrapper.sol
  50. 2 2
      contracts/mocks/MessageHelper.sol
  51. 1 1
      contracts/mocks/MintedCrowdsaleImpl.sol
  52. 1 1
      contracts/mocks/PausableMock.sol
  53. 1 1
      contracts/mocks/PausableTokenMock.sol
  54. 1 1
      contracts/mocks/PostDeliveryCrowdsaleImpl.sol
  55. 1 1
      contracts/mocks/PullPaymentMock.sol
  56. 1 1
      contracts/mocks/RBACMock.sol
  57. 1 1
      contracts/mocks/ReentrancyAttack.sol
  58. 1 1
      contracts/mocks/ReentrancyMock.sol
  59. 1 1
      contracts/mocks/RefundableCrowdsaleImpl.sol
  60. 1 1
      contracts/mocks/SafeERC20Helper.sol
  61. 1 1
      contracts/mocks/SafeMathMock.sol
  62. 1 1
      contracts/mocks/SecureTargetBounty.sol
  63. 1 1
      contracts/mocks/StandardTokenMock.sol
  64. 1 1
      contracts/mocks/TimedCrowdsaleImpl.sol
  65. 1 1
      contracts/mocks/WhitelistMock.sol
  66. 1 1
      contracts/mocks/WhitelistedCrowdsaleImpl.sol
  67. 1 1
      contracts/ownership/CanReclaimToken.sol
  68. 2 2
      contracts/ownership/Claimable.sol
  69. 1 1
      contracts/ownership/Contactable.sol
  70. 2 2
      contracts/ownership/DelayedClaimable.sol
  71. 1 1
      contracts/ownership/HasNoContracts.sol
  72. 1 1
      contracts/ownership/HasNoEther.sol
  73. 1 1
      contracts/ownership/HasNoTokens.sol
  74. 7 7
      contracts/ownership/Heritable.sol
  75. 1 1
      contracts/ownership/NoOwner.sol
  76. 2 2
      contracts/ownership/Ownable.sol
  77. 11 11
      contracts/ownership/Whitelist.sol
  78. 3 3
      contracts/ownership/rbac/RBAC.sol
  79. 1 1
      contracts/ownership/rbac/RBACWithAdmin.sol
  80. 1 1
      contracts/ownership/rbac/Roles.sol
  81. 1 1
      contracts/payment/PullPayment.sol
  82. 1 1
      contracts/payment/SplitPayment.sol
  83. 2 2
      contracts/token/ERC20/BasicToken.sol
  84. 3 3
      contracts/token/ERC20/BurnableToken.sol
  85. 1 1
      contracts/token/ERC20/CappedToken.sol
  86. 1 1
      contracts/token/ERC20/DetailedERC20.sol
  87. 1 1
      contracts/token/ERC20/ERC20.sol
  88. 1 1
      contracts/token/ERC20/ERC20Basic.sol
  89. 4 4
      contracts/token/ERC20/MintableToken.sol
  90. 1 1
      contracts/token/ERC20/PausableToken.sol
  91. 1 1
      contracts/token/ERC20/SafeERC20.sol
  92. 5 5
      contracts/token/ERC20/StandardToken.sol
  93. 1 1
      contracts/token/ERC20/TokenTimelock.sol
  94. 3 3
      contracts/token/ERC20/TokenVesting.sol
  95. 1 1
      contracts/token/ERC721/DeprecatedERC721.sol
  96. 1 1
      contracts/token/ERC721/ERC721.sol
  97. 1 1
      contracts/token/ERC721/ERC721Basic.sol
  98. 7 7
      contracts/token/ERC721/ERC721BasicToken.sol
  99. 1 1
      contracts/token/ERC721/ERC721Holder.sol
  100. 1 1
      contracts/token/ERC721/ERC721Receiver.sol

+ 1 - 1
.github/ISSUE_TEMPLATE.md

@@ -12,7 +12,7 @@
 Next, we need to know what your environment looks like.
 
 - Which version of OpenZeppelin are you using?
-- What network are you deploying to? testrpc? Ganache? Ropsten?
+- What network are you deploying to? Ganache? Ropsten?
 - How are you deploying your OpenZeppelin-backed contracts? truffle? Remix? Let us know!
 
 ## 📝 Details

+ 1 - 1
contracts/AddressUtils.sol

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

+ 2 - 2
contracts/Bounty.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 
 import "./payment/PullPayment.sol";
@@ -30,7 +30,7 @@ contract Bounty is PullPayment, Destructible {
   function createTarget() public returns(Target) {
     Target target = Target(deployContract());
     researchers[target] = msg.sender;
-    TargetCreated(target);
+    emit TargetCreated(target);
     return target;
   }
 

+ 1 - 1
contracts/DayLimit.sol

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

+ 1 - 1
contracts/ECRecovery.sol

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

+ 1 - 1
contracts/LimitBalance.sol

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

+ 2 - 2
contracts/MerkleProof.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 
 /*
@@ -14,7 +14,7 @@ library MerkleProof {
    * @param _root Merkle root
    * @param _leaf Leaf of Merkle tree
    */
-  function verifyProof(bytes32[] _proof, bytes32 _root, bytes32 _leaf) public pure returns (bool) {
+  function verifyProof(bytes32[] _proof, bytes32 _root, bytes32 _leaf) internal pure returns (bool) {
     bytes32 computedHash = _leaf;
 
     for (uint256 i = 0; i < _proof.length; i++) {

+ 1 - 1
contracts/ReentrancyGuard.sol

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

+ 2 - 2
contracts/crowdsale/Crowdsale.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/ERC20.sol";
 import "../math/SafeMath.sol";
@@ -82,7 +82,7 @@ contract Crowdsale {
     weiRaised = weiRaised.add(weiAmount);
 
     _processPurchase(_beneficiary, tokens);
-    TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens);
+    emit TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens);
 
     _updatePurchasingState(_beneficiary, weiAmount);
 

+ 2 - 2
contracts/crowdsale/distribution/FinalizableCrowdsale.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../../math/SafeMath.sol";
 import "../../ownership/Ownable.sol";
@@ -26,7 +26,7 @@ contract FinalizableCrowdsale is TimedCrowdsale, Ownable {
     require(hasClosed());
 
     finalization();
-    Finalized();
+    emit Finalized();
 
     isFinalized = true;
   }

+ 1 - 1
contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../validation/TimedCrowdsale.sol";
 import "../../token/ERC20/ERC20.sol";

+ 1 - 1
contracts/crowdsale/distribution/RefundableCrowdsale.sol

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

+ 4 - 4
contracts/crowdsale/distribution/utils/RefundVault.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../../../math/SafeMath.sol";
 import "../../../ownership/Ownable.sol";
@@ -43,14 +43,14 @@ contract RefundVault is Ownable {
   function close() onlyOwner public {
     require(state == State.Active);
     state = State.Closed;
-    Closed();
+    emit Closed();
     wallet.transfer(this.balance);
   }
 
   function enableRefunds() onlyOwner public {
     require(state == State.Active);
     state = State.Refunding;
-    RefundsEnabled();
+    emit RefundsEnabled();
   }
 
   /**
@@ -61,6 +61,6 @@ contract RefundVault is Ownable {
     uint256 depositedValue = deposited[investor];
     deposited[investor] = 0;
     investor.transfer(depositedValue);
-    Refunded(investor, depositedValue);
+    emit Refunded(investor, depositedValue);
   }
 }

+ 1 - 1
contracts/crowdsale/emission/AllowanceCrowdsale.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../Crowdsale.sol";
 import "../../token/ERC20/ERC20.sol";

+ 1 - 1
contracts/crowdsale/emission/MintedCrowdsale.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../Crowdsale.sol";
 import "../../token/ERC20/MintableToken.sol";

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

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../validation/TimedCrowdsale.sol";
 import "../../math/SafeMath.sol";

+ 1 - 1
contracts/crowdsale/validation/CappedCrowdsale.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../../math/SafeMath.sol";
 import "../Crowdsale.sol";

+ 1 - 1
contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../../math/SafeMath.sol";
 import "../Crowdsale.sol";

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

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../../math/SafeMath.sol";
 import "../Crowdsale.sol";

+ 1 - 1
contracts/crowdsale/validation/WhitelistedCrowdsale.sol

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

+ 1 - 1
contracts/examples/SampleCrowdsale.sol

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

+ 4 - 4
contracts/examples/SimpleSavingsWallet.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.21;
 
 import "../ownership/Heritable.sol";
 
@@ -20,12 +20,12 @@ contract SimpleSavingsWallet is Heritable {
 
 
   function SimpleSavingsWallet(uint256 _heartbeatTimeout) Heritable(_heartbeatTimeout) public {}
-  
+
   /**
    * @dev wallet can receive funds.
    */
   function () public payable {
-    Received(msg.sender, msg.value, this.balance);
+    emit Received(msg.sender, msg.value, this.balance);
   }
 
   /**
@@ -35,6 +35,6 @@ contract SimpleSavingsWallet is Heritable {
     require(payee != 0 && payee != address(this));
     require(amount > 0);
     payee.transfer(amount);
-    Sent(payee, amount, this.balance);
+    emit Sent(payee, amount, this.balance);
   }
 }

+ 2 - 2
contracts/examples/SimpleToken.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 
 import "../token/ERC20/StandardToken.sol";
@@ -24,7 +24,7 @@ contract SimpleToken is StandardToken {
   function SimpleToken() public {
     totalSupply_ = INITIAL_SUPPLY;
     balances[msg.sender] = INITIAL_SUPPLY;
-    Transfer(0x0, msg.sender, INITIAL_SUPPLY);
+    emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
   }
 
 }

+ 1 - 1
contracts/lifecycle/Destructible.sol

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

+ 1 - 1
contracts/lifecycle/Migrations.sol

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

+ 3 - 3
contracts/lifecycle/Pausable.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 
 import "../ownership/Ownable.sol";
@@ -36,7 +36,7 @@ contract Pausable is Ownable {
    */
   function pause() onlyOwner whenNotPaused public {
     paused = true;
-    Pause();
+    emit Pause();
   }
 
   /**
@@ -44,6 +44,6 @@ contract Pausable is Ownable {
    */
   function unpause() onlyOwner whenPaused public {
     paused = false;
-    Unpause();
+    emit Unpause();
   }
 }

+ 1 - 1
contracts/lifecycle/TokenDestructible.sol

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

+ 1 - 1
contracts/math/Math.sol

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

+ 1 - 1
contracts/math/SafeMath.sol

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

+ 1 - 1
contracts/mocks/AllowanceCrowdsaleImpl.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/ERC20.sol";
 import "../crowdsale/emission/AllowanceCrowdsale.sol";

+ 1 - 1
contracts/mocks/BasicTokenMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 
 import "../token/ERC20/BasicToken.sol";

+ 1 - 1
contracts/mocks/BurnableTokenMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/BurnableToken.sol";
 

+ 1 - 1
contracts/mocks/CappedCrowdsaleImpl.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/ERC20.sol";
 import "../crowdsale/validation/CappedCrowdsale.sol";

+ 1 - 1
contracts/mocks/DayLimitMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../../contracts/DayLimit.sol";
 

+ 1 - 1
contracts/mocks/DetailedERC20Mock.sol

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

+ 1 - 1
contracts/mocks/ECRecoveryMock.sol

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

+ 1 - 1
contracts/mocks/ERC223TokenMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/BasicToken.sol";
 

+ 1 - 1
contracts/mocks/ERC721BasicTokenMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC721/ERC721BasicToken.sol";
 

+ 2 - 2
contracts/mocks/ERC721ReceiverMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC721/ERC721Receiver.sol";
 
@@ -16,7 +16,7 @@ contract ERC721ReceiverMock is ERC721Receiver {
 
   function onERC721Received(address _address, uint256 _tokenId, bytes _data) public returns(bytes4) {
     require(!reverts);
-    Received(_address, _tokenId, _data, msg.gas);
+    emit Received(_address, _tokenId, _data, msg.gas);
     return retval;
   }
 }

+ 1 - 1
contracts/mocks/ERC721TokenMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC721/ERC721Token.sol";
 

+ 1 - 1
contracts/mocks/ERC827TokenMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.13;
+pragma solidity ^0.4.21;
 
 
 import "../token/ERC827/ERC827Token.sol";

+ 1 - 1
contracts/mocks/FinalizableCrowdsaleImpl.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/MintableToken.sol";
 import "../crowdsale/distribution/FinalizableCrowdsale.sol";

+ 1 - 1
contracts/mocks/ForceEther.sol

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

+ 1 - 1
contracts/mocks/HasNoEtherTest.sol

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

+ 1 - 1
contracts/mocks/IncreasingPriceCrowdsaleImpl.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../crowdsale/price/IncreasingPriceCrowdsale.sol";
 import "../math/SafeMath.sol";

+ 1 - 1
contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/ERC20.sol";
 import "../crowdsale/validation/IndividuallyCappedCrowdsale.sol";

+ 1 - 1
contracts/mocks/InsecureTargetBounty.sol

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

+ 1 - 1
contracts/mocks/LimitBalanceMock.sol

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

+ 11 - 0
contracts/mocks/MerkleProofWrapper.sol

@@ -0,0 +1,11 @@
+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);
+  }
+}

+ 2 - 2
contracts/mocks/MessageHelper.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.21;
 
 
 contract MessageHelper {
@@ -6,7 +6,7 @@ contract MessageHelper {
   event Show(bytes32 b32, uint256 number, string text);
 
   function showMessage( bytes32 message, uint256 number, string text ) public returns (bool) {
-    Show(message, number, text);
+    emit Show(message, number, text);
     return true;
   }
 

+ 1 - 1
contracts/mocks/MintedCrowdsaleImpl.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/MintableToken.sol";
 import "../crowdsale/emission/MintedCrowdsale.sol";

+ 1 - 1
contracts/mocks/PausableMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 
 import "../lifecycle/Pausable.sol";

+ 1 - 1
contracts/mocks/PausableTokenMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/PausableToken.sol";
 

+ 1 - 1
contracts/mocks/PostDeliveryCrowdsaleImpl.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/ERC20.sol";
 import "../crowdsale/distribution/PostDeliveryCrowdsale.sol";

+ 1 - 1
contracts/mocks/PullPaymentMock.sol

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

+ 1 - 1
contracts/mocks/RBACMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.8;
+pragma solidity ^0.4.21;
 
 import "../ownership/rbac/RBACWithAdmin.sol";
 

+ 1 - 1
contracts/mocks/ReentrancyAttack.sol

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

+ 1 - 1
contracts/mocks/ReentrancyMock.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../ReentrancyGuard.sol";
 import "./ReentrancyAttack.sol";

+ 1 - 1
contracts/mocks/RefundableCrowdsaleImpl.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/MintableToken.sol";
 import "../crowdsale/distribution/RefundableCrowdsale.sol";

+ 1 - 1
contracts/mocks/SafeERC20Helper.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/ERC20.sol";
 import "../token/ERC20/SafeERC20.sol";

+ 1 - 1
contracts/mocks/SafeMathMock.sol

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

+ 1 - 1
contracts/mocks/SecureTargetBounty.sol

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

+ 1 - 1
contracts/mocks/StandardTokenMock.sol

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

+ 1 - 1
contracts/mocks/TimedCrowdsaleImpl.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/ERC20.sol";
 import "../crowdsale/validation/TimedCrowdsale.sol";

+ 1 - 1
contracts/mocks/WhitelistMock.sol

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

+ 1 - 1
contracts/mocks/WhitelistedCrowdsaleImpl.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "../token/ERC20/ERC20.sol";
 import "../crowdsale/validation/WhitelistedCrowdsale.sol";

+ 1 - 1
contracts/ownership/CanReclaimToken.sol

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

+ 2 - 2
contracts/ownership/Claimable.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 
 import "./Ownable.sol";
@@ -32,7 +32,7 @@ contract Claimable is Ownable {
    * @dev Allows the pendingOwner address to finalize the transfer.
    */
   function claimOwnership() onlyPendingOwner public {
-    OwnershipTransferred(owner, pendingOwner);
+    emit OwnershipTransferred(owner, pendingOwner);
     owner = pendingOwner;
     pendingOwner = address(0);
   }

+ 1 - 1
contracts/ownership/Contactable.sol

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

+ 2 - 2
contracts/ownership/DelayedClaimable.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "./Claimable.sol";
 
@@ -31,7 +31,7 @@ contract DelayedClaimable is Claimable {
    */
   function claimOwnership() onlyPendingOwner public {
     require((block.number <= end) && (block.number >= start));
-    OwnershipTransferred(owner, pendingOwner);
+    emit OwnershipTransferred(owner, pendingOwner);
     owner = pendingOwner;
     pendingOwner = address(0);
     end = 0;

+ 1 - 1
contracts/ownership/HasNoContracts.sol

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

+ 1 - 1
contracts/ownership/HasNoEther.sol

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

+ 1 - 1
contracts/ownership/HasNoTokens.sol

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

+ 7 - 7
contracts/ownership/Heritable.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.21;
 
 
 import "./Ownable.sol";
@@ -46,7 +46,7 @@ contract Heritable is Ownable {
   function setHeir(address newHeir) public onlyOwner {
     require(newHeir != owner);
     heartbeat();
-    HeirChanged(owner, newHeir);
+    emit HeirChanged(owner, newHeir);
     heir_ = newHeir;
   }
 
@@ -61,7 +61,7 @@ contract Heritable is Ownable {
   function heartbeatTimeout() public view returns(uint256) {
     return heartbeatTimeout_;
   }
-  
+
   function timeOfDeath() public view returns(uint256) {
     return timeOfDeath_;
   }
@@ -80,7 +80,7 @@ contract Heritable is Ownable {
    */
   function proclaimDeath() public onlyHeir {
     require(ownerLives());
-    OwnerProclaimedDead(owner, heir_, timeOfDeath_);
+    emit OwnerProclaimedDead(owner, heir_, timeOfDeath_);
     timeOfDeath_ = block.timestamp;
   }
 
@@ -88,7 +88,7 @@ contract Heritable is Ownable {
    * @dev Owner can send a heartbeat if they were mistakenly pronounced dead.
    */
   function heartbeat() public onlyOwner {
-    OwnerHeartbeated(owner);
+    emit OwnerHeartbeated(owner);
     timeOfDeath_ = 0;
   }
 
@@ -98,8 +98,8 @@ contract Heritable is Ownable {
   function claimHeirOwnership() public onlyHeir {
     require(!ownerLives());
     require(block.timestamp >= timeOfDeath_ + heartbeatTimeout_);
-    OwnershipTransferred(owner, heir_);
-    HeirOwnershipClaimed(owner, heir_);
+    emit OwnershipTransferred(owner, heir_);
+    emit HeirOwnershipClaimed(owner, heir_);
     owner = heir_;
     timeOfDeath_ = 0;
   }

+ 1 - 1
contracts/ownership/NoOwner.sol

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

+ 2 - 2
contracts/ownership/Ownable.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 
 /**
@@ -35,7 +35,7 @@ contract Ownable {
    */
   function transferOwnership(address newOwner) public onlyOwner {
     require(newOwner != address(0));
-    OwnershipTransferred(owner, newOwner);
+    emit OwnershipTransferred(owner, newOwner);
     owner = newOwner;
   }
 

+ 11 - 11
contracts/ownership/Whitelist.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 
 import "./Ownable.sol";
@@ -11,7 +11,7 @@ import "./Ownable.sol";
  */
 contract Whitelist is Ownable {
   mapping(address => bool) public whitelist;
-  
+
   event WhitelistedAddressAdded(address addr);
   event WhitelistedAddressRemoved(address addr);
 
@@ -26,21 +26,21 @@ contract Whitelist is Ownable {
   /**
    * @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 
+   * @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;
-      WhitelistedAddressAdded(addr);
-      success = 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  
+   * @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++) {
@@ -53,13 +53,13 @@ contract Whitelist is Ownable {
   /**
    * @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 
+   * @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;
-      WhitelistedAddressRemoved(addr);
+      emit WhitelistedAddressRemoved(addr);
       success = true;
     }
   }
@@ -67,7 +67,7 @@ contract Whitelist is Ownable {
   /**
    * @dev remove addresses from the whitelist
    * @param addrs addresses
-   * @return true if at least one address was removed from the whitelist, 
+   * @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) {

+ 3 - 3
contracts/ownership/rbac/RBAC.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "./Roles.sol";
 
@@ -58,7 +58,7 @@ contract RBAC {
     internal
   {
     roles[roleName].add(addr);
-    RoleAdded(addr, roleName);
+    emit RoleAdded(addr, roleName);
   }
 
   /**
@@ -70,7 +70,7 @@ contract RBAC {
     internal
   {
     roles[roleName].remove(addr);
-    RoleRemoved(addr, roleName);
+    emit RoleRemoved(addr, roleName);
   }
 
   /**

+ 1 - 1
contracts/ownership/rbac/RBACWithAdmin.sol

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

+ 1 - 1
contracts/ownership/rbac/Roles.sol

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

+ 1 - 1
contracts/payment/PullPayment.sol

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

+ 1 - 1
contracts/payment/SplitPayment.sol

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

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

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 
 import "./ERC20Basic.sol";
@@ -34,7 +34,7 @@ contract BasicToken is ERC20Basic {
 
     balances[msg.sender] = balances[msg.sender].sub(_value);
     balances[_to] = balances[_to].add(_value);
-    Transfer(msg.sender, _to, _value);
+    emit Transfer(msg.sender, _to, _value);
     return true;
   }
 

+ 3 - 3
contracts/token/ERC20/BurnableToken.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "./BasicToken.sol";
 
@@ -23,7 +23,7 @@ contract BurnableToken is BasicToken {
     address burner = msg.sender;
     balances[burner] = balances[burner].sub(_value);
     totalSupply_ = totalSupply_.sub(_value);
-    Burn(burner, _value);
-    Transfer(burner, address(0), _value);
+    emit Burn(burner, _value);
+    emit Transfer(burner, address(0), _value);
   }
 }

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

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

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

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

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

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

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

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

+ 4 - 4
contracts/token/ERC20/MintableToken.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "./StandardToken.sol";
 import "../../ownership/Ownable.sol";
@@ -31,8 +31,8 @@ contract MintableToken is StandardToken, Ownable {
   function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
     totalSupply_ = totalSupply_.add(_amount);
     balances[_to] = balances[_to].add(_amount);
-    Mint(_to, _amount);
-    Transfer(address(0), _to, _amount);
+    emit Mint(_to, _amount);
+    emit Transfer(address(0), _to, _amount);
     return true;
   }
 
@@ -42,7 +42,7 @@ contract MintableToken is StandardToken, Ownable {
    */
   function finishMinting() onlyOwner canMint public returns (bool) {
     mintingFinished = true;
-    MintFinished();
+    emit MintFinished();
     return true;
   }
 }

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

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

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

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

+ 5 - 5
contracts/token/ERC20/StandardToken.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "./BasicToken.sol";
 import "./ERC20.sol";
@@ -30,7 +30,7 @@ contract StandardToken is ERC20, BasicToken {
     balances[_from] = balances[_from].sub(_value);
     balances[_to] = balances[_to].add(_value);
     allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
-    Transfer(_from, _to, _value);
+    emit Transfer(_from, _to, _value);
     return true;
   }
 
@@ -46,7 +46,7 @@ contract StandardToken is ERC20, BasicToken {
    */
   function approve(address _spender, uint256 _value) public returns (bool) {
     allowed[msg.sender][_spender] = _value;
-    Approval(msg.sender, _spender, _value);
+    emit Approval(msg.sender, _spender, _value);
     return true;
   }
 
@@ -72,7 +72,7 @@ contract StandardToken is ERC20, BasicToken {
    */
   function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
     allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
-    Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
+    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
     return true;
   }
 
@@ -93,7 +93,7 @@ contract StandardToken is ERC20, BasicToken {
     } else {
       allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
     }
-    Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
+    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
     return true;
   }
 

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

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

+ 3 - 3
contracts/token/ERC20/TokenVesting.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "./ERC20Basic.sol";
 import "./SafeERC20.sol";
@@ -72,7 +72,7 @@ contract TokenVesting is Ownable {
 
     token.safeTransfer(beneficiary, unreleased);
 
-    Released(unreleased);
+    emit Released(unreleased);
   }
 
   /**
@@ -93,7 +93,7 @@ contract TokenVesting is Ownable {
 
     token.safeTransfer(owner, refund);
 
-    Revoked();
+    emit Revoked();
   }
 
   /**

+ 1 - 1
contracts/token/ERC721/DeprecatedERC721.sol

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

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

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

+ 1 - 1
contracts/token/ERC721/ERC721Basic.sol

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

+ 7 - 7
contracts/token/ERC721/ERC721BasicToken.sol

@@ -1,4 +1,4 @@
-pragma solidity ^0.4.18;
+pragma solidity ^0.4.21;
 
 import "./ERC721Basic.sol";
 import "./ERC721Receiver.sol";
@@ -94,7 +94,7 @@ contract ERC721BasicToken is ERC721Basic {
 
     if (getApproved(_tokenId) != address(0) || _to != address(0)) {
       tokenApprovals[_tokenId] = _to;
-      Approval(owner, _to, _tokenId);
+      emit Approval(owner, _to, _tokenId);
     }
   }
 
@@ -116,7 +116,7 @@ contract ERC721BasicToken is ERC721Basic {
   function setApprovalForAll(address _to, bool _approved) public {
     require(_to != msg.sender);
     operatorApprovals[msg.sender][_to] = _approved;
-    ApprovalForAll(msg.sender, _to, _approved);
+    emit ApprovalForAll(msg.sender, _to, _approved);
   }
 
   /**
@@ -145,7 +145,7 @@ contract ERC721BasicToken is ERC721Basic {
     removeTokenFrom(_from, _tokenId);
     addTokenTo(_to, _tokenId);
 
-    Transfer(_from, _to, _tokenId);
+    emit Transfer(_from, _to, _tokenId);
   }
 
   /**
@@ -216,7 +216,7 @@ contract ERC721BasicToken is ERC721Basic {
   function _mint(address _to, uint256 _tokenId) internal {
     require(_to != address(0));
     addTokenTo(_to, _tokenId);
-    Transfer(address(0), _to, _tokenId);
+    emit Transfer(address(0), _to, _tokenId);
   }
 
   /**
@@ -227,7 +227,7 @@ contract ERC721BasicToken is ERC721Basic {
   function _burn(address _owner, uint256 _tokenId) internal {
     clearApproval(_owner, _tokenId);
     removeTokenFrom(_owner, _tokenId);
-    Transfer(_owner, address(0), _tokenId);
+    emit Transfer(_owner, address(0), _tokenId);
   }
 
   /**
@@ -240,7 +240,7 @@ contract ERC721BasicToken is ERC721Basic {
     require(ownerOf(_tokenId) == _owner);
     if (tokenApprovals[_tokenId] != address(0)) {
       tokenApprovals[_tokenId] = address(0);
-      Approval(_owner, address(0), _tokenId);
+      emit Approval(_owner, address(0), _tokenId);
     }
   }
 

+ 1 - 1
contracts/token/ERC721/ERC721Holder.sol

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

+ 1 - 1
contracts/token/ERC721/ERC721Receiver.sol

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

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