Two index entries point to separate attachments whose sizes determine the second starting position.
SEE IT FOR YOURSELF
Follow a dynamic string from head to tailStep 1 / 4
This example encodes one string parameter with value hello. A dynamic argument uses an offset in its head, even when it is the only argument.
This example encodes one string parameter with value hello. A dynamic argument uses an offset in its head, even when it is the only argument.At argument byte 32, the string tail begins with length five. This counts the UTF-8 payload bytes and excludes all padding.At argument byte 64, read 68 65 6c 6c 6f for hello. Twenty-seven following zero bytes fill the final content word.The encoding uses ninety-six argument bytes: one offset word, one length word and one padded content word. A normal function call adds a four-byte selector before these bytes.
Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.
Reserve both head entries
For string and bytes, each dynamic member contributes one offset word. Their shared head is sixty-four bytes, so the first tail starts at byte 64.
Build the first complete tail
The string a uses one length word and one padded content word. Its complete tail takes sixty-four bytes, even though the original text is only one byte.
Place the second pointer
The second tail starts at byte 128: sixty-four head bytes plus sixty-four bytes for the first tail. Both top-level pointers use the same tuple base.
Check a size change
Growing the first payload past thirty-two bytes adds another content word and moves the second tail. The head size stays fixed because the parameter types have not changed.
Trace a local example
types: string,bytes
values: ["a","0x1234"]
no function selector prefix
word 0 · argument offset 0 bytes
0x0000000000000000000000000000000000000000000000000000000000000040
word 1 · argument offset 32 bytes
0x0000000000000000000000000000000000000000000000000000000000000080
word 2 · argument offset 64 bytes
0x0000000000000000000000000000000000000000000000000000000000000001
word 3 · argument offset 96 bytes
0x6100000000000000000000000000000000000000000000000000000000000000
word 4 · argument offset 128 bytes
0x0000000000000000000000000000000000000000000000000000000000000002
word 5 · argument offset 160 bytes
0x1234000000000000000000000000000000000000000000000000000000000000