Skip to content

ReserveContractAuth ​

validAddress ​

solidity
modifier validAddress(address value_)

validates that an address is not the zero address

onlyAuth ​

solidity
modifier onlyAuth()

Checks that the sender is an auth

updateAuth ​

solidity
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 ​

solidity
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 ​

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

Approves protocols to spend the reserves tokens

The parameters are parallel arrays

Parameters ​

NameTypeDescription
protocols_address[]The protocols that will be spending reserve tokens
tokens_address[]The tokens to approve
amounts_uint256[]The amounts to approve

revoke ​

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

Revokes protocols' ability to spend the reserves tokens

The parameters are parallel arrays

Parameters ​

NameTypeDescription
protocols_address[]The protocols that will no longer be spending reserve tokens
tokens_address[]The tokens to revoke

FluidReserveContract ​

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

onlyRebalancer ​

solidity
modifier onlyRebalancer()

Checks that the sender is a rebalancer

constructor ​

solidity
constructor(contract IFluidLiquidity liquidity_) public

initialize ​

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

initializes the contract

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 ​

solidity
function _authorizeUpgrade(address) internal

renounceOwnership ​

solidity
function renounceOwnership() public view

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

rebalanceFToken ​

solidity
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 ​

solidity
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 ​

solidity
function transferFunds(address[] tokens_) external virtual

getProtocolTokens ​

solidity
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_address[]The tokens that are approved for use by the protocol

receive ​

solidity
receive() external payable

allow receive native token