Skip to content

FluidLimitsAuth ​

Git Source

Inherits:Variables, Events, Error

Functions ​

validAddress ​

Validates that an address is not the zero address

solidity
modifier validAddress(address value_);

onlyMultisig ​

solidity
modifier onlyMultisig();

constructor ​

solidity
constructor(address liquidity_) validAddress(liquidity_);

setWithdrawalLimit ​

Sets the withdrawal limit for a specific token of a user in the liquidity

This function can only be called by team multisig

solidity
function setWithdrawalLimit(address user_, address token_, uint256 newLimit_) external onlyMultisig;

Parameters

NameTypeDescription
user_addressThe address of the user for which to set the withdrawal limit
token_addressThe address of the token for which to set the withdrawal limit
newLimit_uint256The new withdrawal limit to be set

setUserWithdrawLimit ​

sets withdraw base limit without restrictions. Can only be called by team multisig.

solidity
function setUserWithdrawLimit(address user_, address token_, uint256 baseLimit_, bool skipMaxPercentChangeCheck_)
    external
    onlyMultisig;

Parameters

NameTypeDescription
user_addressThe address of the user for which to set the user withdraw limit
token_addressThe address of the token for which to set the user withdraw limit
baseLimit_uint256The base limit for the user supply. Set to 0 to keep current value.
skipMaxPercentChangeCheck_boolallow full range of limit check. Keep to false by default to have additional human error check.

setUserBorrowLimits ​

Sets the user borrow limits for a specific token of a user, with time and max percent change restrictions. Can only be called by team multisig.

This function can only be called by team multisig

solidity
function setUserBorrowLimits(address user_, address token_, uint256 baseLimit_, uint256 maxLimit_)
    external
    onlyMultisig;

Parameters

NameTypeDescription
user_addressThe address of the user for which to set the user borrow limit
token_addressThe address of the token for which to set the user borrow limit
baseLimit_uint256The base limit for the user borrow. Set to 0 to keep current value.
maxLimit_uint256The max limit for the user borrow. Set to 0 to keep current value.

getUserSupplyConfig ​

Returns the user supply config for a given user and token.

solidity
function getUserSupplyConfig(address user_, address token_)
    public
    view
    returns (AdminModuleStructs.UserSupplyConfig memory userSupplyConfigs_);

getUserBorrowConfig ​

Returns the user borrow config for a given user and token.

solidity
function getUserBorrowConfig(address user_, address token_)
    public
    view
    returns (AdminModuleStructs.UserBorrowConfig memory userBorrowConfigs_);

_validateWithinMaxPercentChange ​

Validates that the new limit is within the allowed max percent change.

solidity
function _validateWithinMaxPercentChange(uint256 oldLimit_, uint256 newLimit_) internal pure;

_validateLastUpdateTime ​

Validates that the cooldown period has passed since the last update.

solidity
function _validateLastUpdateTime(uint256 lastUpdateTime_) internal view;