aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenton Liu <liu.denton+github@gmail.com>2016-05-18 23:11:39 +0800
committerDenton Liu <liu.denton+github@gmail.com>2016-05-19 05:17:05 +0800
commitc851cd0481b557ef0a18c0bfa13cbe2ab0abf716 (patch)
tree2c8fa15a55dd23506339313b610b7c51251289a2
parenta8164eb5d72f01b44d5c83ce1b0d9650dc54b04c (diff)
downloaddexon-solidity-c851cd0481b557ef0a18c0bfa13cbe2ab0abf716.tar.gz
dexon-solidity-c851cd0481b557ef0a18c0bfa13cbe2ab0abf716.tar.zst
dexon-solidity-c851cd0481b557ef0a18c0bfa13cbe2ab0abf716.zip
Corrected capitalisation of symbol names
-rw-r--r--docs/contracts.rst23
-rw-r--r--docs/control-structures.rst8
-rw-r--r--docs/frequently-asked-questions.rst6
-rw-r--r--docs/miscellaneous.rst6
4 files changed, 22 insertions, 21 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst
index dd75e857..b0d24c67 100644
--- a/docs/contracts.rst
+++ b/docs/contracts.rst
@@ -185,7 +185,7 @@ return parameter list for functions.
::
- contract c {
+ contract C {
function f(uint a) private returns (uint b) { return a + 1; }
function setData(uint a) internal { data = a; }
uint public data;
@@ -214,7 +214,7 @@ it is a state variable and if it is accessed externally
::
- contract test {
+ contract Test {
uint public data = 42;
}
@@ -222,7 +222,7 @@ The next example is a bit more complex:
::
- contract complex {
+ contract Complex {
struct Data {
uint a;
bytes3 b;
@@ -266,7 +266,7 @@ inheritable properties of contracts and may be overridden by derived contracts.
// This means that if the owner calls this function, the
// function is executed and otherwise, an exception is
// thrown.
- modifier onlyowner {
+ modifier onlyOwner {
if (msg.sender != owner)
throw;
_
@@ -275,11 +275,11 @@ inheritable properties of contracts and may be overridden by derived contracts.
contract mortal is owned {
- // This contract inherits the "onlyowner"-modifier from
+ // This contract inherits the "onlyOwner"-modifier from
// "owned" and applies it to the "close"-function, which
// causes that calls to "close" only have an effect if
// they are made by the stored owner.
- function close() onlyowner {
+ function close() onlyOwner {
selfdestruct(owner);
}
}
@@ -305,7 +305,7 @@ inheritable properties of contracts and may be overridden by derived contracts.
registeredAddresses[msg.sender] = true;
}
- function changePrice(uint _price) onlyowner {
+ function changePrice(uint _price) onlyOwner {
price = _price;
}
}
@@ -717,13 +717,13 @@ Abstract Contracts
Contract functions can lack an implementation as in the following example (note that the function declaration header is terminated by `;`)::
- contract feline {
+ contract Feline {
function utterance() returns (bytes32);
}
Such contracts cannot be compiled (even if they contain implemented functions alongside non-implemented functions), but they can be used as base contracts::
- contract Cat is feline {
+ contract Cat is Feline {
function utterance() returns (bytes32) { return "miaow"; }
}
@@ -837,7 +837,7 @@ custom types without the overhead of external function calls:
::
- library bigint {
+ library BigInt {
struct bigint {
uint[] limbs;
}
@@ -880,7 +880,8 @@ custom types without the overhead of external function calls:
contract C {
- using bigint for bigint.bigint;
+ using BigInt for BigInt.bigint;
+
function f() {
var x = bigint.fromUint(7);
var y = bigint.fromUint(uint(-1));
diff --git a/docs/control-structures.rst b/docs/control-structures.rst
index c26300a3..15effb78 100644
--- a/docs/control-structures.rst
+++ b/docs/control-structures.rst
@@ -31,7 +31,7 @@ Internal Function Calls
Functions of the current contract can be called directly ("internally"), also recursively, as seen in
this nonsensical example::
- contract c {
+ contract C {
function g(uint a) returns (uint ret) { return f(); }
function f() returns (uint ret) { return g(7) + f(); }
}
@@ -77,7 +77,7 @@ of unused parameters (especially return parameters) can be omitted.
::
- contract c {
+ contract C {
function f(uint key, uint value) { ... }
function g() {
@@ -541,7 +541,7 @@ It is planned that the stack height changes can be specified in inline assembly.
.. code::
- contract c {
+ contract C {
uint b;
function f(uint x) returns (uint r) {
assembly {
@@ -615,7 +615,7 @@ be just `0`, but it can also be a complex functional-style expression.
.. code::
- contract c {
+ contract C {
function f(uint x) returns (uint b) {
assembly {
let v := add(x, 1)
diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst
index ff4d6fc0..65b5afdf 100644
--- a/docs/frequently-asked-questions.rst
+++ b/docs/frequently-asked-questions.rst
@@ -179,7 +179,7 @@ Mappings are already syntactically similar to arrays as they are, therefore it d
An example of this would be::
- contract c {
+ contract C {
struct myStruct {
uint someNumber;
string someString;
@@ -218,7 +218,7 @@ Example::
contract C {
function f() returns (uint8[5]) {
- string[4] memory AdaArr = ["This", "is", "an", "array"];
+ string[4] memory adaArr = ["This", "is", "an", "array"];
return ([1, 2, 3, 4, 5]);
}
}
@@ -360,7 +360,7 @@ Examples::
S public x = S(1, 2);
string name = "Ada";
- string[4] memory AdaArr = ["This", "is", "an", "array"];
+ string[4] memory adaArr = ["This", "is", "an", "array"];
}
diff --git a/docs/miscellaneous.rst b/docs/miscellaneous.rst
index de046c6d..e1c9f4aa 100644
--- a/docs/miscellaneous.rst
+++ b/docs/miscellaneous.rst
@@ -31,10 +31,10 @@ non-elementary type, the positions are found by adding an offset of `sha3(k . p)
So for the following contract snippet::
- contract c {
- struct S { uint a; uint b; }
+ contract C {
+ struct s { uint a; uint b; }
uint x;
- mapping(uint => mapping(uint => S)) data;
+ mapping(uint => mapping(uint => s)) data;
}
The position of `data[4][9].b` is at `sha3(uint256(9) . sha3(uint256(4) . uint256(1))) + 1`.