The data hook is passed contextual information from the transactions, which it uses to derive custom data for the protocol to affect subsequent behaviors in the pay and cash out transactions. Contextual information from the pay transaction is passed in the form of JBBeforePayRecordedContext, and contextual information from the cash out transaction is passed in the form of JBBeforeCashOutRecordedContext.
Data hooks can revert under custom circumstances, enabling functionality such as gated treasuries, max token supplies, or minimum contribution amounts.
A data hook is responsible for specifying any pay hook that should be triggered after the core functionality of a pay(...) or cashOutTokensOf(...) transaction executes successfully.
Each IJBTerminal fork can leverage data hooks in unique ways.