Merge pull request #12625 from shuklaayush/patch-1

Docs: fix slot calculation for mappings of strings/byte arrays
This commit is contained in:
Daniel Kirchner 2022-02-07 10:54:05 +01:00 committed by GitHub
commit 6b8654384c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,7 +90,7 @@ The value corresponding to a mapping key ``k`` is located at ``keccak256(h(k) .
where ``.`` is concatenation and ``h`` is a function that is applied to the key depending on its type:
- for value types, ``h`` pads the value to 32 bytes in the same way as when storing the value in memory.
- for strings and byte arrays, ``h`` computes the ``keccak256`` hash of the unpadded data.
- for strings and byte arrays, ``h(k)`` is just the unpadded data.
If the mapping value is a
non-value type, the computed slot marks the start of the data. If the value is of struct type,