TradingRuleFacet.sol
TradingRuleFacet
Inherits: HandlerAccountMaxTradeSize, HandlerUtils, HandlerTokenMaxBuySellVolume, AppAdministratorOrOwnerOnlyDiamondVersion, IZeroAddressError, IHandlerDiamondErrors
Functions
checkTradingRules
This function consolidates all the trading rules.
Parameters
Name | Type | Description |
---|---|---|
_from | address | address of the from account |
_to | address | address of the to account |
_sender | address | address of the caller |
fromTags | bytes32[] | tags of the from account |
toTags | bytes32[] | tags of the from account |
_amount | uint256 | number of tokens transferred |
action | ActionTypes | if selling or buying (of ActionTypes type) |
_checkTradeRulesBuyAction
non custodial buy non custodial sell
This function checks the trading rules for Buy actions
Parameters
Name | Type | Description |
---|---|---|
_to | address | address of the to account |
toTags | bytes32[] | tags of the from account |
_amount | uint256 | number of tokens transferred |
_checkTradeRulesSellAction
update with new blockTime if rule check is successful
This function checks the trading rules for Sell actions
Parameters
Name | Type | Description |
---|---|---|
_from | address | address of the from account |
fromTags | bytes32[] | tags of the from account |
_amount | uint256 | number of tokens transferred |