diff options
author | chriseth <chris@ethereum.org> | 2018-11-12 20:00:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-12 20:00:16 +0800 |
commit | 60b44b1101d69d63158ecb0cf0505a1f5c5509ef (patch) | |
tree | 22c533afc3d0ac42c684ccb276e2bb46e283c698 | |
parent | 09f8ff27fc576dbbd05e31471bb39c00abe90563 (diff) | |
parent | 0b94ac5b04bb65de21f60e2361a6c60fe9ce92c0 (diff) | |
download | dexon-solidity-60b44b1101d69d63158ecb0cf0505a1f5c5509ef.tar.gz dexon-solidity-60b44b1101d69d63158ecb0cf0505a1f5c5509ef.tar.zst dexon-solidity-60b44b1101d69d63158ecb0cf0505a1f5c5509ef.zip |
Merge pull request #5364 from ethereum/chriseth-patch-5
Add note about changing the storage layout.
-rw-r--r-- | docs/miscellaneous.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/miscellaneous.rst b/docs/miscellaneous.rst index 8cc52c8f..7e4385bd 100644 --- a/docs/miscellaneous.rst +++ b/docs/miscellaneous.rst @@ -31,6 +31,14 @@ Statically-sized variables (everything except mapping and dynamically-sized arra declaring your storage variables in the order of ``uint128, uint128, uint256`` instead of ``uint128, uint256, uint128``, as the former will only take up two slots of storage whereas the latter will take up three. + + .. note:: + The layout of state variables in storage is considered to be part of the external interface + of Solidity due to the fact that storage pointers can be passed to libraries. This means that + any change to the rules outlined in this section is considered a breaking change + of the language and due to its critical nature should be considered very carefully before + being executed. + The elements of structs and arrays are stored after each other, just as if they were given explicitly. |