Module Setup

Each module instance is initialized at creation time by the public setUp function, which is triggered by the createHatsModule function in HatsModuleFactory. This is where custom initial (mutable) variables and other configurations are set.

That custom logic can be implemented in the virtual _setUp function, which the module implementation should override.

function _setUp(bytes calldata _initData) internal virtual { }

Parameters:

  • _initData - abi-encoded initialization data.

The setUp function is modified by OpenZeppelin's initializable, which prevents any future calls that could re-initialize the instance. setUp will be called even if _setUp is empty, ensuring that all instances are properly initialized.

Last updated