Follow the tuple-relative pointer before reading UTF-8 content.
LET’S PICTURE IT
An index entry points to an attachment with its own length.
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.
Use the exact declaration
Decode setMessage(string) with the supplied interface. The first four bytes frame the function request and are not part of the argument tuple’s offset base.
Read the dynamic head
The first argument word contains 32. Add that offset to argument byte zero, which begins immediately after the selector.
Read the tail boundaries
The next word contains length five, then the bytes of hello and twenty-seven padding bytes. Length counts payload bytes, not padding.
Check absolute positions
The string length begins at calldata byte 36 and content at byte 68. Re-encode the recovered value and compare complete calldata.
Your acceptance target
function setMessage(string message)
arguments: ["hello"]
selector: 0x368b8772
arguments begin at calldata byte 4
word 0 · argument offset 0 bytes
0x0000000000000000000000000000000000000000000000000000000000000020
word 1 · argument offset 32 bytes
0x0000000000000000000000000000000000000000000000000000000000000005
word 2 · argument offset 64 bytes
0x68656c6c6f000000000000000000000000000000000000000000000000000000
Use only local examples and public sample addresses. State the assumptions and limits alongside the result.