The Hedera mainnet was upgraded to v0.17.4 on September 2nd, 2021. It included the new functionality of HIP-18: Custom Hedera Token Service Fees — the ability for anyone issuing a token on Hedera using the Hedera Token Service to include programmatic custom fees.
Custom fees can be `fractional`, `fixed`, or `royalty`:
Fixed Fee: A fixed fee transfers a set number of tokens, collected as a fee, every time a token transfer is initiated.
Fractional Fee: A fractional fee transfers a variable number of tokens, collected as a fee, every time a token transfer is initiated. The amount is configured by setting a numerator and denominator to determine a fractional (or percentage) fee. Fractional fees can be configured to impose minimum and maximum limits on the amount transferred.
Royalty Fee: A royalty fee can be enabled on the fee schedule of an NFT and collected during the transfer of ownership. This fee is defined as a fraction of the fungible token value used in exchange (HBAR or a custom fungible token) for the NFT, as defined by the fee schedule of the NFT. The fee is collected from the receiver of the NFT in a transaction and sent to the NFT’s fee collector account, as defined in the fee schedule.
Fees are configured to be paid in the token being transacted, any other type of token created using Hedera Token Service, or hbar.
Custom Token Fee Use Cases and Code Examples
Custom Fractional Fee Schedule