Corrected capitalisation of symbol names

This commit is contained in:
Denton Liu 2016-05-18 11:11:39 -04:00
parent a8164eb5d7
commit c851cd0481
4 changed files with 22 additions and 21 deletions

View File

@ -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));

View File

@ -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)

View File

@ -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"];
}

View File

@ -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`.