mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4432 from ethereum/visibilityCompilationTests
Specify default visibility in compilation tests
This commit is contained in:
commit
694754b4fe
@ -49,8 +49,8 @@ contract ico is safeMath {
|
|||||||
mapping (address => mapping(uint256 => interest_s)) public interestDB;
|
mapping (address => mapping(uint256 => interest_s)) public interestDB;
|
||||||
uint256 public totalMint;
|
uint256 public totalMint;
|
||||||
uint256 public totalPremiumMint;
|
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.
|
Installation function.
|
||||||
|
|
||||||
@ -283,8 +283,8 @@ contract ico is safeMath {
|
|||||||
require( isICO() );
|
require( isICO() );
|
||||||
require( buy(msg.sender, address(0x00)) );
|
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
|
Buying a token
|
||||||
|
|
||||||
|
@ -34,10 +34,10 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
modules_s[] public modules;
|
modules_s[] public modules;
|
||||||
address public foundationAddress;
|
address public foundationAddress;
|
||||||
uint256 debugModeUntil = block.number + 1000000;
|
uint256 debugModeUntil = block.number + 1000000;
|
||||||
|
|
||||||
|
|
||||||
constructor(address[] newOwners) multiOwner(newOwners) {}
|
constructor(address[] newOwners) multiOwner(newOwners) public {}
|
||||||
function load(address foundation, bool forReplace, address Token, address Premium, address Publisher, address Schelling, address Provider) {
|
function load(address foundation, bool forReplace, address Token, address Premium, address Publisher, address Schelling, address Provider) public {
|
||||||
/*
|
/*
|
||||||
Loading modulest to ModuleHandler.
|
Loading modulest to ModuleHandler.
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ contract multiOwner is safeMath {
|
|||||||
/*
|
/*
|
||||||
Constructor
|
Constructor
|
||||||
*/
|
*/
|
||||||
constructor(address[] newOwners) {
|
constructor(address[] newOwners) public {
|
||||||
for ( uint256 a=0 ; a<newOwners.length ; a++ ) {
|
for ( uint256 a=0 ; a<newOwners.length ; a++ ) {
|
||||||
_addOwner(newOwners[a]);
|
_addOwner(newOwners[a]);
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,8 @@ contract premium is module, safeMath {
|
|||||||
bool public isICO;
|
bool public isICO;
|
||||||
|
|
||||||
mapping(address => bool) public genesis;
|
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.
|
Setup function.
|
||||||
If an ICOaddress is defined then the balance of the genesis addresses will be set as well.
|
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) );
|
require( db.setAllowance(msg.sender, spender, amount, nonce) );
|
||||||
emit Approval(msg.sender, spender, amount);
|
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
|
Get the quantity of tokens given to be used
|
||||||
|
|
||||||
@ -318,8 +318,8 @@ contract premium is module, safeMath {
|
|||||||
}
|
}
|
||||||
return _codeLength > 0;
|
return _codeLength > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function balanceOf(address owner) view returns (uint256 value) {
|
function balanceOf(address owner) public view returns (uint256 value) {
|
||||||
/*
|
/*
|
||||||
Token balance query
|
Token balance query
|
||||||
|
|
||||||
@ -328,8 +328,8 @@ contract premium is module, safeMath {
|
|||||||
*/
|
*/
|
||||||
return db.balanceOf(owner);
|
return db.balanceOf(owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
function totalSupply() view returns (uint256 value) {
|
function totalSupply() public view returns (uint256 value) {
|
||||||
/*
|
/*
|
||||||
Total token quantity query
|
Total token quantity query
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ contract provider is module, safeMath, announcementTypes {
|
|||||||
|
|
||||||
uint256 private currentSchellingRound = 1;
|
uint256 private currentSchellingRound = 1;
|
||||||
|
|
||||||
constructor(address _moduleHandler) {
|
constructor(address _moduleHandler) public {
|
||||||
/*
|
/*
|
||||||
Install function.
|
Install function.
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ contract publisher is announcementTypes, module, safeMath {
|
|||||||
uint256 announcementsLength = 1;
|
uint256 announcementsLength = 1;
|
||||||
|
|
||||||
mapping (address => uint256[]) public opponents;
|
mapping (address => uint256[]) public opponents;
|
||||||
|
|
||||||
constructor(address moduleHandler) {
|
constructor(address moduleHandler) public {
|
||||||
/*
|
/*
|
||||||
Installation function. The installer will be registered in the admin list automatically
|
Installation function. The installer will be registered in the admin list automatically
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ contract schellingDB is safeMath, schellingVars {
|
|||||||
/*
|
/*
|
||||||
Constructor
|
Constructor
|
||||||
*/
|
*/
|
||||||
constructor() {
|
constructor() public {
|
||||||
rounds.length = 2;
|
rounds.length = 2;
|
||||||
rounds[0].blockHeight = block.number;
|
rounds[0].blockHeight = block.number;
|
||||||
currentSchellingRound = 1;
|
currentSchellingRound = 1;
|
||||||
@ -54,7 +54,7 @@ contract schellingDB is safeMath, schellingVars {
|
|||||||
Funds
|
Funds
|
||||||
*/
|
*/
|
||||||
mapping(address => uint256) private 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]);
|
return (true, funds[_owner]);
|
||||||
}
|
}
|
||||||
function setFunds(address _owner, uint256 _amount) isOwner external returns(bool) {
|
function setFunds(address _owner, uint256 _amount) isOwner external returns(bool) {
|
||||||
@ -65,7 +65,7 @@ contract schellingDB is safeMath, schellingVars {
|
|||||||
Rounds
|
Rounds
|
||||||
*/
|
*/
|
||||||
_rounds[] private 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); }
|
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); }
|
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);
|
rounds[_id] = _rounds(_totalAboveWeight, _totalBelowWeight, _reward, _blockHeight, _voted);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
function getCurrentRound() view returns(bool, uint256) {
|
function getCurrentRound() public view returns(bool, uint256) {
|
||||||
return (true, rounds.length-1);
|
return (true, rounds.length-1);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Voter
|
Voter
|
||||||
*/
|
*/
|
||||||
mapping(address => _voter) private 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) {
|
bytes32 hash, voterStatus status, bool voteResult, uint256 rewards) {
|
||||||
roundID = voter[_owner].roundID;
|
roundID = voter[_owner].roundID;
|
||||||
hash = voter[_owner].hash;
|
hash = voter[_owner].hash;
|
||||||
@ -106,7 +106,7 @@ contract schellingDB is safeMath, schellingVars {
|
|||||||
Schelling Token emission
|
Schelling Token emission
|
||||||
*/
|
*/
|
||||||
mapping(uint256 => uint256) private schellingExpansion;
|
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]);
|
return (true, schellingExpansion[_id]);
|
||||||
}
|
}
|
||||||
function setSchellingExpansion(uint256 _id, uint256 _expansion) isOwner external returns(bool) {
|
function setSchellingExpansion(uint256 _id, uint256 _expansion) isOwner external returns(bool) {
|
||||||
@ -121,7 +121,7 @@ contract schellingDB is safeMath, schellingVars {
|
|||||||
currentSchellingRound = _id;
|
currentSchellingRound = _id;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
function getCurrentSchellingRound() view returns(bool, uint256) {
|
function getCurrentSchellingRound() public view returns(bool, uint256) {
|
||||||
return (true, currentSchellingRound);
|
return (true, currentSchellingRound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -246,8 +246,8 @@ contract schelling is module, announcementTypes, schellingVars {
|
|||||||
bytes1 public aboveChar = 0x31;
|
bytes1 public aboveChar = 0x31;
|
||||||
bytes1 public belowChar = 0x30;
|
bytes1 public belowChar = 0x30;
|
||||||
schellingDB private db;
|
schellingDB private db;
|
||||||
|
|
||||||
constructor(address _moduleHandler, address _db, bool _forReplace) {
|
constructor(address _moduleHandler, address _db, bool _forReplace) public {
|
||||||
/*
|
/*
|
||||||
Installation function.
|
Installation function.
|
||||||
|
|
||||||
|
@ -47,8 +47,8 @@ contract token is safeMath, module, announcementTypes {
|
|||||||
bool public isICO = true;
|
bool public isICO = true;
|
||||||
|
|
||||||
mapping(address => bool) public genesis;
|
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
|
Installation function
|
||||||
|
|
||||||
@ -154,8 +154,8 @@ contract token is safeMath, module, announcementTypes {
|
|||||||
require( db.setAllowance(msg.sender, spender, amount, nonce) );
|
require( db.setAllowance(msg.sender, spender, amount, nonce) );
|
||||||
emit Approval(msg.sender, spender, amount);
|
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
|
Get the quantity of tokens given to be used
|
||||||
|
|
||||||
@ -471,8 +471,8 @@ contract token is safeMath, module, announcementTypes {
|
|||||||
}
|
}
|
||||||
return _codeLength > 0;
|
return _codeLength > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function balanceOf(address owner) view returns (uint256 value) {
|
function balanceOf(address owner) public view returns (uint256 value) {
|
||||||
/*
|
/*
|
||||||
Token balance query
|
Token balance query
|
||||||
|
|
||||||
@ -482,8 +482,8 @@ contract token is safeMath, module, announcementTypes {
|
|||||||
*/
|
*/
|
||||||
return db.balanceOf(owner);
|
return db.balanceOf(owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
function totalSupply() view returns (uint256 value) {
|
function totalSupply() public view returns (uint256 value) {
|
||||||
/*
|
/*
|
||||||
Total token quantity query
|
Total token quantity query
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ contract tokenDB is safeMath, ownedDB {
|
|||||||
allowance[owner][spender].nonce = nonce;
|
allowance[owner][spender].nonce = nonce;
|
||||||
return true;
|
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.
|
Get allowance from the database.
|
||||||
|
|
||||||
|
@ -8,15 +8,15 @@ contract Migrations {
|
|||||||
if (msg.sender == owner) _;
|
if (msg.sender == owner) _;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() public {
|
||||||
owner = msg.sender;
|
owner = msg.sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCompleted(uint completed) restricted {
|
function setCompleted(uint completed) public restricted {
|
||||||
last_completed_migration = completed;
|
last_completed_migration = completed;
|
||||||
}
|
}
|
||||||
|
|
||||||
function upgrade(address new_address) restricted {
|
function upgrade(address new_address) public restricted {
|
||||||
Migrations upgraded = Migrations(new_address);
|
Migrations upgraded = Migrations(new_address);
|
||||||
upgraded.setCompleted(last_completed_migration);
|
upgraded.setCompleted(last_completed_migration);
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ contract MilestoneTracker {
|
|||||||
address _arbitrator,
|
address _arbitrator,
|
||||||
address _donor,
|
address _donor,
|
||||||
address _recipient
|
address _recipient
|
||||||
) {
|
) public {
|
||||||
arbitrator = _arbitrator;
|
arbitrator = _arbitrator;
|
||||||
donor = _donor;
|
donor = _donor;
|
||||||
recipient = _recipient;
|
recipient = _recipient;
|
||||||
@ -124,7 +124,7 @@ contract MilestoneTracker {
|
|||||||
/////////
|
/////////
|
||||||
|
|
||||||
/// @return The number of milestones ever created even if they were canceled
|
/// @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;
|
return milestones.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,19 +135,19 @@ contract MilestoneTracker {
|
|||||||
|
|
||||||
/// @notice `onlyArbitrator` Reassigns the arbitrator to a new address
|
/// @notice `onlyArbitrator` Reassigns the arbitrator to a new address
|
||||||
/// @param _newArbitrator The new arbitrator
|
/// @param _newArbitrator The new arbitrator
|
||||||
function changeArbitrator(address _newArbitrator) onlyArbitrator {
|
function changeArbitrator(address _newArbitrator) public onlyArbitrator {
|
||||||
arbitrator = _newArbitrator;
|
arbitrator = _newArbitrator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @notice `onlyDonor` Reassigns the `donor` to a new address
|
/// @notice `onlyDonor` Reassigns the `donor` to a new address
|
||||||
/// @param _newDonor The new donor
|
/// @param _newDonor The new donor
|
||||||
function changeDonor(address _newDonor) onlyDonor {
|
function changeDonor(address _newDonor) public onlyDonor {
|
||||||
donor = _newDonor;
|
donor = _newDonor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @notice `onlyRecipient` Reassigns the `recipient` to a new address
|
/// @notice `onlyRecipient` Reassigns the `recipient` to a new address
|
||||||
/// @param _newRecipient The new recipient
|
/// @param _newRecipient The new recipient
|
||||||
function changeRecipient(address _newRecipient) onlyRecipient {
|
function changeRecipient(address _newRecipient) public onlyRecipient {
|
||||||
recipient = _newRecipient;
|
recipient = _newRecipient;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ contract MilestoneTracker {
|
|||||||
/// address paymentSource,
|
/// address paymentSource,
|
||||||
/// bytes payData,
|
/// bytes payData,
|
||||||
function proposeMilestones(bytes _newMilestones
|
function proposeMilestones(bytes _newMilestones
|
||||||
) onlyRecipient campaignNotCanceled {
|
) public onlyRecipient campaignNotCanceled {
|
||||||
proposedMilestones = _newMilestones;
|
proposedMilestones = _newMilestones;
|
||||||
changingMilestones = true;
|
changingMilestones = true;
|
||||||
emit NewMilestoneListProposed();
|
emit NewMilestoneListProposed();
|
||||||
@ -189,7 +189,7 @@ contract MilestoneTracker {
|
|||||||
|
|
||||||
/// @notice `onlyRecipient` Cancels the proposed milestones and reactivates
|
/// @notice `onlyRecipient` Cancels the proposed milestones and reactivates
|
||||||
/// the previous set of milestones
|
/// the previous set of milestones
|
||||||
function unproposeMilestones() onlyRecipient campaignNotCanceled {
|
function unproposeMilestones() public onlyRecipient campaignNotCanceled {
|
||||||
delete proposedMilestones;
|
delete proposedMilestones;
|
||||||
changingMilestones = false;
|
changingMilestones = false;
|
||||||
emit NewMilestoneListUnproposed();
|
emit NewMilestoneListUnproposed();
|
||||||
@ -200,7 +200,7 @@ contract MilestoneTracker {
|
|||||||
/// bytecode; this confirms that the `donor` knows the set of milestones
|
/// bytecode; this confirms that the `donor` knows the set of milestones
|
||||||
/// they are approving
|
/// they are approving
|
||||||
function acceptProposedMilestones(bytes32 _hashProposals
|
function acceptProposedMilestones(bytes32 _hashProposals
|
||||||
) onlyDonor campaignNotCanceled {
|
) public onlyDonor campaignNotCanceled {
|
||||||
|
|
||||||
uint i;
|
uint i;
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ contract MilestoneTracker {
|
|||||||
/// ready for review
|
/// ready for review
|
||||||
/// @param _idMilestone ID of the milestone that has been completed
|
/// @param _idMilestone ID of the milestone that has been completed
|
||||||
function markMilestoneComplete(uint _idMilestone)
|
function markMilestoneComplete(uint _idMilestone)
|
||||||
campaignNotCanceled notChanging
|
public campaignNotCanceled notChanging
|
||||||
{
|
{
|
||||||
if (_idMilestone >= milestones.length) throw;
|
if (_idMilestone >= milestones.length) throw;
|
||||||
Milestone milestone = milestones[_idMilestone];
|
Milestone milestone = milestones[_idMilestone];
|
||||||
@ -274,7 +274,7 @@ contract MilestoneTracker {
|
|||||||
/// @notice `onlyReviewer` Approves a specific milestone
|
/// @notice `onlyReviewer` Approves a specific milestone
|
||||||
/// @param _idMilestone ID of the milestone that is approved
|
/// @param _idMilestone ID of the milestone that is approved
|
||||||
function approveCompletedMilestone(uint _idMilestone)
|
function approveCompletedMilestone(uint _idMilestone)
|
||||||
campaignNotCanceled notChanging
|
public campaignNotCanceled notChanging
|
||||||
{
|
{
|
||||||
if (_idMilestone >= milestones.length) throw;
|
if (_idMilestone >= milestones.length) throw;
|
||||||
Milestone milestone = milestones[_idMilestone];
|
Milestone milestone = milestones[_idMilestone];
|
||||||
@ -289,7 +289,7 @@ contract MilestoneTracker {
|
|||||||
/// state
|
/// state
|
||||||
/// @param _idMilestone ID of the milestone that is being rejected
|
/// @param _idMilestone ID of the milestone that is being rejected
|
||||||
function rejectMilestone(uint _idMilestone)
|
function rejectMilestone(uint _idMilestone)
|
||||||
campaignNotCanceled notChanging
|
public campaignNotCanceled notChanging
|
||||||
{
|
{
|
||||||
if (_idMilestone >= milestones.length) throw;
|
if (_idMilestone >= milestones.length) throw;
|
||||||
Milestone milestone = milestones[_idMilestone];
|
Milestone milestone = milestones[_idMilestone];
|
||||||
@ -305,7 +305,7 @@ contract MilestoneTracker {
|
|||||||
/// `reviewTime` has elapsed
|
/// `reviewTime` has elapsed
|
||||||
/// @param _idMilestone ID of the milestone to be paid out
|
/// @param _idMilestone ID of the milestone to be paid out
|
||||||
function requestMilestonePayment(uint _idMilestone
|
function requestMilestonePayment(uint _idMilestone
|
||||||
) campaignNotCanceled notChanging {
|
) public campaignNotCanceled notChanging {
|
||||||
if (_idMilestone >= milestones.length) throw;
|
if (_idMilestone >= milestones.length) throw;
|
||||||
Milestone milestone = milestones[_idMilestone];
|
Milestone milestone = milestones[_idMilestone];
|
||||||
if ( (msg.sender != milestone.milestoneLeadLink)
|
if ( (msg.sender != milestone.milestoneLeadLink)
|
||||||
@ -321,7 +321,7 @@ contract MilestoneTracker {
|
|||||||
/// @notice `onlyRecipient` Cancels a previously accepted milestone
|
/// @notice `onlyRecipient` Cancels a previously accepted milestone
|
||||||
/// @param _idMilestone ID of the milestone to be canceled
|
/// @param _idMilestone ID of the milestone to be canceled
|
||||||
function cancelMilestone(uint _idMilestone)
|
function cancelMilestone(uint _idMilestone)
|
||||||
onlyRecipient campaignNotCanceled notChanging
|
public onlyRecipient campaignNotCanceled notChanging
|
||||||
{
|
{
|
||||||
if (_idMilestone >= milestones.length) throw;
|
if (_idMilestone >= milestones.length) throw;
|
||||||
Milestone milestone = milestones[_idMilestone];
|
Milestone milestone = milestones[_idMilestone];
|
||||||
@ -337,7 +337,7 @@ contract MilestoneTracker {
|
|||||||
/// has not been paid or canceled
|
/// has not been paid or canceled
|
||||||
/// @param _idMilestone ID of the milestone to be paid out
|
/// @param _idMilestone ID of the milestone to be paid out
|
||||||
function arbitrateApproveMilestone(uint _idMilestone
|
function arbitrateApproveMilestone(uint _idMilestone
|
||||||
) onlyArbitrator campaignNotCanceled notChanging {
|
) public onlyArbitrator campaignNotCanceled notChanging {
|
||||||
if (_idMilestone >= milestones.length) throw;
|
if (_idMilestone >= milestones.length) throw;
|
||||||
Milestone milestone = milestones[_idMilestone];
|
Milestone milestone = milestones[_idMilestone];
|
||||||
if ((milestone.status != MilestoneStatus.AcceptedAndInProgress) &&
|
if ((milestone.status != MilestoneStatus.AcceptedAndInProgress) &&
|
||||||
@ -348,7 +348,7 @@ contract MilestoneTracker {
|
|||||||
|
|
||||||
/// @notice `onlyArbitrator` Cancels the entire campaign voiding all
|
/// @notice `onlyArbitrator` Cancels the entire campaign voiding all
|
||||||
/// milestones.
|
/// milestones.
|
||||||
function arbitrateCancelCampaign() onlyArbitrator campaignNotCanceled {
|
function arbitrateCancelCampaign() public onlyArbitrator campaignNotCanceled {
|
||||||
campaignCanceled = true;
|
campaignCanceled = true;
|
||||||
emit CampaignCanceled();
|
emit CampaignCanceled();
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ contract Bounty is PullPayment, Destructible {
|
|||||||
* msg.sender as a researcher
|
* msg.sender as a researcher
|
||||||
* @return A target contract
|
* @return A target contract
|
||||||
*/
|
*/
|
||||||
function createTarget() returns(Target) {
|
function createTarget() public returns(Target) {
|
||||||
Target target = Target(deployContract());
|
Target target = Target(deployContract());
|
||||||
researchers[target] = msg.sender;
|
researchers[target] = msg.sender;
|
||||||
emit TargetCreated(target);
|
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.
|
* @dev Sends the contract funds to the researcher that proved the contract is broken.
|
||||||
* @param target contract
|
* @param target contract
|
||||||
*/
|
*/
|
||||||
function claim(Target target) {
|
function claim(Target target) public {
|
||||||
address researcher = researchers[target];
|
address researcher = researchers[target];
|
||||||
if (researcher == address(0)) {
|
if (researcher == address(0)) {
|
||||||
throw;
|
throw;
|
||||||
@ -74,5 +74,5 @@ contract Target {
|
|||||||
* In order to win the bounty, security researchers will try to cause this broken state.
|
* 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.
|
* @return True if all invariant values are correct, false otherwise.
|
||||||
*/
|
*/
|
||||||
function checkInvariant() returns(bool);
|
function checkInvariant() public returns(bool);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ contract DayLimit {
|
|||||||
* @dev Constructor that sets the passed value as a dailyLimit.
|
* @dev Constructor that sets the passed value as a dailyLimit.
|
||||||
* @param _limit uint256 to represent the daily limit.
|
* @param _limit uint256 to represent the daily limit.
|
||||||
*/
|
*/
|
||||||
constructor(uint256 _limit) {
|
constructor(uint256 _limit) public {
|
||||||
dailyLimit = _limit;
|
dailyLimit = _limit;
|
||||||
lastDay = today();
|
lastDay = today();
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ contract LimitBalance {
|
|||||||
* @dev Constructor that sets the passed value as a limit.
|
* @dev Constructor that sets the passed value as a limit.
|
||||||
* @param _limit uint256 to represent the limit.
|
* @param _limit uint256 to represent the limit.
|
||||||
*/
|
*/
|
||||||
constructor(uint256 _limit) {
|
constructor(uint256 _limit) public {
|
||||||
limit = _limit;
|
limit = _limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,19 +25,19 @@ contract MultisigWallet is Multisig, Shareable, DayLimit {
|
|||||||
* @param _owners A list of owners.
|
* @param _owners A list of owners.
|
||||||
* @param _required The amount required for a transaction to be approved.
|
* @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)
|
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 {
|
function destroy(address _to) onlymanyowners(keccak256(msg.data)) external {
|
||||||
selfdestruct(_to);
|
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 {
|
function() external payable {
|
||||||
// just being sent some cash?
|
// 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
|
* @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
|
* 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
|
* 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,
|
* the _to, _value, and _data arguments). They still get the option of using them if they want,
|
||||||
* anyways.
|
* anyways.
|
||||||
* @param _to The receiver address
|
* @param _to The receiver address
|
||||||
* @param _value The value to send
|
* @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.
|
* txs, in order to determine the body of the transaction from the hash provided.
|
||||||
* @param _h The transaction hash to approve.
|
* @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 != address(0)) {
|
||||||
if (!txs[_h].to.call.value(txs[_h].value)(txs[_h].data)) {
|
if (!txs[_h].to.call.value(txs[_h].value)(txs[_h].data)) {
|
||||||
throw;
|
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.
|
* @param _newLimit uint256 to represent the new limit.
|
||||||
*/
|
*/
|
||||||
function setDailyLimit(uint256 _newLimit) onlymanyowners(keccak256(msg.data)) external {
|
function setDailyLimit(uint256 _newLimit) onlymanyowners(keccak256(msg.data)) external {
|
||||||
_setDailyLimit(_newLimit);
|
_setDailyLimit(_newLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev Resets the value spent to enable more spending
|
* @dev Resets the value spent to enable more spending
|
||||||
*/
|
*/
|
||||||
function resetSpentToday() onlymanyowners(keccak256(msg.data)) external {
|
function resetSpentToday() onlymanyowners(keccak256(msg.data)) external {
|
||||||
@ -108,7 +108,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit {
|
|||||||
|
|
||||||
|
|
||||||
// INTERNAL METHODS
|
// INTERNAL METHODS
|
||||||
/**
|
/**
|
||||||
* @dev Clears the list of transactions pending approval.
|
* @dev Clears the list of transactions pending approval.
|
||||||
*/
|
*/
|
||||||
function clearPending() internal {
|
function clearPending() internal {
|
||||||
|
@ -12,7 +12,7 @@ contract CappedCrowdsale is Crowdsale {
|
|||||||
|
|
||||||
uint256 public cap;
|
uint256 public cap;
|
||||||
|
|
||||||
constructor(uint256 _cap) {
|
constructor(uint256 _cap) public {
|
||||||
cap = _cap;
|
cap = _cap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,11 +4,11 @@ import '../token/MintableToken.sol';
|
|||||||
import '../math/SafeMath.sol';
|
import '../math/SafeMath.sol';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title Crowdsale
|
* @title Crowdsale
|
||||||
* @dev Crowdsale is a base contract for managing a token crowdsale.
|
* @dev Crowdsale is a base contract for managing a token crowdsale.
|
||||||
* Crowdsales have a start and end block, where investors can make
|
* Crowdsales have a start and end block, where investors can make
|
||||||
* token purchases and the crowdsale will assign them tokens based
|
* 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.
|
* as they arrive.
|
||||||
*/
|
*/
|
||||||
contract Crowdsale {
|
contract Crowdsale {
|
||||||
@ -36,11 +36,11 @@ contract Crowdsale {
|
|||||||
* @param beneficiary who got the tokens
|
* @param beneficiary who got the tokens
|
||||||
* @param value weis paid for purchase
|
* @param value weis paid for purchase
|
||||||
* @param amount amount of tokens purchased
|
* @param amount amount of tokens purchased
|
||||||
*/
|
*/
|
||||||
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
|
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(_startBlock >= block.number);
|
||||||
require(_endBlock >= _startBlock);
|
require(_endBlock >= _startBlock);
|
||||||
require(_rate > 0);
|
require(_rate > 0);
|
||||||
@ -53,7 +53,7 @@ contract Crowdsale {
|
|||||||
wallet = _wallet;
|
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.
|
// override this method to have crowdsale of a specific mintable token.
|
||||||
function createTokenContract() internal returns (MintableToken) {
|
function createTokenContract() internal returns (MintableToken) {
|
||||||
return new MintableToken();
|
return new MintableToken();
|
||||||
@ -66,7 +66,7 @@ contract Crowdsale {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// low level token purchase function
|
// low level token purchase function
|
||||||
function buyTokens(address beneficiary) payable {
|
function buyTokens(address beneficiary) public payable {
|
||||||
require(beneficiary != address(0x0));
|
require(beneficiary != address(0x0));
|
||||||
require(validPurchase());
|
require(validPurchase());
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ contract FinalizableCrowdsale is Crowdsale, Ownable {
|
|||||||
|
|
||||||
// should be called after crowdsale ends, to do
|
// should be called after crowdsale ends, to do
|
||||||
// some extra finalization work
|
// some extra finalization work
|
||||||
function finalize() onlyOwner {
|
function finalize() public onlyOwner {
|
||||||
require(!isFinalized);
|
require(!isFinalized);
|
||||||
require(hasEnded());
|
require(hasEnded());
|
||||||
|
|
||||||
|
@ -22,31 +22,31 @@ contract RefundVault is Ownable {
|
|||||||
event RefundsEnabled();
|
event RefundsEnabled();
|
||||||
event Refunded(address indexed beneficiary, uint256 weiAmount);
|
event Refunded(address indexed beneficiary, uint256 weiAmount);
|
||||||
|
|
||||||
constructor(address _wallet) {
|
constructor(address _wallet) public {
|
||||||
require(_wallet != address(0x0));
|
require(_wallet != address(0x0));
|
||||||
wallet = _wallet;
|
wallet = _wallet;
|
||||||
state = State.Active;
|
state = State.Active;
|
||||||
}
|
}
|
||||||
|
|
||||||
function deposit(address investor) onlyOwner payable {
|
function deposit(address investor) public onlyOwner payable {
|
||||||
require(state == State.Active);
|
require(state == State.Active);
|
||||||
deposited[investor] = deposited[investor].add(msg.value);
|
deposited[investor] = deposited[investor].add(msg.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() onlyOwner {
|
function close() public onlyOwner {
|
||||||
require(state == State.Active);
|
require(state == State.Active);
|
||||||
state = State.Closed;
|
state = State.Closed;
|
||||||
emit Closed();
|
emit Closed();
|
||||||
wallet.transfer(this.balance);
|
wallet.transfer(this.balance);
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableRefunds() onlyOwner {
|
function enableRefunds() public onlyOwner {
|
||||||
require(state == State.Active);
|
require(state == State.Active);
|
||||||
state = State.Refunding;
|
state = State.Refunding;
|
||||||
emit RefundsEnabled();
|
emit RefundsEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
function refund(address investor) {
|
function refund(address investor) public {
|
||||||
require(state == State.Refunding);
|
require(state == State.Refunding);
|
||||||
uint256 depositedValue = deposited[investor];
|
uint256 depositedValue = deposited[investor];
|
||||||
deposited[investor] = 0;
|
deposited[investor] = 0;
|
||||||
|
@ -21,7 +21,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale {
|
|||||||
// refund vault used to hold funds while crowdsale is running
|
// refund vault used to hold funds while crowdsale is running
|
||||||
RefundVault public vault;
|
RefundVault public vault;
|
||||||
|
|
||||||
constructor(uint256 _goal) {
|
constructor(uint256 _goal) public {
|
||||||
vault = new RefundVault(wallet);
|
vault = new RefundVault(wallet);
|
||||||
goal = _goal;
|
goal = _goal;
|
||||||
}
|
}
|
||||||
@ -34,7 +34,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if crowdsale is unsuccessful, investors can claim refunds here
|
// if crowdsale is unsuccessful, investors can claim refunds here
|
||||||
function claimRefund() {
|
function claimRefund() public {
|
||||||
require(isFinalized);
|
require(isFinalized);
|
||||||
require(!goalReached());
|
require(!goalReached());
|
||||||
|
|
||||||
|
@ -10,16 +10,16 @@ import "../ownership/Ownable.sol";
|
|||||||
*/
|
*/
|
||||||
contract Destructible is Ownable {
|
contract Destructible is Ownable {
|
||||||
|
|
||||||
constructor() payable { }
|
constructor() public payable { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev Transfers the current balance to the owner and terminates the contract.
|
* @dev Transfers the current balance to the owner and terminates the contract.
|
||||||
*/
|
*/
|
||||||
function destroy() onlyOwner {
|
function destroy() public onlyOwner {
|
||||||
selfdestruct(owner);
|
selfdestruct(owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
function destroyAndSend(address _recipient) onlyOwner {
|
function destroyAndSend(address _recipient) public onlyOwner {
|
||||||
selfdestruct(_recipient);
|
selfdestruct(_recipient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,11 +10,11 @@ import '../ownership/Ownable.sol';
|
|||||||
contract Migrations is Ownable {
|
contract Migrations is Ownable {
|
||||||
uint256 public lastCompletedMigration;
|
uint256 public lastCompletedMigration;
|
||||||
|
|
||||||
function setCompleted(uint256 completed) onlyOwner {
|
function setCompleted(uint256 completed) public onlyOwner {
|
||||||
lastCompletedMigration = completed;
|
lastCompletedMigration = completed;
|
||||||
}
|
}
|
||||||
|
|
||||||
function upgrade(address newAddress) onlyOwner {
|
function upgrade(address newAddress) public onlyOwner {
|
||||||
Migrations upgraded = Migrations(newAddress);
|
Migrations upgraded = Migrations(newAddress);
|
||||||
upgraded.setCompleted(lastCompletedMigration);
|
upgraded.setCompleted(lastCompletedMigration);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ contract Pausable is Ownable {
|
|||||||
/**
|
/**
|
||||||
* @dev called by the owner to pause, triggers stopped state
|
* @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;
|
paused = true;
|
||||||
emit Pause();
|
emit Pause();
|
||||||
return true;
|
return true;
|
||||||
@ -43,7 +43,7 @@ contract Pausable is Ownable {
|
|||||||
/**
|
/**
|
||||||
* @dev called by the owner to unpause, returns to normal state
|
* @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;
|
paused = false;
|
||||||
emit Unpause();
|
emit Unpause();
|
||||||
return true;
|
return true;
|
||||||
|
@ -12,7 +12,7 @@ import "../token/ERC20Basic.sol";
|
|||||||
*/
|
*/
|
||||||
contract TokenDestructible is Ownable {
|
contract TokenDestructible is Ownable {
|
||||||
|
|
||||||
constructor() payable { }
|
constructor() public payable { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notice Terminate contract and refund to owner
|
* @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
|
* @notice The called token contracts could try to re-enter this contract. Only
|
||||||
supply token contracts you trust.
|
supply token contracts you trust.
|
||||||
*/
|
*/
|
||||||
function destroy(address[] tokens) onlyOwner {
|
function destroy(address[] tokens) public onlyOwner {
|
||||||
|
|
||||||
// Transfer tokens to owner
|
// Transfer tokens to owner
|
||||||
for(uint256 i = 0; i < tokens.length; i++) {
|
for(uint256 i = 0; i < tokens.length; i++) {
|
||||||
|
@ -26,14 +26,14 @@ contract Claimable is Ownable {
|
|||||||
* @dev Allows the current owner to set the pendingOwner address.
|
* @dev Allows the current owner to set the pendingOwner address.
|
||||||
* @param newOwner The address to transfer ownership to.
|
* @param newOwner The address to transfer ownership to.
|
||||||
*/
|
*/
|
||||||
function transferOwnership(address newOwner) onlyOwner {
|
function transferOwnership(address newOwner) public onlyOwner {
|
||||||
pendingOwner = newOwner;
|
pendingOwner = newOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev Allows the pendingOwner address to finalize the transfer.
|
* @dev Allows the pendingOwner address to finalize the transfer.
|
||||||
*/
|
*/
|
||||||
function claimOwnership() onlyPendingOwner {
|
function claimOwnership() public onlyPendingOwner {
|
||||||
owner = pendingOwner;
|
owner = pendingOwner;
|
||||||
pendingOwner = address(0x0);
|
pendingOwner = address(0x0);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ contract Contactable is Ownable{
|
|||||||
* @dev Allows the owner to set a string with their contact information.
|
* @dev Allows the owner to set a string with their contact information.
|
||||||
* @param info The contact information to attach to the contract.
|
* @param info The contact information to attach to the contract.
|
||||||
*/
|
*/
|
||||||
function setContactInformation(string info) onlyOwner{
|
function setContactInformation(string info) public onlyOwner{
|
||||||
contactInformation = info;
|
contactInformation = info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ contract DelayedClaimable is Claimable {
|
|||||||
* @param _start The earliest time ownership can be claimed.
|
* @param _start The earliest time ownership can be claimed.
|
||||||
* @param _end The latest 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)
|
if (_start > _end)
|
||||||
throw;
|
throw;
|
||||||
end = _end;
|
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
|
* @dev Allows the pendingOwner address to finalize the transfer, as long as it is called within
|
||||||
* the specified start and end time.
|
* the specified start and end time.
|
||||||
*/
|
*/
|
||||||
function claimOwnership() onlyPendingOwner {
|
function claimOwnership() public onlyPendingOwner {
|
||||||
if ((block.number > end) || (block.number < start))
|
if ((block.number > end) || (block.number < start))
|
||||||
throw;
|
throw;
|
||||||
owner = pendingOwner;
|
owner = pendingOwner;
|
||||||
|
@ -21,7 +21,7 @@ contract HasNoEther is Ownable {
|
|||||||
* constructor. By doing it this way we prevent a payable constructor from working. Alternatively
|
* constructor. By doing it this way we prevent a payable constructor from working. Alternatively
|
||||||
* we could use assembly to access msg.value.
|
* we could use assembly to access msg.value.
|
||||||
*/
|
*/
|
||||||
constructor() payable {
|
constructor() public payable {
|
||||||
if(msg.value > 0) {
|
if(msg.value > 0) {
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
@ -24,5 +24,5 @@ contract Multisig {
|
|||||||
// TODO: document
|
// TODO: document
|
||||||
function changeOwner(address _from, address _to) external;
|
function changeOwner(address _from, address _to) external;
|
||||||
function execute(address _to, uint256 _value, bytes _data) external returns (bytes32);
|
function execute(address _to, uint256 _value, bytes _data) external returns (bytes32);
|
||||||
function confirm(bytes32 _h) returns (bool);
|
function confirm(bytes32 _h) public returns (bool);
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ contract Ownable {
|
|||||||
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
|
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
|
||||||
* account.
|
* account.
|
||||||
*/
|
*/
|
||||||
constructor() {
|
constructor() public {
|
||||||
owner = msg.sender;
|
owner = msg.sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ contract Ownable {
|
|||||||
* @dev Allows the current owner to transfer control of the contract to a newOwner.
|
* @dev Allows the current owner to transfer control of the contract to a newOwner.
|
||||||
* @param newOwner The address to transfer ownership to.
|
* @param newOwner The address to transfer ownership to.
|
||||||
*/
|
*/
|
||||||
function transferOwnership(address newOwner) onlyOwner {
|
function transferOwnership(address newOwner) public onlyOwner {
|
||||||
if (newOwner != address(0)) {
|
if (newOwner != address(0)) {
|
||||||
owner = newOwner;
|
owner = newOwner;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ contract Shareable {
|
|||||||
* @param _owners A list of owners.
|
* @param _owners A list of owners.
|
||||||
* @param _required The amount required for a transaction to be approved.
|
* @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;
|
owners[1] = msg.sender;
|
||||||
ownerIndex[msg.sender] = 1;
|
ownerIndex[msg.sender] = 1;
|
||||||
for (uint256 i = 0; i < _owners.length; ++i) {
|
for (uint256 i = 0; i < _owners.length; ++i) {
|
||||||
@ -105,7 +105,7 @@ contract Shareable {
|
|||||||
* @param _addr address The address which you want to check.
|
* @param _addr address The address which you want to check.
|
||||||
* @return True if the address is an owner and fase otherwise.
|
* @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;
|
return ownerIndex[_addr] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ contract Shareable {
|
|||||||
* @param _owner The owner address.
|
* @param _owner The owner address.
|
||||||
* @return True if the owner has confirmed and false otherwise.
|
* @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];
|
PendingState memory pending = pendings[_operation];
|
||||||
uint256 index = ownerIndex[_owner];
|
uint256 index = ownerIndex[_owner];
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ contract PullPayment {
|
|||||||
/**
|
/**
|
||||||
* @dev withdraw accumulated balance, called by payee.
|
* @dev withdraw accumulated balance, called by payee.
|
||||||
*/
|
*/
|
||||||
function withdrawPayments() {
|
function withdrawPayments() public {
|
||||||
address payee = msg.sender;
|
address payee = msg.sender;
|
||||||
uint256 payment = payments[payee];
|
uint256 payment = payments[payee];
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ contract BasicToken is ERC20Basic {
|
|||||||
* @param _to The address to transfer to.
|
* @param _to The address to transfer to.
|
||||||
* @param _value The amount to be transferred.
|
* @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[msg.sender] = balances[msg.sender].sub(_value);
|
||||||
balances[_to] = balances[_to].add(_value);
|
balances[_to] = balances[_to].add(_value);
|
||||||
emit Transfer(msg.sender, _to, _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.
|
* @param _owner The address to query the the balance of.
|
||||||
* @return An uint256 representing the amount owned by the passed address.
|
* @return An uint256 representing the amount owned by the passed address.
|
||||||
*/
|
*/
|
||||||
function balanceOf(address _owner) view returns (uint256 balance) {
|
function balanceOf(address _owner) public view returns (uint256 balance) {
|
||||||
return balances[_owner];
|
return balances[_owner];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@ import './ERC20Basic.sol';
|
|||||||
* @dev see https://github.com/ethereum/EIPs/issues/20
|
* @dev see https://github.com/ethereum/EIPs/issues/20
|
||||||
*/
|
*/
|
||||||
contract ERC20 is ERC20Basic {
|
contract ERC20 is ERC20Basic {
|
||||||
function allowance(address owner, address spender) view returns (uint256);
|
function allowance(address owner, address spender) public view returns (uint256);
|
||||||
function transferFrom(address from, address to, uint256 value);
|
function transferFrom(address from, address to, uint256 value) public;
|
||||||
function approve(address spender, uint256 value);
|
function approve(address spender, uint256 value) public;
|
||||||
event Approval(address indexed owner, address indexed spender, uint256 value);
|
event Approval(address indexed owner, address indexed spender, uint256 value);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ pragma solidity ^0.4.11;
|
|||||||
*/
|
*/
|
||||||
contract ERC20Basic {
|
contract ERC20Basic {
|
||||||
uint256 public totalSupply;
|
uint256 public totalSupply;
|
||||||
function balanceOf(address who) view returns (uint256);
|
function balanceOf(address who) public view returns (uint256);
|
||||||
function transfer(address to, uint256 value);
|
function transfer(address to, uint256 value) public;
|
||||||
event Transfer(address indexed from, address indexed to, uint256 value);
|
event Transfer(address indexed from, address indexed to, uint256 value);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ contract LimitedTransferToken is ERC20 {
|
|||||||
* @param _to The address that will recieve the tokens.
|
* @param _to The address that will recieve the tokens.
|
||||||
* @param _value The amount of tokens to be transferred.
|
* @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);
|
super.transfer(_to, _value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ contract LimitedTransferToken is ERC20 {
|
|||||||
* @param _to The address that will recieve the tokens.
|
* @param _to The address that will recieve the tokens.
|
||||||
* @param _value The amount of tokens to be transferred.
|
* @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);
|
super.transferFrom(_from, _to, _value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ contract MintableToken is StandardToken, Ownable {
|
|||||||
* @param _amount The amount of tokens to mint.
|
* @param _amount The amount of tokens to mint.
|
||||||
* @return A boolean that indicates if the operation was successful.
|
* @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);
|
totalSupply = totalSupply.add(_amount);
|
||||||
balances[_to] = balances[_to].add(_amount);
|
balances[_to] = balances[_to].add(_amount);
|
||||||
emit Mint(_to, _amount);
|
emit Mint(_to, _amount);
|
||||||
@ -42,7 +42,7 @@ contract MintableToken is StandardToken, Ownable {
|
|||||||
* @dev Function to stop minting new tokens.
|
* @dev Function to stop minting new tokens.
|
||||||
* @return True if the operation was successful.
|
* @return True if the operation was successful.
|
||||||
*/
|
*/
|
||||||
function finishMinting() onlyOwner returns (bool) {
|
function finishMinting() public onlyOwner returns (bool) {
|
||||||
mintingFinished = true;
|
mintingFinished = true;
|
||||||
emit MintFinished();
|
emit MintFinished();
|
||||||
return true;
|
return true;
|
||||||
|
@ -11,11 +11,11 @@ import '../lifecycle/Pausable.sol';
|
|||||||
|
|
||||||
contract PausableToken is StandardToken, Pausable {
|
contract PausableToken is StandardToken, Pausable {
|
||||||
|
|
||||||
function transfer(address _to, uint _value) whenNotPaused {
|
function transfer(address _to, uint _value) public whenNotPaused {
|
||||||
super.transfer(_to, _value);
|
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);
|
super.transferFrom(_from, _to, _value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ contract SimpleToken is StandardToken {
|
|||||||
/**
|
/**
|
||||||
* @dev Contructor that gives msg.sender all of existing tokens.
|
* @dev Contructor that gives msg.sender all of existing tokens.
|
||||||
*/
|
*/
|
||||||
constructor() {
|
constructor() public {
|
||||||
totalSupply = INITIAL_SUPPLY;
|
totalSupply = INITIAL_SUPPLY;
|
||||||
balances[msg.sender] = INITIAL_SUPPLY;
|
balances[msg.sender] = INITIAL_SUPPLY;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ contract StandardToken is ERC20, BasicToken {
|
|||||||
* @param _to address The address which you want to transfer to
|
* @param _to address The address which you want to transfer to
|
||||||
* @param _value uint256 the amout of tokens to be transfered
|
* @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];
|
uint256 _allowance = allowed[_from][msg.sender];
|
||||||
|
|
||||||
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
|
// 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 _spender The address which will spend the funds.
|
||||||
* @param _value The amount of tokens to be spent.
|
* @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`
|
// To change the approve amount you first have to reduce the addresses`
|
||||||
// allowance to zero by calling `approve(_spender, 0)` if it is not
|
// 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.
|
* @param _spender address The address which will spend the funds.
|
||||||
* @return A uint256 specifing the amount of tokens still avaible for the spender.
|
* @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];
|
return allowed[_owner][_spender];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ contract TokenTimelock {
|
|||||||
// timestamp when token release is enabled
|
// timestamp when token release is enabled
|
||||||
uint releaseTime;
|
uint releaseTime;
|
||||||
|
|
||||||
constructor(ERC20Basic _token, address _beneficiary, uint _releaseTime) {
|
constructor(ERC20Basic _token, address _beneficiary, uint _releaseTime) public {
|
||||||
require(_releaseTime > now);
|
require(_releaseTime > now);
|
||||||
token = _token;
|
token = _token;
|
||||||
beneficiary = _beneficiary;
|
beneficiary = _beneficiary;
|
||||||
@ -29,7 +29,7 @@ contract TokenTimelock {
|
|||||||
/**
|
/**
|
||||||
* @dev beneficiary claims tokens held by time lock
|
* @dev beneficiary claims tokens held by time lock
|
||||||
*/
|
*/
|
||||||
function claim() {
|
function claim() public {
|
||||||
require(msg.sender == beneficiary);
|
require(msg.sender == beneficiary);
|
||||||
require(now >= releaseTime);
|
require(now >= releaseTime);
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
|
|||||||
* @param _holder The holder of the grants.
|
* @param _holder The holder of the grants.
|
||||||
* @return A uint256 representing the total amount of 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;
|
return grants[_holder].length;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
|
|||||||
uint256 time,
|
uint256 time,
|
||||||
uint256 start,
|
uint256 start,
|
||||||
uint256 cliff,
|
uint256 cliff,
|
||||||
uint256 vesting) view returns (uint256)
|
uint256 vesting) public view returns (uint256)
|
||||||
{
|
{
|
||||||
// Shortcuts for before cliff and after vesting cases.
|
// Shortcuts for before cliff and after vesting cases.
|
||||||
if (time < cliff) return 0;
|
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,
|
* @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.
|
* 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];
|
TokenGrant grant = grants[_holder][_grantId];
|
||||||
|
|
||||||
granter = grant.granter;
|
granter = grant.granter;
|
||||||
|
Loading…
Reference in New Issue
Block a user