An unsigned integer occupies one left-padded 32-byte word.
LET’S PICTURE IT
A numbered box can be right-aligned in a fixed-width shelf with empty leading spaces.
SEE IT FOR YOURSELF
Build a transfer call from typed fieldsStep 1 / 4
The standard transfer interface takes an address and a raw integer amount. This diagram uses address one and amount one hundred.
The standard transfer interface takes an address and a raw integer amount. This diagram uses address one and amount one hundred.Keccak-256 of the canonical signature supplies the first four bytes. The transfer selector is a9059cbb.An address is twenty bytes. Standard ABI encoding adds twelve zero bytes on the left to fill one thirty-two-byte word.The integer one hundred is hex 64, left-padded in word one. Selector plus two words produces sixty-eight bytes of standard calldata.
Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.
Check the range
uint256 represents integers from zero through 2²⁵⁶ − 1. A negative or out-of-range input does not become valid merely by adding zeros.
Convert the integer to hex
Decimal 42 is hexadecimal 2a. Standard ABI uint256 encoding places those bits at the lower-order end of a thirty-two-byte word.
Pad on the left
Fill the remaining leading bytes with zeros until the word has sixty-four hexadecimal digits. The 0x prefix is display notation and is not an extra encoded byte.
Keep economic scale separate
This word could represent Wei, raw token units or a counter. The uint256 schema explains numeric representation, while the application supplies the quantity’s meaning.
Follow the bytes
types: uint256
values: ["42"]
no function selector prefix
word 0 · argument offset 0 bytes
0x000000000000000000000000000000000000000000000000000000000000002a