mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adds review suggestions.
This commit is contained in:
parent
e16e37f507
commit
2031e8e0c1
@ -437,7 +437,7 @@ For example,
|
||||
|
||||
::
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity >0.4.24;
|
||||
|
||||
contract Test {
|
||||
constructor() public { b = 0x12345678901234567890123456789012; }
|
||||
|
@ -28,7 +28,7 @@ become the new richest.
|
||||
|
||||
::
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity >0.4.24;
|
||||
|
||||
contract WithdrawalContract {
|
||||
address public richest;
|
||||
@ -65,7 +65,7 @@ This is as opposed to the more intuitive sending pattern:
|
||||
|
||||
::
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity >0.4.24;
|
||||
|
||||
contract SendContract {
|
||||
address public richest;
|
||||
|
@ -990,7 +990,7 @@ default constructor: ``contructor() public {}``.
|
||||
|
||||
::
|
||||
|
||||
pragma solidity ^0.4.22;
|
||||
pragma solidity >0.4.24;
|
||||
|
||||
contract A {
|
||||
uint public a;
|
||||
@ -1007,7 +1007,7 @@ default constructor: ``contructor() public {}``.
|
||||
A constructor set as ``internal`` causes the contract to be marked as :ref:`abstract <abstract-contract>`.
|
||||
|
||||
.. warning ::
|
||||
Prior to version 0.4.22, constructors were defined as functions with the same name as the contract. This syntax was deprecated is not allowed anymore in version 0.5.0.
|
||||
Prior to version 0.4.22, constructors were defined as functions with the same name as the contract. This syntax was deprecated and is not allowed anymore in version 0.5.0.
|
||||
|
||||
|
||||
.. index:: ! base;constructor
|
||||
|
@ -225,7 +225,7 @@ creation-dependencies are not possible.
|
||||
|
||||
::
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity >0.4.24;
|
||||
|
||||
contract D {
|
||||
uint x;
|
||||
|
@ -426,7 +426,7 @@ In the case of a ``contract A`` calling a new instance of ``contract B``, parent
|
||||
You will need to make sure that you have both contracts aware of each other's presence and that ``contract B`` has a ``payable`` constructor.
|
||||
In this example::
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity >0.4.24;
|
||||
|
||||
contract B {
|
||||
constructor() public payable {}
|
||||
|
@ -80,7 +80,7 @@ registering with username and password — all you need is an Ethereum keypair.
|
||||
|
||||
::
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity >0.4.24;
|
||||
|
||||
contract Coin {
|
||||
// The keyword "public" makes those variables
|
||||
|
@ -180,7 +180,7 @@ Never use tx.origin for authorization. Let's say you have a wallet contract like
|
||||
|
||||
::
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity >0.4.24;
|
||||
|
||||
// THIS CONTRACT CONTAINS A BUG - DO NOT USE
|
||||
contract TxUserWallet {
|
||||
@ -200,7 +200,7 @@ Now someone tricks you into sending ether to the address of this attack wallet:
|
||||
|
||||
::
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
pragma solidity >0.4.24;
|
||||
|
||||
interface TxUserWallet {
|
||||
function transferTo(address dest, uint amount) public;
|
||||
|
Loading…
Reference in New Issue
Block a user