The first topic in the array is the sha3 hash of the hexadecimal representation of the canonical signature of the event. The remaining items in the topics array (there may be up to three) are the hexadecimal values of the
indexed parameters to the event. The event's remaining parameters (non-indexed) are stored in the 'data' field of the log.
For example, the ERC20 token
Transfer event, which is defined as
Transfer(address indexed _from, address indexed _to, uint256 _value)
has this canonical signature (A canonical signature is the name of event and the data types listed with no spaces):
which, when run through sha3, gives:
This is topic. Topic is the value of _from (padded with zeros to 32 bytes on the left), topic is the value of _to (padded), and the non-indexed _value parameter is carried (in hex) in the log's
This transfer event:
generates this log:
address field is the address of the smart contract that generated the event.