Git Source

Inherits: IInputErrors, IRuleProcessorErrors, IAccessLevelErrors

Author: @ShaneDuncan602 @oscarsernarosero @TJ-Everett

Implements Access Level Rule Checks. Access Level rules are measured in in terms of USD with 18 decimals of precision.

This contract implements rules to be checked by am Application Handler.

Functions

checkAccountMaxValueByAccessLevel

Check if transaction passes Account Max Value By AccessLevel rule.

function checkAccountMaxValueByAccessLevel(
    uint32 _ruleId,
    uint8 _accessLevel,
    uint128 _balance,
    uint128 _amountToTransfer
) external view;

Parameters

NameTypeDescription
_ruleIduint32Rule Identifier for rule arguments
_accessLeveluint8the Access Level of the account
_balanceuint128account’s beginning balance in USD with 18 decimals of precision
_amountToTransferuint128total USD amount to be transferred with 18 decimals of precision

getAccountMaxValueByAccessLevel

max has to be multiplied by 10 ** 18 to take decimals in token pricing into account

Function to get the Account Max Value By Access Level rule in the rule set that belongs to the Access Level

function getAccountMaxValueByAccessLevel(uint32 _index, uint8 _accessLevel) public view returns (uint48);

Parameters

NameTypeDescription
_indexuint32position of rule in array
_accessLeveluint8AccessLevel Level to check

Returns

NameTypeDescription
<none>uint48balanceAmount balance allowed for access level

getTotalAccountMaxValueByAccessLevel

Function to get total Account Max Value By Access Level rules

function getTotalAccountMaxValueByAccessLevel() public view returns (uint32);

Returns

NameTypeDescription
<none>uint32Total length of array

checkAccountMaxValueOutByAccessLevel

Check if transaction passes Account Max Value Out By Access Level rule.

function checkAccountMaxValueOutByAccessLevel(
    uint32 _ruleId,
    uint8 _accessLevel,
    uint128 _usdWithdrawalTotal,
    uint128 _usdAmountTransferring
) external view returns (uint128);

Parameters

NameTypeDescription
_ruleIduint32Rule Identifier for rule arguments
_accessLeveluint8the Access Level of the account
_usdWithdrawalTotaluint128account’s total amount withdrawn in USD with 18 decimals of precision
_usdAmountTransferringuint128total USD amount to be transferred with 18 decimals of precision

getAccountMaxValueOutByAccessLevel

max has to be multiplied by 10 ** 18 to take decimals in token pricing into account

Function to get the Account Max Value Out By Access Level rule in the rule set that belongs to the Access Level

function getAccountMaxValueOutByAccessLevel(uint32 _index, uint8 _accessLevel) public view returns (uint48);

Parameters

NameTypeDescription
_indexuint32position of rule in array
_accessLeveluint8AccessLevel Level to check

Returns

NameTypeDescription
<none>uint48balanceAmount balance allowed for access level

getTotalAccountMaxValueOutByAccessLevel

Function to get total Account Max Value Out By Access Level rules

function getTotalAccountMaxValueOutByAccessLevel() external view returns (uint32);

Returns

NameTypeDescription
<none>uint32Total number of access level withdrawal rules

checkAccountDenyForNoAccessLevel

Check if transaction passes Account Deny For No Access Level rule.This has no stored rule as there are no additional variables needed.

function checkAccountDenyForNoAccessLevel(uint8 _accessLevel) external pure;

Parameters

NameTypeDescription
_accessLeveluint8the Access Level of the account