Fees
Inherits: IApplicationEvents, ITokenHandlerEvents, IInputErrors, ITagInputErrors, IOwnershipErrors, IZeroAddressError, IFeesErrors, RuleAdministratorOnly
Author: @ShaneDuncan602, @oscarsernarosero, @TJ-Everett
This contract serves as a storage for asset transfer fees
This contract should not be accessed directly. All processing should go through its controlling asset. Example found in (UtilApplicationERC20, UtilApplicationERC721).
State Variables
BLANK_TAG
Functions
addFee
This function adds a fee to the token. Blank tags are allowed
Parameters
Name | Type | Description |
---|---|---|
_tag | bytes32 | meta data tag for fee |
_minBalance | uint256 | minimum balance for fee application |
_maxBalance | uint256 | maximum balance for fee application |
_feePercentage | int24 | fee percentage to assess |
_targetAccount | address | fee percentage to assess |
removeFee
This function removes a fee to the token
Parameters
Name | Type | Description |
---|---|---|
_tag | bytes32 | meta data tag for fee |
getFee
returns the fee struct for the given tag
Parameters
Name | Type | Description |
---|---|---|
_tag | bytes32 | meta data tag for fee |
Returns
Name | Type | Description |
---|---|---|
<none> | Fee | fee struct containing fee data |
getFeeTotal
returns the total number of fees
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | feeTotal total number of fees |
getApplicableFees
Get all the fees/discounts for the transaction. This is assessed and returned as two separate arrays. This was necessary because the fees may go to different target accounts. Since struct arrays cannot be function parameters for external functions, two separate arrays must be used.
Parameters
Name | Type | Description |
---|---|---|
_from | address | originating address |
_balanceFrom | uint256 | Token balance of the sender address |
Returns
Name | Type | Description |
---|---|---|
feeSinks | address[] | list of where the fees are sent |
feePercentages | int24[] | list of all applicable fees/discounts |