World
System Hooks

System hooks

This page is about hooks that are called before or after a System call. You can also use store hooks that are called whenever information in a table is modified, regardless of the source of the change.

The namespace owner can register (opens in a new tab) hooks that are called before and/or after calls to a specific System.

System hook contracts

A system hook contract is a contract that implements the ISystemHook (opens in a new tab) interface. This interface requires the implementation of two functions.

  • onBeforeCallSystem, which is called before the actual call.
  • onAfterCallSystem, which is called afterward.
  • supportsInterface, which is part of IEP-165 (opens in a new tab) used to specify which interfaces are supported by a contract.

To have the correct supportsInterface you can inherit from SystemHook (opens in a new tab).