HookOn Field
Specify which transaction types a Hook should be triggered on
Understanding the HookOn field
Each bit in this unsigned 256-bit integer indicates whether the Hook should execute on a particular transaction type. All bits are active low except bit 22 which is active high. Since 22 is ttHOOK_SET this means the default value of all 0's will not fire on a SetHook transaction but will fire on every other transaction type. This is a deliberate design choice to help people avoid bricking their Xahau account with a misbehaving hook.
Bits are numbered from right to left:
bit 0 - right most, i.e. the least significant bit.
bit 63 - the left-most, i.e. the most significant bit.
Examples (assuming a 256-bit unsigned integer type):
If we want to completely disable the hook:
If we want to disable the hook on everything except ttPAYMENT:
If we want to enable the hook on everything except ttHOOK_SET
If we want to enable hook firing on ttHOOK_SET (dangerous) and every other transaction type:
HookOn Calculator
Last updated