Skip to main content

HookManager

Git Source

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

NameTypeDescription
accountaddressThe account to retrieve the hooks for

Returns

NameTypeDescription
<none>PrizeHooksPrizeHooks The hooks for the given account

setHooks

Sets the hooks for a winner.

Emits a SetHooks event

function setHooks(PrizeHooks calldata hooks) external;

Parameters

NameTypeDescription
hooksPrizeHooksThe hooks to set

Events

SetHooks

Emitted when an account sets new hooks

event SetHooks(address indexed account, PrizeHooks hooks);

Parameters

NameTypeDescription
accountaddressThe account whose hooks are being configured
hooksPrizeHooksThe hooks being set