Skip to content

Updated constructors and pragma solidity lines. #3964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/contracts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -841,10 +841,10 @@ Details are given in the following example.

::

pragma solidity ^0.4.16;
pragma solidity ^0.4.22;

contract owned {
function owned() { owner = msg.sender; }
constructor() { owner = msg.sender; }
address owner;
}

Expand Down Expand Up @@ -875,7 +875,7 @@ Details are given in the following example.
// also a base class of `mortal`, yet there is only a single
// instance of `owned` (as for virtual inheritance in C++).
contract named is owned, mortal {
function named(bytes32 name) {
constructor(bytes32 name) {
Config config = Config(0xD5f9D8D94886E70b06E474c3fB14Fd43E2f23970);
NameReg(config.lookup(1)).register(name);
}
Expand Down Expand Up @@ -913,10 +913,10 @@ Note that above, we call ``mortal.kill()`` to "forward" the
destruction request. The way this is done is problematic, as
seen in the following example::

pragma solidity ^0.4.0;
pragma solidity ^0.4.22;

contract owned {
function owned() public { owner = msg.sender; }
constructor() public { owner = msg.sender; }
address owner;
}

Expand All @@ -942,10 +942,10 @@ derived override, but this function will bypass
``Base1.kill``, basically because it does not even know about
``Base1``. The way around this is to use ``super``::

pragma solidity ^0.4.0;
pragma solidity ^0.4.22;

contract owned {
function owned() public { owner = msg.sender; }
constructor() public { owner = msg.sender; }
address owner;
}

Expand Down Expand Up @@ -1033,7 +1033,7 @@ Arguments for Base Constructors
Derived contracts need to provide all arguments needed for
the base constructors. This can be done in two ways::

pragma solidity ^0.4.0;
pragma solidity ^0.4.22;

contract Base {
uint x;
Expand Down