aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-02-26 17:21:08 +0800
committerGitHub <noreply@github.com>2018-02-26 17:21:08 +0800
commit6b3a5e5d87230da076f1cac293e21e8d34036f03 (patch)
tree8d94f324a5078f8d19b30aaa989d32c70d2e57f6
parent272262ea9908f2c8a12e0a8e367393f2a49ba3ca (diff)
parentef7fbf8d0c7310142c39fb7a940e0732e245754a (diff)
downloaddexon-solidity-6b3a5e5d87230da076f1cac293e21e8d34036f03.tar.gz
dexon-solidity-6b3a5e5d87230da076f1cac293e21e8d34036f03.tar.zst
dexon-solidity-6b3a5e5d87230da076f1cac293e21e8d34036f03.zip
Merge pull request #3585 from aaroncolaco/develop
Fix example; closes #3582
-rw-r--r--docs/frequently-asked-questions.rst33
1 files changed, 24 insertions, 9 deletions
diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst
index a6bead29..3c83cbc7 100644
--- a/docs/frequently-asked-questions.rst
+++ b/docs/frequently-asked-questions.rst
@@ -40,9 +40,9 @@ Is there a decompiler available?
================================
There is no exact decompiler to Solidity, but
-`Porosity <https://github.com/comaeio/porosity>`_ is close.
-Because some information like variable names, comments, and
-source code formatting is lost in the compilation process,
+`Porosity <https://github.com/comaeio/porosity>`_ is close.
+Because some information like variable names, comments, and
+source code formatting is lost in the compilation process,
it is not possible to completely recover the original source code.
Bytecode can be disassembled to opcodes, a service that is provided by
@@ -542,12 +542,27 @@ contract level) with ``arrayname.length = <some new length>;``. If you get the
::
- int8[] memory memArr; // Case 1
- memArr.length++; // illegal
- int8[5] storageArr; // Case 2
- somearray.length++; // legal
- int8[5] storage storageArr2; // Explicit case 2
- somearray2.length++; // legal
+ // This will not compile
+
+ pragma solidity ^0.4.18;
+
+ contract C {
+ int8[] dynamicStorageArray;
+ int8[5] fixedStorageArray;
+
+ function f() {
+ int8[] memory memArr; // Case 1
+ memArr.length++; // illegal
+
+ int8[5] storage storageArr = fixedStorageArray; // Case 2
+ storageArr.length++; // illegal
+
+ int8[] storage storageArr2 = dynamicStorageArray;
+ storageArr2.length++; // legal
+
+
+ }
+ }
**Important note:** In Solidity, array dimensions are declared backwards from the way you
might be used to declaring them in C or Java, but they are access as in