FluidReserveContract

Git Source

Inherits:Error, ReserveContractAuth, UUPSUpgradeable

This contract manages the approval of tokens for use by protocols and the execution of rebalances on protocols

Functions

onlyRebalancer

Checks that the sender is a rebalancer

modifier onlyRebalancer();

constructor

constructor(IFluidLiquidity liquidity_) validAddress(address(liquidity_)) Variables(liquidity_);

initialize

initializes the contract

function initialize(address[] memory _auths, address[] memory _rebalancers, address owner_)
    public
    initializer
    validAddress(owner_);

Parameters

NameTypeDescription
_authsaddress[]The addresses that have the auth to approve and revoke protocol token allowances
_rebalancersaddress[]The addresses that can execute a rebalance on a protocol
owner_addressowner address is able to upgrade contract and update auth users

_authorizeUpgrade

function _authorizeUpgrade(address) internal override onlyOwner;

renounceOwnership

override renounce ownership as it could leave the contract in an unwanted state if called by mistake.

function renounceOwnership() public view override onlyOwner;

rebalanceFToken

Executes a rebalance on a protocol by calling that protocol's rebalance function

function rebalanceFToken(address protocol_, uint256 value_) external payable onlyRebalancer;

Parameters

NameTypeDescription
protocol_addressThe protocol to rebalance
value_uint256any msg.value to send along (as fetched from resolver!)

rebalanceVault

Executes a rebalance on a protocol by calling that protocol's rebalance function

function rebalanceVault(address protocol_, uint256 value_) external payable onlyRebalancer;

Parameters

NameTypeDescription
protocol_addressThe protocol to rebalance
value_uint256any msg.value to send along (as fetched from resolver!)

transferFunds

function transferFunds(address[] calldata tokens_) external virtual onlyAuth;

getProtocolTokens

Gets the tokens that are approved for use by a protocol

function getProtocolTokens(address protocol_) external view returns (address[] memory result_);

Parameters

NameTypeDescription
protocol_addressThe protocol to get the tokens for

Returns

NameTypeDescription
result_address[]The tokens that are approved for use by the protocol

receive

allow receive native token

receive() external payable;