Git Source

Inherits: HandlerAccountMaxTradeSize, HandlerUtils, HandlerTokenMaxBuySellVolume, AppAdministratorOrOwnerOnlyDiamondVersion, IZeroAddressError, IHandlerDiamondErrors

Functions

checkTradingRules

This function consolidates all the trading rules.

function checkTradingRules(
    address _from,
    address _to,
    address _sender,
    bytes32[] memory fromTags,
    bytes32[] memory toTags,
    uint256 _amount,
    ActionTypes action
) external onlyOwner;

Parameters

NameTypeDescription
_fromaddressaddress of the from account
_toaddressaddress of the to account
_senderaddressaddress of the caller
fromTagsbytes32[]tags of the from account
toTagsbytes32[]tags of the from account
_amountuint256number of tokens transferred
actionActionTypesif selling or buying (of ActionTypes type)

_checkTradeRulesBuyAction

non custodial buy non custodial sell

This function checks the trading rules for Buy actions

function _checkTradeRulesBuyAction(address _to, bytes32[] memory toTags, uint256 _amount) internal;

Parameters

NameTypeDescription
_toaddressaddress of the to account
toTagsbytes32[]tags of the from account
_amountuint256number of tokens transferred

_checkTradeRulesSellAction

update with new blockTime if rule check is successful

This function checks the trading rules for Sell actions

function _checkTradeRulesSellAction(address _from, bytes32[] memory fromTags, uint256 _amount) internal;

Parameters

NameTypeDescription
_fromaddressaddress of the from account
fromTagsbytes32[]tags of the from account
_amountuint256number of tokens transferred