Factory-Of-Factories Fees methods
The Factory-Of-Factories provides two methods that must be called in your Factory in order to build a fee-based business model.
Creation Fee and Usage Static Fee
The burnOrTransferTokenAmount
function allow you to implement a Creation Fee(burn or transfer) and/or a Usage Static Fee.
It takes as input:
address
sender
-> address paying the Feeaddress
tokenAddress
-> in which token the fee should be paiduint256
value
-> fee amount to paybytes
permitSignature
-> eventual Permit approval. If it's not passed, the classic approve must be executedaddress
receiver
-> if it's passed asaddress(0)
, the fee is burned. If it's populated, it represents the address receiving the transfer Fee. For example, it could be your Factory host address or a treasury.
The FoF takes a percentage on the value (whether it is burn or transfer) amount, actually it is 0.8%.
Examples
You set a burn fee value of 10 USDC. 0.08 USDC goes to the FoF, 9.92 are burned
You set a transfer fee value of 1 ETH. 0.008 ETH goes to the FoF, 0.992 ETH goes to the receiver address you set
Usage Percentage Fee
The payFee
function allow you to implement a Percentage Fee.
It takes as input:
address
sender
-> address paying the Feeaddress
tokenAddress
-> in which token the fee should be paiduint256
value
-> transacted amountbytes
permitSignature
-> eventual Permit approval. If it's not passed, the classic approve must be executeduint256
feePercentage
-> percentage fee amount. It is multiplied by valueaddress
feeReceiver
-> address receiving the Fee. For example, it could be your Factory host address or a treasury.
The FoF takes a percentage on the value*feePercentage
amount, actually it is 0.8%.
Examples
You set a fee percentage of 5%, the transacted value is 1000USDC. 0.04 USDC goes to the FoF, 49.96 goes to the receiver address you set
You set a fee percentage of 12%, the transacted value is 15ETH. 0.00144 ETH goes to the FoF, 1.79856 goes to the receiver address you set
In the next page, you can find how to implement these functions in your Factory.
Last updated