diff options
author | Erik Kundt <bitshift@posteo.org> | 2018-07-05 01:20:51 +0800 |
---|---|---|
committer | Erik Kundt <bitshift@posteo.org> | 2018-07-05 01:20:51 +0800 |
commit | febbfd4204f72ea9371553dc3f2e349309b1bb0c (patch) | |
tree | f0543d5cb7948a13a555e9695a41b7f1053d798f /test | |
parent | 7101a8905656d52cf9023a2e4340219d184920c3 (diff) | |
download | dexon-solidity-febbfd4204f72ea9371553dc3f2e349309b1bb0c.tar dexon-solidity-febbfd4204f72ea9371553dc3f2e349309b1bb0c.tar.gz dexon-solidity-febbfd4204f72ea9371553dc3f2e349309b1bb0c.tar.bz2 dexon-solidity-febbfd4204f72ea9371553dc3f2e349309b1bb0c.tar.lz dexon-solidity-febbfd4204f72ea9371553dc3f2e349309b1bb0c.tar.xz dexon-solidity-febbfd4204f72ea9371553dc3f2e349309b1bb0c.tar.zst dexon-solidity-febbfd4204f72ea9371553dc3f2e349309b1bb0c.zip |
Adds visibility to compilation tests.
Diffstat (limited to 'test')
42 files changed, 137 insertions, 137 deletions
diff --git a/test/compilationTests/corion/ico.sol b/test/compilationTests/corion/ico.sol index b6d8e035..80444395 100644 --- a/test/compilationTests/corion/ico.sol +++ b/test/compilationTests/corion/ico.sol @@ -49,8 +49,8 @@ contract ico is safeMath { mapping (address => mapping(uint256 => interest_s)) public interestDB; uint256 public totalMint; uint256 public totalPremiumMint; - - constructor(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) public { /* Installation function. @@ -283,8 +283,8 @@ contract ico is safeMath { require( isICO() ); require( buy(msg.sender, address(0x00)) ); } - - function buy(address beneficiaryAddress, address affilateAddress) payable returns (bool success) { + + function buy(address beneficiaryAddress, address affilateAddress) public payable returns (bool success) { /* Buying a token diff --git a/test/compilationTests/corion/moduleHandler.sol b/test/compilationTests/corion/moduleHandler.sol index b3d03c2a..441f7fba 100644 --- a/test/compilationTests/corion/moduleHandler.sol +++ b/test/compilationTests/corion/moduleHandler.sol @@ -34,10 +34,10 @@ contract moduleHandler is multiOwner, announcementTypes { modules_s[] public modules; address public foundationAddress; uint256 debugModeUntil = block.number + 1000000; - - - constructor(address[] newOwners) multiOwner(newOwners) {} - function load(address foundation, bool forReplace, address Token, address Premium, address Publisher, address Schelling, address Provider) { + + + constructor(address[] newOwners) multiOwner(newOwners) public {} + function load(address foundation, bool forReplace, address Token, address Premium, address Publisher, address Schelling, address Provider) public { /* Loading modulest to ModuleHandler. diff --git a/test/compilationTests/corion/multiOwner.sol b/test/compilationTests/corion/multiOwner.sol index 78f7109c..337467db 100644 --- a/test/compilationTests/corion/multiOwner.sol +++ b/test/compilationTests/corion/multiOwner.sol @@ -12,7 +12,7 @@ contract multiOwner is safeMath { /* Constructor */ - constructor(address[] newOwners) { + constructor(address[] newOwners) public { 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 695dd344..14f18ad2 100644 --- a/test/compilationTests/corion/premium.sol +++ b/test/compilationTests/corion/premium.sol @@ -39,8 +39,8 @@ contract premium is module, safeMath { bool public isICO; mapping(address => bool) public genesis; - - constructor(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) public { /* Setup function. If an ICOaddress is defined then the balance of the genesis addresses will be set as well. @@ -139,8 +139,8 @@ contract premium is module, safeMath { require( db.setAllowance(msg.sender, spender, amount, nonce) ); emit Approval(msg.sender, spender, amount); } - - function allowance(address owner, address spender) view returns (uint256 remaining, uint256 nonce) { + + function allowance(address owner, address spender) public view returns (uint256 remaining, uint256 nonce) { /* Get the quantity of tokens given to be used @@ -318,8 +318,8 @@ contract premium is module, safeMath { } return _codeLength > 0; } - - function balanceOf(address owner) view returns (uint256 value) { + + function balanceOf(address owner) public view returns (uint256 value) { /* Token balance query @@ -328,8 +328,8 @@ contract premium is module, safeMath { */ return db.balanceOf(owner); } - - function totalSupply() view returns (uint256 value) { + + function totalSupply() public view returns (uint256 value) { /* Total token quantity query diff --git a/test/compilationTests/corion/provider.sol b/test/compilationTests/corion/provider.sol index 16546809..83edcc01 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; - constructor(address _moduleHandler) { + constructor(address _moduleHandler) public { /* Install function. diff --git a/test/compilationTests/corion/publisher.sol b/test/compilationTests/corion/publisher.sol index f7d8fdea..3a332706 100644 --- a/test/compilationTests/corion/publisher.sol +++ b/test/compilationTests/corion/publisher.sol @@ -60,8 +60,8 @@ contract publisher is announcementTypes, module, safeMath { uint256 announcementsLength = 1;
mapping (address => uint256[]) public opponents;
-
- constructor(address moduleHandler) {
+
+ constructor(address moduleHandler) public {
/*
Installation function. The installer will be registered in the admin list automatically
diff --git a/test/compilationTests/corion/schelling.sol b/test/compilationTests/corion/schelling.sol index 74f8af9d..0f84239d 100644 --- a/test/compilationTests/corion/schelling.sol +++ b/test/compilationTests/corion/schelling.sol @@ -45,7 +45,7 @@ contract schellingDB is safeMath, schellingVars { /* Constructor */ - constructor() { + constructor() public { rounds.length = 2; rounds[0].blockHeight = block.number; currentSchellingRound = 1; @@ -54,7 +54,7 @@ contract schellingDB is safeMath, schellingVars { Funds */ mapping(address => uint256) private funds; - function getFunds(address _owner) view returns(bool, uint256) { + function getFunds(address _owner) public view returns(bool, uint256) { return (true, funds[_owner]); } function setFunds(address _owner, uint256 _amount) isOwner external returns(bool) { @@ -65,7 +65,7 @@ contract schellingDB is safeMath, schellingVars { Rounds */ _rounds[] private rounds; - function getRound(uint256 _id) view returns(bool, uint256, uint256, uint256, uint256, bool) { + function getRound(uint256 _id) public view returns(bool, uint256, uint256, uint256, uint256, bool) { if ( rounds.length <= _id ) { return (false, 0, 0, 0, 0, false); } else { return (true, rounds[_id].totalAboveWeight, rounds[_id].totalBelowWeight, rounds[_id].reward, rounds[_id].blockHeight, rounds[_id].voted); } } @@ -76,14 +76,14 @@ contract schellingDB is safeMath, schellingVars { rounds[_id] = _rounds(_totalAboveWeight, _totalBelowWeight, _reward, _blockHeight, _voted); return true; } - function getCurrentRound() view returns(bool, uint256) { + function getCurrentRound() public view returns(bool, uint256) { return (true, rounds.length-1); } /* Voter */ mapping(address => _voter) private voter; - function getVoter(address _owner) view returns(bool success, uint256 roundID, + function getVoter(address _owner) public view returns(bool success, uint256 roundID, bytes32 hash, voterStatus status, bool voteResult, uint256 rewards) { roundID = voter[_owner].roundID; hash = voter[_owner].hash; @@ -106,7 +106,7 @@ contract schellingDB is safeMath, schellingVars { Schelling Token emission */ mapping(uint256 => uint256) private schellingExpansion; - function getSchellingExpansion(uint256 _id) view returns(bool, uint256) { + function getSchellingExpansion(uint256 _id) public view returns(bool, uint256) { return (true, schellingExpansion[_id]); } function setSchellingExpansion(uint256 _id, uint256 _expansion) isOwner external returns(bool) { @@ -121,7 +121,7 @@ contract schellingDB is safeMath, schellingVars { currentSchellingRound = _id; return true; } - function getCurrentSchellingRound() view returns(bool, uint256) { + function getCurrentSchellingRound() public view returns(bool, uint256) { return (true, currentSchellingRound); } } @@ -246,8 +246,8 @@ contract schelling is module, announcementTypes, schellingVars { bytes1 public aboveChar = 0x31; bytes1 public belowChar = 0x30; schellingDB private db; - - constructor(address _moduleHandler, address _db, bool _forReplace) { + + constructor(address _moduleHandler, address _db, bool _forReplace) public { /* Installation function. diff --git a/test/compilationTests/corion/token.sol b/test/compilationTests/corion/token.sol index fecbce3d..195b4ada 100644 --- a/test/compilationTests/corion/token.sol +++ b/test/compilationTests/corion/token.sol @@ -47,8 +47,8 @@ contract token is safeMath, module, announcementTypes { bool public isICO = true; mapping(address => bool) public genesis; - - constructor(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) public payable { /* Installation function @@ -154,8 +154,8 @@ contract token is safeMath, module, announcementTypes { require( db.setAllowance(msg.sender, spender, amount, nonce) ); emit Approval(msg.sender, spender, amount); } - - function allowance(address owner, address spender) view returns (uint256 remaining, uint256 nonce) { + + function allowance(address owner, address spender) public view returns (uint256 remaining, uint256 nonce) { /* Get the quantity of tokens given to be used @@ -471,8 +471,8 @@ contract token is safeMath, module, announcementTypes { } return _codeLength > 0; } - - function balanceOf(address owner) view returns (uint256 value) { + + function balanceOf(address owner) public view returns (uint256 value) { /* Token balance query @@ -482,8 +482,8 @@ contract token is safeMath, module, announcementTypes { */ return db.balanceOf(owner); } - - function totalSupply() view returns (uint256 value) { + + function totalSupply() public view returns (uint256 value) { /* Total token quantity query diff --git a/test/compilationTests/corion/tokenDB.sol b/test/compilationTests/corion/tokenDB.sol index 40304a54..484135ca 100644 --- a/test/compilationTests/corion/tokenDB.sol +++ b/test/compilationTests/corion/tokenDB.sol @@ -60,8 +60,8 @@ contract tokenDB is safeMath, ownedDB { allowance[owner][spender].nonce = nonce;
return true;
}
-
- function getAllowance(address owner, address spender) view returns(bool success, uint256 remaining, uint256 nonce) {
+
+ function getAllowance(address owner, address spender) public view returns(bool success, uint256 remaining, uint256 nonce) {
/*
Get allowance from the database.
diff --git a/test/compilationTests/gnosis/Migrations.sol b/test/compilationTests/gnosis/Migrations.sol index c7d09bd2..f1a3ea9d 100644 --- a/test/compilationTests/gnosis/Migrations.sol +++ b/test/compilationTests/gnosis/Migrations.sol @@ -8,15 +8,15 @@ contract Migrations { if (msg.sender == owner) _; } - constructor() { + constructor() public { owner = msg.sender; } - function setCompleted(uint completed) restricted { + function setCompleted(uint completed) public restricted { last_completed_migration = completed; } - function upgrade(address new_address) restricted { + function upgrade(address new_address) public restricted { Migrations upgraded = Migrations(new_address); upgraded.setCompleted(last_completed_migration); } diff --git a/test/compilationTests/milestonetracker/MilestoneTracker.sol b/test/compilationTests/milestonetracker/MilestoneTracker.sol index 378f7b73..545acb0a 100644 --- a/test/compilationTests/milestonetracker/MilestoneTracker.sol +++ b/test/compilationTests/milestonetracker/MilestoneTracker.sol @@ -112,7 +112,7 @@ contract MilestoneTracker { address _arbitrator, address _donor, address _recipient - ) { + ) public { arbitrator = _arbitrator; donor = _donor; recipient = _recipient; @@ -124,7 +124,7 @@ contract MilestoneTracker { ///////// /// @return The number of milestones ever created even if they were canceled - function numberOfMilestones() view returns (uint) { + function numberOfMilestones() public view returns (uint) { return milestones.length; } @@ -135,19 +135,19 @@ contract MilestoneTracker { /// @notice `onlyArbitrator` Reassigns the arbitrator to a new address /// @param _newArbitrator The new arbitrator - function changeArbitrator(address _newArbitrator) onlyArbitrator { + function changeArbitrator(address _newArbitrator) public onlyArbitrator { arbitrator = _newArbitrator; } /// @notice `onlyDonor` Reassigns the `donor` to a new address /// @param _newDonor The new donor - function changeDonor(address _newDonor) onlyDonor { + function changeDonor(address _newDonor) public onlyDonor { donor = _newDonor; } /// @notice `onlyRecipient` Reassigns the `recipient` to a new address /// @param _newRecipient The new recipient - function changeRecipient(address _newRecipient) onlyRecipient { + function changeRecipient(address _newRecipient) public onlyRecipient { recipient = _newRecipient; } @@ -176,7 +176,7 @@ contract MilestoneTracker { /// address paymentSource, /// bytes payData, function proposeMilestones(bytes _newMilestones - ) onlyRecipient campaignNotCanceled { + ) public onlyRecipient campaignNotCanceled { proposedMilestones = _newMilestones; changingMilestones = true; emit NewMilestoneListProposed(); @@ -189,7 +189,7 @@ contract MilestoneTracker { /// @notice `onlyRecipient` Cancels the proposed milestones and reactivates /// the previous set of milestones - function unproposeMilestones() onlyRecipient campaignNotCanceled { + function unproposeMilestones() public onlyRecipient campaignNotCanceled { delete proposedMilestones; changingMilestones = false; emit NewMilestoneListUnproposed(); @@ -200,7 +200,7 @@ contract MilestoneTracker { /// bytecode; this confirms that the `donor` knows the set of milestones /// they are approving function acceptProposedMilestones(bytes32 _hashProposals - ) onlyDonor campaignNotCanceled { + ) public onlyDonor campaignNotCanceled { uint i; @@ -256,7 +256,7 @@ contract MilestoneTracker { /// ready for review /// @param _idMilestone ID of the milestone that has been completed function markMilestoneComplete(uint _idMilestone) - campaignNotCanceled notChanging + public campaignNotCanceled notChanging { if (_idMilestone >= milestones.length) throw; Milestone milestone = milestones[_idMilestone]; @@ -274,7 +274,7 @@ contract MilestoneTracker { /// @notice `onlyReviewer` Approves a specific milestone /// @param _idMilestone ID of the milestone that is approved function approveCompletedMilestone(uint _idMilestone) - campaignNotCanceled notChanging + public campaignNotCanceled notChanging { if (_idMilestone >= milestones.length) throw; Milestone milestone = milestones[_idMilestone]; @@ -289,7 +289,7 @@ contract MilestoneTracker { /// state /// @param _idMilestone ID of the milestone that is being rejected function rejectMilestone(uint _idMilestone) - campaignNotCanceled notChanging + public campaignNotCanceled notChanging { if (_idMilestone >= milestones.length) throw; Milestone milestone = milestones[_idMilestone]; @@ -305,7 +305,7 @@ contract MilestoneTracker { /// `reviewTime` has elapsed /// @param _idMilestone ID of the milestone to be paid out function requestMilestonePayment(uint _idMilestone - ) campaignNotCanceled notChanging { + ) public campaignNotCanceled notChanging { if (_idMilestone >= milestones.length) throw; Milestone milestone = milestones[_idMilestone]; if ( (msg.sender != milestone.milestoneLeadLink) @@ -321,7 +321,7 @@ contract MilestoneTracker { /// @notice `onlyRecipient` Cancels a previously accepted milestone /// @param _idMilestone ID of the milestone to be canceled function cancelMilestone(uint _idMilestone) - onlyRecipient campaignNotCanceled notChanging + public onlyRecipient campaignNotCanceled notChanging { if (_idMilestone >= milestones.length) throw; Milestone milestone = milestones[_idMilestone]; @@ -337,7 +337,7 @@ contract MilestoneTracker { /// has not been paid or canceled /// @param _idMilestone ID of the milestone to be paid out function arbitrateApproveMilestone(uint _idMilestone - ) onlyArbitrator campaignNotCanceled notChanging { + ) public onlyArbitrator campaignNotCanceled notChanging { if (_idMilestone >= milestones.length) throw; Milestone milestone = milestones[_idMilestone]; if ((milestone.status != MilestoneStatus.AcceptedAndInProgress) && @@ -348,7 +348,7 @@ contract MilestoneTracker { /// @notice `onlyArbitrator` Cancels the entire campaign voiding all /// milestones. - function arbitrateCancelCampaign() onlyArbitrator campaignNotCanceled { + function arbitrateCancelCampaign() public onlyArbitrator campaignNotCanceled { campaignCanceled = true; emit CampaignCanceled(); } diff --git a/test/compilationTests/zeppelin/Bounty.sol b/test/compilationTests/zeppelin/Bounty.sol index 8be16a54..6341610b 100644 --- a/test/compilationTests/zeppelin/Bounty.sol +++ b/test/compilationTests/zeppelin/Bounty.sol @@ -29,7 +29,7 @@ contract Bounty is PullPayment, Destructible { * msg.sender as a researcher * @return A target contract */ - function createTarget() returns(Target) { + function createTarget() public returns(Target) { Target target = Target(deployContract()); researchers[target] = msg.sender; emit TargetCreated(target); @@ -46,7 +46,7 @@ contract Bounty is PullPayment, Destructible { * @dev Sends the contract funds to the researcher that proved the contract is broken. * @param target contract */ - function claim(Target target) { + function claim(Target target) public { address researcher = researchers[target]; if (researcher == address(0)) { throw; @@ -74,5 +74,5 @@ contract Target { * In order to win the bounty, security researchers will try to cause this broken state. * @return True if all invariant values are correct, false otherwise. */ - function checkInvariant() returns(bool); + function checkInvariant() public returns(bool); } diff --git a/test/compilationTests/zeppelin/DayLimit.sol b/test/compilationTests/zeppelin/DayLimit.sol index e55076b7..5a2937b5 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. */ - constructor(uint256 _limit) { + constructor(uint256 _limit) public { dailyLimit = _limit; lastDay = today(); } diff --git a/test/compilationTests/zeppelin/LimitBalance.sol b/test/compilationTests/zeppelin/LimitBalance.sol index 40edd014..cf040097 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. */ - constructor(uint256 _limit) { + constructor(uint256 _limit) public { limit = _limit; } diff --git a/test/compilationTests/zeppelin/MultisigWallet.sol b/test/compilationTests/zeppelin/MultisigWallet.sol index 96624d3a..e8e8d05d 100644 --- a/test/compilationTests/zeppelin/MultisigWallet.sol +++ b/test/compilationTests/zeppelin/MultisigWallet.sol @@ -25,19 +25,19 @@ contract MultisigWallet is Multisig, Shareable, DayLimit { * @param _owners A list of owners. * @param _required The amount required for a transaction to be approved. */ - constructor(address[] _owners, uint256 _required, uint256 _daylimit) + constructor(address[] _owners, uint256 _required, uint256 _daylimit) Shareable(_owners, _required) - DayLimit(_daylimit) { } + DayLimit(_daylimit) public { } - /** - * @dev destroys the contract sending everything to `_to`. + /** + * @dev destroys the contract sending everything to `_to`. */ function destroy(address _to) onlymanyowners(keccak256(msg.data)) external { selfdestruct(_to); } - /** - * @dev Fallback function, receives value and emits a deposit event. + /** + * @dev Fallback function, receives value and emits a deposit event. */ function() external payable { // just being sent some cash? @@ -46,10 +46,10 @@ contract MultisigWallet is Multisig, Shareable, DayLimit { } /** - * @dev Outside-visible transaction entry point. Executes transaction immediately if below daily - * spending limit. If not, goes into multisig process. We provide a hash on return to allow the - * sender to provide shortcuts for the other confirmations (allowing them to avoid replicating - * the _to, _value, and _data arguments). They still get the option of using them if they want, + * @dev Outside-visible transaction entry point. Executes transaction immediately if below daily + * spending limit. If not, goes into multisig process. We provide a hash on return to allow the + * sender to provide shortcuts for the other confirmations (allowing them to avoid replicating + * the _to, _value, and _data arguments). They still get the option of using them if they want, * anyways. * @param _to The receiver address * @param _value The value to send @@ -76,11 +76,11 @@ contract MultisigWallet is Multisig, Shareable, DayLimit { } /** - * @dev Confirm a transaction by providing just the hash. We use the previous transactions map, + * @dev Confirm a transaction by providing just the hash. We use the previous transactions map, * txs, in order to determine the body of the transaction from the hash provided. * @param _h The transaction hash to approve. */ - function confirm(bytes32 _h) onlymanyowners(_h) returns (bool) { + function confirm(bytes32 _h) onlymanyowners(_h) public returns (bool) { if (txs[_h].to != address(0)) { if (!txs[_h].to.call.value(txs[_h].value)(txs[_h].data)) { throw; @@ -91,15 +91,15 @@ contract MultisigWallet is Multisig, Shareable, DayLimit { } } - /** - * @dev Updates the daily limit value. + /** + * @dev Updates the daily limit value. * @param _newLimit uint256 to represent the new limit. */ function setDailyLimit(uint256 _newLimit) onlymanyowners(keccak256(msg.data)) external { _setDailyLimit(_newLimit); } - /** + /** * @dev Resets the value spent to enable more spending */ function resetSpentToday() onlymanyowners(keccak256(msg.data)) external { @@ -108,7 +108,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit { // INTERNAL METHODS - /** + /** * @dev Clears the list of transactions pending approval. */ function clearPending() internal { diff --git a/test/compilationTests/zeppelin/crowdsale/CappedCrowdsale.sol b/test/compilationTests/zeppelin/crowdsale/CappedCrowdsale.sol index d4066812..98c8c3d4 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; - constructor(uint256 _cap) { + constructor(uint256 _cap) public { cap = _cap; } diff --git a/test/compilationTests/zeppelin/crowdsale/Crowdsale.sol b/test/compilationTests/zeppelin/crowdsale/Crowdsale.sol index 1f148a74..51eeb7b8 100644 --- a/test/compilationTests/zeppelin/crowdsale/Crowdsale.sol +++ b/test/compilationTests/zeppelin/crowdsale/Crowdsale.sol @@ -4,11 +4,11 @@ import '../token/MintableToken.sol'; import '../math/SafeMath.sol'; /** - * @title Crowdsale + * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end block, where investors can make * token purchases and the crowdsale will assign them tokens based - * on a token per ETH rate. Funds collected are forwarded to a wallet + * on a token per ETH rate. Funds collected are forwarded to a wallet * as they arrive. */ contract Crowdsale { @@ -36,11 +36,11 @@ contract Crowdsale { * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased - */ + */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); - constructor(uint256 _startBlock, uint256 _endBlock, uint256 _rate, address _wallet) { + constructor(uint256 _startBlock, uint256 _endBlock, uint256 _rate, address _wallet) public { require(_startBlock >= block.number); require(_endBlock >= _startBlock); require(_rate > 0); @@ -53,7 +53,7 @@ contract Crowdsale { wallet = _wallet; } - // creates the token to be sold. + // creates the token to be sold. // override this method to have crowdsale of a specific mintable token. function createTokenContract() internal returns (MintableToken) { return new MintableToken(); @@ -66,7 +66,7 @@ contract Crowdsale { } // low level token purchase function - function buyTokens(address beneficiary) payable { + function buyTokens(address beneficiary) public payable { require(beneficiary != address(0x0)); require(validPurchase()); diff --git a/test/compilationTests/zeppelin/crowdsale/FinalizableCrowdsale.sol b/test/compilationTests/zeppelin/crowdsale/FinalizableCrowdsale.sol index 7965a66d..da4e3b7f 100644 --- a/test/compilationTests/zeppelin/crowdsale/FinalizableCrowdsale.sol +++ b/test/compilationTests/zeppelin/crowdsale/FinalizableCrowdsale.sol @@ -18,7 +18,7 @@ contract FinalizableCrowdsale is Crowdsale, Ownable { // should be called after crowdsale ends, to do // some extra finalization work - function finalize() onlyOwner { + function finalize() public onlyOwner { require(!isFinalized); require(hasEnded()); diff --git a/test/compilationTests/zeppelin/crowdsale/RefundVault.sol b/test/compilationTests/zeppelin/crowdsale/RefundVault.sol index 0be45ec4..19346c42 100644 --- a/test/compilationTests/zeppelin/crowdsale/RefundVault.sol +++ b/test/compilationTests/zeppelin/crowdsale/RefundVault.sol @@ -22,31 +22,31 @@ contract RefundVault is Ownable { event RefundsEnabled(); event Refunded(address indexed beneficiary, uint256 weiAmount); - constructor(address _wallet) { + constructor(address _wallet) public { require(_wallet != address(0x0)); wallet = _wallet; state = State.Active; } - function deposit(address investor) onlyOwner payable { + function deposit(address investor) public onlyOwner payable { require(state == State.Active); deposited[investor] = deposited[investor].add(msg.value); } - function close() onlyOwner { + function close() public onlyOwner { require(state == State.Active); state = State.Closed; emit Closed(); wallet.transfer(this.balance); } - function enableRefunds() onlyOwner { + function enableRefunds() public onlyOwner { require(state == State.Active); state = State.Refunding; emit RefundsEnabled(); } - function refund(address investor) { + function refund(address investor) public { require(state == State.Refunding); uint256 depositedValue = deposited[investor]; deposited[investor] = 0; diff --git a/test/compilationTests/zeppelin/crowdsale/RefundableCrowdsale.sol b/test/compilationTests/zeppelin/crowdsale/RefundableCrowdsale.sol index bb6b5e17..94e3af99 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; - constructor(uint256 _goal) { + constructor(uint256 _goal) public { vault = new RefundVault(wallet); goal = _goal; } @@ -34,7 +34,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale { } // if crowdsale is unsuccessful, investors can claim refunds here - function claimRefund() { + function claimRefund() public { require(isFinalized); require(!goalReached()); diff --git a/test/compilationTests/zeppelin/lifecycle/Destructible.sol b/test/compilationTests/zeppelin/lifecycle/Destructible.sol index 00492590..5b0e9f58 100644 --- a/test/compilationTests/zeppelin/lifecycle/Destructible.sol +++ b/test/compilationTests/zeppelin/lifecycle/Destructible.sol @@ -10,16 +10,16 @@ import "../ownership/Ownable.sol"; */ contract Destructible is Ownable { - constructor() payable { } + constructor() public payable { } /** * @dev Transfers the current balance to the owner and terminates the contract. */ - function destroy() onlyOwner { + function destroy() public onlyOwner { selfdestruct(owner); } - function destroyAndSend(address _recipient) onlyOwner { + function destroyAndSend(address _recipient) public onlyOwner { selfdestruct(_recipient); } } diff --git a/test/compilationTests/zeppelin/lifecycle/Migrations.sol b/test/compilationTests/zeppelin/lifecycle/Migrations.sol index d5b05308..4ca95d36 100644 --- a/test/compilationTests/zeppelin/lifecycle/Migrations.sol +++ b/test/compilationTests/zeppelin/lifecycle/Migrations.sol @@ -10,11 +10,11 @@ import '../ownership/Ownable.sol'; contract Migrations is Ownable { uint256 public lastCompletedMigration; - function setCompleted(uint256 completed) onlyOwner { + function setCompleted(uint256 completed) public onlyOwner { lastCompletedMigration = completed; } - function upgrade(address newAddress) onlyOwner { + function upgrade(address newAddress) public onlyOwner { Migrations upgraded = Migrations(newAddress); upgraded.setCompleted(lastCompletedMigration); } diff --git a/test/compilationTests/zeppelin/lifecycle/Pausable.sol b/test/compilationTests/zeppelin/lifecycle/Pausable.sol index 10b0fcd8..4ffd281a 100644 --- a/test/compilationTests/zeppelin/lifecycle/Pausable.sol +++ b/test/compilationTests/zeppelin/lifecycle/Pausable.sol @@ -34,7 +34,7 @@ contract Pausable is Ownable { /** * @dev called by the owner to pause, triggers stopped state */ - function pause() onlyOwner whenNotPaused returns (bool) { + function pause() public onlyOwner whenNotPaused returns (bool) { paused = true; emit Pause(); return true; @@ -43,7 +43,7 @@ contract Pausable is Ownable { /** * @dev called by the owner to unpause, returns to normal state */ - function unpause() onlyOwner whenPaused returns (bool) { + function unpause() public onlyOwner whenPaused returns (bool) { paused = false; emit Unpause(); return true; diff --git a/test/compilationTests/zeppelin/lifecycle/TokenDestructible.sol b/test/compilationTests/zeppelin/lifecycle/TokenDestructible.sol index f88a55aa..0b19eb71 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 { - constructor() payable { } + constructor() public payable { } /** * @notice Terminate contract and refund to owner @@ -21,7 +21,7 @@ contract TokenDestructible is Ownable { * @notice The called token contracts could try to re-enter this contract. Only supply token contracts you trust. */ - function destroy(address[] tokens) onlyOwner { + function destroy(address[] tokens) public onlyOwner { // Transfer tokens to owner for(uint256 i = 0; i < tokens.length; i++) { diff --git a/test/compilationTests/zeppelin/ownership/Claimable.sol b/test/compilationTests/zeppelin/ownership/Claimable.sol index 14d0ac6a..72390411 100644 --- a/test/compilationTests/zeppelin/ownership/Claimable.sol +++ b/test/compilationTests/zeppelin/ownership/Claimable.sol @@ -26,14 +26,14 @@ contract Claimable is Ownable { * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to transfer ownership to. */ - function transferOwnership(address newOwner) onlyOwner { + function transferOwnership(address newOwner) public onlyOwner { pendingOwner = newOwner; } /** * @dev Allows the pendingOwner address to finalize the transfer. */ - function claimOwnership() onlyPendingOwner { + function claimOwnership() public onlyPendingOwner { owner = pendingOwner; pendingOwner = address(0x0); } diff --git a/test/compilationTests/zeppelin/ownership/Contactable.sol b/test/compilationTests/zeppelin/ownership/Contactable.sol index 0db3ee07..11b0e1dd 100644 --- a/test/compilationTests/zeppelin/ownership/Contactable.sol +++ b/test/compilationTests/zeppelin/ownership/Contactable.sol @@ -15,7 +15,7 @@ contract Contactable is Ownable{ * @dev Allows the owner to set a string with their contact information. * @param info The contact information to attach to the contract. */ - function setContactInformation(string info) onlyOwner{ + function setContactInformation(string info) public onlyOwner{ contactInformation = info; } } diff --git a/test/compilationTests/zeppelin/ownership/DelayedClaimable.sol b/test/compilationTests/zeppelin/ownership/DelayedClaimable.sol index 93177dc6..f019d2f1 100644 --- a/test/compilationTests/zeppelin/ownership/DelayedClaimable.sol +++ b/test/compilationTests/zeppelin/ownership/DelayedClaimable.sol @@ -20,7 +20,7 @@ contract DelayedClaimable is Claimable { * @param _start The earliest time ownership can be claimed. * @param _end The latest time ownership can be claimed. */ - function setLimits(uint256 _start, uint256 _end) onlyOwner { + function setLimits(uint256 _start, uint256 _end) public onlyOwner { if (_start > _end) throw; end = _end; @@ -32,7 +32,7 @@ contract DelayedClaimable is Claimable { * @dev Allows the pendingOwner address to finalize the transfer, as long as it is called within * the specified start and end time. */ - function claimOwnership() onlyPendingOwner { + function claimOwnership() public onlyPendingOwner { if ((block.number > end) || (block.number < start)) throw; owner = pendingOwner; diff --git a/test/compilationTests/zeppelin/ownership/HasNoEther.sol b/test/compilationTests/zeppelin/ownership/HasNoEther.sol index 8f9edc03..ffd1d76f 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. */ - constructor() payable { + constructor() public payable { if(msg.value > 0) { throw; } diff --git a/test/compilationTests/zeppelin/ownership/Multisig.sol b/test/compilationTests/zeppelin/ownership/Multisig.sol index 76c78411..25531d8d 100644 --- a/test/compilationTests/zeppelin/ownership/Multisig.sol +++ b/test/compilationTests/zeppelin/ownership/Multisig.sol @@ -24,5 +24,5 @@ contract Multisig { // TODO: document function changeOwner(address _from, address _to) external; function execute(address _to, uint256 _value, bytes _data) external returns (bytes32); - function confirm(bytes32 _h) returns (bool); + function confirm(bytes32 _h) public returns (bool); } diff --git a/test/compilationTests/zeppelin/ownership/Ownable.sol b/test/compilationTests/zeppelin/ownership/Ownable.sol index 0a2257d6..7417b2bd 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. */ - constructor() { + constructor() public { owner = msg.sender; } @@ -34,7 +34,7 @@ contract Ownable { * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ - function transferOwnership(address newOwner) onlyOwner { + function transferOwnership(address newOwner) public onlyOwner { if (newOwner != address(0)) { owner = newOwner; } diff --git a/test/compilationTests/zeppelin/ownership/Shareable.sol b/test/compilationTests/zeppelin/ownership/Shareable.sol index c954052b..d44f63b8 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. */ - constructor(address[] _owners, uint256 _required) { + constructor(address[] _owners, uint256 _required) public { owners[1] = msg.sender; ownerIndex[msg.sender] = 1; for (uint256 i = 0; i < _owners.length; ++i) { @@ -105,7 +105,7 @@ contract Shareable { * @param _addr address The address which you want to check. * @return True if the address is an owner and fase otherwise. */ - function isOwner(address _addr) view returns (bool) { + function isOwner(address _addr) public view returns (bool) { return ownerIndex[_addr] > 0; } @@ -115,7 +115,7 @@ contract Shareable { * @param _owner The owner address. * @return True if the owner has confirmed and false otherwise. */ - function hasConfirmed(bytes32 _operation, address _owner) view returns (bool) { + function hasConfirmed(bytes32 _operation, address _owner) public view returns (bool) { PendingState memory pending = pendings[_operation]; uint256 index = ownerIndex[_owner]; diff --git a/test/compilationTests/zeppelin/payment/PullPayment.sol b/test/compilationTests/zeppelin/payment/PullPayment.sol index ba710b53..6db7df78 100644 --- a/test/compilationTests/zeppelin/payment/PullPayment.sol +++ b/test/compilationTests/zeppelin/payment/PullPayment.sol @@ -28,7 +28,7 @@ contract PullPayment { /** * @dev withdraw accumulated balance, called by payee. */ - function withdrawPayments() { + function withdrawPayments() public { address payee = msg.sender; uint256 payment = payments[payee]; diff --git a/test/compilationTests/zeppelin/token/BasicToken.sol b/test/compilationTests/zeppelin/token/BasicToken.sol index 8a3d8ead..bc085f85 100644 --- a/test/compilationTests/zeppelin/token/BasicToken.sol +++ b/test/compilationTests/zeppelin/token/BasicToken.sol @@ -19,7 +19,7 @@ contract BasicToken is ERC20Basic { * @param _to The address to transfer to. * @param _value The amount to be transferred. */ - function transfer(address _to, uint256 _value) { + function transfer(address _to, uint256 _value) public { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); @@ -30,7 +30,7 @@ contract BasicToken is ERC20Basic { * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ - function balanceOf(address _owner) view returns (uint256 balance) { + function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } diff --git a/test/compilationTests/zeppelin/token/ERC20.sol b/test/compilationTests/zeppelin/token/ERC20.sol index ae5aa624..5b5dc748 100644 --- a/test/compilationTests/zeppelin/token/ERC20.sol +++ b/test/compilationTests/zeppelin/token/ERC20.sol @@ -9,8 +9,8 @@ import './ERC20Basic.sol'; * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { - function allowance(address owner, address spender) view returns (uint256); - function transferFrom(address from, address to, uint256 value); - function approve(address spender, uint256 value); + function allowance(address owner, address spender) public view returns (uint256); + function transferFrom(address from, address to, uint256 value) public; + function approve(address spender, uint256 value) public; event Approval(address indexed owner, address indexed spender, uint256 value); } diff --git a/test/compilationTests/zeppelin/token/ERC20Basic.sol b/test/compilationTests/zeppelin/token/ERC20Basic.sol index 94fb7bcf..fbe33134 100644 --- a/test/compilationTests/zeppelin/token/ERC20Basic.sol +++ b/test/compilationTests/zeppelin/token/ERC20Basic.sol @@ -8,7 +8,7 @@ pragma solidity ^0.4.11; */ contract ERC20Basic { uint256 public totalSupply; - function balanceOf(address who) view returns (uint256); - function transfer(address to, uint256 value); + function balanceOf(address who) public view returns (uint256); + function transfer(address to, uint256 value) public; event Transfer(address indexed from, address indexed to, uint256 value); } diff --git a/test/compilationTests/zeppelin/token/LimitedTransferToken.sol b/test/compilationTests/zeppelin/token/LimitedTransferToken.sol index 0ccd60b2..5a056f78 100644 --- a/test/compilationTests/zeppelin/token/LimitedTransferToken.sol +++ b/test/compilationTests/zeppelin/token/LimitedTransferToken.sol @@ -32,7 +32,7 @@ contract LimitedTransferToken is ERC20 { * @param _to The address that will recieve the tokens. * @param _value The amount of tokens to be transferred. */ - function transfer(address _to, uint256 _value) canTransfer(msg.sender, _value) { + function transfer(address _to, uint256 _value) canTransfer(msg.sender, _value) public { super.transfer(_to, _value); } @@ -42,7 +42,7 @@ contract LimitedTransferToken is ERC20 { * @param _to The address that will recieve the tokens. * @param _value The amount of tokens to be transferred. */ - function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from, _value) { + function transferFrom(address _from, address _to, uint256 _value) public canTransfer(_from, _value) { super.transferFrom(_from, _to, _value); } diff --git a/test/compilationTests/zeppelin/token/MintableToken.sol b/test/compilationTests/zeppelin/token/MintableToken.sol index 45926afb..4c4787e3 100644 --- a/test/compilationTests/zeppelin/token/MintableToken.sol +++ b/test/compilationTests/zeppelin/token/MintableToken.sol @@ -31,7 +31,7 @@ contract MintableToken is StandardToken, Ownable { * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ - function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) { + function mint(address _to, uint256 _amount) public onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); @@ -42,7 +42,7 @@ contract MintableToken is StandardToken, Ownable { * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ - function finishMinting() onlyOwner returns (bool) { + function finishMinting() public onlyOwner returns (bool) { mintingFinished = true; emit MintFinished(); return true; diff --git a/test/compilationTests/zeppelin/token/PausableToken.sol b/test/compilationTests/zeppelin/token/PausableToken.sol index 8ee114e1..66f80b80 100644 --- a/test/compilationTests/zeppelin/token/PausableToken.sol +++ b/test/compilationTests/zeppelin/token/PausableToken.sol @@ -11,11 +11,11 @@ import '../lifecycle/Pausable.sol'; contract PausableToken is StandardToken, Pausable { - function transfer(address _to, uint _value) whenNotPaused { + function transfer(address _to, uint _value) public whenNotPaused { super.transfer(_to, _value); } - function transferFrom(address _from, address _to, uint _value) whenNotPaused { + function transferFrom(address _from, address _to, uint _value) public whenNotPaused { super.transferFrom(_from, _to, _value); } } diff --git a/test/compilationTests/zeppelin/token/SimpleToken.sol b/test/compilationTests/zeppelin/token/SimpleToken.sol index a4ba9eb3..d0232bca 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. */ - constructor() { + constructor() public { 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 900a9102..a55d961c 100644 --- a/test/compilationTests/zeppelin/token/StandardToken.sol +++ b/test/compilationTests/zeppelin/token/StandardToken.sol @@ -23,7 +23,7 @@ contract StandardToken is ERC20, BasicToken { * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ - function transferFrom(address _from, address _to, uint256 _value) { + function transferFrom(address _from, address _to, uint256 _value) public { uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met @@ -40,7 +40,7 @@ contract StandardToken is ERC20, BasicToken { * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ - function approve(address _spender, uint256 _value) { + function approve(address _spender, uint256 _value) public { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not @@ -58,7 +58,7 @@ contract StandardToken is ERC20, BasicToken { * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still avaible for the spender. */ - function allowance(address _owner, address _spender) view returns (uint256 remaining) { + function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } diff --git a/test/compilationTests/zeppelin/token/TokenTimelock.sol b/test/compilationTests/zeppelin/token/TokenTimelock.sol index e9f998ba..fa1af025 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; - constructor(ERC20Basic _token, address _beneficiary, uint _releaseTime) { + constructor(ERC20Basic _token, address _beneficiary, uint _releaseTime) public { require(_releaseTime > now); token = _token; beneficiary = _beneficiary; @@ -29,7 +29,7 @@ contract TokenTimelock { /** * @dev beneficiary claims tokens held by time lock */ - function claim() { + function claim() public { require(msg.sender == beneficiary); require(now >= releaseTime); diff --git a/test/compilationTests/zeppelin/token/VestedToken.sol b/test/compilationTests/zeppelin/token/VestedToken.sol index 3953612d..17141bdf 100644 --- a/test/compilationTests/zeppelin/token/VestedToken.sol +++ b/test/compilationTests/zeppelin/token/VestedToken.sol @@ -130,7 +130,7 @@ contract VestedToken is StandardToken, LimitedTransferToken { * @param _holder The holder of the grants. * @return A uint256 representing the total amount of grants. */ - function tokenGrantsCount(address _holder) view returns (uint256 index) { + function tokenGrantsCount(address _holder) public view returns (uint256 index) { return grants[_holder].length; } @@ -163,7 +163,7 @@ contract VestedToken is StandardToken, LimitedTransferToken { uint256 time, uint256 start, uint256 cliff, - uint256 vesting) view returns (uint256) + uint256 vesting) public view returns (uint256) { // Shortcuts for before cliff and after vesting cases. if (time < cliff) return 0; @@ -192,7 +192,7 @@ contract VestedToken is StandardToken, LimitedTransferToken { * @return Returns all the values that represent a TokenGrant(address, value, start, cliff, * revokability, burnsOnRevoke, and vesting) plus the vested value at the current time. */ - function tokenGrant(address _holder, uint256 _grantId) view returns (address granter, uint256 value, uint256 vested, uint64 start, uint64 cliff, uint64 vesting, bool revokable, bool burnsOnRevoke) { + function tokenGrant(address _holder, uint256 _grantId) public view returns (address granter, uint256 value, uint256 vested, uint64 start, uint64 cliff, uint64 vesting, bool revokable, bool burnsOnRevoke) { TokenGrant grant = grants[_holder][_grantId]; granter = grant.granter; |