From 25a26d2f8bca41e9f488bc8b2eef558da32fb27a Mon Sep 17 00:00:00 2001 From: minami Date: Sun, 5 Dec 2021 16:57:48 +0900 Subject: [PATCH 1/3] Fix cheatsheet --- docs/cheatsheet.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cheatsheet.rst b/docs/cheatsheet.rst index d36a96360..17537914a 100644 --- a/docs/cheatsheet.rst +++ b/docs/cheatsheet.rst @@ -81,7 +81,7 @@ Global Variables - ``abi.encodeWithSelector(bytes4 selector, ...) returns (bytes memory)``: :ref:`ABI `-encodes the given arguments starting from the second and prepends the given four-byte selector - ``abi.encodeWithSignature(string memory signature, ...) returns (bytes memory)``: Equivalent - to ``abi.encodeWithSelector(bytes4(keccak256(bytes(signature)), ...)``` + to ``abi.encodeWithSelector(bytes4(keccak256(bytes(signature)), ...)`` - ``bytes.concat(...) returns (bytes memory)``: :ref:`Concatenates variable number of arguments to one byte array` - ``block.basefee`` (``uint``): current block's base fee (`EIP-3198 `_ and `EIP-1559 `_) From 907405e2e06082389be99eb763e797c142f757a1 Mon Sep 17 00:00:00 2001 From: minami Date: Sun, 5 Dec 2021 16:57:59 +0900 Subject: [PATCH 2/3] Fix units-and-global-variables --- docs/units-and-global-variables.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/units-and-global-variables.rst b/docs/units-and-global-variables.rst index 8a6173280..ac11e0806 100644 --- a/docs/units-and-global-variables.rst +++ b/docs/units-and-global-variables.rst @@ -135,7 +135,7 @@ ABI Encoding and Decoding Functions - ``abi.encode(...) returns (bytes memory)``: ABI-encodes the given arguments - ``abi.encodePacked(...) returns (bytes memory)``: Performs :ref:`packed encoding ` of the given arguments. Note that packed encoding can be ambiguous! - ``abi.encodeWithSelector(bytes4 selector, ...) returns (bytes memory)``: ABI-encodes the given arguments starting from the second and prepends the given four-byte selector -- ``abi.encodeWithSignature(string memory signature, ...) returns (bytes memory)``: Equivalent to ``abi.encodeWithSelector(bytes4(keccak256(bytes(signature))), ...)``` +- ``abi.encodeWithSignature(string memory signature, ...) returns (bytes memory)``: Equivalent to ``abi.encodeWithSelector(bytes4(keccak256(bytes(signature))), ...)`` .. note:: These encoding functions can be used to craft data for external function calls without actually From 6bafeca8a25ec87f50ee2c2de8a8eb1cd549a7e9 Mon Sep 17 00:00:00 2001 From: minami Date: Sun, 5 Dec 2021 16:58:03 +0900 Subject: [PATCH 3/3] Fix yul --- docs/yul.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/yul.rst b/docs/yul.rst index ef44a575b..219905cd5 100644 --- a/docs/yul.rst +++ b/docs/yul.rst @@ -166,7 +166,7 @@ Inside a code block, the following elements can be used - if statements, e.g. ``if lt(a, b) { sstore(0, 1) }`` - switch statements, e.g. ``switch mload(0) case 0 { revert() } default { mstore(0, 1) }`` - for loops, e.g. ``for { let i := 0} lt(i, 10) { i := add(i, 1) } { mstore(i, 7) }`` -- function definitions, e.g. ``function f(a, b) -> c { c := add(a, b) }``` +- function definitions, e.g. ``function f(a, b) -> c { c := add(a, b) }`` Multiple syntactical elements can follow each other simply separated by whitespace, i.e. there is no terminating ``;`` or newline required.