HookManager
Author: G9 Software Inc.
Allows each account to set and manage prize hooks that can be called when they win.
State Variables
_hooks
Maps user addresses to hooks that they want to execute when prizes are won.
mapping(address => PrizeHooks) internal _hooks;
Functions
getHooks
Gets the hooks for the given account.
function getHooks(address account) external view returns (PrizeHooks memory);
Parameters
Name | Type | Description |
---|---|---|
account | address | The account to retrieve the hooks for |
Returns
Name | Type | Description |
---|---|---|
<none> | PrizeHooks | PrizeHooks The hooks for the given account |
setHooks
Sets the hooks for a winner.
Emits a SetHooks
event
function setHooks(PrizeHooks calldata hooks) external;
Parameters
Name | Type | Description |
---|---|---|
hooks | PrizeHooks | The hooks to set |
Events
SetHooks
Emitted when an account sets new hooks
event SetHooks(address indexed account, PrizeHooks hooks);
Parameters
Name | Type | Description |
---|---|---|
account | address | The account whose hooks are being configured |
hooks | PrizeHooks | The hooks being set |