Integrate a Usage Fee
As previously established, a Usage Fee can be either a static fee (a burn fee or a transfer fee) or a percentage fee.
In either case, the fee payment logic must be inserted into the model contract according to the business logic of your contract.
So, when you code your model contract according to these guidelines, you have to keep in mind to code your Usage Fees logics.
This example shows the Fees logic of the Covenants Farming contract cloned by the Farming Factory, implementing the EthereansFactory
contract.
You should use it as a guideline to adapt to your Fees system.
Usage Fee Integration Example
The Covenants Farming Factory implements the EthereansFactory
utility contract. In this way, the Farming model contract can have Usage Fees inside.
In particular, when a farmer withdraws his liquidity he can choose to:
pay the static burn usage fee -> it interacts with the
burnOrTransferTokenAmount
of theEthereansFactory
pay the percentage usage fee -> it interacts with the
payFee
of theEthereansFactory
Last updated