fTokenAdmin

Git Source

Inherits:fTokenCore, fTokenViews

fToken admin related methods. fToken admins are Lending Factory auths. Possible actions are updating rewards, funding rewards, and rescuing any stuck funds (fToken contract itself never holds any funds).

Functions

_checkIsLendingFactoryAuth

checks if msg.sender is an allowed auth at LendingFactory. internal method instead of modifier to reduce bytecode size.

function _checkIsLendingFactoryAuth() internal view;

updateRewards

updates the rewards rate model contract. Only callable by LendingFactory auths.

function updateRewards(IFluidLendingRewardsRateModel rewardsRateModel_) external;

Parameters

NameTypeDescription
rewardsRateModel_IFluidLendingRewardsRateModelthe new rewards rate model contract address. can be set to address(0) to set no rewards (to save gas)

rebalance

Balances out the difference between fToken supply at Liquidity vs totalAssets(). Deposits underlying from rebalancer address into Liquidity but doesn't mint any shares -> thus making deposit available as rewards. Only callable by rebalancer.

function rebalance() external payable virtual nonReentrant returns (uint256 assets_);

Returns

NameTypeDescription
assets_uint256amount deposited to Liquidity

updateRebalancer

Updates the rebalancer address (ReserveContract). Only callable by LendingFactory auths.

function updateRebalancer(address newRebalancer_) public validAddress(newRebalancer_);

updateRates

gets the liquidity exchange price of the underlying asset, calculates the updated exchange price (with reward rates) and writes those values to storage. Callable by anyone.

function updateRates() public returns (uint256 tokenExchangePrice_, uint256 liquidityExchangePrice_);

Returns

NameTypeDescription
tokenExchangePrice_uint256exchange price of fToken share to underlying asset
liquidityExchangePrice_uint256exchange price at Liquidity for the underlying asset

rescueFunds

sends any potentially stuck funds to Liquidity contract. Only callable by LendingFactory auths.

function rescueFunds(address token_) external virtual nonReentrant;