Event Hash

eventHash is calculated from the eventId and eventArgs:

eventHash = keccak256(eventId,eventArgs)

eventId is the event params combined together to create a unique id.

eventId = EventName + EventChainId + EventContract + EventTransactionHash

where:

  • EventName - the name of the event

  • EventChainId - chainId of the transaction with invoked event

  • EventContract - a contract that invoked the event

  • EventTransactionHash - hash of the transaction with invoked event

EventArgs is the event's arguments. All event arguments will be combined in the same order as they were in the event.

eventArgs = eventArg_1 + eventArg_2 + ... 

For example, for this Transfer event, eventHash will be:

message=keccak256(
    "Transfer",
    1,
    "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "0xa3b1123b8181f27c30f9cae42340325f0fcecf80c7886045dc159a8b8abd9a63",
    "0x974CaA59e49682CdA0AD2bbe82983419A2ECC400",
    "0x59169f3c0e9e3630D0EBa5E5561dC1677D9451F3",
    "1574766820"
    )="0x9d4776df88b0ab9bc77fdd2170fc62ce668886290c49b5306bb003d0a751bdc1"

Last updated