Git Source

Inherits: RuleAdministratorOnly, ActionTypesArray, ITokenHandlerEvents, IAssetHandlerErrors

Author: @ShaneDuncan602 @oscarsernarosero @TJ-Everett

Setters and getters for the rule in the handler. Meant to be inherited by a handler facet to easily support the rule.

State Variables

MAX_HOLD_TIME_HOURS

uint16 constant MAX_HOLD_TIME_HOURS = 43830;

Functions

activateTokenMinHoldTime

-------------SIMPLE RULE SETTERS and GETTERS---------------

Tells you if the minimum hold time rule is active or not.

function activateTokenMinHoldTime(ActionTypes[] calldata _actions, bool _on)
    external
    ruleAdministratorOnly(lib.handlerBaseStorage().appManager);

Parameters

NameTypeDescription
_actionsActionTypes[]the action type
_onboolboolean representing if the rule is active

setTokenMinHoldTime

that setting a rule will automatically activate it.

Set the TokenMinHoldTime. Restricted to rule administrators only.

function setTokenMinHoldTime(ActionTypes[] calldata _actions, uint32 _ruleId)
    external
    ruleAdministratorOnly(lib.handlerBaseStorage().appManager);

Parameters

NameTypeDescription
_actionsActionTypes[]the action types
_ruleIduint32the rule id

setTokenMinHoldTimeFull

that setting a rule will automatically activate it.

This function does not check that the array length is greater than zero to allow for clearing out of the action types data

Set the setTokenMinHoldTimeRule suite. Restricted to rule administrators only.

function setTokenMinHoldTimeFull(ActionTypes[] calldata _actions, uint32[] calldata _ruleIds)
    external
    ruleAdministratorOnly(lib.handlerBaseStorage().appManager);

Parameters

NameTypeDescription
_actionsActionTypes[]actions to have the rule applied to
_ruleIdsuint32[]the rule ids corresponding to the actions

clearTokenMinHoldTime

Clear the rule data structure

function clearTokenMinHoldTime() internal;

resetTokenMinHoldTime

reset the ruleChangeDate within the rule data struct. This will signal the rule check to clear the accumulator data prior to checking the rule.

function resetTokenMinHoldTime() internal;

setTokenMinHoldTimeIdUpdate

that setting a rule will automatically activate it.

Set the TokenMinHoldTime.

function setTokenMinHoldTimeIdUpdate(ActionTypes _action, uint32 _ruleId) internal;

Parameters

NameTypeDescription
_actionActionTypesthe action type to set the rule
_ruleIduint32the rule id

getTokenMinHoldTimePeriod

Get the minimum hold time rule hold hours

function getTokenMinHoldTimePeriod(ActionTypes _action) external view returns (uint32);

Parameters

NameTypeDescription
_actionActionTypesthe action type

Returns

NameTypeDescription
<none>uint32period minimum amount of time to hold the asset

isTokenMinHoldTimeActive

function to check if Minumum Hold Time is active

function isTokenMinHoldTimeActive(ActionTypes _action) external view returns (bool);

Parameters

NameTypeDescription
_actionActionTypesthe action type

Returns

NameTypeDescription
<none>boolbool