From d4447658a5bd005c17e5e0e822e64fe2eb0dc305 Mon Sep 17 00:00:00 2001 From: Al <80943867+al-ias@users.noreply.github.com> Date: Fri, 22 Jul 2022 19:38:42 +0200 Subject: Fix functions and more index --- solidity.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'solidity.html.markdown') diff --git a/solidity.html.markdown b/solidity.html.markdown index c52d2002..1942c42a 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -388,7 +388,7 @@ block.gasLimit(); storage['abc'] = 'def'; // maps 256 bit words to 256 bit words -// 4. FUNCTIONS AND MORE +// 5. FUNCTIONS AND MORE // A. Functions // Simple function function increment(uint x) returns (uint) { -- cgit v1.2.3 From bfb73cb02b1312bf187d903993bdd44be1bf36de Mon Sep 17 00:00:00 2001 From: Al <80943867+al-ias@users.noreply.github.com> Date: Fri, 22 Jul 2022 19:40:24 +0200 Subject: Fix hoisting example --- solidity.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'solidity.html.markdown') diff --git a/solidity.html.markdown b/solidity.html.markdown index c52d2002..2006333e 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -435,7 +435,7 @@ function increment(uint x) view returns (uint x) { // Functions hoisted - and can assign a function to a variable function a() { var z = b; - b(); + z(); } function b() { -- cgit v1.2.3 From 6de5f8152b6fc61c1b240ece1d0bf5c37f8e431d Mon Sep 17 00:00:00 2001 From: Al <80943867+al-ias@users.noreply.github.com> Date: Fri, 22 Jul 2022 19:40:54 +0200 Subject: Fix delete example --- solidity.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'solidity.html.markdown') diff --git a/solidity.html.markdown b/solidity.html.markdown index 2006333e..fc9c8788 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -278,7 +278,7 @@ f(22); // call // Delete can be called on most types // (does NOT destroy value, but sets value to 0, the initial value) -uint x = 5; +delete x; // Destructuring/Tuples -- cgit v1.2.3 From 2949bf690a32ae47b507c8551d8c347e7dad4c70 Mon Sep 17 00:00:00 2001 From: Al <80943867+al-ias@users.noreply.github.com> Date: Sat, 23 Jul 2022 14:01:21 +0200 Subject: Fix sub indexes into contract design note section (9) --- solidity.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'solidity.html.markdown') diff --git a/solidity.html.markdown b/solidity.html.markdown index 1942c42a..fd076532 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -646,7 +646,7 @@ reveal(100, "mySecret"); // All data to start of time is stored in blockchain, so // anyone can observe all previous data and changes -// E. Oracles and External Data +// D. Oracles and External Data // Oracles are ways to interact with your smart contracts outside the blockchain. // They are used to get data from the real world, send post requests, to the real world // or vise versa. @@ -671,12 +671,12 @@ reveal(100, "mySecret"); // Setting up oracle networks yourself -// D. Cron Job +// E. Cron Job // Contracts must be manually called to handle time-based scheduling; can create external // code to regularly ping, or provide incentives (ether) for others to // -// E. Observer Pattern +// F. Observer Pattern // An Observer Pattern lets you register as a subscriber and // register a function which is called by the oracle (note, the oracle pays // for this action to be run) @@ -714,7 +714,7 @@ contract SomeOracle { // Now, your client contract can addSubscriber by importing SomeOracleCallback // and registering with Some Oracle -// F. State machines +// G. State machines // see example below for State enum and inState modifier ``` -- cgit v1.2.3 From 40e69760e93322603cf1780f9f54793a5aefaaa3 Mon Sep 17 00:00:00 2001 From: Al <80943867+al-ias@users.noreply.github.com> Date: Sun, 24 Jul 2022 21:17:41 +0200 Subject: Fix missing semicolon --- solidity.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'solidity.html.markdown') diff --git a/solidity.html.markdown b/solidity.html.markdown index fc9c8788..f60ba30f 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -494,7 +494,7 @@ Coin.LogSent().watch({}, '', function(error, result) { // '_' (underscore) often included as last line in body, and indicates // function being called should be placed there modifier onlyAfter(uint _time) { require (now >= _time); _; } -modifier onlyOwner { require(msg.sender == owner) _; } +modifier onlyOwner { require(msg.sender == owner); _; } // commonly used with state machines modifier onlyIfStateA (State currState) { require(currState == State.A) _; } -- cgit v1.2.3 From 23be2f300cfab96e455e2403d8364dfc9ed35037 Mon Sep 17 00:00:00 2001 From: Al <80943867+al-ias@users.noreply.github.com> Date: Mon, 25 Jul 2022 10:54:32 +0200 Subject: Fix missing semicolon --- solidity.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'solidity.html.markdown') diff --git a/solidity.html.markdown b/solidity.html.markdown index 4dfb0adc..d40536b4 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -496,7 +496,7 @@ Coin.LogSent().watch({}, '', function(error, result) { modifier onlyAfter(uint _time) { require (now >= _time); _; } modifier onlyOwner { require(msg.sender == owner); _; } // commonly used with state machines -modifier onlyIfStateA (State currState) { require(currState == State.A) _; } +modifier onlyIfStateA (State currState) { require(currState == State.A); _; } // Append right after function declaration function changeOwner(newOwner) -- cgit v1.2.3