Modules are standalone contracts that adhere to the IModule interface. These modules play a crucial role in taking action on IP to change the data/state around or of IP.

Existing Modules

There are a few important modules, created by the Story team, to be aware of:

ModuleDescription
📜 Licensing ModuleResponsible for defining and attaching licenses to IP Assets.
💸 Royalty ModuleResponsible for handling royalty flow between parent & child IP Assets.
❌ Dispute ModuleResponsible for handling the dispute of wrongfully registered or misbehaved IP Assets.
👥 Grouping ModuleResponsible for handling groups of IPAs.
👀 Metadata ModuleManage and view metadata for IP Assets.

Base Module

The Base Module provides a standard set of must-have functionalities for all modules registered on Story. Anyone wishing to create and register a module on Story must inherit and override the Base Module.

View the smart contract here.

Key Features

Simplicity and Flexibility

The BaseModule is intentionally kept simple and generalized. It only implements the ERC165 interface, which is crucial for interface detection. This design choice allows for maximum flexibility when developing more specific modules within Story.

ERC165 Interface Implementation

By implementing the ERC165 interface, BaseModule allows other contracts to query whether it supports a specific interface. This feature is essential for ensuring compatibility and interoperability within the Story ecosystem and beyond.

abstract contract BaseModule is ERC165, IModule {
    ...
}

supportsInterface Function

A key function in the BaseModule is supportsInterface, which overrides the ERC165’s supportsInterface method. This function is crucial for interface detection, allowing the contract to declare support for both its own IModule interface and any other interfaces it might inherit.

function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
    return interfaceId == type(IModule).interfaceId || super.supportsInterface(interfaceId);
}