TaggedRuleDataFacet
Inherits: Context, RuleAdministratorOnly, IEconomicEvents, IInputErrors, ITagInputErrors, ITagRuleInputErrors, IZeroAddressError
Author: @ShaneDuncan602 @oscarsernarosero @TJ-Everett
This contract sets and gets the Tagged Rules for the protocol. Rules will be applied via General Tags to accounts.
setters and getters for Tagged token specific rules
Functions
addAccountMaxTradeSize
Account Max Trade Size **************
Function add an Account Max Trade Size rule
Function has RuleAdministratorOnly Modifier and takes AppManager Address Param
Parameters
Name | Type | Description |
---|---|---|
_appManagerAddr | address | Address of App Manager |
_accountTypes | bytes32[] | Types of Accounts |
_maxSizes | uint240[] | Allowed total purchase limits |
_periods | uint16[] | Hours purhchases allowed |
_startTime | uint64 | timestamp period to start |
Returns
Name | Type | Description |
---|---|---|
<none> | uint32 | position of new rule in array |
_addAccountMaxTradeSize
since all the arrays must have matching lengths, it is only necessary to check for one of them being empty.
Internal Function to avoid stack too deep error
Parameters
Name | Type | Description |
---|---|---|
_accountTypes | bytes32[] | Types of Accounts |
_maxSizes | uint240[] | Allowed total buy sizes |
_periods | uint16[] | Amount of hours that define the periods |
_startTime | uint64 | timestamp for first period to start |
Returns
Name | Type | Description |
---|---|---|
<none> | uint32 | position of new rule in array |
addAccountMinMaxTokenBalance
Account Min Max Token Balance **************
Function adds Account Min Max Token Balance Rule
Parameters
Name | Type | Description |
---|---|---|
_appManagerAddr | address | App Manager Address |
_accountTypes | bytes32[] | Types of Accounts |
_min | uint256[] | Minimum Balance allowed for tagged accounts |
_max | uint256[] | Maximum Balance allowed for tagged accounts |
_periods | uint16[] | Amount of hours that define the periods |
_startTime | uint64 | Timestamp that the check should start |
Returns
Name | Type | Description |
---|---|---|
<none> | uint32 | _addAccountMinMaxTokenBalance which returns location of rule in array |
_addAccountMinMaxTokenBalance
since all the arrays must have matching lengths, it is only necessary to check for one of them being empty.
Internal Function to avoid stack too deep error
Parameters
Name | Type | Description |
---|---|---|
_accountTypes | bytes32[] | Types of Accounts |
_min | uint256[] | Minimum Balance allowed for tagged accounts |
_max | uint256[] | Maximum Balance allowed for tagged accounts |
_periods | uint16[] | Amount of hours that define the periods |
_startTime | uint64 | Timestamp that the check should start |
Returns
Name | Type | Description |
---|---|---|
<none> | uint32 | position of new rule in array |
addTokenMaxDailyTrades
Token Max Daily Trades ******
Function adds Token Max Daily Trades Rule
Parameters
Name | Type | Description |
---|---|---|
_appManagerAddr | address | App Manager Address |
_nftTags | bytes32[] | Tags of NFTs |
_tradesAllowed | uint8[] | Maximum trades allowed within 24 hours |
_startTime | uint64 | starting timestamp for the rule |
Returns
Name | Type | Description |
---|---|---|
<none> | uint32 | _nftTransferCounterRules which returns location of rule in array |
_addTokenMaxDailyTrades
Internal Function to avoid stack too deep error
Parameters
Name | Type | Description |
---|---|---|
_nftTags | bytes32[] | Tags of NFTs |
_tradesAllowed | uint8[] | Maximum trades allowed within 24 hours |
_startTime | uint64 | starting timestamp for the rule |
Returns
Name | Type | Description |
---|---|---|
<none> | uint32 | position of new rule in array |