FeeDistributor

Fee distributing operations implementation

PRICE_DENOMINATOR

uint256 PRICE_DENOMINATOR

Value used to normalise pricePerSecond value

FEE_MAX_PERCENT_VALUE

uint256 FEE_MAX_PERCENT_VALUE

Maximum value of fee

operator

address operator

Operator address

protocolFeeReceiver

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

Name
Type
Description

operator_

address

operator address

feeReceiver_

address

protocolFeeReceiver address

paymentToken_

address

paymentToken address

protocolFee_

uint16

protocolFee value

setProtocolFeeReceiver

Updates feeReceiver address

Parameters

Name
Type
Description

feeReceiver_

address

New feeReceiver address

_setFeeReceiver

Updates fee receiver

Parameters

Name
Type
Description

newFeeReceiver

address

New fee receiver address

setProtocolFee

Updates protocolFee value

Parameters

Name
Type
Description

protocolFee_

uint16

New protocolFee value

_setProtocolFee

Updates protocol fee value

Parameters

Name
Type
Description

newProtocolFee

uint16

Value of new protocol fee

distributeFee

Distributes fee to relevant addresses based on duration and pricePerSecond

Parameters

Name
Type
Description

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

Name
Type
Description

amount

uint256

Amount of tokens based on which fee is calculated

Return Values

Name
Type
Description

[0]

uint256

Calculated lender fee

getProtocolFeeAmount

Calculated amount of tokens protocolFeeReceiver receives based on amount

Parameters

Name
Type
Description

amount

uint256

Amount of tokens based on which fee is calculated

Return Values

Name
Type
Description

[0]

uint256

Calculated protocol fee

getRentPrice

Returns calculated rental price

Parameters

Name
Type
Description

duration

uint256

Duration of renting (in seconds)

pricePerSecond

uint256

Price per second or rental period

Return Values

Name
Type
Description

[0]

uint256

Rental price

Last updated