Skip to content

Commit

Permalink
update constructor syntax for solidity 0.4.23 in numerous contracts (#…
Browse files Browse the repository at this point in the history
…921)

* update solidity-coverage to ^0.5.0

* update truffle dependency to ^4.1.8

* update solium to ^1.1.7

* update all contracts to solidity ^0.4.23
  • Loading branch information
pemulis authored and shrugs committed May 9, 2018
1 parent 20b85be commit ad12381
Show file tree
Hide file tree
Showing 108 changed files with 361 additions and 725 deletions.
2 changes: 1 addition & 1 deletion contracts/AddressUtils.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/Bounty.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


import "./payment/PullPayment.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/DayLimit.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


/**
Expand All @@ -16,7 +16,7 @@ contract DayLimit {
* @dev Constructor that sets the passed value as a dailyLimit.
* @param _limit uint256 to represent the daily limit.
*/
function DayLimit(uint256 _limit) public {
constructor(uint256 _limit) public {
dailyLimit = _limit;
lastDay = today();
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/ECRecovery.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


/**
Expand Down
4 changes: 2 additions & 2 deletions contracts/LimitBalance.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


/**
Expand All @@ -15,7 +15,7 @@ contract LimitBalance {
* @dev Constructor that sets the passed value as a limit.
* @param _limit uint256 to represent the limit.
*/
function LimitBalance(uint256 _limit) public {
constructor(uint256 _limit) public {
limit = _limit;
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/MerkleProof.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


/*
Expand Down
2 changes: 1 addition & 1 deletion contracts/ReentrancyGuard.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/access/SignatureBouncer.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.18;
pragma solidity ^0.4.23;

import "../ownership/Ownable.sol";
import "../ownership/rbac/RBAC.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/crowdsale/Crowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../token/ERC20/ERC20.sol";
import "../math/SafeMath.sol";
Expand Down Expand Up @@ -45,7 +45,7 @@ contract Crowdsale {
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
function Crowdsale(uint256 _rate, address _wallet, ERC20 _token) public {
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/distribution/FinalizableCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../../math/SafeMath.sol";
import "../../ownership/Ownable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../validation/TimedCrowdsale.sol";
import "../../token/ERC20/ERC20.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/crowdsale/distribution/RefundableCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


import "../../math/SafeMath.sol";
Expand All @@ -25,7 +25,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale {
* @dev Constructor, creates RefundVault.
* @param _goal Funding goal
*/
function RefundableCrowdsale(uint256 _goal) public {
constructor(uint256 _goal) public {
require(_goal > 0);
vault = new RefundVault(wallet);
goal = _goal;
Expand Down
4 changes: 2 additions & 2 deletions contracts/crowdsale/distribution/utils/RefundVault.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../../../math/SafeMath.sol";
import "../../../ownership/Ownable.sol";
Expand Down Expand Up @@ -26,7 +26,7 @@ contract RefundVault is Ownable {
/**
* @param _wallet Vault address
*/
function RefundVault(address _wallet) public {
constructor(address _wallet) public {
require(_wallet != address(0));
wallet = _wallet;
state = State.Active;
Expand Down
6 changes: 3 additions & 3 deletions contracts/crowdsale/emission/AllowanceCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../Crowdsale.sol";
import "../../token/ERC20/ERC20.sol";
Expand All @@ -15,10 +15,10 @@ contract AllowanceCrowdsale is Crowdsale {
address public tokenWallet;

/**
* @dev Constructor, takes token wallet address.
* @dev Constructor, takes token wallet address.
* @param _tokenWallet Address holding the tokens, which has approved allowance to the crowdsale
*/
function AllowanceCrowdsale(address _tokenWallet) public {
constructor(address _tokenWallet) public {
require(_tokenWallet != address(0));
tokenWallet = _tokenWallet;
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/crowdsale/emission/MintedCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../Crowdsale.sol";
import "../../token/ERC20/MintableToken.sol";
Expand All @@ -7,7 +7,7 @@ import "../../token/ERC20/MintableToken.sol";
/**
* @title MintedCrowdsale
* @dev Extension of Crowdsale contract whose tokens are minted in each purchase.
* Token ownership should be transferred to MintedCrowdsale for minting.
* Token ownership should be transferred to MintedCrowdsale for minting.
*/
contract MintedCrowdsale is Crowdsale {

Expand Down
4 changes: 2 additions & 2 deletions contracts/crowdsale/price/IncreasingPriceCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../validation/TimedCrowdsale.sol";
import "../../math/SafeMath.sol";
Expand All @@ -21,7 +21,7 @@ contract IncreasingPriceCrowdsale is TimedCrowdsale {
* @param _initialRate Number of tokens a buyer gets per wei at the start of the crowdsale
* @param _finalRate Number of tokens a buyer gets per wei at the end of the crowdsale
*/
function IncreasingPriceCrowdsale(uint256 _initialRate, uint256 _finalRate) public {
constructor(uint256 _initialRate, uint256 _finalRate) public {
require(_initialRate >= _finalRate);
require(_finalRate > 0);
initialRate = _initialRate;
Expand Down
6 changes: 3 additions & 3 deletions contracts/crowdsale/validation/CappedCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../../math/SafeMath.sol";
import "../Crowdsale.sol";
Expand All @@ -17,13 +17,13 @@ contract CappedCrowdsale is Crowdsale {
* @dev Constructor, takes maximum amount of wei accepted in the crowdsale.
* @param _cap Max amount of wei to be contributed
*/
function CappedCrowdsale(uint256 _cap) public {
constructor(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}

/**
* @dev Checks whether the cap has been reached.
* @dev Checks whether the cap has been reached.
* @return Whether the cap was reached
*/
function capReached() public view returns (bool) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../../math/SafeMath.sol";
import "../Crowdsale.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/crowdsale/validation/TimedCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../../math/SafeMath.sol";
import "../Crowdsale.sol";
Expand Down Expand Up @@ -28,7 +28,7 @@ contract TimedCrowdsale is Crowdsale {
* @param _openingTime Crowdsale opening time
* @param _closingTime Crowdsale closing time
*/
function TimedCrowdsale(uint256 _openingTime, uint256 _closingTime) public {
constructor(uint256 _openingTime, uint256 _closingTime) public {
// solium-disable-next-line security/no-block-members
require(_openingTime >= block.timestamp);
require(_closingTime >= _openingTime);
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/validation/WhitelistedCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../Crowdsale.sol";
import "../../ownership/Ownable.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/examples/SampleCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../crowdsale/validation/CappedCrowdsale.sol";
import "../crowdsale/distribution/RefundableCrowdsale.sol";
Expand Down Expand Up @@ -33,7 +33,7 @@ contract SampleCrowdsaleToken is MintableToken {
*/
contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale, MintedCrowdsale {

function SampleCrowdsale(
constructor(
uint256 _openingTime,
uint256 _closingTime,
uint256 _rate,
Expand Down
4 changes: 2 additions & 2 deletions contracts/examples/SimpleSavingsWallet.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../ownership/Heritable.sol";

Expand All @@ -19,7 +19,7 @@ contract SimpleSavingsWallet is Heritable {
event Received(address indexed payer, uint256 amount, uint256 balance);


function SimpleSavingsWallet(uint256 _heartbeatTimeout) Heritable(_heartbeatTimeout) public {}
constructor(uint256 _heartbeatTimeout) Heritable(_heartbeatTimeout) public {}

/**
* @dev wallet can receive funds.
Expand Down
4 changes: 2 additions & 2 deletions contracts/examples/SimpleToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


import "../token/ERC20/StandardToken.sol";
Expand All @@ -21,7 +21,7 @@ contract SimpleToken is StandardToken {
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
function SimpleToken() public {
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
Expand Down
4 changes: 2 additions & 2 deletions contracts/lifecycle/Destructible.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


import "../ownership/Ownable.sol";
Expand All @@ -10,7 +10,7 @@ import "../ownership/Ownable.sol";
*/
contract Destructible is Ownable {

function Destructible() public payable { }
constructor() public payable { }

/**
* @dev Transfers the current balance to the owner and terminates the contract.
Expand Down
2 changes: 1 addition & 1 deletion contracts/lifecycle/Pausable.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


import "../ownership/Ownable.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/lifecycle/TokenDestructible.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../ownership/Ownable.sol";
import "../token/ERC20/ERC20Basic.sol";
Expand All @@ -12,7 +12,7 @@ import "../token/ERC20/ERC20Basic.sol";
*/
contract TokenDestructible is Ownable {

function TokenDestructible() public payable { }
constructor() public payable { }

/**
* @notice Terminate contract and refund to owner
Expand Down
2 changes: 1 addition & 1 deletion contracts/math/Math.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/math/SafeMath.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


/**
Expand Down
6 changes: 3 additions & 3 deletions contracts/mocks/AllowanceCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../token/ERC20/ERC20.sol";
import "../crowdsale/emission/AllowanceCrowdsale.sol";


contract AllowanceCrowdsaleImpl is AllowanceCrowdsale {

function AllowanceCrowdsaleImpl (
constructor (
uint256 _rate,
address _wallet,
ERC20 _token,
address _tokenWallet
)
)
public
Crowdsale(_rate, _wallet, _token)
AllowanceCrowdsale(_tokenWallet)
Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/BasicTokenMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;


import "../token/ERC20/BasicToken.sol";
Expand All @@ -7,7 +7,7 @@ import "../token/ERC20/BasicToken.sol";
// mock class using BasicToken
contract BasicTokenMock is BasicToken {

function BasicTokenMock(address initialAccount, uint256 initialBalance) public {
constructor(address initialAccount, uint256 initialBalance) public {
balances[initialAccount] = initialBalance;
totalSupply_ = initialBalance;
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/BouncerMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.18;
pragma solidity ^0.4.23;

import "../access/SignatureBouncer.sol";

Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/BurnableTokenMock.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../token/ERC20/BurnableToken.sol";


contract BurnableTokenMock is BurnableToken {

function BurnableTokenMock(address initialAccount, uint initialBalance) public {
constructor(address initialAccount, uint initialBalance) public {
balances[initialAccount] = initialBalance;
totalSupply_ = initialBalance;
}
Expand Down
6 changes: 3 additions & 3 deletions contracts/mocks/CappedCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.23;

import "../token/ERC20/ERC20.sol";
import "../crowdsale/validation/CappedCrowdsale.sol";


contract CappedCrowdsaleImpl is CappedCrowdsale {

function CappedCrowdsaleImpl (
constructor (
uint256 _rate,
address _wallet,
ERC20 _token,
uint256 _cap
)
)
public
Crowdsale(_rate, _wallet, _token)
CappedCrowdsale(_cap)
Expand Down

0 comments on commit ad12381

Please sign in to comment.