mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4350 from ethereum/constructorWorkaroundExternal
New constructor syntax for external compilation tests
This commit is contained in:
commit
4be9dc4304
@ -102,7 +102,7 @@ contract MultiSigWallet {
|
||||
/// @dev Contract constructor sets initial owners and required number of confirmations.
|
||||
/// @param _owners List of initial owners.
|
||||
/// @param _required Number of required confirmations.
|
||||
function MultiSigWallet(address[] _owners, uint _required)
|
||||
constructor(address[] _owners, uint _required)
|
||||
public
|
||||
validRequirement(_owners.length, _required)
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ contract MultiSigWalletWithDailyLimit is MultiSigWallet {
|
||||
/// @param _owners List of initial owners.
|
||||
/// @param _required Number of required confirmations.
|
||||
/// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis.
|
||||
function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit)
|
||||
constructor(address[] _owners, uint _required, uint _dailyLimit)
|
||||
public
|
||||
MultiSigWallet(_owners, _required)
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ contract ico is safeMath {
|
||||
uint256 public totalMint;
|
||||
uint256 public totalPremiumMint;
|
||||
|
||||
function ico(address foundation, address priceSet, uint256 exchangeRate, uint256 startBlockNum, address[] genesisAddr, uint256[] genesisValue) {
|
||||
constructor(address foundation, address priceSet, uint256 exchangeRate, uint256 startBlockNum, address[] genesisAddr, uint256[] genesisValue) {
|
||||
/*
|
||||
Installation function.
|
||||
|
||||
|
@ -35,8 +35,8 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
address public foundationAddress;
|
||||
uint256 debugModeUntil = block.number + 1000000;
|
||||
|
||||
function moduleHandler(address[] newOwners) multiOwner(newOwners) {}
|
||||
|
||||
constructor(address[] newOwners) multiOwner(newOwners) {}
|
||||
function load(address foundation, bool forReplace, address Token, address Premium, address Publisher, address Schelling, address Provider) {
|
||||
/*
|
||||
Loading modulest to ModuleHandler.
|
||||
|
@ -12,7 +12,7 @@ contract multiOwner is safeMath {
|
||||
/*
|
||||
Constructor
|
||||
*/
|
||||
function multiOwner(address[] newOwners) {
|
||||
constructor(address[] newOwners) {
|
||||
for ( uint256 a=0 ; a<newOwners.length ; a++ ) {
|
||||
_addOwner(newOwners[a]);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ contract premium is module, safeMath {
|
||||
|
||||
mapping(address => bool) public genesis;
|
||||
|
||||
function premium(bool forReplace, address moduleHandler, address dbAddress, address icoContractAddr, address[] genesisAddr, uint256[] genesisValue) {
|
||||
constructor(bool forReplace, address moduleHandler, address dbAddress, address icoContractAddr, address[] genesisAddr, uint256[] genesisValue) {
|
||||
/*
|
||||
Setup function.
|
||||
If an ICOaddress is defined then the balance of the genesis addresses will be set as well.
|
||||
|
@ -118,7 +118,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
|
||||
uint256 private currentSchellingRound = 1;
|
||||
|
||||
function provider(address _moduleHandler) {
|
||||
constructor(address _moduleHandler) {
|
||||
/*
|
||||
Install function.
|
||||
|
||||
|
@ -61,7 +61,7 @@ contract publisher is announcementTypes, module, safeMath {
|
||||
|
||||
mapping (address => uint256[]) public opponents;
|
||||
|
||||
function publisher(address moduleHandler) {
|
||||
constructor(address moduleHandler) {
|
||||
/*
|
||||
Installation function. The installer will be registered in the admin list automatically
|
||||
|
||||
|
@ -45,7 +45,7 @@ contract schellingDB is safeMath, schellingVars {
|
||||
/*
|
||||
Constructor
|
||||
*/
|
||||
function schellingDB() {
|
||||
constructor() {
|
||||
rounds.length = 2;
|
||||
rounds[0].blockHeight = block.number;
|
||||
currentSchellingRound = 1;
|
||||
@ -247,7 +247,7 @@ contract schelling is module, announcementTypes, schellingVars {
|
||||
bytes1 public belowChar = 0x30;
|
||||
schellingDB private db;
|
||||
|
||||
function schelling(address _moduleHandler, address _db, bool _forReplace) {
|
||||
constructor(address _moduleHandler, address _db, bool _forReplace) {
|
||||
/*
|
||||
Installation function.
|
||||
|
||||
|
@ -48,7 +48,7 @@ contract token is safeMath, module, announcementTypes {
|
||||
|
||||
mapping(address => bool) public genesis;
|
||||
|
||||
function token(bool forReplace, address moduleHandler, address dbAddr, address icoContractAddr, address exchangeContractAddress, address[] genesisAddr, uint256[] genesisValue) payable {
|
||||
constructor(bool forReplace, address moduleHandler, address dbAddr, address icoContractAddr, address exchangeContractAddress, address[] genesisAddr, uint256[] genesisValue) payable {
|
||||
/*
|
||||
Installation function
|
||||
|
||||
|
@ -13,7 +13,7 @@ contract CategoricalEvent is Event {
|
||||
/// @param _collateralToken Tokens used as collateral in exchange for outcome tokens
|
||||
/// @param _oracle Oracle contract used to resolve the event
|
||||
/// @param outcomeCount Number of event outcomes
|
||||
function CategoricalEvent(
|
||||
constructor(
|
||||
Token _collateralToken,
|
||||
Oracle _oracle,
|
||||
uint8 outcomeCount
|
||||
|
@ -33,7 +33,7 @@ contract Event {
|
||||
/// @param _collateralToken Tokens used as collateral in exchange for outcome tokens
|
||||
/// @param _oracle Oracle contract used to resolve the event
|
||||
/// @param outcomeCount Number of event outcomes
|
||||
function Event(Token _collateralToken, Oracle _oracle, uint8 outcomeCount)
|
||||
constructor(Token _collateralToken, Oracle _oracle, uint8 outcomeCount)
|
||||
public
|
||||
{
|
||||
// Validate input
|
||||
|
@ -28,7 +28,7 @@ contract ScalarEvent is Event {
|
||||
/// @param _oracle Oracle contract used to resolve the event
|
||||
/// @param _lowerBound Lower bound for event outcome
|
||||
/// @param _upperBound Lower bound for event outcome
|
||||
function ScalarEvent(
|
||||
constructor(
|
||||
Token _collateralToken,
|
||||
Oracle _oracle,
|
||||
int _lowerBound,
|
||||
|
@ -70,7 +70,7 @@ contract Campaign {
|
||||
/// @param _fee Market fee
|
||||
/// @param _funding Initial funding for market
|
||||
/// @param _deadline Campaign deadline
|
||||
function Campaign(
|
||||
constructor(
|
||||
Event _eventContract,
|
||||
MarketFactory _marketFactory,
|
||||
MarketMaker _marketMaker,
|
||||
|
@ -38,7 +38,7 @@ contract StandardMarket is Market {
|
||||
/// @param _eventContract Event contract
|
||||
/// @param _marketMaker Market maker contract
|
||||
/// @param _fee Market fee
|
||||
function StandardMarket(address _creator, Event _eventContract, MarketMaker _marketMaker, uint24 _fee)
|
||||
constructor(address _creator, Event _eventContract, MarketMaker _marketMaker, uint24 _fee)
|
||||
public
|
||||
{
|
||||
// Validate inputs
|
||||
|
@ -8,7 +8,7 @@ contract Migrations {
|
||||
if (msg.sender == owner) _;
|
||||
}
|
||||
|
||||
function Migrations() {
|
||||
constructor() {
|
||||
owner = msg.sender;
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ contract CentralizedOracle is Oracle {
|
||||
*/
|
||||
/// @dev Constructor sets owner address and IPFS hash
|
||||
/// @param _ipfsHash Hash identifying off chain event description
|
||||
function CentralizedOracle(address _owner, bytes _ipfsHash)
|
||||
constructor(address _owner, bytes _ipfsHash)
|
||||
public
|
||||
{
|
||||
// Description hash cannot be null
|
||||
|
@ -22,7 +22,7 @@ contract DifficultyOracle is Oracle {
|
||||
*/
|
||||
/// @dev Contract constructor validates and sets target block number
|
||||
/// @param _blockNumber Target block number
|
||||
function DifficultyOracle(uint _blockNumber)
|
||||
constructor(uint _blockNumber)
|
||||
public
|
||||
{
|
||||
// Block has to be in the future
|
||||
|
@ -55,7 +55,7 @@ contract FutarchyOracle is Oracle {
|
||||
/// @param marketMaker Market maker contract
|
||||
/// @param fee Market fee
|
||||
/// @param _deadline Decision deadline
|
||||
function FutarchyOracle(
|
||||
constructor(
|
||||
address _creator,
|
||||
EventFactory eventFactory,
|
||||
Token collateralToken,
|
||||
|
@ -33,7 +33,7 @@ contract FutarchyOracleFactory {
|
||||
*/
|
||||
/// @dev Constructor sets event factory contract
|
||||
/// @param _eventFactory Event factory contract
|
||||
function FutarchyOracleFactory(EventFactory _eventFactory)
|
||||
constructor(EventFactory _eventFactory)
|
||||
public
|
||||
{
|
||||
require(address(_eventFactory) != address(0));
|
||||
|
@ -16,7 +16,7 @@ contract MajorityOracle is Oracle {
|
||||
*/
|
||||
/// @dev Allows to create an oracle for a majority vote based on other oracles
|
||||
/// @param _oracles List of oracles taking part in the majority vote
|
||||
function MajorityOracle(Oracle[] _oracles)
|
||||
constructor(Oracle[] _oracles)
|
||||
public
|
||||
{
|
||||
// At least 2 oracles should be defined
|
||||
|
@ -38,7 +38,7 @@ contract SignedMessageOracle is Oracle {
|
||||
/// @param v Signature parameter
|
||||
/// @param r Signature parameter
|
||||
/// @param s Signature parameter
|
||||
function SignedMessageOracle(bytes32 _descriptionHash, uint8 v, bytes32 r, bytes32 s)
|
||||
constructor(bytes32 _descriptionHash, uint8 v, bytes32 r, bytes32 s)
|
||||
public
|
||||
{
|
||||
signer = ecrecover(_descriptionHash, v, r, s);
|
||||
|
@ -46,7 +46,7 @@ contract UltimateOracle is Oracle {
|
||||
/// @param _challengePeriod Time to challenge oracle outcome
|
||||
/// @param _challengeAmount Amount to challenge the outcome
|
||||
/// @param _frontRunnerPeriod Time to overbid the front-runner
|
||||
function UltimateOracle(
|
||||
constructor(
|
||||
Oracle _forwardedOracle,
|
||||
Token _collateralToken,
|
||||
uint8 _spreadMultiplier,
|
||||
|
@ -31,7 +31,7 @@ contract OutcomeToken is StandardToken {
|
||||
* Public functions
|
||||
*/
|
||||
/// @dev Constructor sets events contract address
|
||||
function OutcomeToken()
|
||||
constructor()
|
||||
public
|
||||
{
|
||||
eventContract = msg.sender;
|
||||
|
@ -108,7 +108,7 @@ contract MilestoneTracker {
|
||||
/// @param _arbitrator Address assigned to be the arbitrator
|
||||
/// @param _donor Address assigned to be the donor
|
||||
/// @param _recipient Address assigned to be the recipient
|
||||
function MilestoneTracker (
|
||||
constructor (
|
||||
address _arbitrator,
|
||||
address _donor,
|
||||
address _recipient
|
||||
|
@ -15,7 +15,7 @@ contract DayLimit {
|
||||
* @dev Constructor that sets the passed value as a dailyLimit.
|
||||
* @param _limit uint256 to represent the daily limit.
|
||||
*/
|
||||
function DayLimit(uint256 _limit) {
|
||||
constructor(uint256 _limit) {
|
||||
dailyLimit = _limit;
|
||||
lastDay = today();
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ contract LimitBalance {
|
||||
* @dev Constructor that sets the passed value as a limit.
|
||||
* @param _limit uint256 to represent the limit.
|
||||
*/
|
||||
function LimitBalance(uint256 _limit) {
|
||||
constructor(uint256 _limit) {
|
||||
limit = _limit;
|
||||
}
|
||||
|
||||
|
@ -25,8 +25,8 @@ contract MultisigWallet is Multisig, Shareable, DayLimit {
|
||||
* @param _owners A list of owners.
|
||||
* @param _required The amount required for a transaction to be approved.
|
||||
*/
|
||||
function MultisigWallet(address[] _owners, uint256 _required, uint256 _daylimit)
|
||||
Shareable(_owners, _required)
|
||||
constructor(address[] _owners, uint256 _required, uint256 _daylimit)
|
||||
Shareable(_owners, _required)
|
||||
DayLimit(_daylimit) { }
|
||||
|
||||
/**
|
||||
|
@ -12,7 +12,7 @@ contract CappedCrowdsale is Crowdsale {
|
||||
|
||||
uint256 public cap;
|
||||
|
||||
function CappedCrowdsale(uint256 _cap) {
|
||||
constructor(uint256 _cap) {
|
||||
cap = _cap;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ contract Crowdsale {
|
||||
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
|
||||
|
||||
|
||||
function Crowdsale(uint256 _startBlock, uint256 _endBlock, uint256 _rate, address _wallet) {
|
||||
constructor(uint256 _startBlock, uint256 _endBlock, uint256 _rate, address _wallet) {
|
||||
require(_startBlock >= block.number);
|
||||
require(_endBlock >= _startBlock);
|
||||
require(_rate > 0);
|
||||
|
@ -22,7 +22,7 @@ contract RefundVault is Ownable {
|
||||
event RefundsEnabled();
|
||||
event Refunded(address indexed beneficiary, uint256 weiAmount);
|
||||
|
||||
function RefundVault(address _wallet) {
|
||||
constructor(address _wallet) {
|
||||
require(_wallet != address(0x0));
|
||||
wallet = _wallet;
|
||||
state = State.Active;
|
||||
|
@ -21,7 +21,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale {
|
||||
// refund vault used to hold funds while crowdsale is running
|
||||
RefundVault public vault;
|
||||
|
||||
function RefundableCrowdsale(uint256 _goal) {
|
||||
constructor(uint256 _goal) {
|
||||
vault = new RefundVault(wallet);
|
||||
goal = _goal;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import "../ownership/Ownable.sol";
|
||||
*/
|
||||
contract Destructible is Ownable {
|
||||
|
||||
function Destructible() payable { }
|
||||
constructor() payable { }
|
||||
|
||||
/**
|
||||
* @dev Transfers the current balance to the owner and terminates the contract.
|
||||
|
@ -12,7 +12,7 @@ import "../token/ERC20Basic.sol";
|
||||
*/
|
||||
contract TokenDestructible is Ownable {
|
||||
|
||||
function TokenDestructible() payable { }
|
||||
constructor() payable { }
|
||||
|
||||
/**
|
||||
* @notice Terminate contract and refund to owner
|
||||
|
@ -21,7 +21,7 @@ contract HasNoEther is Ownable {
|
||||
* constructor. By doing it this way we prevent a payable constructor from working. Alternatively
|
||||
* we could use assembly to access msg.value.
|
||||
*/
|
||||
function HasNoEther() payable {
|
||||
constructor() payable {
|
||||
if(msg.value > 0) {
|
||||
throw;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ contract Ownable {
|
||||
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
|
||||
* account.
|
||||
*/
|
||||
function Ownable() {
|
||||
constructor() {
|
||||
owner = msg.sender;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ contract Shareable {
|
||||
* @param _owners A list of owners.
|
||||
* @param _required The amount required for a transaction to be approved.
|
||||
*/
|
||||
function Shareable(address[] _owners, uint256 _required) {
|
||||
constructor(address[] _owners, uint256 _required) {
|
||||
owners[1] = msg.sender;
|
||||
ownerIndex[msg.sender] = 1;
|
||||
for (uint256 i = 0; i < _owners.length; ++i) {
|
||||
|
@ -20,7 +20,7 @@ contract SimpleToken is StandardToken {
|
||||
/**
|
||||
* @dev Contructor that gives msg.sender all of existing tokens.
|
||||
*/
|
||||
function SimpleToken() {
|
||||
constructor() {
|
||||
totalSupply = INITIAL_SUPPLY;
|
||||
balances[msg.sender] = INITIAL_SUPPLY;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ contract TokenTimelock {
|
||||
// timestamp when token release is enabled
|
||||
uint releaseTime;
|
||||
|
||||
function TokenTimelock(ERC20Basic _token, address _beneficiary, uint _releaseTime) {
|
||||
constructor(ERC20Basic _token, address _beneficiary, uint _releaseTime) {
|
||||
require(_releaseTime > now);
|
||||
token = _token;
|
||||
beneficiary = _beneficiary;
|
||||
|
Loading…
Reference in New Issue
Block a user