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
Name | Type | Description |
---|---|---|
auth_ | address | The address to update |
isAuth_ | bool | Whether 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
Name | Type | Description |
---|---|---|
rebalancer_ | address | The address to update |
isRebalancer_ | bool | Whether 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
Name | Type | Description |
---|---|---|
protocols_ | address | The protocols that will be spending reserve tokens |
tokens_ | address | The tokens to approve |
amounts_ | uint256 | The 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
Name | Type | Description |
---|---|---|
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
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
Name | Type | Description |
---|---|---|
_auths | address | The addresses that have the auth to approve and revoke protocol token allowances |
_rebalancers | address | The addresses that can execute a rebalance on a protocol |
owner_ | address | owner 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
Name | Type | Description |
---|---|---|
protocol_ | address | The protocol to rebalance |
value_ | uint256 | any 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
Name | Type | Description |
---|---|---|
protocol_ | address | The protocol to rebalance |
value_ | uint256 | any 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
Name | Type | Description |
---|---|---|
protocol_ | address | The protocol to get the tokens for |
Return Values
Name | Type | Description |
---|---|---|
result_ | address | The tokens that are approved for use by the protocol |
receive
receive() external payable
allow receive native token