IFeeDistributor

Interface for base fee distribution implementation

ProtocolFeeReceiverUpdated

event ProtocolFeeReceiverUpdated(address newFeeReceiver)

Emitted when protocolFeeReceiver address changed

Parameters

Name
Type
Description

newFeeReceiver

address

New protocolFeeReceiver address

PaymentTokenUpdated

event PaymentTokenUpdated(address newPaymentToken)

Emitted when paymentToken address changed

Parameters

Name
Type
Description

newPaymentToken

address

New paymentToken address

ProtocolFeeUpdated

event ProtocolFeeUpdated(uint16 newProtocolFee)

Emitted when protocolFee value changed

Parameters

Name
Type
Description

newProtocolFee

uint16

New protocolFee value

FeeDistributed

event FeeDistributed(uint256 rentPrice, uint256 protocolFee, uint256 lenderFee)

Emitted when fee is disributed

Parameters

Name
Type
Description

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

Name
Type
Description

protocolFee_

uint16

Passed protocol fee value

setProtocolFeeReceiver

function setProtocolFeeReceiver(address feeReceiver_) external

Updates feeReceiver address

Parameters

Name
Type
Description

feeReceiver_

address

New feeReceiver address

setProtocolFee

function setProtocolFee(uint16 protocolFee_) external

Updates protocolFee value

Parameters

Name
Type
Description

protocolFee_

uint16

New protocolFee value

distributeFee

function distributeFee(address lender, address borrower, uint256 duration, uint256 pricePerSecond) external

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

function withdrawFees() external

Withdraws accumulatedFee value for caller

getLenderFeeAmount

function getLenderFeeAmount(uint256 amount) external view returns (uint256)

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

function getProtocolFeeAmount(uint256 amount) external view returns (uint256)

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

function getRentPrice(uint256 duration, uint256 pricePerSecond) external pure returns (uint256)

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