aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-11-26 21:46:01 +0800
committerGitHub <noreply@github.com>2018-11-26 21:46:01 +0800
commitd00082f12f60ad4a76123e0905e5e3c76c1d2643 (patch)
tree5ff54200ac67b1c261abc113677eaaa35dd30809
parentd950905a28805b86b633a3fe22e27ea606a8d764 (diff)
parentb98a9eeb976b40f2f5a246889cadcb69e4596fc7 (diff)
downloaddexon-solidity-d00082f12f60ad4a76123e0905e5e3c76c1d2643.tar
dexon-solidity-d00082f12f60ad4a76123e0905e5e3c76c1d2643.tar.gz
dexon-solidity-d00082f12f60ad4a76123e0905e5e3c76c1d2643.tar.bz2
dexon-solidity-d00082f12f60ad4a76123e0905e5e3c76c1d2643.tar.lz
dexon-solidity-d00082f12f60ad4a76123e0905e5e3c76c1d2643.tar.xz
dexon-solidity-d00082f12f60ad4a76123e0905e5e3c76c1d2643.tar.zst
dexon-solidity-d00082f12f60ad4a76123e0905e5e3c76c1d2643.zip
Merge pull request #5435 from fulldecent/patch-9
Define how inheritance affects storage
-rw-r--r--docs/miscellaneous.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/miscellaneous.rst b/docs/miscellaneous.rst
index cc2ba801..017d5b81 100644
--- a/docs/miscellaneous.rst
+++ b/docs/miscellaneous.rst
@@ -15,6 +15,10 @@ Statically-sized variables (everything except mapping and dynamically-sized arra
- If an elementary type does not fit the remaining part of a storage slot, it is moved to the next storage slot.
- Structs and array data always start a new slot and occupy whole slots (but items inside a struct or array are packed tightly according to these rules).
+For contracts that use inheritance, the ordering of state variables is determined by the
+C3-linearized order of contracts starting with the most base-ward contract. If allowed
+by the above rules, state variables from different contracts do share the same storage slot.
+
.. warning::
When using elements that are smaller than 32 bytes, your contract's gas usage may be higher.
This is because the EVM operates on 32 bytes at a time. Therefore, if the element is smaller