SetRegistryHook
Inherits: ISetRegistryHook
Title: SetRegistryHook
Base implementation of ISetRegistryHook for handling set lifecycle callbacks.
Updates the SetContext during set registration, upgrades, and touches. Intended to be inherited by set contracts to handle automatic context tracking.
Functions
_SetRegistryHook_initialize
function _SetRegistryHook_initialize(address setRegistry) internal;
onlySetRegistry
Restricts access to only the configured SetRegistry.
modifier onlySetRegistry() ;
onSetRegister
Called before a set is registered.
function onSetRegister(uint64 set, Descriptor memory od)
external
virtual
override
onlySetRegistry
returns (bytes4);
Parameters
| Name | Type | Description |
|---|---|---|
set | uint64 | Set ID being registered. |
od | Descriptor | Initial descriptor of the set. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bytes4 | selector Must return onSetRegister.selector to confirm the action. |
onSetUpdate
Called before a set is updated.
function onSetUpdate(uint64 set, Descriptor memory od) external virtual override onlySetRegistry returns (bytes4);
Parameters
| Name | Type | Description |
|---|---|---|
set | uint64 | Set ID being updated. |
od | Descriptor | Updated descriptor of the set. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bytes4 | selector Must return onSetUpdate.selector to confirm the action. |
onSetUpgrade
Called before a set is upgraded.
function onSetUpgrade(uint64 set, Descriptor memory od) external virtual override onlySetRegistry returns (bytes4);
Parameters
| Name | Type | Description |
|---|---|---|
set | uint64 | Set ID being upgraded. |
od | Descriptor | Descriptor of the set after the upgrade. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bytes4 | selector Must return onSetUpgrade.selector to confirm the action. |
onSetTouch
Called before a set is touched (bumped revision with no content change).
function onSetTouch(uint64 set, Descriptor memory od) external virtual override onlySetRegistry returns (bytes4);
Parameters
| Name | Type | Description |
|---|---|---|
set | uint64 | Set ID being touched. |
od | Descriptor | Descriptor of the set after the touch. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bytes4 | selector Must return onSetTouch.selector to confirm the action. |
supportsInterface
Returns true if this contract implements the interface defined by
interfaceId. See the corresponding
https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
to learn more about how these ids are created.
This function call must use less than 30 000 gas.
function supportsInterface(bytes4 interfaceId) external pure virtual override returns (bool supported);
_onlySetRegistry
function _onlySetRegistry() internal view;
_SetRegistryHook_supportsInterface
function _SetRegistryHook_supportsInterface(bytes4 interfaceId) internal pure returns (bool supported);
Errors
NotSetRegistry
error NotSetRegistry();