In this track: Read logs and failures
advanced · 4 MIN READ

Decode an ERC-20 Transfer event

Read two indexed addresses and one raw amount.

LET’S PICTURE IT

A movement record has a source label, a destination label and an unscaled quantity.

SEE IT FOR YOURSELF
From an emitted Transfer event to a receipt logStep 1 / 4
From an emitted Transfer event to a receipt logToken executionApply coded rulesUpdate relevant balancesEmit Transferfrom · to · valueA structured logA reverted execution portion does not keep its emitted logsTransfer(address,address,uint256)Topic 0: 0xddf252ad…b3efFull digest · 32 bytesEvent topic zero and a function selector use different lengthsTopic 1from addressIndexedTopic 2to addressIndexedDataraw valueNot indexedThis diagram is specifically the common ERC-20 Transfer layoutReceipt logTopics + dataBlock contextApplication viewDecoded fieldsImplementation still mattersThe local event tool does not query or authenticate a deployed token

A token implementation may update balances and emit its standard Transfer event. State and the emitted record are related but distinct.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

Confirm the event shape

The common ERC-20 Transfer declaration has indexed from and to addresses and a non-indexed uint256 value. Other event declarations need their own schema.

Recover the address fields

Topic one and topic two contain padded address values. Extract and validate their twenty-byte address portions with a typed decoder rather than guessing from visual spacing.

Interpret the amount carefully

The data word holds a raw integer. Converting it to a human token amount needs trusted decimals information; the Transfer record itself does not supply that metadata.

Keep interpretation tied to evidence

Check the emitting contract and receipt context before describing an economic transfer. A matching log alone does not establish honest balances, token value or finalized inclusion.

Inspect the example

event Transfer(address indexed from, address indexed to, uint256 value)

topic 0: 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
topic 1: 0x0000000000000000000000000000000000000000000000000000000000000001
topic 2: 0x0000000000000000000000000000000000000000000000000000000000000002
data: 0x0000000000000000000000000000000000000000000000000000000000000064

Toy emitter; from address 1; to address 2; raw amount 100.
No token decimals or verified token identity are implied.

Use the event decoder with these full topics and data.

TURN UNDERSTANDING INTO PRACTICEOpen the Event decoder →
QUICK CHECK · NO PRESSURE

Does raw value 100 establish 100 whole tokens?

Your progress stays in this browser.
Keep exploring the original referenceSolidity documentation ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.