mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-17 12:10:52 +02:00
Merge pull request #4 from al-ias/could-be-fix/solidity
Could be fix/solidity
This commit is contained in:
@@ -278,7 +278,7 @@ f(22); // call
|
|||||||
|
|
||||||
// Delete can be called on most types
|
// Delete can be called on most types
|
||||||
// (does NOT destroy value, but sets value to 0, the initial value)
|
// (does NOT destroy value, but sets value to 0, the initial value)
|
||||||
uint x = 5;
|
delete x;
|
||||||
|
|
||||||
|
|
||||||
// Destructuring/Tuples
|
// Destructuring/Tuples
|
||||||
@@ -435,7 +435,7 @@ function increment(uint x) view returns (uint x) {
|
|||||||
// Functions hoisted - and can assign a function to a variable
|
// Functions hoisted - and can assign a function to a variable
|
||||||
function a() {
|
function a() {
|
||||||
var z = b;
|
var z = b;
|
||||||
b();
|
z();
|
||||||
}
|
}
|
||||||
|
|
||||||
function b() {
|
function b() {
|
||||||
@@ -494,7 +494,7 @@ Coin.LogSent().watch({}, '', function(error, result) {
|
|||||||
// '_' (underscore) often included as last line in body, and indicates
|
// '_' (underscore) often included as last line in body, and indicates
|
||||||
// function being called should be placed there
|
// function being called should be placed there
|
||||||
modifier onlyAfter(uint _time) { require (now >= _time); _; }
|
modifier onlyAfter(uint _time) { require (now >= _time); _; }
|
||||||
modifier onlyOwner { require(msg.sender == owner) _; }
|
modifier onlyOwner { require(msg.sender == owner); _; }
|
||||||
// commonly used with state machines
|
// commonly used with state machines
|
||||||
modifier onlyIfStateA (State currState) { require(currState == State.A) _; }
|
modifier onlyIfStateA (State currState) { require(currState == State.A) _; }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user