FeeDistributor
Fee distributing operations implementation
PRICE_DENOMINATOR
Value used to normalise pricePerSecond
value
FEE_MAX_PERCENT_VALUE
Maximum value of fee
operator
Operator address
protocolFeeReceiver
Protocol fee receiver address
paymentToken
Token address used for paying fees
protocolFee
Protocol fee value (percentage %) Note Value 0 == 0%, 1 == 0.01% 10000 == 100%
accumulatedFees
Mapping from user to amount of accumulated fees
initialize
Initializer method
Parameters
operator_
address
operator
address
feeReceiver_
address
protocolFeeReceiver
address
paymentToken_
address
paymentToken
address
protocolFee_
uint16
protocolFee
value
setProtocolFeeReceiver
Updates feeReceiver
address
Parameters
feeReceiver_
address
New feeReceiver
address
_setFeeReceiver
Updates fee receiver
Parameters
newFeeReceiver
address
New fee receiver address
setProtocolFee
Updates protocolFee
value
Parameters
protocolFee_
uint16
New protocolFee
value
_setProtocolFee
Updates protocol fee value
Parameters
newProtocolFee
uint16
Value of new protocol fee
distributeFee
Distributes 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
Withdraws accumulatedFee
value for caller
getLenderFeeAmount
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
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
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