You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A style guide is about consistency. Consistency with this style guide is important. Consistency within a project is more important. Consistency within one module or function is most important.
28
-
But most importantly: know when to be inconsistent -- sometimes the style guide just doesn't apply. When in doubt, use your best judgement. Look at other examples and decide what looks best. And don't hesitate to ask!
30
+
31
+
But most importantly: **know when to be inconsistent** -- sometimes the style guide just doesn't apply. When in doubt, use your best judgement. Look at other examples and decide what looks best. And don't hesitate to ask!
29
32
30
33
31
34
***********
@@ -383,8 +386,7 @@ No::
383
386
384
387
function spam(uint i , Coin coin) public ;
385
388
386
-
More than one space around an assignment or other operator to align with
387
-
another:
389
+
More than one space around an assignment or other operator to align with another:
388
390
389
391
Yes::
390
392
@@ -996,7 +998,7 @@ Contract and Library Names
996
998
* Contract and library names should also match their filenames.
997
999
* If a contract file includes multiple contracts and/or libraries, then the filename should match the *core contract*. This is not recommended however if it can be avoided.
998
1000
999
-
As shown in the example below, if the contract name is `Congress` and the library name is `Owned`, then their associated filenames should be `Congress.sol` and `Owned.sol`.
1001
+
As shown in the example below, if the contract name is ``Congress`` and the library name is ``Owned``, then their associated filenames should be ``Congress.sol`` and ``Owned.sol``.
1000
1002
1001
1003
Yes::
1002
1004
@@ -1132,8 +1134,8 @@ Solidity contracts can have a form of comments that are the basis of the
1132
1134
Ethereum Natural Language Specification Format.
1133
1135
1134
1136
Add comments above functions or contracts following `doxygen <http://www.doxygen.nl>`_ notation
1135
-
of one or multiple lines starting with `///` or a
1136
-
multiline comment starting with `/**` and ending with `*/`.
1137
+
of one or multiple lines starting with ``///`` or a
1138
+
multiline comment starting with ``/**`` and ending with ``*/``.
1137
1139
1138
1140
For example, the contract from `a simple smart contract <simple-smart-contract>`_ with the comments
Copy file name to clipboardExpand all lines: docs/types.rst
+2-2
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ operators. For a quick reference of the various operators, see :ref:`order`.
16
16
The concept of "undefined" or "null" values does not exist in Solidity, but newly
17
17
declared variables always have a :ref:`default value<default-value>` dependent
18
18
on its type. To handle any unexpected values, you should use the :ref:`revert function<assert-and-require>` to revert the whole transaction, or return a
19
-
tuple with a second `bool` value denoting success.
19
+
tuple with a second ``bool`` value denoting success.
20
20
21
21
.. include:: types/value-types.rst
22
22
@@ -26,4 +26,4 @@ tuple with a second `bool` value denoting success.
``addmod(uint x, uint y, uint k) returns (uint)``:
163
+
``addmod(uint x, uint y, uint k) returns (uint)``
160
164
compute ``(x + y) % k`` where the addition is performed with arbitrary precision and does not wrap around at ``2**256``. Assert that ``k != 0`` starting from version 0.5.0.
161
165
162
-
``mulmod(uint x, uint y, uint k) returns (uint)``:
166
+
``mulmod(uint x, uint y, uint k) returns (uint)``
163
167
compute ``(x * y) % k`` where the multiplication is performed with arbitrary precision and does not wrap around at ``2**256``. Assert that ``k != 0`` starting from version 0.5.0.
164
168
165
-
``keccak256(bytes memory) returns (bytes32)``:
169
+
``keccak256(bytes memory) returns (bytes32)``
166
170
compute the Keccak-256 hash of the input
167
171
168
172
.. note::
169
173
170
174
There used to be an alias for ``keccak256`` called ``sha3``, which was removed in version 0.5.0.
0 commit comments