Support .offset and .length for calldata bytes and string arrays.

This commit is contained in:
chriseth
2020-11-18 01:45:56 +01:00
parent e694cc1b1c
commit 2665eaa4fa
31 changed files with 366 additions and 128 deletions
+4
View File
@@ -135,6 +135,10 @@ inside that slot. To retrieve the slot pointed to by the variable ``x``, you
use ``x.slot``, and to retrieve the byte-offset you use ``x.offset``.
Using ``x`` itself will result in an error.
For dynamic calldata arrays, you can access
their calldata offset (in bytes) and length (number of elements) using ``x.offset`` and ``x.length``.
Both expressions can also be assigned to.
Local Solidity variables are available for assignments, for example:
.. code::