SetRegistryHook
Inherits: ISetRegistryHook
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
constructor
Constructs the hook and sets the SetRegistry address in context.
constructor(address setRegistry);
Parameters
Name | Type | Description |
---|---|---|
setRegistry | address | Address of the SetRegistry contract. |
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);
Errors
CallerNotSetRegistry
error CallerNotSetRegistry();