Function Input

Catch on-chain occurrences and execute function

Your function is called with two arguments, context and data:

  • context is chain agnostic and contains information about the current block, the current transaction, the current function call, and the trigger responsible for the function's invocation.
  • data is chain specific and contains the data that was passed to your function by the blockchain.

Formatting

Inside context, we stick as closely as possible to existing blockchain RPC conventions. This means we make extensive use of "0x" prefixed hex strings, and we checksum (ERC55) addresses whenever appropriate.

The data object, however, is passed from the blockchain directly to you function and so it is not always possible to ensure that the data is formatted correctly. This can mean that an event topic that you expect to be a uint256 will actually be a zero-padded hex string, or that an address will not adhere to a mixed case checksum.

Always check the examples we provide for the correct formatting inside the data object and reach out to us if you have any questions.