ReserveContractAuth

validAddress

modifier validAddress(address value_)

validates that an address is not the zero address

onlyAuth

modifier onlyAuth()

Checks that the sender is an auth

updateAuth

function updateAuth(address auth_, bool isAuth_) external

Updates an auth's status as an auth

Parameters

NameTypeDescription
auth_addressThe address to update
isAuth_boolWhether or not the address should be an auth

updateRebalancer

function updateRebalancer(address rebalancer_, bool isRebalancer_) external

Updates a rebalancer's status as a rebalancer

Parameters

NameTypeDescription
rebalancer_addressThe address to update
isRebalancer_boolWhether or not the address should be a rebalancer

approve

function approve(address[] protocols_, address[] tokens_, uint256[] amounts_) external

Approves protocols to spend the reserves tokens

The parameters are parallel arrays

Parameters

NameTypeDescription
protocols_addressThe protocols that will be spending reserve tokens
tokens_addressThe tokens to approve
amounts_uint256The amounts to approve

revoke

function revoke(address[] protocols_, address[] tokens_) external

Revokes protocols' ability to spend the reserves tokens

The parameters are parallel arrays

Parameters

NameTypeDescription
protocols_addressThe protocols that will no longer be spending reserve tokens
tokens_addressThe tokens to revoke

FluidReserveContract

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

onlyRebalancer

modifier onlyRebalancer()

Checks that the sender is a rebalancer

constructor

constructor(contract IFluidLiquidity liquidity_) public

initialize

function initialize(address[] _auths, address[] _rebalancers, address owner_) public

initializes the contract

Parameters

NameTypeDescription
_authsaddressThe addresses that have the auth to approve and revoke protocol token allowances
_rebalancersaddressThe 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

renounceOwnership

function renounceOwnership() public view

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

rebalanceFToken

function rebalanceFToken(address protocol_, uint256 value_) external payable

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

Parameters

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

rebalanceVault

function rebalanceVault(address protocol_, uint256 value_) external payable

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

Parameters

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

transferFunds

function transferFunds(address[] tokens_) external virtual

getProtocolTokens

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

Gets the tokens that are approved for use by a protocol

Parameters

NameTypeDescription
protocol_addressThe protocol to get the tokens for

Return Values

NameTypeDescription
result_addressThe tokens that are approved for use by the protocol

receive

receive() external payable

allow receive native token