Unverified Commit a7e91856 by Francisco Giordano Committed by GitHub

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
parent 06666be9
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
Next, we need to know what your environment looks like. Next, we need to know what your environment looks like.
- Which version of OpenZeppelin are you using? - 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! - How are you deploying your OpenZeppelin-backed contracts? truffle? Remix? Let us know!
## 📝 Details ## 📝 Details
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./payment/PullPayment.sol"; import "./payment/PullPayment.sol";
...@@ -30,7 +30,7 @@ contract Bounty is PullPayment, Destructible { ...@@ -30,7 +30,7 @@ contract Bounty is PullPayment, Destructible {
function createTarget() public returns(Target) { function createTarget() public returns(Target) {
Target target = Target(deployContract()); Target target = Target(deployContract());
researchers[target] = msg.sender; researchers[target] = msg.sender;
TargetCreated(target); emit TargetCreated(target);
return target; return target;
} }
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
/* /*
...@@ -14,7 +14,7 @@ library MerkleProof { ...@@ -14,7 +14,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(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; bytes32 computedHash = _leaf;
for (uint256 i = 0; i < _proof.length; i++) { for (uint256 i = 0; i < _proof.length; i++) {
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
import "../math/SafeMath.sol"; import "../math/SafeMath.sol";
...@@ -82,7 +82,7 @@ contract Crowdsale { ...@@ -82,7 +82,7 @@ contract Crowdsale {
weiRaised = weiRaised.add(weiAmount); weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens); _processPurchase(_beneficiary, tokens);
TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens); emit TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens);
_updatePurchasingState(_beneficiary, weiAmount); _updatePurchasingState(_beneficiary, weiAmount);
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
import "../../ownership/Ownable.sol"; import "../../ownership/Ownable.sol";
...@@ -26,7 +26,7 @@ contract FinalizableCrowdsale is TimedCrowdsale, Ownable { ...@@ -26,7 +26,7 @@ contract FinalizableCrowdsale is TimedCrowdsale, Ownable {
require(hasClosed()); require(hasClosed());
finalization(); finalization();
Finalized(); emit Finalized();
isFinalized = true; isFinalized = true;
} }
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../validation/TimedCrowdsale.sol"; import "../validation/TimedCrowdsale.sol";
import "../../token/ERC20/ERC20.sol"; import "../../token/ERC20/ERC20.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../../../math/SafeMath.sol"; import "../../../math/SafeMath.sol";
import "../../../ownership/Ownable.sol"; import "../../../ownership/Ownable.sol";
...@@ -43,14 +43,14 @@ contract RefundVault is Ownable { ...@@ -43,14 +43,14 @@ contract RefundVault is Ownable {
function close() onlyOwner public { function close() onlyOwner public {
require(state == State.Active); require(state == State.Active);
state = State.Closed; state = State.Closed;
Closed(); emit Closed();
wallet.transfer(this.balance); wallet.transfer(this.balance);
} }
function enableRefunds() onlyOwner public { function enableRefunds() onlyOwner public {
require(state == State.Active); require(state == State.Active);
state = State.Refunding; state = State.Refunding;
RefundsEnabled(); emit RefundsEnabled();
} }
/** /**
...@@ -61,6 +61,6 @@ contract RefundVault is Ownable { ...@@ -61,6 +61,6 @@ contract RefundVault is Ownable {
uint256 depositedValue = deposited[investor]; uint256 depositedValue = deposited[investor];
deposited[investor] = 0; deposited[investor] = 0;
investor.transfer(depositedValue); investor.transfer(depositedValue);
Refunded(investor, depositedValue); emit Refunded(investor, depositedValue);
} }
} }
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../Crowdsale.sol"; import "../Crowdsale.sol";
import "../../token/ERC20/ERC20.sol"; import "../../token/ERC20/ERC20.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../Crowdsale.sol"; import "../Crowdsale.sol";
import "../../token/ERC20/MintableToken.sol"; import "../../token/ERC20/MintableToken.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../validation/TimedCrowdsale.sol"; import "../validation/TimedCrowdsale.sol";
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
import "../Crowdsale.sol"; import "../Crowdsale.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
import "../Crowdsale.sol"; import "../Crowdsale.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
import "../Crowdsale.sol"; import "../Crowdsale.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../Crowdsale.sol"; import "../Crowdsale.sol";
import "../../ownership/Ownable.sol"; import "../../ownership/Ownable.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../crowdsale/validation/CappedCrowdsale.sol"; import "../crowdsale/validation/CappedCrowdsale.sol";
import "../crowdsale/distribution/RefundableCrowdsale.sol"; import "../crowdsale/distribution/RefundableCrowdsale.sol";
......
pragma solidity ^0.4.11; pragma solidity ^0.4.21;
import "../ownership/Heritable.sol"; import "../ownership/Heritable.sol";
...@@ -20,12 +20,12 @@ contract SimpleSavingsWallet is Heritable { ...@@ -20,12 +20,12 @@ contract SimpleSavingsWallet is Heritable {
function SimpleSavingsWallet(uint256 _heartbeatTimeout) Heritable(_heartbeatTimeout) public {} function SimpleSavingsWallet(uint256 _heartbeatTimeout) Heritable(_heartbeatTimeout) public {}
/** /**
* @dev wallet can receive funds. * @dev wallet can receive funds.
*/ */
function () public payable { 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 { ...@@ -35,6 +35,6 @@ contract SimpleSavingsWallet is Heritable {
require(payee != 0 && payee != address(this)); require(payee != 0 && payee != address(this));
require(amount > 0); require(amount > 0);
payee.transfer(amount); payee.transfer(amount);
Sent(payee, amount, this.balance); emit Sent(payee, amount, this.balance);
} }
} }
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/StandardToken.sol"; import "../token/ERC20/StandardToken.sol";
...@@ -24,7 +24,7 @@ contract SimpleToken is StandardToken { ...@@ -24,7 +24,7 @@ contract SimpleToken is StandardToken {
function SimpleToken() public { function SimpleToken() public {
totalSupply_ = INITIAL_SUPPLY; totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY;
Transfer(0x0, msg.sender, INITIAL_SUPPLY); emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
} }
} }
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../ownership/Ownable.sol"; import "../ownership/Ownable.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../ownership/Ownable.sol"; import "../ownership/Ownable.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../ownership/Ownable.sol"; import "../ownership/Ownable.sol";
...@@ -36,7 +36,7 @@ contract Pausable is Ownable { ...@@ -36,7 +36,7 @@ contract Pausable is Ownable {
*/ */
function pause() onlyOwner whenNotPaused public { function pause() onlyOwner whenNotPaused public {
paused = true; paused = true;
Pause(); emit Pause();
} }
/** /**
...@@ -44,6 +44,6 @@ contract Pausable is Ownable { ...@@ -44,6 +44,6 @@ contract Pausable is Ownable {
*/ */
function unpause() onlyOwner whenPaused public { function unpause() onlyOwner whenPaused public {
paused = false; paused = false;
Unpause(); emit Unpause();
} }
} }
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../ownership/Ownable.sol"; import "../ownership/Ownable.sol";
import "../token/ERC20/ERC20Basic.sol"; import "../token/ERC20/ERC20Basic.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
import "../crowdsale/emission/AllowanceCrowdsale.sol"; import "../crowdsale/emission/AllowanceCrowdsale.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/BasicToken.sol"; import "../token/ERC20/BasicToken.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/BurnableToken.sol"; import "../token/ERC20/BurnableToken.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
import "../crowdsale/validation/CappedCrowdsale.sol"; import "../crowdsale/validation/CappedCrowdsale.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../../contracts/DayLimit.sol"; import "../../contracts/DayLimit.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/StandardToken.sol"; import "../token/ERC20/StandardToken.sol";
import "../token/ERC20/DetailedERC20.sol"; import "../token/ERC20/DetailedERC20.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../ECRecovery.sol"; import "../ECRecovery.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/BasicToken.sol"; import "../token/ERC20/BasicToken.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC721/ERC721BasicToken.sol"; import "../token/ERC721/ERC721BasicToken.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC721/ERC721Receiver.sol"; import "../token/ERC721/ERC721Receiver.sol";
...@@ -16,7 +16,7 @@ contract ERC721ReceiverMock is ERC721Receiver { ...@@ -16,7 +16,7 @@ contract ERC721ReceiverMock is ERC721Receiver {
function onERC721Received(address _address, uint256 _tokenId, bytes _data) public returns(bytes4) { function onERC721Received(address _address, uint256 _tokenId, bytes _data) public returns(bytes4) {
require(!reverts); require(!reverts);
Received(_address, _tokenId, _data, msg.gas); emit Received(_address, _tokenId, _data, msg.gas);
return retval; return retval;
} }
} }
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC721/ERC721Token.sol"; import "../token/ERC721/ERC721Token.sol";
......
pragma solidity ^0.4.13; pragma solidity ^0.4.21;
import "../token/ERC827/ERC827Token.sol"; import "../token/ERC827/ERC827Token.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/MintableToken.sol"; import "../token/ERC20/MintableToken.sol";
import "../crowdsale/distribution/FinalizableCrowdsale.sol"; import "../crowdsale/distribution/FinalizableCrowdsale.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
// @title Force Ether into a contract. // @title Force Ether into a contract.
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../../contracts/ownership/HasNoEther.sol"; import "../../contracts/ownership/HasNoEther.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../crowdsale/price/IncreasingPriceCrowdsale.sol"; import "../crowdsale/price/IncreasingPriceCrowdsale.sol";
import "../math/SafeMath.sol"; import "../math/SafeMath.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
import "../crowdsale/validation/IndividuallyCappedCrowdsale.sol"; import "../crowdsale/validation/IndividuallyCappedCrowdsale.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import {Bounty, Target} from "../../contracts/Bounty.sol"; import {Bounty, Target} from "../../contracts/Bounty.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../LimitBalance.sol"; import "../LimitBalance.sol";
......
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);
}
}
pragma solidity ^0.4.11; pragma solidity ^0.4.21;
contract MessageHelper { contract MessageHelper {
...@@ -6,7 +6,7 @@ contract MessageHelper { ...@@ -6,7 +6,7 @@ contract MessageHelper {
event Show(bytes32 b32, uint256 number, string text); event Show(bytes32 b32, uint256 number, string text);
function showMessage( bytes32 message, uint256 number, string text ) public returns (bool) { function showMessage( bytes32 message, uint256 number, string text ) public returns (bool) {
Show(message, number, text); emit Show(message, number, text);
return true; return true;
} }
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/MintableToken.sol"; import "../token/ERC20/MintableToken.sol";
import "../crowdsale/emission/MintedCrowdsale.sol"; import "../crowdsale/emission/MintedCrowdsale.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../lifecycle/Pausable.sol"; import "../lifecycle/Pausable.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/PausableToken.sol"; import "../token/ERC20/PausableToken.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
import "../crowdsale/distribution/PostDeliveryCrowdsale.sol"; import "../crowdsale/distribution/PostDeliveryCrowdsale.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../payment/PullPayment.sol"; import "../payment/PullPayment.sol";
......
pragma solidity ^0.4.8; pragma solidity ^0.4.21;
import "../ownership/rbac/RBACWithAdmin.sol"; import "../ownership/rbac/RBACWithAdmin.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
contract ReentrancyAttack { contract ReentrancyAttack {
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../ReentrancyGuard.sol"; import "../ReentrancyGuard.sol";
import "./ReentrancyAttack.sol"; import "./ReentrancyAttack.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/MintableToken.sol"; import "../token/ERC20/MintableToken.sol";
import "../crowdsale/distribution/RefundableCrowdsale.sol"; import "../crowdsale/distribution/RefundableCrowdsale.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
import "../token/ERC20/SafeERC20.sol"; import "../token/ERC20/SafeERC20.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../math/SafeMath.sol"; import "../math/SafeMath.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import {Bounty, Target} from "../../contracts/Bounty.sol"; import {Bounty, Target} from "../../contracts/Bounty.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/StandardToken.sol"; import "../token/ERC20/StandardToken.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
import "../crowdsale/validation/TimedCrowdsale.sol"; import "../crowdsale/validation/TimedCrowdsale.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../ownership/Whitelist.sol"; import "../ownership/Whitelist.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
import "../crowdsale/validation/WhitelistedCrowdsale.sol"; import "../crowdsale/validation/WhitelistedCrowdsale.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./Ownable.sol"; import "./Ownable.sol";
import "../token/ERC20/ERC20Basic.sol"; import "../token/ERC20/ERC20Basic.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./Ownable.sol"; import "./Ownable.sol";
...@@ -32,7 +32,7 @@ contract Claimable is Ownable { ...@@ -32,7 +32,7 @@ contract Claimable is Ownable {
* @dev Allows the pendingOwner address to finalize the transfer. * @dev Allows the pendingOwner address to finalize the transfer.
*/ */
function claimOwnership() onlyPendingOwner public { function claimOwnership() onlyPendingOwner public {
OwnershipTransferred(owner, pendingOwner); emit OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner; owner = pendingOwner;
pendingOwner = address(0); pendingOwner = address(0);
} }
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./Ownable.sol"; import "./Ownable.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./Claimable.sol"; import "./Claimable.sol";
...@@ -31,7 +31,7 @@ contract DelayedClaimable is Claimable { ...@@ -31,7 +31,7 @@ contract DelayedClaimable is Claimable {
*/ */
function claimOwnership() onlyPendingOwner public { function claimOwnership() onlyPendingOwner public {
require((block.number <= end) && (block.number >= start)); require((block.number <= end) && (block.number >= start));
OwnershipTransferred(owner, pendingOwner); emit OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner; owner = pendingOwner;
pendingOwner = address(0); pendingOwner = address(0);
end = 0; end = 0;
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./Ownable.sol"; import "./Ownable.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./Ownable.sol"; import "./Ownable.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./CanReclaimToken.sol"; import "./CanReclaimToken.sol";
......
pragma solidity ^0.4.11; pragma solidity ^0.4.21;
import "./Ownable.sol"; import "./Ownable.sol";
...@@ -46,7 +46,7 @@ contract Heritable is Ownable { ...@@ -46,7 +46,7 @@ contract Heritable is Ownable {
function setHeir(address newHeir) public onlyOwner { function setHeir(address newHeir) public onlyOwner {
require(newHeir != owner); require(newHeir != owner);
heartbeat(); heartbeat();
HeirChanged(owner, newHeir); emit HeirChanged(owner, newHeir);
heir_ = newHeir; heir_ = newHeir;
} }
...@@ -61,7 +61,7 @@ contract Heritable is Ownable { ...@@ -61,7 +61,7 @@ contract Heritable is Ownable {
function heartbeatTimeout() public view returns(uint256) { function heartbeatTimeout() public view returns(uint256) {
return heartbeatTimeout_; return heartbeatTimeout_;
} }
function timeOfDeath() public view returns(uint256) { function timeOfDeath() public view returns(uint256) {
return timeOfDeath_; return timeOfDeath_;
} }
...@@ -80,7 +80,7 @@ contract Heritable is Ownable { ...@@ -80,7 +80,7 @@ contract Heritable is Ownable {
*/ */
function proclaimDeath() public onlyHeir { function proclaimDeath() public onlyHeir {
require(ownerLives()); require(ownerLives());
OwnerProclaimedDead(owner, heir_, timeOfDeath_); emit OwnerProclaimedDead(owner, heir_, timeOfDeath_);
timeOfDeath_ = block.timestamp; timeOfDeath_ = block.timestamp;
} }
...@@ -88,7 +88,7 @@ contract Heritable is Ownable { ...@@ -88,7 +88,7 @@ contract Heritable is Ownable {
* @dev Owner can send a heartbeat if they were mistakenly pronounced dead. * @dev Owner can send a heartbeat if they were mistakenly pronounced dead.
*/ */
function heartbeat() public onlyOwner { function heartbeat() public onlyOwner {
OwnerHeartbeated(owner); emit OwnerHeartbeated(owner);
timeOfDeath_ = 0; timeOfDeath_ = 0;
} }
...@@ -98,8 +98,8 @@ contract Heritable is Ownable { ...@@ -98,8 +98,8 @@ contract Heritable is Ownable {
function claimHeirOwnership() public onlyHeir { function claimHeirOwnership() public onlyHeir {
require(!ownerLives()); require(!ownerLives());
require(block.timestamp >= timeOfDeath_ + heartbeatTimeout_); require(block.timestamp >= timeOfDeath_ + heartbeatTimeout_);
OwnershipTransferred(owner, heir_); emit OwnershipTransferred(owner, heir_);
HeirOwnershipClaimed(owner, heir_); emit HeirOwnershipClaimed(owner, heir_);
owner = heir_; owner = heir_;
timeOfDeath_ = 0; timeOfDeath_ = 0;
} }
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./HasNoEther.sol"; import "./HasNoEther.sol";
import "./HasNoTokens.sol"; import "./HasNoTokens.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
/** /**
...@@ -35,7 +35,7 @@ contract Ownable { ...@@ -35,7 +35,7 @@ contract Ownable {
*/ */
function transferOwnership(address newOwner) public onlyOwner { function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0)); require(newOwner != address(0));
OwnershipTransferred(owner, newOwner); emit OwnershipTransferred(owner, newOwner);
owner = newOwner; owner = newOwner;
} }
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./Ownable.sol"; import "./Ownable.sol";
...@@ -11,7 +11,7 @@ import "./Ownable.sol"; ...@@ -11,7 +11,7 @@ import "./Ownable.sol";
*/ */
contract Whitelist is Ownable { contract Whitelist is Ownable {
mapping(address => bool) public whitelist; mapping(address => bool) public whitelist;
event WhitelistedAddressAdded(address addr); event WhitelistedAddressAdded(address addr);
event WhitelistedAddressRemoved(address addr); event WhitelistedAddressRemoved(address addr);
...@@ -26,21 +26,21 @@ contract Whitelist is Ownable { ...@@ -26,21 +26,21 @@ contract Whitelist is Ownable {
/** /**
* @dev add an address to the whitelist * @dev add an address to the whitelist
* @param addr address * @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) { function addAddressToWhitelist(address addr) onlyOwner public returns(bool success) {
if (!whitelist[addr]) { if (!whitelist[addr]) {
whitelist[addr] = true; whitelist[addr] = true;
WhitelistedAddressAdded(addr); emit WhitelistedAddressAdded(addr);
success = true; success = true;
} }
} }
/** /**
* @dev add addresses to the whitelist * @dev add addresses to the whitelist
* @param addrs addresses * @param addrs addresses
* @return true if at least one address was added to the whitelist, * @return true if at least one address was added to the whitelist,
* false if all addresses were already in the whitelist * false if all addresses were already in the whitelist
*/ */
function addAddressesToWhitelist(address[] addrs) onlyOwner public returns(bool success) { function addAddressesToWhitelist(address[] addrs) onlyOwner public returns(bool success) {
for (uint256 i = 0; i < addrs.length; i++) { for (uint256 i = 0; i < addrs.length; i++) {
...@@ -53,13 +53,13 @@ contract Whitelist is Ownable { ...@@ -53,13 +53,13 @@ contract Whitelist is Ownable {
/** /**
* @dev remove an address from the whitelist * @dev remove an address from the whitelist
* @param addr address * @param addr address
* @return true if the address was removed from the whitelist, * @return true if the address was removed from the whitelist,
* false if the address wasn't in the whitelist in the first place * false if the address wasn't in the whitelist in the first place
*/ */
function removeAddressFromWhitelist(address addr) onlyOwner public returns(bool success) { function removeAddressFromWhitelist(address addr) onlyOwner public returns(bool success) {
if (whitelist[addr]) { if (whitelist[addr]) {
whitelist[addr] = false; whitelist[addr] = false;
WhitelistedAddressRemoved(addr); emit WhitelistedAddressRemoved(addr);
success = true; success = true;
} }
} }
...@@ -67,7 +67,7 @@ contract Whitelist is Ownable { ...@@ -67,7 +67,7 @@ contract Whitelist is Ownable {
/** /**
* @dev remove addresses from the whitelist * @dev remove addresses from the whitelist
* @param addrs addresses * @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 * false if all addresses weren't in the whitelist in the first place
*/ */
function removeAddressesFromWhitelist(address[] addrs) onlyOwner public returns(bool success) { function removeAddressesFromWhitelist(address[] addrs) onlyOwner public returns(bool success) {
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./Roles.sol"; import "./Roles.sol";
...@@ -58,7 +58,7 @@ contract RBAC { ...@@ -58,7 +58,7 @@ contract RBAC {
internal internal
{ {
roles[roleName].add(addr); roles[roleName].add(addr);
RoleAdded(addr, roleName); emit RoleAdded(addr, roleName);
} }
/** /**
...@@ -70,7 +70,7 @@ contract RBAC { ...@@ -70,7 +70,7 @@ contract RBAC {
internal internal
{ {
roles[roleName].remove(addr); roles[roleName].remove(addr);
RoleRemoved(addr, roleName); emit RoleRemoved(addr, roleName);
} }
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./RBAC.sol"; import "./RBAC.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../math/SafeMath.sol"; import "../math/SafeMath.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "../math/SafeMath.sol"; import "../math/SafeMath.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./ERC20Basic.sol"; import "./ERC20Basic.sol";
...@@ -34,7 +34,7 @@ contract BasicToken is ERC20Basic { ...@@ -34,7 +34,7 @@ contract BasicToken is ERC20Basic {
balances[msg.sender] = balances[msg.sender].sub(_value); balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value); balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value); emit Transfer(msg.sender, _to, _value);
return true; return true;
} }
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./BasicToken.sol"; import "./BasicToken.sol";
...@@ -23,7 +23,7 @@ contract BurnableToken is BasicToken { ...@@ -23,7 +23,7 @@ contract BurnableToken is BasicToken {
address burner = msg.sender; address burner = msg.sender;
balances[burner] = balances[burner].sub(_value); balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value); totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value); emit Burn(burner, _value);
Transfer(burner, address(0), _value); emit Transfer(burner, address(0), _value);
} }
} }
pragma solidity ^0.4.11; pragma solidity ^0.4.21;
import "./MintableToken.sol"; import "./MintableToken.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./ERC20.sol"; import "./ERC20.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./ERC20Basic.sol"; import "./ERC20Basic.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./StandardToken.sol"; import "./StandardToken.sol";
import "../../ownership/Ownable.sol"; import "../../ownership/Ownable.sol";
...@@ -31,8 +31,8 @@ contract MintableToken is StandardToken, Ownable { ...@@ -31,8 +31,8 @@ contract MintableToken is StandardToken, Ownable {
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount); totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount); balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount); emit Mint(_to, _amount);
Transfer(address(0), _to, _amount); emit Transfer(address(0), _to, _amount);
return true; return true;
} }
...@@ -42,7 +42,7 @@ contract MintableToken is StandardToken, Ownable { ...@@ -42,7 +42,7 @@ contract MintableToken is StandardToken, Ownable {
*/ */
function finishMinting() onlyOwner canMint public returns (bool) { function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true; mintingFinished = true;
MintFinished(); emit MintFinished();
return true; return true;
} }
} }
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./StandardToken.sol"; import "./StandardToken.sol";
import "../../lifecycle/Pausable.sol"; import "../../lifecycle/Pausable.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./ERC20Basic.sol"; import "./ERC20Basic.sol";
import "./ERC20.sol"; import "./ERC20.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./BasicToken.sol"; import "./BasicToken.sol";
import "./ERC20.sol"; import "./ERC20.sol";
...@@ -30,7 +30,7 @@ contract StandardToken is ERC20, BasicToken { ...@@ -30,7 +30,7 @@ contract StandardToken is ERC20, BasicToken {
balances[_from] = balances[_from].sub(_value); balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value); balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value); emit Transfer(_from, _to, _value);
return true; return true;
} }
...@@ -46,7 +46,7 @@ contract StandardToken is ERC20, BasicToken { ...@@ -46,7 +46,7 @@ contract StandardToken is ERC20, BasicToken {
*/ */
function approve(address _spender, uint256 _value) public returns (bool) { function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value; allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value); emit Approval(msg.sender, _spender, _value);
return true; return true;
} }
...@@ -72,7 +72,7 @@ contract StandardToken is ERC20, BasicToken { ...@@ -72,7 +72,7 @@ contract StandardToken is ERC20, BasicToken {
*/ */
function increaseApproval(address _spender, uint _addedValue) public returns (bool) { function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); 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; return true;
} }
...@@ -93,7 +93,7 @@ contract StandardToken is ERC20, BasicToken { ...@@ -93,7 +93,7 @@ contract StandardToken is ERC20, BasicToken {
} else { } else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); 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; return true;
} }
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./SafeERC20.sol"; import "./SafeERC20.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./ERC20Basic.sol"; import "./ERC20Basic.sol";
import "./SafeERC20.sol"; import "./SafeERC20.sol";
...@@ -72,7 +72,7 @@ contract TokenVesting is Ownable { ...@@ -72,7 +72,7 @@ contract TokenVesting is Ownable {
token.safeTransfer(beneficiary, unreleased); token.safeTransfer(beneficiary, unreleased);
Released(unreleased); emit Released(unreleased);
} }
/** /**
...@@ -93,7 +93,7 @@ contract TokenVesting is Ownable { ...@@ -93,7 +93,7 @@ contract TokenVesting is Ownable {
token.safeTransfer(owner, refund); token.safeTransfer(owner, refund);
Revoked(); emit Revoked();
} }
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./ERC721.sol"; import "./ERC721.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./ERC721Basic.sol"; import "./ERC721Basic.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./ERC721Basic.sol"; import "./ERC721Basic.sol";
import "./ERC721Receiver.sol"; import "./ERC721Receiver.sol";
...@@ -94,7 +94,7 @@ contract ERC721BasicToken is ERC721Basic { ...@@ -94,7 +94,7 @@ contract ERC721BasicToken is ERC721Basic {
if (getApproved(_tokenId) != address(0) || _to != address(0)) { if (getApproved(_tokenId) != address(0) || _to != address(0)) {
tokenApprovals[_tokenId] = _to; tokenApprovals[_tokenId] = _to;
Approval(owner, _to, _tokenId); emit Approval(owner, _to, _tokenId);
} }
} }
...@@ -116,7 +116,7 @@ contract ERC721BasicToken is ERC721Basic { ...@@ -116,7 +116,7 @@ contract ERC721BasicToken is ERC721Basic {
function setApprovalForAll(address _to, bool _approved) public { function setApprovalForAll(address _to, bool _approved) public {
require(_to != msg.sender); require(_to != msg.sender);
operatorApprovals[msg.sender][_to] = _approved; operatorApprovals[msg.sender][_to] = _approved;
ApprovalForAll(msg.sender, _to, _approved); emit ApprovalForAll(msg.sender, _to, _approved);
} }
/** /**
...@@ -145,7 +145,7 @@ contract ERC721BasicToken is ERC721Basic { ...@@ -145,7 +145,7 @@ contract ERC721BasicToken is ERC721Basic {
removeTokenFrom(_from, _tokenId); removeTokenFrom(_from, _tokenId);
addTokenTo(_to, _tokenId); addTokenTo(_to, _tokenId);
Transfer(_from, _to, _tokenId); emit Transfer(_from, _to, _tokenId);
} }
/** /**
...@@ -216,7 +216,7 @@ contract ERC721BasicToken is ERC721Basic { ...@@ -216,7 +216,7 @@ contract ERC721BasicToken is ERC721Basic {
function _mint(address _to, uint256 _tokenId) internal { function _mint(address _to, uint256 _tokenId) internal {
require(_to != address(0)); require(_to != address(0));
addTokenTo(_to, _tokenId); addTokenTo(_to, _tokenId);
Transfer(address(0), _to, _tokenId); emit Transfer(address(0), _to, _tokenId);
} }
/** /**
...@@ -227,7 +227,7 @@ contract ERC721BasicToken is ERC721Basic { ...@@ -227,7 +227,7 @@ contract ERC721BasicToken is ERC721Basic {
function _burn(address _owner, uint256 _tokenId) internal { function _burn(address _owner, uint256 _tokenId) internal {
clearApproval(_owner, _tokenId); clearApproval(_owner, _tokenId);
removeTokenFrom(_owner, _tokenId); removeTokenFrom(_owner, _tokenId);
Transfer(_owner, address(0), _tokenId); emit Transfer(_owner, address(0), _tokenId);
} }
/** /**
...@@ -240,7 +240,7 @@ contract ERC721BasicToken is ERC721Basic { ...@@ -240,7 +240,7 @@ contract ERC721BasicToken is ERC721Basic {
require(ownerOf(_tokenId) == _owner); require(ownerOf(_tokenId) == _owner);
if (tokenApprovals[_tokenId] != address(0)) { if (tokenApprovals[_tokenId] != address(0)) {
tokenApprovals[_tokenId] = address(0); tokenApprovals[_tokenId] = address(0);
Approval(_owner, address(0), _tokenId); emit Approval(_owner, address(0), _tokenId);
} }
} }
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
import "./ERC721Receiver.sol"; import "./ERC721Receiver.sol";
......
pragma solidity ^0.4.18; pragma solidity ^0.4.21;
/** /**
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment