IFeeDistributor
Interface for base fee distribution implementation
ProtocolFeeReceiverUpdated
event ProtocolFeeReceiverUpdated(address newFeeReceiver)Emitted when protocolFeeReceiver address changed
Parameters
newFeeReceiver
address
New protocolFeeReceiver address
PaymentTokenUpdated
event PaymentTokenUpdated(address newPaymentToken)Emitted when paymentToken address changed
Parameters
newPaymentToken
address
New paymentToken address
ProtocolFeeUpdated
event ProtocolFeeUpdated(uint16 newProtocolFee)Emitted when protocolFee value changed
Parameters
newProtocolFee
uint16
New protocolFee value
FeeDistributed
event FeeDistributed(uint256 rentPrice, uint256 protocolFee, uint256 lenderFee)Emitted when fee is disributed
Parameters
rentPrice
uint256
Rental price
protocolFee
uint256
Protocol fee amount
lenderFee
uint256
Lender fee amount
SenderNotOperator
error SenderNotOperator()Triggered when sender is not operator
InvalidProtocolFee
error InvalidProtocolFee(uint16 protocolFee_)Triggered when invaid protocolFee value passed
Parameters
protocolFee_
uint16
Passed protocol fee value
setProtocolFeeReceiver
function setProtocolFeeReceiver(address feeReceiver_) externalUpdates feeReceiver address
Parameters
feeReceiver_
address
New feeReceiver address
setProtocolFee
function setProtocolFee(uint16 protocolFee_) externalUpdates protocolFee value
Parameters
protocolFee_
uint16
New protocolFee value
distributeFee
function distributeFee(address lender, address borrower, uint256 duration, uint256 pricePerSecond) externalDistributes fee to relevant addresses based on duration and pricePerSecond
Parameters
lender
address
Lender address
borrower
address
Borrower address
duration
uint256
Duration of renting (in seconds)
pricePerSecond
uint256
Price per second or rental period
withdrawFees
function withdrawFees() externalWithdraws accumulatedFee value for caller
getLenderFeeAmount
function getLenderFeeAmount(uint256 amount) external view returns (uint256)Calculates amount of tokens lender receives based on amount
Parameters
amount
uint256
Amount of tokens based on which fee is calculated
Return Values
[0]
uint256
Calculated lender fee
getProtocolFeeAmount
function getProtocolFeeAmount(uint256 amount) external view returns (uint256)Calculated amount of tokens protocolFeeReceiver receives based on amount
Parameters
amount
uint256
Amount of tokens based on which fee is calculated
Return Values
[0]
uint256
Calculated protocol fee
getRentPrice
function getRentPrice(uint256 duration, uint256 pricePerSecond) external pure returns (uint256)Returns calculated rental price
Parameters
duration
uint256
Duration of renting (in seconds)
pricePerSecond
uint256
Price per second or rental period
Return Values
[0]
uint256
Rental price
Last updated