ABI
ABI is like the API documentation that tells you how to structure requests and parse responses.
ABI essentials include:
JSON format: Lists functions, inputs, outputs, and events.
Selector derivation: Keccak256 of signature → first 4 bytes.
Data packing: Fixed‑width 32‑byte slots for arguments.
Event topics: Defines indexed vs. non‑indexed log data.
Truffle generates an ABI file after compiling contracts, used by front‑end DApps to call on‑chain methods.
During a transaction, calldata = selector + encoded arguments. The EVM dispatcher uses the selector to jump to the correct function. For events, topics[0] = keccak256(event signature), followed by indexed parameter values.
Mismatched ABI and bytecode can break UI integrations silently.
ABIs do not include library link references; linking must be handled separately.