mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update version pragma and use new constructor syntax in std/ contracts.
This commit is contained in:
parent
c98464db06
commit
f855c78a08
@ -40,7 +40,7 @@ This means that cyclic creation dependencies are impossible.
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
pragma solidity ^0.4.20; // should actually be 0.4.21
|
pragma solidity >0.4.21;
|
||||||
|
|
||||||
contract OwnedToken {
|
contract OwnedToken {
|
||||||
// TokenCreator is a contract type that is defined below.
|
// TokenCreator is a contract type that is defined below.
|
||||||
@ -981,7 +981,7 @@ Constructor functions can be either ``public`` or ``internal``.
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
pragma solidity ^0.4.20; // should actually be 0.4.21
|
pragma solidity >0.4.21;
|
||||||
|
|
||||||
contract A {
|
contract A {
|
||||||
uint public a;
|
uint public a;
|
||||||
@ -998,7 +998,7 @@ Constructor functions can be either ``public`` or ``internal``.
|
|||||||
A constructor set as ``internal`` causes the contract to be marked as :ref:`abstract <abstract-contract>`.
|
A constructor set as ``internal`` causes the contract to be marked as :ref:`abstract <abstract-contract>`.
|
||||||
|
|
||||||
.. note ::
|
.. note ::
|
||||||
Prior to version 0.4.21, constructors were defined as functions with the same name as the contract. This syntax is now deprecated.
|
Prior to version 0.4.22, constructors were defined as functions with the same name as the contract. This syntax is now deprecated.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
pragma solidity ^0.4.0;
|
pragma solidity >0.4.21;
|
||||||
|
|
||||||
import "./Token.sol";
|
import "./Token.sol";
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ contract StandardToken is Token {
|
|||||||
mapping (address =>
|
mapping (address =>
|
||||||
mapping (address => uint256)) m_allowance;
|
mapping (address => uint256)) m_allowance;
|
||||||
|
|
||||||
function StandardToken(address _initialOwner, uint256 _supply) public {
|
constructor(address _initialOwner, uint256 _supply) public {
|
||||||
supply = _supply;
|
supply = _supply;
|
||||||
balance[_initialOwner] = _supply;
|
balance[_initialOwner] = _supply;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
pragma solidity ^0.4.0;
|
pragma solidity >0.4.21;
|
||||||
|
|
||||||
contract owned {
|
contract owned {
|
||||||
address owner;
|
address owner;
|
||||||
@ -9,7 +9,7 @@ contract owned {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function owned() public {
|
constructor() public {
|
||||||
owner = msg.sender;
|
owner = msg.sender;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user