IAbstractFeeModule
Author: DEFYCA Labs S.à.r.l
Copyright © 2023 DEFYCA Labs S.à.r.l Permission is hereby granted, free of charge, to any person obtaining a copy of the Frictionless protocol smart contracts (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DEFYCA LABS S.à.r.l BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Functions
getFeeInfo
get the FeeInfo for a given key.
Parameters
feeKey_
bytes32
the key as generated by the function getTokenFeeKey
Returns
<none>
FeeInfo
FeeInfo the fees associated with a token transfer.
getFeeInBps
get the feeInBps value for a given key
Parameters
tokenFeeKey_
bytes32
the key as generated by the function getTokenFeeKey
Returns
<none>
uint256
the feeInBps value
getFeeRecipient
get the feeRecipientAddr value for a given key
Parameters
tokenFeeKey_
bytes32
the key as generated by the function getTokenFeeKey
Returns
<none>
address
the feeRecipientAddr value
calculateFeeAmount
Calculates the actual fee in absolute terms for a given fee in basis points.
Parameters
tokensAmount_
uint256
the amount of tokens used to determine the base calculation.
feeInBps_
uint256
the fee in basis points for calculation.
Returns
feeAmount_
uint256
the actual fee in absolute terms for a given fee in basis points.
Events
FrictionlessFeeSet
Event emitted during _setTokenFee
Errors
AbstractFeeModuleInvalidFeeRecipient
error thrown if the recipient is a zero address
AbstractFeeModuleInvalidFee
error thrown if the feesInBps is outside the valid range
Structs
FeeInfo
Struct which defines the FeeInfo, representing the fee in basis points and the recipient of the fees on-chain.