The boolean schema uses canonical zero or one values.
LET’S PICTURE IT
A yes/no form uses two agreed numeric states rather than any arbitrary nonzero label.
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.
False and true have canonical forms
A standard ABI bool is encoded like a word containing zero for false or one for true. It still occupies thirty-two bytes in ordinary parameter encoding.
Do not import loose language truthiness
A JavaScript object or the text false is not automatically a typed boolean value. Parse input according to the tool’s schema rather than assuming every programming language treats the same input identically.
Decoding needs the intended type
A word containing one can also be read as an integer under another schema. The bytes do not independently announce that the author intended a boolean.
Keep packed layouts separate
A packed encoding can use fewer bytes for bool. That is a distinct representation with different concatenation and decoding properties, not a reason to shorten a standard ABI word.
Follow the bytes
types: bool,bool
values: [false,true]
no function selector prefix
word 0 · argument offset 0 bytes
0x0000000000000000000000000000000000000000000000000000000000000000
word 1 · argument offset 32 bytes
0x0000000000000000000000000000000000000000000000000000000000000001
The second word ends in 01, while the first is entirely zero.