diff options
Diffstat (limited to 'test/compilationTests')
58 files changed, 161 insertions, 161 deletions
diff --git a/test/compilationTests/MultiSigWallet/Factory.sol b/test/compilationTests/MultiSigWallet/Factory.sol index f1be6884..f7a96cbd 100644 --- a/test/compilationTests/MultiSigWallet/Factory.sol +++ b/test/compilationTests/MultiSigWallet/Factory.sol @@ -23,6 +23,6 @@ contract Factory { { isInstantiation[instantiation] = true; instantiations[msg.sender].push(instantiation); - ContractInstantiation(msg.sender, instantiation); + emit ContractInstantiation(msg.sender, instantiation); } } diff --git a/test/compilationTests/MultiSigWallet/MultiSigWallet.sol b/test/compilationTests/MultiSigWallet/MultiSigWallet.sol index 48b75230..78e18f3c 100644 --- a/test/compilationTests/MultiSigWallet/MultiSigWallet.sol +++ b/test/compilationTests/MultiSigWallet/MultiSigWallet.sol @@ -93,7 +93,7 @@ contract MultiSigWallet { payable { if (msg.value > 0) - Deposit(msg.sender, msg.value); + emit Deposit(msg.sender, msg.value); } /* @@ -102,7 +102,7 @@ contract MultiSigWallet { /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. - function MultiSigWallet(address[] _owners, uint _required) + constructor(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { @@ -126,7 +126,7 @@ contract MultiSigWallet { { isOwner[owner] = true; owners.push(owner); - OwnerAddition(owner); + emit OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. @@ -145,7 +145,7 @@ contract MultiSigWallet { owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); - OwnerRemoval(owner); + emit OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. @@ -164,8 +164,8 @@ contract MultiSigWallet { } isOwner[owner] = false; isOwner[newOwner] = true; - OwnerRemoval(owner); - OwnerAddition(newOwner); + emit OwnerRemoval(owner); + emit OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. @@ -176,7 +176,7 @@ contract MultiSigWallet { validRequirement(owners.length, _required) { required = _required; - RequirementChange(_required); + emit RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. @@ -201,7 +201,7 @@ contract MultiSigWallet { notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; - Confirmation(msg.sender, transactionId); + emit Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } @@ -214,7 +214,7 @@ contract MultiSigWallet { notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; - Revocation(msg.sender, transactionId); + emit Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. @@ -227,9 +227,9 @@ contract MultiSigWallet { Transaction tx = transactions[transactionId]; tx.executed = true; if (tx.destination.call.value(tx.value)(tx.data)) - Execution(transactionId); + emit Execution(transactionId); else { - ExecutionFailure(transactionId); + emit ExecutionFailure(transactionId); tx.executed = false; } } @@ -273,7 +273,7 @@ contract MultiSigWallet { executed: false }); transactionCount += 1; - Submission(transactionId); + emit Submission(transactionId); } /* diff --git a/test/compilationTests/MultiSigWallet/MultiSigWalletWithDailyLimit.sol b/test/compilationTests/MultiSigWallet/MultiSigWalletWithDailyLimit.sol index 024d3ef4..0ca9fa54 100644 --- a/test/compilationTests/MultiSigWallet/MultiSigWalletWithDailyLimit.sol +++ b/test/compilationTests/MultiSigWallet/MultiSigWalletWithDailyLimit.sol @@ -19,7 +19,7 @@ contract MultiSigWalletWithDailyLimit is MultiSigWallet { /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. - function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit) + constructor(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required) { @@ -33,7 +33,7 @@ contract MultiSigWalletWithDailyLimit is MultiSigWallet { onlyWallet { dailyLimit = _dailyLimit; - DailyLimitChange(_dailyLimit); + emit DailyLimitChange(_dailyLimit); } /// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached. @@ -49,9 +49,9 @@ contract MultiSigWalletWithDailyLimit is MultiSigWallet { if (!confirmed) spentToday += tx.value; if (tx.destination.call.value(tx.value)(tx.data)) - Execution(transactionId); + emit Execution(transactionId); else { - ExecutionFailure(transactionId); + emit ExecutionFailure(transactionId); tx.executed = false; if (!confirmed) spentToday -= tx.value; diff --git a/test/compilationTests/MultiSigWallet/TestToken.sol b/test/compilationTests/MultiSigWallet/TestToken.sol index 0f6cd20e..69727cbd 100644 --- a/test/compilationTests/MultiSigWallet/TestToken.sol +++ b/test/compilationTests/MultiSigWallet/TestToken.sol @@ -31,7 +31,7 @@ contract TestToken { } balances[msg.sender] -= _value; balances[_to] += _value; - Transfer(msg.sender, _to, _value); + emit Transfer(msg.sender, _to, _value); return true; } @@ -45,7 +45,7 @@ contract TestToken { balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; - Transfer(_from, _to, _value); + emit Transfer(_from, _to, _value); return true; } @@ -54,7 +54,7 @@ contract TestToken { returns (bool success) { allowed[msg.sender][_spender] = _value; - Approval(msg.sender, _spender, _value); + emit Approval(msg.sender, _spender, _value); return true; } diff --git a/test/compilationTests/corion/ico.sol b/test/compilationTests/corion/ico.sol index 13f8ab01..cb437624 100644 --- a/test/compilationTests/corion/ico.sol +++ b/test/compilationTests/corion/ico.sol @@ -50,7 +50,7 @@ contract ico is safeMath { uint256 public totalMint; uint256 public totalPremiumMint; - function ico(address foundation, address priceSet, uint256 exchangeRate, uint256 startBlockNum, address[] genesisAddr, uint256[] genesisValue) { + constructor(address foundation, address priceSet, uint256 exchangeRate, uint256 startBlockNum, address[] genesisAddr, uint256[] genesisValue) { /* Installation function. @@ -337,7 +337,7 @@ contract ico is safeMath { token(tokenAddr).mint(affilateAddress, extra); } checkPremium(beneficiaryAddress); - EICO(beneficiaryAddress, _reward, affilateAddress, extra); + emit EICO(beneficiaryAddress, _reward, affilateAddress, extra); return true; } diff --git a/test/compilationTests/corion/moduleHandler.sol b/test/compilationTests/corion/moduleHandler.sol index a2880f56..e77d9e09 100644 --- a/test/compilationTests/corion/moduleHandler.sol +++ b/test/compilationTests/corion/moduleHandler.sol @@ -35,8 +35,8 @@ contract moduleHandler is multiOwner, announcementTypes { address public foundationAddress; uint256 debugModeUntil = block.number + 1000000; - function moduleHandler(address[] newOwners) multiOwner(newOwners) {} + constructor(address[] newOwners) multiOwner(newOwners) {} function load(address foundation, bool forReplace, address Token, address Premium, address Publisher, address Schelling, address Provider) { /* Loading modulest to ModuleHandler. diff --git a/test/compilationTests/corion/multiOwner.sol b/test/compilationTests/corion/multiOwner.sol index 744874e9..2b8a46b9 100644 --- a/test/compilationTests/corion/multiOwner.sol +++ b/test/compilationTests/corion/multiOwner.sol @@ -12,7 +12,7 @@ contract multiOwner is safeMath { /* Constructor */ - function multiOwner(address[] newOwners) { + constructor(address[] newOwners) { for ( uint256 a=0 ; a<newOwners.length ; a++ ) { _addOwner(newOwners[a]); } diff --git a/test/compilationTests/corion/premium.sol b/test/compilationTests/corion/premium.sol index 843a2d16..5a80ecc6 100644 --- a/test/compilationTests/corion/premium.sol +++ b/test/compilationTests/corion/premium.sol @@ -40,7 +40,7 @@ contract premium is module, safeMath { mapping(address => bool) public genesis; - function premium(bool forReplace, address moduleHandler, address dbAddress, address icoContractAddr, address[] genesisAddr, uint256[] genesisValue) { + constructor(bool forReplace, address moduleHandler, address dbAddress, address icoContractAddr, address[] genesisAddr, uint256[] genesisValue) { /* Setup function. If an ICOaddress is defined then the balance of the genesis addresses will be set as well. @@ -63,7 +63,7 @@ contract premium is module, safeMath { for ( uint256 a=0 ; a<genesisAddr.length ; a++ ) { genesis[genesisAddr[a]] = true; require( db.increase(genesisAddr[a], genesisValue[a]) ); - Mint(genesisAddr[a], genesisValue[a]); + emit Mint(genesisAddr[a], genesisValue[a]); } } } @@ -137,7 +137,7 @@ contract premium is module, safeMath { require( msg.sender != spender ); require( db.balanceOf(msg.sender) >= amount ); require( db.setAllowance(msg.sender, spender, amount, nonce) ); - Approval(msg.sender, spender, amount); + emit Approval(msg.sender, spender, amount); } function allowance(address owner, address spender) constant returns (uint256 remaining, uint256 nonce) { @@ -178,7 +178,7 @@ contract premium is module, safeMath { } else { _transfer(msg.sender, to, amount); } - Transfer(msg.sender, to, amount, _data); + emit Transfer(msg.sender, to, amount, _data); return true; } @@ -207,7 +207,7 @@ contract premium is module, safeMath { _reamining = safeSub(_reamining, amount); _nonce = safeAdd(_nonce, 1); require( db.setAllowance(from, msg.sender, _reamining, _nonce) ); - AllowanceUsed(msg.sender, from, amount); + emit AllowanceUsed(msg.sender, from, amount); } bytes memory _data; if ( isContract(to) ) { @@ -215,7 +215,7 @@ contract premium is module, safeMath { } else { _transfer( from, to, amount); } - Transfer(from, to, amount, _data); + emit Transfer(from, to, amount, _data); return true; } @@ -242,7 +242,7 @@ contract premium is module, safeMath { } else { _transfer( msg.sender, to, amount); } - Transfer(msg.sender, to, amount, extraData); + emit Transfer(msg.sender, to, amount, extraData); return true; } @@ -301,7 +301,7 @@ contract premium is module, safeMath { @value Amount */ require( db.increase(owner, value) ); - Mint(owner, value); + emit Mint(owner, value); } function isContract(address addr) internal returns (bool success) { diff --git a/test/compilationTests/corion/provider.sol b/test/compilationTests/corion/provider.sol index b3b8169d..0c1f69e5 100644 --- a/test/compilationTests/corion/provider.sol +++ b/test/compilationTests/corion/provider.sol @@ -118,7 +118,7 @@ contract provider is module, safeMath, announcementTypes { uint256 private currentSchellingRound = 1; - function provider(address _moduleHandler) { + constructor(address _moduleHandler) { /* Install function. @@ -268,7 +268,7 @@ contract provider is module, safeMath, announcementTypes { } else { delete providers[msg.sender].data[currHeight].supply[currentSchellingRound]; } - EProviderOpen(msg.sender, currHeight); + emit EProviderOpen(msg.sender, currHeight); } function setProviderDetails(address addr, string website, string country, string info, uint8 rate, address admin) isReady external { /* @@ -297,7 +297,7 @@ contract provider is module, safeMath, announcementTypes { providers[addr].data[currHeight].country = country; providers[addr].data[currHeight].info = info; providers[addr].data[currHeight].currentRate = rate; - EProviderDetailsChanged(addr, currHeight, website, country, info, rate, admin); + emit EProviderDetailsChanged(addr, currHeight, website, country, info, rate, admin); } function getProviderInfo(address addr, uint256 height) public constant returns (string name, string website, string country, string info, uint256 create) { /* @@ -367,7 +367,7 @@ contract provider is module, safeMath, announcementTypes { providers[msg.sender].data[currHeight].valid = false; providers[msg.sender].data[currHeight].close = currentSchellingRound; setRightForInterest(getProviderCurrentSupply(msg.sender), 0, providers[msg.sender].data[currHeight].priv); - EProviderClose(msg.sender, currHeight); + emit EProviderClose(msg.sender, currHeight); } function allowUsers(address provider, address[] addr) isReady external { /* @@ -437,7 +437,7 @@ contract provider is module, safeMath, announcementTypes { clients[msg.sender].paidUpTo = currentSchellingRound; clients[msg.sender].lastRate = providers[provider].data[currHeight].currentRate; clients[msg.sender].providerConnected = now; - ENewClient(msg.sender, provider, currHeight, bal); + emit ENewClient(msg.sender, provider, currHeight, bal); } function partProvider() isReady external { /* @@ -467,7 +467,7 @@ contract provider is module, safeMath, announcementTypes { delete clients[msg.sender].paidUpTo; delete clients[msg.sender].lastRate; delete clients[msg.sender].providerConnected; - EClientLost(msg.sender, provider, currHeight, bal); + emit EClientLost(msg.sender, provider, currHeight, bal); } function checkReward(address addr) public constant returns (uint256 reward) { /* @@ -522,7 +522,7 @@ contract provider is module, safeMath, announcementTypes { if ( providerReward > 0 ) { require( moduleHandler(moduleHandlerAddress).transfer(address(this), provider, providerReward, false) ); } - EReward(msg.sender, provider, clientReward, providerReward); + emit EReward(msg.sender, provider, clientReward, providerReward); } function getClientReward(uint256 limit) internal returns (uint256 reward) { /* diff --git a/test/compilationTests/corion/publisher.sol b/test/compilationTests/corion/publisher.sol index 98d5af2a..0e8f825f 100644 --- a/test/compilationTests/corion/publisher.sol +++ b/test/compilationTests/corion/publisher.sol @@ -61,7 +61,7 @@ contract publisher is announcementTypes, module, safeMath { mapping (address => uint256[]) public opponents;
- function publisher(address moduleHandler) {
+ constructor(address moduleHandler) {
/*
Installation function. The installer will be registered in the admin list automatically
@@ -148,7 +148,7 @@ contract publisher is announcementTypes, module, safeMath { announcements[announcementsLength]._str = _str;
announcements[announcementsLength]._uint = _uint;
announcements[announcementsLength]._addr = _addr;
- ENewAnnouncement(announcementsLength, Type);
+ emit ENewAnnouncement(announcementsLength, Type);
}
function closeAnnouncement(uint256 id) onlyOwner external {
@@ -238,7 +238,7 @@ contract publisher is announcementTypes, module, safeMath { opponents[msg.sender].push(id);
}
announcements[id].oppositionWeight += _balance;
- EOppositeAnnouncement(id, msg.sender, _balance);
+ emit EOppositeAnnouncement(id, msg.sender, _balance);
}
function invalidateAnnouncement(uint256 id) onlyOwner external {
@@ -250,7 +250,7 @@ contract publisher is announcementTypes, module, safeMath { require( announcements[id].open );
announcements[id].end = block.number;
announcements[id].open = false;
- EInvalidateAnnouncement(id);
+ emit EInvalidateAnnouncement(id);
}
modifier onlyOwner() {
diff --git a/test/compilationTests/corion/schelling.sol b/test/compilationTests/corion/schelling.sol index 519d92b4..f8c36fc5 100644 --- a/test/compilationTests/corion/schelling.sol +++ b/test/compilationTests/corion/schelling.sol @@ -45,7 +45,7 @@ contract schellingDB is safeMath, schellingVars { /* Constructor */ - function schellingDB() { + constructor() { rounds.length = 2; rounds[0].blockHeight = block.number; currentSchellingRound = 1; @@ -247,7 +247,7 @@ contract schelling is module, announcementTypes, schellingVars { bytes1 public belowChar = 0x30; schellingDB private db; - function schelling(address _moduleHandler, address _db, bool _forReplace) { + constructor(address _moduleHandler, address _db, bool _forReplace) { /* Installation function. diff --git a/test/compilationTests/corion/token.sol b/test/compilationTests/corion/token.sol index 468e3e79..0709baca 100644 --- a/test/compilationTests/corion/token.sol +++ b/test/compilationTests/corion/token.sol @@ -48,7 +48,7 @@ contract token is safeMath, module, announcementTypes { mapping(address => bool) public genesis; - function token(bool forReplace, address moduleHandler, address dbAddr, address icoContractAddr, address exchangeContractAddress, address[] genesisAddr, uint256[] genesisValue) payable { + constructor(bool forReplace, address moduleHandler, address dbAddr, address icoContractAddr, address exchangeContractAddress, address[] genesisAddr, uint256[] genesisValue) payable { /* Installation function @@ -78,7 +78,7 @@ contract token is safeMath, module, announcementTypes { genesis[genesisAddr[a]] = true; require( db.increase(genesisAddr[a], genesisValue[a]) ); if ( ! genesisAddr[a].send(0.2 ether) ) {} - Mint(genesisAddr[a], genesisValue[a]); + emit Mint(genesisAddr[a], genesisValue[a]); } } } @@ -152,7 +152,7 @@ contract token is safeMath, module, announcementTypes { require( msg.sender != spender ); require( db.balanceOf(msg.sender) >= amount ); require( db.setAllowance(msg.sender, spender, amount, nonce) ); - Approval(msg.sender, spender, amount); + emit Approval(msg.sender, spender, amount); } function allowance(address owner, address spender) constant returns (uint256 remaining, uint256 nonce) { @@ -193,7 +193,7 @@ contract token is safeMath, module, announcementTypes { } else { _transfer( msg.sender, to, amount, true); } - Transfer(msg.sender, to, amount, _data); + emit Transfer(msg.sender, to, amount, _data); return true; } @@ -222,7 +222,7 @@ contract token is safeMath, module, announcementTypes { _reamining = safeSub(_reamining, amount); _nonce = safeAdd(_nonce, 1); require( db.setAllowance(from, msg.sender, _reamining, _nonce) ); - AllowanceUsed(msg.sender, from, amount); + emit AllowanceUsed(msg.sender, from, amount); } bytes memory _data; if ( isContract(to) ) { @@ -230,7 +230,7 @@ contract token is safeMath, module, announcementTypes { } else { _transfer( from, to, amount, true); } - Transfer(from, to, amount, _data); + emit Transfer(from, to, amount, _data); return true; } @@ -256,7 +256,7 @@ contract token is safeMath, module, announcementTypes { bytes memory _data; require( super.isModuleHandler(msg.sender) ); _transfer( from, to, amount, fee); - Transfer(from, to, amount, _data); + emit Transfer(from, to, amount, _data); return true; } @@ -284,7 +284,7 @@ contract token is safeMath, module, announcementTypes { } else { _transfer( msg.sender, to, amount, true); } - Transfer(msg.sender, to, amount, extraData); + emit Transfer(msg.sender, to, amount, extraData); return true; } @@ -379,7 +379,7 @@ contract token is safeMath, module, announcementTypes { require( db.increase(_schellingAddr, _forSchelling) ); _burn(owner, _forBurn); bytes memory _data; - Transfer(owner, _schellingAddr, _forSchelling, _data); + emit Transfer(owner, _schellingAddr, _forSchelling, _data); require( moduleHandler(moduleHandlerAddress).broadcastTransfer(owner, _schellingAddr, _forSchelling) ); } else { _burn(owner, _fee); @@ -428,7 +428,7 @@ contract token is safeMath, module, announcementTypes { if ( isICO ) { require( ico(icoAddr).setInterestDB(owner, db.balanceOf(owner)) ); } - Mint(owner, value); + emit Mint(owner, value); } function burn(address owner, uint256 value) isReady external returns (bool success) { @@ -454,7 +454,7 @@ contract token is safeMath, module, announcementTypes { */ require( db.decrease(owner, value) ); require( moduleHandler(moduleHandlerAddress).broadcastTransfer(owner, address(0x00), value) ); - Burn(owner, value); + emit Burn(owner, value); } function isContract(address addr) internal returns (bool success) { diff --git a/test/compilationTests/gnosis/Events/CategoricalEvent.sol b/test/compilationTests/gnosis/Events/CategoricalEvent.sol index be2c81a7..0f5196e8 100644 --- a/test/compilationTests/gnosis/Events/CategoricalEvent.sol +++ b/test/compilationTests/gnosis/Events/CategoricalEvent.sol @@ -13,7 +13,7 @@ contract CategoricalEvent is Event { /// @param _collateralToken Tokens used as collateral in exchange for outcome tokens /// @param _oracle Oracle contract used to resolve the event /// @param outcomeCount Number of event outcomes - function CategoricalEvent( + constructor( Token _collateralToken, Oracle _oracle, uint8 outcomeCount @@ -38,7 +38,7 @@ contract CategoricalEvent is Event { outcomeTokens[uint(outcome)].revoke(msg.sender, winnings); // Payout winnings require(collateralToken.transfer(msg.sender, winnings)); - WinningsRedemption(msg.sender, winnings); + emit WinningsRedemption(msg.sender, winnings); } /// @dev Calculates and returns event hash diff --git a/test/compilationTests/gnosis/Events/Event.sol b/test/compilationTests/gnosis/Events/Event.sol index cb991447..a6edb778 100644 --- a/test/compilationTests/gnosis/Events/Event.sol +++ b/test/compilationTests/gnosis/Events/Event.sol @@ -33,7 +33,7 @@ contract Event { /// @param _collateralToken Tokens used as collateral in exchange for outcome tokens /// @param _oracle Oracle contract used to resolve the event /// @param outcomeCount Number of event outcomes - function Event(Token _collateralToken, Oracle _oracle, uint8 outcomeCount) + constructor(Token _collateralToken, Oracle _oracle, uint8 outcomeCount) public { // Validate input @@ -44,7 +44,7 @@ contract Event { for (uint8 i = 0; i < outcomeCount; i++) { OutcomeToken outcomeToken = new OutcomeToken(); outcomeTokens.push(outcomeToken); - OutcomeTokenCreation(outcomeToken, i); + emit OutcomeTokenCreation(outcomeToken, i); } } @@ -58,7 +58,7 @@ contract Event { // Issue new outcome tokens to sender for (uint8 i = 0; i < outcomeTokens.length; i++) outcomeTokens[i].issue(msg.sender, collateralTokenCount); - OutcomeTokenSetIssuance(msg.sender, collateralTokenCount); + emit OutcomeTokenSetIssuance(msg.sender, collateralTokenCount); } /// @dev Sells equal number of tokens of all outcomes, exchanging collateral tokens and sets of outcome tokens 1:1 @@ -71,7 +71,7 @@ contract Event { outcomeTokens[i].revoke(msg.sender, outcomeTokenCount); // Transfer collateral tokens to sender require(collateralToken.transfer(msg.sender, outcomeTokenCount)); - OutcomeTokenSetRevocation(msg.sender, outcomeTokenCount); + emit OutcomeTokenSetRevocation(msg.sender, outcomeTokenCount); } /// @dev Sets winning event outcome @@ -83,7 +83,7 @@ contract Event { // Set winning outcome outcome = oracle.getOutcome(); isOutcomeSet = true; - OutcomeAssignment(outcome); + emit OutcomeAssignment(outcome); } /// @dev Returns outcome count diff --git a/test/compilationTests/gnosis/Events/EventFactory.sol b/test/compilationTests/gnosis/Events/EventFactory.sol index 5ef08544..cfe772ec 100644 --- a/test/compilationTests/gnosis/Events/EventFactory.sol +++ b/test/compilationTests/gnosis/Events/EventFactory.sol @@ -45,7 +45,7 @@ contract EventFactory { outcomeCount ); categoricalEvents[eventHash] = eventContract; - CategoricalEventCreation(msg.sender, eventContract, collateralToken, oracle, outcomeCount); + emit CategoricalEventCreation(msg.sender, eventContract, collateralToken, oracle, outcomeCount); } /// @dev Creates a new scalar event and adds it to the event mapping @@ -74,6 +74,6 @@ contract EventFactory { upperBound ); scalarEvents[eventHash] = eventContract; - ScalarEventCreation(msg.sender, eventContract, collateralToken, oracle, lowerBound, upperBound); + emit ScalarEventCreation(msg.sender, eventContract, collateralToken, oracle, lowerBound, upperBound); } } diff --git a/test/compilationTests/gnosis/Events/ScalarEvent.sol b/test/compilationTests/gnosis/Events/ScalarEvent.sol index e84bf324..d5cbef14 100644 --- a/test/compilationTests/gnosis/Events/ScalarEvent.sol +++ b/test/compilationTests/gnosis/Events/ScalarEvent.sol @@ -28,7 +28,7 @@ contract ScalarEvent is Event { /// @param _oracle Oracle contract used to resolve the event /// @param _lowerBound Lower bound for event outcome /// @param _upperBound Lower bound for event outcome - function ScalarEvent( + constructor( Token _collateralToken, Oracle _oracle, int _lowerBound, @@ -72,7 +72,7 @@ contract ScalarEvent is Event { outcomeTokens[LONG].revoke(msg.sender, longOutcomeTokenCount); // Payout winnings to sender require(collateralToken.transfer(msg.sender, winnings)); - WinningsRedemption(msg.sender, winnings); + emit WinningsRedemption(msg.sender, winnings); } /// @dev Calculates and returns event hash diff --git a/test/compilationTests/gnosis/Markets/Campaign.sol b/test/compilationTests/gnosis/Markets/Campaign.sol index 15d7010a..f99ede53 100644 --- a/test/compilationTests/gnosis/Markets/Campaign.sol +++ b/test/compilationTests/gnosis/Markets/Campaign.sol @@ -70,7 +70,7 @@ contract Campaign { /// @param _fee Market fee /// @param _funding Initial funding for market /// @param _deadline Campaign deadline - function Campaign( + constructor( Event _eventContract, MarketFactory _marketFactory, MarketMaker _marketMaker, @@ -111,7 +111,7 @@ contract Campaign { contributions[msg.sender] = contributions[msg.sender].add(amount); if (amount == maxAmount) stage = Stages.AuctionSuccessful; - CampaignFunding(msg.sender, amount); + emit CampaignFunding(msg.sender, amount); } /// @dev Withdraws refund amount @@ -126,7 +126,7 @@ contract Campaign { contributions[msg.sender] = 0; // Refund collateral tokens require(eventContract.collateralToken().transfer(msg.sender, refundAmount)); - CampaignRefund(msg.sender, refundAmount); + emit CampaignRefund(msg.sender, refundAmount); } /// @dev Allows to create market after successful funding @@ -141,7 +141,7 @@ contract Campaign { require(eventContract.collateralToken().approve(market, funding)); market.fund(funding); stage = Stages.MarketCreated; - MarketCreation(market); + emit MarketCreation(market); return market; } @@ -158,7 +158,7 @@ contract Campaign { eventContract.redeemWinnings(); finalBalance = eventContract.collateralToken().balanceOf(this); stage = Stages.MarketClosed; - MarketClosing(); + emit MarketClosing(); } /// @dev Allows to withdraw fees from campaign contract to contributor @@ -172,6 +172,6 @@ contract Campaign { contributions[msg.sender] = 0; // Send fee share to contributor require(eventContract.collateralToken().transfer(msg.sender, fees)); - FeeWithdrawal(msg.sender, fees); + emit FeeWithdrawal(msg.sender, fees); } } diff --git a/test/compilationTests/gnosis/Markets/CampaignFactory.sol b/test/compilationTests/gnosis/Markets/CampaignFactory.sol index 930ec2e2..d80d7d63 100644 --- a/test/compilationTests/gnosis/Markets/CampaignFactory.sol +++ b/test/compilationTests/gnosis/Markets/CampaignFactory.sol @@ -34,6 +34,6 @@ contract CampaignFactory { returns (Campaign campaign) { campaign = new Campaign(eventContract, marketFactory, marketMaker, fee, funding, deadline); - CampaignCreation(msg.sender, campaign, eventContract, marketFactory, marketMaker, fee, funding, deadline); + emit CampaignCreation(msg.sender, campaign, eventContract, marketFactory, marketMaker, fee, funding, deadline); } } diff --git a/test/compilationTests/gnosis/Markets/StandardMarket.sol b/test/compilationTests/gnosis/Markets/StandardMarket.sol index 4273655a..84f30386 100644 --- a/test/compilationTests/gnosis/Markets/StandardMarket.sol +++ b/test/compilationTests/gnosis/Markets/StandardMarket.sol @@ -38,7 +38,7 @@ contract StandardMarket is Market { /// @param _eventContract Event contract /// @param _marketMaker Market maker contract /// @param _fee Market fee - function StandardMarket(address _creator, Event _eventContract, MarketMaker _marketMaker, uint24 _fee) + constructor(address _creator, Event _eventContract, MarketMaker _marketMaker, uint24 _fee) public { // Validate inputs @@ -65,7 +65,7 @@ contract StandardMarket is Market { eventContract.buyAllOutcomes(_funding); funding = _funding; stage = Stages.MarketFunded; - MarketFunding(funding); + emit MarketFunding(funding); } /// @dev Allows market creator to close the markets by transferring all remaining outcome tokens to the creator @@ -78,7 +78,7 @@ contract StandardMarket is Market { for (uint8 i = 0; i < outcomeCount; i++) require(eventContract.outcomeTokens(i).transfer(creator, eventContract.outcomeTokens(i).balanceOf(this))); stage = Stages.MarketClosed; - MarketClosing(); + emit MarketClosing(); } /// @dev Allows market creator to withdraw fees generated by trades @@ -91,7 +91,7 @@ contract StandardMarket is Market { fees = eventContract.collateralToken().balanceOf(this); // Transfer fees require(eventContract.collateralToken().transfer(creator, fees)); - FeeWithdrawal(fees); + emit FeeWithdrawal(fees); } /// @dev Allows to buy outcome tokens from market maker @@ -121,7 +121,7 @@ contract StandardMarket is Market { // Add outcome token count to market maker net balance require(int(outcomeTokenCount) >= 0); netOutcomeTokensSold[outcomeTokenIndex] = netOutcomeTokensSold[outcomeTokenIndex].add(int(outcomeTokenCount)); - OutcomeTokenPurchase(msg.sender, outcomeTokenIndex, outcomeTokenCount, cost); + emit OutcomeTokenPurchase(msg.sender, outcomeTokenIndex, outcomeTokenCount, cost); } /// @dev Allows to sell outcome tokens to market maker @@ -150,7 +150,7 @@ contract StandardMarket is Market { // Subtract outcome token count from market maker net balance require(int(outcomeTokenCount) >= 0); netOutcomeTokensSold[outcomeTokenIndex] = netOutcomeTokensSold[outcomeTokenIndex].sub(int(outcomeTokenCount)); - OutcomeTokenSale(msg.sender, outcomeTokenIndex, outcomeTokenCount, profit); + emit OutcomeTokenSale(msg.sender, outcomeTokenIndex, outcomeTokenCount, profit); } /// @dev Buys all outcomes, then sells all shares of selected outcome which were bought, keeping @@ -178,7 +178,7 @@ contract StandardMarket is Market { require(eventContract.outcomeTokens(i).transfer(msg.sender, outcomeTokenCount)); // Send change back to buyer require(eventContract.collateralToken().transfer(msg.sender, profit)); - OutcomeTokenShortSale(msg.sender, outcomeTokenIndex, outcomeTokenCount, cost); + emit OutcomeTokenShortSale(msg.sender, outcomeTokenIndex, outcomeTokenCount, cost); } /// @dev Calculates fee to be paid to market maker diff --git a/test/compilationTests/gnosis/Markets/StandardMarketFactory.sol b/test/compilationTests/gnosis/Markets/StandardMarketFactory.sol index 101c37a2..88dcbe79 100644 --- a/test/compilationTests/gnosis/Markets/StandardMarketFactory.sol +++ b/test/compilationTests/gnosis/Markets/StandardMarketFactory.sol @@ -20,6 +20,6 @@ contract StandardMarketFactory is MarketFactory { returns (Market market) { market = new StandardMarket(msg.sender, eventContract, marketMaker, fee); - MarketCreation(msg.sender, market, eventContract, marketMaker, fee); + emit MarketCreation(msg.sender, market, eventContract, marketMaker, fee); } } diff --git a/test/compilationTests/gnosis/Migrations.sol b/test/compilationTests/gnosis/Migrations.sol index 7e7fe8d4..c7d09bd2 100644 --- a/test/compilationTests/gnosis/Migrations.sol +++ b/test/compilationTests/gnosis/Migrations.sol @@ -8,7 +8,7 @@ contract Migrations { if (msg.sender == owner) _; } - function Migrations() { + constructor() { owner = msg.sender; } diff --git a/test/compilationTests/gnosis/Oracles/CentralizedOracle.sol b/test/compilationTests/gnosis/Oracles/CentralizedOracle.sol index 26acf526..362c514c 100644 --- a/test/compilationTests/gnosis/Oracles/CentralizedOracle.sol +++ b/test/compilationTests/gnosis/Oracles/CentralizedOracle.sol @@ -34,7 +34,7 @@ contract CentralizedOracle is Oracle { */ /// @dev Constructor sets owner address and IPFS hash /// @param _ipfsHash Hash identifying off chain event description - function CentralizedOracle(address _owner, bytes _ipfsHash) + constructor(address _owner, bytes _ipfsHash) public { // Description hash cannot be null @@ -52,7 +52,7 @@ contract CentralizedOracle is Oracle { // Result is not set yet require(!isSet); owner = newOwner; - OwnerReplacement(newOwner); + emit OwnerReplacement(newOwner); } /// @dev Sets event outcome @@ -65,7 +65,7 @@ contract CentralizedOracle is Oracle { require(!isSet); isSet = true; outcome = _outcome; - OutcomeAssignment(_outcome); + emit OutcomeAssignment(_outcome); } /// @dev Returns if winning outcome is set diff --git a/test/compilationTests/gnosis/Oracles/CentralizedOracleFactory.sol b/test/compilationTests/gnosis/Oracles/CentralizedOracleFactory.sol index 62a12cf4..ca4e37d2 100644 --- a/test/compilationTests/gnosis/Oracles/CentralizedOracleFactory.sol +++ b/test/compilationTests/gnosis/Oracles/CentralizedOracleFactory.sol @@ -22,6 +22,6 @@ contract CentralizedOracleFactory { returns (CentralizedOracle centralizedOracle) { centralizedOracle = new CentralizedOracle(msg.sender, ipfsHash); - CentralizedOracleCreation(msg.sender, centralizedOracle, ipfsHash); + emit CentralizedOracleCreation(msg.sender, centralizedOracle, ipfsHash); } } diff --git a/test/compilationTests/gnosis/Oracles/DifficultyOracle.sol b/test/compilationTests/gnosis/Oracles/DifficultyOracle.sol index 87351dfa..94fc70ca 100644 --- a/test/compilationTests/gnosis/Oracles/DifficultyOracle.sol +++ b/test/compilationTests/gnosis/Oracles/DifficultyOracle.sol @@ -22,7 +22,7 @@ contract DifficultyOracle is Oracle { */ /// @dev Contract constructor validates and sets target block number /// @param _blockNumber Target block number - function DifficultyOracle(uint _blockNumber) + constructor(uint _blockNumber) public { // Block has to be in the future @@ -37,7 +37,7 @@ contract DifficultyOracle is Oracle { // Block number was reached and outcome was not set yet require(block.number >= blockNumber && difficulty == 0); difficulty = block.difficulty; - OutcomeAssignment(difficulty); + emit OutcomeAssignment(difficulty); } /// @dev Returns if difficulty is set diff --git a/test/compilationTests/gnosis/Oracles/DifficultyOracleFactory.sol b/test/compilationTests/gnosis/Oracles/DifficultyOracleFactory.sol index 2e97362c..fc5dcc3b 100644 --- a/test/compilationTests/gnosis/Oracles/DifficultyOracleFactory.sol +++ b/test/compilationTests/gnosis/Oracles/DifficultyOracleFactory.sol @@ -22,6 +22,6 @@ contract DifficultyOracleFactory { returns (DifficultyOracle difficultyOracle) { difficultyOracle = new DifficultyOracle(blockNumber); - DifficultyOracleCreation(msg.sender, difficultyOracle, blockNumber); + emit DifficultyOracleCreation(msg.sender, difficultyOracle, blockNumber); } } diff --git a/test/compilationTests/gnosis/Oracles/FutarchyOracle.sol b/test/compilationTests/gnosis/Oracles/FutarchyOracle.sol index 524103d8..7105f247 100644 --- a/test/compilationTests/gnosis/Oracles/FutarchyOracle.sol +++ b/test/compilationTests/gnosis/Oracles/FutarchyOracle.sol @@ -55,7 +55,7 @@ contract FutarchyOracle is Oracle { /// @param marketMaker Market maker contract /// @param fee Market fee /// @param _deadline Decision deadline - function FutarchyOracle( + constructor( address _creator, EventFactory eventFactory, Token collateralToken, @@ -105,7 +105,7 @@ contract FutarchyOracle is Oracle { require(market.eventContract().collateralToken().approve(market, funding)); market.fund(funding); } - FutarchyFunding(funding); + emit FutarchyFunding(funding); } /// @dev Closes market for winning outcome and redeems winnings and sends all collateral tokens to creator @@ -123,7 +123,7 @@ contract FutarchyOracle is Oracle { // Redeem collateral token for winning outcome tokens and transfer collateral tokens to creator categoricalEvent.redeemWinnings(); require(categoricalEvent.collateralToken().transfer(creator, categoricalEvent.collateralToken().balanceOf(this))); - FutarchyClosing(); + emit FutarchyClosing(); } /// @dev Allows to set the oracle outcome based on the market with largest long position @@ -144,7 +144,7 @@ contract FutarchyOracle is Oracle { } winningMarketIndex = highestIndex; isSet = true; - OutcomeAssignment(winningMarketIndex); + emit OutcomeAssignment(winningMarketIndex); } /// @dev Returns if winning outcome is set diff --git a/test/compilationTests/gnosis/Oracles/FutarchyOracleFactory.sol b/test/compilationTests/gnosis/Oracles/FutarchyOracleFactory.sol index dbb0a487..3c6e5c15 100644 --- a/test/compilationTests/gnosis/Oracles/FutarchyOracleFactory.sol +++ b/test/compilationTests/gnosis/Oracles/FutarchyOracleFactory.sol @@ -33,7 +33,7 @@ contract FutarchyOracleFactory { */ /// @dev Constructor sets event factory contract /// @param _eventFactory Event factory contract - function FutarchyOracleFactory(EventFactory _eventFactory) + constructor(EventFactory _eventFactory) public { require(address(_eventFactory) != address(0)); @@ -78,7 +78,7 @@ contract FutarchyOracleFactory { fee, deadline ); - FutarchyOracleCreation( + emit FutarchyOracleCreation( msg.sender, futarchyOracle, collateralToken, diff --git a/test/compilationTests/gnosis/Oracles/MajorityOracle.sol b/test/compilationTests/gnosis/Oracles/MajorityOracle.sol index 5c0ab103..24cf9dea 100644 --- a/test/compilationTests/gnosis/Oracles/MajorityOracle.sol +++ b/test/compilationTests/gnosis/Oracles/MajorityOracle.sol @@ -16,7 +16,7 @@ contract MajorityOracle is Oracle { */ /// @dev Allows to create an oracle for a majority vote based on other oracles /// @param _oracles List of oracles taking part in the majority vote - function MajorityOracle(Oracle[] _oracles) + constructor(Oracle[] _oracles) public { // At least 2 oracles should be defined diff --git a/test/compilationTests/gnosis/Oracles/MajorityOracleFactory.sol b/test/compilationTests/gnosis/Oracles/MajorityOracleFactory.sol index 0024516a..3c02fef4 100644 --- a/test/compilationTests/gnosis/Oracles/MajorityOracleFactory.sol +++ b/test/compilationTests/gnosis/Oracles/MajorityOracleFactory.sol @@ -22,6 +22,6 @@ contract MajorityOracleFactory { returns (MajorityOracle majorityOracle) { majorityOracle = new MajorityOracle(oracles); - MajorityOracleCreation(msg.sender, majorityOracle, oracles); + emit MajorityOracleCreation(msg.sender, majorityOracle, oracles); } } diff --git a/test/compilationTests/gnosis/Oracles/SignedMessageOracle.sol b/test/compilationTests/gnosis/Oracles/SignedMessageOracle.sol index 2bbf312f..121824ff 100644 --- a/test/compilationTests/gnosis/Oracles/SignedMessageOracle.sol +++ b/test/compilationTests/gnosis/Oracles/SignedMessageOracle.sol @@ -38,7 +38,7 @@ contract SignedMessageOracle is Oracle { /// @param v Signature parameter /// @param r Signature parameter /// @param s Signature parameter - function SignedMessageOracle(bytes32 _descriptionHash, uint8 v, bytes32 r, bytes32 s) + constructor(bytes32 _descriptionHash, uint8 v, bytes32 r, bytes32 s) public { signer = ecrecover(_descriptionHash, v, r, s); @@ -61,7 +61,7 @@ contract SignedMessageOracle is Oracle { && signer == ecrecover(keccak256(abi.encodePacked(descriptionHash, newSigner, _nonce)), v, r, s)); nonce = _nonce; signer = newSigner; - SignerReplacement(newSigner); + emit SignerReplacement(newSigner); } /// @dev Sets outcome based on signed message @@ -77,7 +77,7 @@ contract SignedMessageOracle is Oracle { && signer == ecrecover(keccak256(abi.encodePacked(descriptionHash, _outcome)), v, r, s)); isSet = true; outcome = _outcome; - OutcomeAssignment(_outcome); + emit OutcomeAssignment(_outcome); } /// @dev Returns if winning outcome diff --git a/test/compilationTests/gnosis/Oracles/SignedMessageOracleFactory.sol b/test/compilationTests/gnosis/Oracles/SignedMessageOracleFactory.sol index 0884d8ca..ea70b2aa 100644 --- a/test/compilationTests/gnosis/Oracles/SignedMessageOracleFactory.sol +++ b/test/compilationTests/gnosis/Oracles/SignedMessageOracleFactory.sol @@ -26,6 +26,6 @@ contract SignedMessageOracleFactory { { signedMessageOracle = new SignedMessageOracle(descriptionHash, v, r, s); address oracle = ecrecover(descriptionHash, v, r, s); - SignedMessageOracleCreation(msg.sender, signedMessageOracle, oracle); + emit SignedMessageOracleCreation(msg.sender, signedMessageOracle, oracle); } } diff --git a/test/compilationTests/gnosis/Oracles/UltimateOracle.sol b/test/compilationTests/gnosis/Oracles/UltimateOracle.sol index 9ed61aef..dd66c9ab 100644 --- a/test/compilationTests/gnosis/Oracles/UltimateOracle.sol +++ b/test/compilationTests/gnosis/Oracles/UltimateOracle.sol @@ -46,7 +46,7 @@ contract UltimateOracle is Oracle { /// @param _challengePeriod Time to challenge oracle outcome /// @param _challengeAmount Amount to challenge the outcome /// @param _frontRunnerPeriod Time to overbid the front-runner - function UltimateOracle( + constructor( Oracle _forwardedOracle, Token _collateralToken, uint8 _spreadMultiplier, @@ -81,7 +81,7 @@ contract UltimateOracle is Oracle { && forwardedOracle.isOutcomeSet()); forwardedOutcome = forwardedOracle.getOutcome(); forwardedOutcomeSetTimestamp = now; - ForwardedOracleOutcomeAssignment(forwardedOutcome); + emit ForwardedOracleOutcomeAssignment(forwardedOutcome); } /// @dev Allows to challenge the oracle outcome @@ -98,7 +98,7 @@ contract UltimateOracle is Oracle { totalAmount = challengeAmount; frontRunner = _outcome; frontRunnerSetTimestamp = now; - OutcomeChallenge(msg.sender, _outcome); + emit OutcomeChallenge(msg.sender, _outcome); } /// @dev Allows to challenge the oracle outcome @@ -122,7 +122,7 @@ contract UltimateOracle is Oracle { frontRunner = _outcome; frontRunnerSetTimestamp = now; } - OutcomeVote(msg.sender, _outcome, amount); + emit OutcomeVote(msg.sender, _outcome, amount); } /// @dev Withdraws winnings for user @@ -137,7 +137,7 @@ contract UltimateOracle is Oracle { outcomeAmounts[msg.sender][frontRunner] = 0; // Transfer earnings to contributor require(collateralToken.transfer(msg.sender, amount)); - Withdrawal(msg.sender, amount); + emit Withdrawal(msg.sender, amount); } /// @dev Checks if time to challenge the outcome is over diff --git a/test/compilationTests/gnosis/Oracles/UltimateOracleFactory.sol b/test/compilationTests/gnosis/Oracles/UltimateOracleFactory.sol index 67f8a96e..51f5610e 100644 --- a/test/compilationTests/gnosis/Oracles/UltimateOracleFactory.sol +++ b/test/compilationTests/gnosis/Oracles/UltimateOracleFactory.sol @@ -50,7 +50,7 @@ contract UltimateOracleFactory { challengeAmount, frontRunnerPeriod ); - UltimateOracleCreation( + emit UltimateOracleCreation( msg.sender, ultimateOracle, oracle, diff --git a/test/compilationTests/gnosis/Tokens/EtherToken.sol b/test/compilationTests/gnosis/Tokens/EtherToken.sol index f6e73e5a..32e64583 100644 --- a/test/compilationTests/gnosis/Tokens/EtherToken.sol +++ b/test/compilationTests/gnosis/Tokens/EtherToken.sol @@ -30,7 +30,7 @@ contract EtherToken is StandardToken { { balances[msg.sender] = balances[msg.sender].add(msg.value); totalTokens = totalTokens.add(msg.value); - Deposit(msg.sender, msg.value); + emit Deposit(msg.sender, msg.value); } /// @dev Sells tokens in exchange for Ether, exchanging them 1:1 @@ -42,6 +42,6 @@ contract EtherToken is StandardToken { balances[msg.sender] = balances[msg.sender].sub(value); totalTokens = totalTokens.sub(value); msg.sender.transfer(value); - Withdrawal(msg.sender, value); + emit Withdrawal(msg.sender, value); } } diff --git a/test/compilationTests/gnosis/Tokens/OutcomeToken.sol b/test/compilationTests/gnosis/Tokens/OutcomeToken.sol index fd1fa590..0bc7307d 100644 --- a/test/compilationTests/gnosis/Tokens/OutcomeToken.sol +++ b/test/compilationTests/gnosis/Tokens/OutcomeToken.sol @@ -31,7 +31,7 @@ contract OutcomeToken is StandardToken { * Public functions */ /// @dev Constructor sets events contract address - function OutcomeToken() + constructor() public { eventContract = msg.sender; @@ -46,7 +46,7 @@ contract OutcomeToken is StandardToken { { balances[_for] = balances[_for].add(outcomeTokenCount); totalTokens = totalTokens.add(outcomeTokenCount); - Issuance(_for, outcomeTokenCount); + emit Issuance(_for, outcomeTokenCount); } /// @dev Events contract revokes tokens for address. Returns success @@ -58,6 +58,6 @@ contract OutcomeToken is StandardToken { { balances[_for] = balances[_for].sub(outcomeTokenCount); totalTokens = totalTokens.sub(outcomeTokenCount); - Revocation(_for, outcomeTokenCount); + emit Revocation(_for, outcomeTokenCount); } } diff --git a/test/compilationTests/gnosis/Tokens/StandardToken.sol b/test/compilationTests/gnosis/Tokens/StandardToken.sol index fc899ca6..b7d0d37a 100644 --- a/test/compilationTests/gnosis/Tokens/StandardToken.sol +++ b/test/compilationTests/gnosis/Tokens/StandardToken.sol @@ -30,7 +30,7 @@ contract StandardToken is Token { return false; balances[msg.sender] -= value; balances[to] += value; - Transfer(msg.sender, to, value); + emit Transfer(msg.sender, to, value); return true; } @@ -50,7 +50,7 @@ contract StandardToken is Token { balances[from] -= value; allowances[from][msg.sender] -= value; balances[to] += value; - Transfer(from, to, value); + emit Transfer(from, to, value); return true; } @@ -63,7 +63,7 @@ contract StandardToken is Token { returns (bool) { allowances[msg.sender][spender] = value; - Approval(msg.sender, spender, value); + emit Approval(msg.sender, spender, value); return true; } diff --git a/test/compilationTests/milestonetracker/MilestoneTracker.sol b/test/compilationTests/milestonetracker/MilestoneTracker.sol index 7a9158ae..56422169 100644 --- a/test/compilationTests/milestonetracker/MilestoneTracker.sol +++ b/test/compilationTests/milestonetracker/MilestoneTracker.sol @@ -108,7 +108,7 @@ contract MilestoneTracker { /// @param _arbitrator Address assigned to be the arbitrator /// @param _donor Address assigned to be the donor /// @param _recipient Address assigned to be the recipient - function MilestoneTracker ( + constructor ( address _arbitrator, address _donor, address _recipient @@ -179,7 +179,7 @@ contract MilestoneTracker { ) onlyRecipient campaignNotCanceled { proposedMilestones = _newMilestones; changingMilestones = true; - NewMilestoneListProposed(); + emit NewMilestoneListProposed(); } @@ -192,7 +192,7 @@ contract MilestoneTracker { function unproposeMilestones() onlyRecipient campaignNotCanceled { delete proposedMilestones; changingMilestones = false; - NewMilestoneListUnproposed(); + emit NewMilestoneListUnproposed(); } /// @notice `onlyDonor` Approves the proposed milestone list @@ -249,7 +249,7 @@ contract MilestoneTracker { delete proposedMilestones; changingMilestones = false; - NewMilestoneListAccepted(); + emit NewMilestoneListAccepted(); } /// @notice `onlyRecipientOrLeadLink`Marks a milestone as DONE and @@ -268,7 +268,7 @@ contract MilestoneTracker { if (now > milestone.maxCompletionDate) throw; milestone.status = MilestoneStatus.Completed; milestone.doneTime = now; - ProposalStatusChanged(_idMilestone, milestone.status); + emit ProposalStatusChanged(_idMilestone, milestone.status); } /// @notice `onlyReviewer` Approves a specific milestone @@ -297,7 +297,7 @@ contract MilestoneTracker { (milestone.status != MilestoneStatus.Completed)) throw; milestone.status = MilestoneStatus.AcceptedAndInProgress; - ProposalStatusChanged(_idMilestone, milestone.status); + emit ProposalStatusChanged(_idMilestone, milestone.status); } /// @notice `onlyRecipientOrLeadLink` Sends the milestone payment as @@ -330,7 +330,7 @@ contract MilestoneTracker { throw; milestone.status = MilestoneStatus.Canceled; - ProposalStatusChanged(_idMilestone, milestone.status); + emit ProposalStatusChanged(_idMilestone, milestone.status); } /// @notice `onlyArbitrator` Forces a milestone to be paid out as long as it @@ -350,7 +350,7 @@ contract MilestoneTracker { /// milestones. function arbitrateCancelCampaign() onlyArbitrator campaignNotCanceled { campaignCanceled = true; - CampaignCanceled(); + emit CampaignCanceled(); } // @dev This internal function is executed when the milestone is paid out @@ -362,6 +362,6 @@ contract MilestoneTracker { milestone.status = MilestoneStatus.AuthorizedForPayment; if (!milestone.paymentSource.call.value(0)(milestone.payData)) throw; - ProposalStatusChanged(_idMilestone, milestone.status); + emit ProposalStatusChanged(_idMilestone, milestone.status); } } diff --git a/test/compilationTests/zeppelin/Bounty.sol b/test/compilationTests/zeppelin/Bounty.sol index 4c62a0b4..91730900 100644 --- a/test/compilationTests/zeppelin/Bounty.sol +++ b/test/compilationTests/zeppelin/Bounty.sol @@ -32,7 +32,7 @@ contract Bounty is PullPayment, Destructible { function createTarget() returns(Target) { Target target = Target(deployContract()); researchers[target] = msg.sender; - TargetCreated(target); + emit TargetCreated(target); return target; } diff --git a/test/compilationTests/zeppelin/DayLimit.sol b/test/compilationTests/zeppelin/DayLimit.sol index 3c8d5b0c..0bcb341a 100644 --- a/test/compilationTests/zeppelin/DayLimit.sol +++ b/test/compilationTests/zeppelin/DayLimit.sol @@ -15,7 +15,7 @@ contract DayLimit { * @dev Constructor that sets the passed value as a dailyLimit. * @param _limit uint256 to represent the daily limit. */ - function DayLimit(uint256 _limit) { + constructor(uint256 _limit) { dailyLimit = _limit; lastDay = today(); } diff --git a/test/compilationTests/zeppelin/LimitBalance.sol b/test/compilationTests/zeppelin/LimitBalance.sol index 57477c74..40edd014 100644 --- a/test/compilationTests/zeppelin/LimitBalance.sol +++ b/test/compilationTests/zeppelin/LimitBalance.sol @@ -15,7 +15,7 @@ contract LimitBalance { * @dev Constructor that sets the passed value as a limit. * @param _limit uint256 to represent the limit. */ - function LimitBalance(uint256 _limit) { + constructor(uint256 _limit) { limit = _limit; } diff --git a/test/compilationTests/zeppelin/MultisigWallet.sol b/test/compilationTests/zeppelin/MultisigWallet.sol index 420c9611..ea620fc0 100644 --- a/test/compilationTests/zeppelin/MultisigWallet.sol +++ b/test/compilationTests/zeppelin/MultisigWallet.sol @@ -25,8 +25,8 @@ contract MultisigWallet is Multisig, Shareable, DayLimit { * @param _owners A list of owners. * @param _required The amount required for a transaction to be approved. */ - function MultisigWallet(address[] _owners, uint256 _required, uint256 _daylimit) - Shareable(_owners, _required) + constructor(address[] _owners, uint256 _required, uint256 _daylimit) + Shareable(_owners, _required) DayLimit(_daylimit) { } /** @@ -42,7 +42,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit { function() payable { // just being sent some cash? if (msg.value > 0) - Deposit(msg.sender, msg.value); + emit Deposit(msg.sender, msg.value); } /** @@ -58,7 +58,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit { function execute(address _to, uint256 _value, bytes _data) external onlyOwner returns (bytes32 _r) { // first, take the opportunity to check that we're under the daily limit. if (underLimit(_value)) { - SingleTransact(msg.sender, _value, _to, _data); + emit SingleTransact(msg.sender, _value, _to, _data); // yes - just execute the call. if (!_to.call.value(_value)(_data)) { throw; @@ -71,7 +71,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit { txs[_r].to = _to; txs[_r].value = _value; txs[_r].data = _data; - ConfirmationNeeded(_r, msg.sender, _value, _to, _data); + emit ConfirmationNeeded(_r, msg.sender, _value, _to, _data); } } @@ -85,7 +85,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit { if (!txs[_h].to.call.value(txs[_h].value)(txs[_h].data)) { throw; } - MultiTransact(msg.sender, _h, txs[_h].value, txs[_h].to, txs[_h].data); + emit MultiTransact(msg.sender, _h, txs[_h].value, txs[_h].to, txs[_h].data); delete txs[_h]; return true; } diff --git a/test/compilationTests/zeppelin/crowdsale/CappedCrowdsale.sol b/test/compilationTests/zeppelin/crowdsale/CappedCrowdsale.sol index f04649f3..afae79b7 100644 --- a/test/compilationTests/zeppelin/crowdsale/CappedCrowdsale.sol +++ b/test/compilationTests/zeppelin/crowdsale/CappedCrowdsale.sol @@ -12,7 +12,7 @@ contract CappedCrowdsale is Crowdsale { uint256 public cap; - function CappedCrowdsale(uint256 _cap) { + constructor(uint256 _cap) { cap = _cap; } diff --git a/test/compilationTests/zeppelin/crowdsale/Crowdsale.sol b/test/compilationTests/zeppelin/crowdsale/Crowdsale.sol index 21d36840..a60a28f8 100644 --- a/test/compilationTests/zeppelin/crowdsale/Crowdsale.sol +++ b/test/compilationTests/zeppelin/crowdsale/Crowdsale.sol @@ -40,7 +40,7 @@ contract Crowdsale { event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); - function Crowdsale(uint256 _startBlock, uint256 _endBlock, uint256 _rate, address _wallet) { + constructor(uint256 _startBlock, uint256 _endBlock, uint256 _rate, address _wallet) { require(_startBlock >= block.number); require(_endBlock >= _startBlock); require(_rate > 0); @@ -80,7 +80,7 @@ contract Crowdsale { weiRaised = updatedWeiRaised; token.mint(beneficiary, tokens); - TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); + emit TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } diff --git a/test/compilationTests/zeppelin/crowdsale/FinalizableCrowdsale.sol b/test/compilationTests/zeppelin/crowdsale/FinalizableCrowdsale.sol index 1a736083..7965a66d 100644 --- a/test/compilationTests/zeppelin/crowdsale/FinalizableCrowdsale.sol +++ b/test/compilationTests/zeppelin/crowdsale/FinalizableCrowdsale.sol @@ -23,7 +23,7 @@ contract FinalizableCrowdsale is Crowdsale, Ownable { require(hasEnded()); finalization(); - Finalized(); + emit Finalized(); isFinalized = true; } diff --git a/test/compilationTests/zeppelin/crowdsale/RefundVault.sol b/test/compilationTests/zeppelin/crowdsale/RefundVault.sol index d88f035f..0be45ec4 100644 --- a/test/compilationTests/zeppelin/crowdsale/RefundVault.sol +++ b/test/compilationTests/zeppelin/crowdsale/RefundVault.sol @@ -22,7 +22,7 @@ contract RefundVault is Ownable { event RefundsEnabled(); event Refunded(address indexed beneficiary, uint256 weiAmount); - function RefundVault(address _wallet) { + constructor(address _wallet) { require(_wallet != address(0x0)); wallet = _wallet; state = State.Active; @@ -36,14 +36,14 @@ contract RefundVault is Ownable { function close() onlyOwner { require(state == State.Active); state = State.Closed; - Closed(); + emit Closed(); wallet.transfer(this.balance); } function enableRefunds() onlyOwner { require(state == State.Active); state = State.Refunding; - RefundsEnabled(); + emit RefundsEnabled(); } function refund(address investor) { @@ -51,6 +51,6 @@ contract RefundVault is Ownable { uint256 depositedValue = deposited[investor]; deposited[investor] = 0; investor.transfer(depositedValue); - Refunded(investor, depositedValue); + emit Refunded(investor, depositedValue); } } diff --git a/test/compilationTests/zeppelin/crowdsale/RefundableCrowdsale.sol b/test/compilationTests/zeppelin/crowdsale/RefundableCrowdsale.sol index f45df1d3..5e798d45 100644 --- a/test/compilationTests/zeppelin/crowdsale/RefundableCrowdsale.sol +++ b/test/compilationTests/zeppelin/crowdsale/RefundableCrowdsale.sol @@ -21,7 +21,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale { // refund vault used to hold funds while crowdsale is running RefundVault public vault; - function RefundableCrowdsale(uint256 _goal) { + constructor(uint256 _goal) { vault = new RefundVault(wallet); goal = _goal; } diff --git a/test/compilationTests/zeppelin/lifecycle/Destructible.sol b/test/compilationTests/zeppelin/lifecycle/Destructible.sol index 3561e3b7..00492590 100644 --- a/test/compilationTests/zeppelin/lifecycle/Destructible.sol +++ b/test/compilationTests/zeppelin/lifecycle/Destructible.sol @@ -10,7 +10,7 @@ import "../ownership/Ownable.sol"; */ contract Destructible is Ownable { - function Destructible() payable { } + constructor() payable { } /** * @dev Transfers the current balance to the owner and terminates the contract. diff --git a/test/compilationTests/zeppelin/lifecycle/Pausable.sol b/test/compilationTests/zeppelin/lifecycle/Pausable.sol index b14f8767..10b0fcd8 100644 --- a/test/compilationTests/zeppelin/lifecycle/Pausable.sol +++ b/test/compilationTests/zeppelin/lifecycle/Pausable.sol @@ -36,7 +36,7 @@ contract Pausable is Ownable { */ function pause() onlyOwner whenNotPaused returns (bool) { paused = true; - Pause(); + emit Pause(); return true; } @@ -45,7 +45,7 @@ contract Pausable is Ownable { */ function unpause() onlyOwner whenPaused returns (bool) { paused = false; - Unpause(); + emit Unpause(); return true; } } diff --git a/test/compilationTests/zeppelin/lifecycle/TokenDestructible.sol b/test/compilationTests/zeppelin/lifecycle/TokenDestructible.sol index fe0b46b6..f88a55aa 100644 --- a/test/compilationTests/zeppelin/lifecycle/TokenDestructible.sol +++ b/test/compilationTests/zeppelin/lifecycle/TokenDestructible.sol @@ -12,7 +12,7 @@ import "../token/ERC20Basic.sol"; */ contract TokenDestructible is Ownable { - function TokenDestructible() payable { } + constructor() payable { } /** * @notice Terminate contract and refund to owner diff --git a/test/compilationTests/zeppelin/ownership/HasNoEther.sol b/test/compilationTests/zeppelin/ownership/HasNoEther.sol index 2bcaf1b8..8f9edc03 100644 --- a/test/compilationTests/zeppelin/ownership/HasNoEther.sol +++ b/test/compilationTests/zeppelin/ownership/HasNoEther.sol @@ -21,7 +21,7 @@ contract HasNoEther is Ownable { * constructor. By doing it this way we prevent a payable constructor from working. Alternatively * we could use assembly to access msg.value. */ - function HasNoEther() payable { + constructor() payable { if(msg.value > 0) { throw; } diff --git a/test/compilationTests/zeppelin/ownership/Ownable.sol b/test/compilationTests/zeppelin/ownership/Ownable.sol index f1628454..0a2257d6 100644 --- a/test/compilationTests/zeppelin/ownership/Ownable.sol +++ b/test/compilationTests/zeppelin/ownership/Ownable.sol @@ -14,7 +14,7 @@ contract Ownable { * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ - function Ownable() { + constructor() { owner = msg.sender; } diff --git a/test/compilationTests/zeppelin/ownership/Shareable.sol b/test/compilationTests/zeppelin/ownership/Shareable.sol index b6cb1c16..f8059650 100644 --- a/test/compilationTests/zeppelin/ownership/Shareable.sol +++ b/test/compilationTests/zeppelin/ownership/Shareable.sol @@ -59,7 +59,7 @@ contract Shareable { * @param _owners A list of owners. * @param _required The amount required for a transaction to be approved. */ - function Shareable(address[] _owners, uint256 _required) { + constructor(address[] _owners, uint256 _required) { owners[1] = msg.sender; ownerIndex[msg.sender] = 1; for (uint256 i = 0; i < _owners.length; ++i) { @@ -87,7 +87,7 @@ contract Shareable { if (pending.ownersDone & ownerIndexBit > 0) { pending.yetNeeded++; pending.ownersDone -= ownerIndexBit; - Revoke(msg.sender, _operation); + emit Revoke(msg.sender, _operation); } } @@ -156,7 +156,7 @@ contract Shareable { uint256 ownerIndexBit = 2**index; // make sure we (the message sender) haven't confirmed this operation previously. if (pending.ownersDone & ownerIndexBit == 0) { - Confirmation(msg.sender, _operation); + emit Confirmation(msg.sender, _operation); // ok - check if count is enough to go ahead. if (pending.yetNeeded <= 1) { // enough confirmations: reset and run interior. diff --git a/test/compilationTests/zeppelin/token/BasicToken.sol b/test/compilationTests/zeppelin/token/BasicToken.sol index 5618227a..831f706e 100644 --- a/test/compilationTests/zeppelin/token/BasicToken.sol +++ b/test/compilationTests/zeppelin/token/BasicToken.sol @@ -22,7 +22,7 @@ contract BasicToken is ERC20Basic { function transfer(address _to, uint256 _value) { 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); } /** diff --git a/test/compilationTests/zeppelin/token/MintableToken.sol b/test/compilationTests/zeppelin/token/MintableToken.sol index 505d13c3..45926afb 100644 --- a/test/compilationTests/zeppelin/token/MintableToken.sol +++ b/test/compilationTests/zeppelin/token/MintableToken.sol @@ -34,7 +34,7 @@ contract MintableToken is StandardToken, Ownable { function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); - Mint(_to, _amount); + emit Mint(_to, _amount); return true; } @@ -44,7 +44,7 @@ contract MintableToken is StandardToken, Ownable { */ function finishMinting() onlyOwner returns (bool) { mintingFinished = true; - MintFinished(); + emit MintFinished(); return true; } } diff --git a/test/compilationTests/zeppelin/token/SimpleToken.sol b/test/compilationTests/zeppelin/token/SimpleToken.sol index 898cb21d..a4ba9eb3 100644 --- a/test/compilationTests/zeppelin/token/SimpleToken.sol +++ b/test/compilationTests/zeppelin/token/SimpleToken.sol @@ -20,7 +20,7 @@ contract SimpleToken is StandardToken { /** * @dev Contructor that gives msg.sender all of existing tokens. */ - function SimpleToken() { + constructor() { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } diff --git a/test/compilationTests/zeppelin/token/StandardToken.sol b/test/compilationTests/zeppelin/token/StandardToken.sol index d86aae4c..ab9f582e 100644 --- a/test/compilationTests/zeppelin/token/StandardToken.sol +++ b/test/compilationTests/zeppelin/token/StandardToken.sol @@ -32,7 +32,7 @@ contract StandardToken is ERC20, BasicToken { balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); - Transfer(_from, _to, _value); + emit Transfer(_from, _to, _value); } /** @@ -49,7 +49,7 @@ contract StandardToken is ERC20, BasicToken { if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw; allowed[msg.sender][_spender] = _value; - Approval(msg.sender, _spender, _value); + emit Approval(msg.sender, _spender, _value); } /** diff --git a/test/compilationTests/zeppelin/token/TokenTimelock.sol b/test/compilationTests/zeppelin/token/TokenTimelock.sol index 595bf8d0..e9f998ba 100644 --- a/test/compilationTests/zeppelin/token/TokenTimelock.sol +++ b/test/compilationTests/zeppelin/token/TokenTimelock.sol @@ -19,7 +19,7 @@ contract TokenTimelock { // timestamp when token release is enabled uint releaseTime; - function TokenTimelock(ERC20Basic _token, address _beneficiary, uint _releaseTime) { + constructor(ERC20Basic _token, address _beneficiary, uint _releaseTime) { require(_releaseTime > now); token = _token; beneficiary = _beneficiary; diff --git a/test/compilationTests/zeppelin/token/VestedToken.sol b/test/compilationTests/zeppelin/token/VestedToken.sol index b7748b09..e9929018 100644 --- a/test/compilationTests/zeppelin/token/VestedToken.sol +++ b/test/compilationTests/zeppelin/token/VestedToken.sol @@ -65,7 +65,7 @@ contract VestedToken is StandardToken, LimitedTransferToken { transfer(_to, _value); - NewTokenGrant(msg.sender, _to, _value, count - 1); + emit NewTokenGrant(msg.sender, _to, _value, count - 1); } /** @@ -96,7 +96,7 @@ contract VestedToken is StandardToken, LimitedTransferToken { balances[receiver] = balances[receiver].add(nonVested); balances[_holder] = balances[_holder].sub(nonVested); - Transfer(_holder, receiver, nonVested); + emit Transfer(_holder, receiver, nonVested); } |