FeeCollector contract manages fee collection for both LiFi protocol fees and integrator fees. It tracks balances per integrator and token, and allows withdrawal of collected fees.
Functions
Fee Collection
collectTokenFees
Collects fees in ERC20 tokens from a transaction.Address of the ERC20 token
Amount of tokens to collect as integrator fee
Amount of tokens to collect as LiFi protocol fee
Address of the integrator to credit the fee to
collectNativeFees
Collects fees in native currency (ETH, MATIC, etc.).Amount of native currency to collect as integrator fee
Amount of native currency to collect as LiFi protocol fee
Address of the integrator to credit the fee to
Fee Withdrawal
withdrawIntegratorFees
Withdraws collected fees for a specific token (integrator only).Address of the token to withdraw (zero address for native)
withdrawLifiFees
Withdraws LiFi protocol fees for a specific token (owner only).Address of the token to withdraw (zero address for native)
batchWithdrawIntegratorFees
Withdraws integrator fees for multiple tokens at once.Array of token addresses to withdraw
batchWithdrawLifiFees
Withdraws LiFi protocol fees for multiple tokens at once (owner only).Array of token addresses to withdraw
View Functions
getTokenBalance
Gets the fee balance for a specific integrator and token.Address of the integrator
Address of the token
getLifiTokenBalance
Gets the LiFi protocol fee balance for a specific token.Address of the token
Ownership Functions
The FeeCollector implements a two-step ownership transfer pattern:transferOwnership
confirmOwnershipTransfer
cancelOwnershipTransfer
owner
pendingOwner
Events
FeesCollected
Emitted when fees are collected.Address of the token (zero for native)
Address of the integrator
Amount collected as integrator fee
Amount collected as LiFi protocol fee
FeesWithdrawn
Emitted when integrator fees are withdrawn.Address of the withdrawn token
Address receiving the fees
Amount withdrawn
LiFiFeesWithdrawn
Emitted when LiFi protocol fees are withdrawn.Address of the withdrawn token
Address receiving the fees
Amount withdrawn
OwnershipTransferRequested
Current owner
Pending new owner
OwnershipTransferred
Previous owner
New owner