Bring code examples for Style Guide inline with style guide

Add back accidentally removed public
This commit is contained in:
Chris Chinchilla 2019-05-30 14:34:52 +02:00
parent dd04a35c0e
commit f99d78117e

View File

@ -757,20 +757,26 @@ No::
pragma solidity >=0.4.0 <0.7.0;
// Base contracts just to make this compile
contract B {
constructor(uint) public {
}
}
contract C {
constructor(uint, uint) public {
}
}
contract D {
constructor(uint) public {
}
}
contract A is B, C, D {
uint x;
@ -778,12 +784,12 @@ No::
B(param1)
C(param2, param3)
D(param4)
public
{
public {
x = param5;
}
}
contract X is B, C, D {
uint x;
@ -796,6 +802,7 @@ No::
}
}
When declaring short functions with a single statement, it is permissible to do it on a single line.
Permissible::
@ -973,6 +980,7 @@ Yes::
pragma solidity >=0.4.0 <0.7.0;
// Owned.sol
contract Owned {
address public owner;
@ -991,9 +999,13 @@ Yes::
}
}
// Congress.sol
and in ``Congress.sol``::
pragma solidity >=0.4.0 <0.7.0;
import "./Owned.sol";
contract Congress is Owned, TokenRecipient {
//...
}
@ -1002,6 +1014,7 @@ No::
pragma solidity >=0.4.0 <0.7.0;
// owned.sol
contract owned {
address public owner;
@ -1020,14 +1033,15 @@ No::
}
}
// Congress.sol
and in ``Congress.sol``::
import "./owned.sol";
contract Congress is owned, tokenRecipient {
//...
}
Struct Names
==========================
@ -1104,6 +1118,7 @@ added looks like the one below::
pragma solidity >=0.4.0 <0.7.0;
/// @author The Solidity Team
/// @title A simple storage example
contract SimpleStorage {