Skip to content

FluidLiquidityDummyImpl ​

Git Source

Inherits:IFluidLiquidityLogic

Liquidity dummy implementation used for Fluid Liquidity infinite proxy.

see https://github.com/Instadapp/infinite-proxy?tab=readme-ov-file#dummy-implementation

Functions ​

updateAuths ​

adds/removes auths. Auths generally could be contracts which can have restricted actions defined on contract. auths can be helpful in reducing governance overhead where it's not needed.

solidity
function updateAuths(AdminModuleStructs.AddressBool[] calldata authsStatus_) external;

Parameters

NameTypeDescription
authsStatus_AdminModuleStructs.AddressBool[]array of structs setting allowed status for an address. status true => add auth, false => remove auth

updateGuardians ​

adds/removes guardians. Only callable by Governance.

solidity
function updateGuardians(AdminModuleStructs.AddressBool[] calldata guardiansStatus_) external;

Parameters

NameTypeDescription
guardiansStatus_AdminModuleStructs.AddressBool[]array of structs setting allowed status for an address. status true => add guardian, false => remove guardian

updateRevenueCollector ​

changes the revenue collector address (contract that is sent revenue). Only callable by Governance.

solidity
function updateRevenueCollector(address revenueCollector_) external;

Parameters

NameTypeDescription
revenueCollector_addressnew revenue collector address

changeStatus ​

changes current status, e.g. for pausing or unpausing all user operations. Only callable by Auths.

solidity
function changeStatus(uint256 newStatus_) external;

Parameters

NameTypeDescription
newStatus_uint256new status status = 2 -> pause, status = 1 -> resume.

updateRateDataV1s ​

update tokens rate data version 1. Only callable by Auths.

solidity
function updateRateDataV1s(AdminModuleStructs.RateDataV1Params[] calldata tokensRateData_) external;

Parameters

NameTypeDescription
tokensRateData_AdminModuleStructs.RateDataV1Params[]array of RateDataV1Params with rate data to set for each token

updateRateDataV2s ​

update tokens rate data version 2. Only callable by Auths.

solidity
function updateRateDataV2s(AdminModuleStructs.RateDataV2Params[] calldata tokensRateData_) external;

Parameters

NameTypeDescription
tokensRateData_AdminModuleStructs.RateDataV2Params[]array of RateDataV2Params with rate data to set for each token

updateTokenConfigs ​

updates token configs: fee charge on borrowers interest & storage update utilization threshold. Only callable by Auths.

solidity
function updateTokenConfigs(AdminModuleStructs.TokenConfig[] calldata tokenConfigs_) external;

Parameters

NameTypeDescription
tokenConfigs_AdminModuleStructs.TokenConfig[]contains token address, fee & utilization threshold

updateUserClasses ​

updates user classes (0–2), which gate user pauses and token-pause enforcement. Only callable by Auths. 0: all operations may be paused. 1: withdraw and payback cannot be paused. 2: nothing may be paused.

solidity
function updateUserClasses(AdminModuleStructs.AddressUint256[] calldata userClasses_) external;

Parameters

NameTypeDescription
userClasses_AdminModuleStructs.AddressUint256[]struct array of uint256 value to assign for each user address

updateUserSupplyConfigs ​

sets user supply configs per token basis. Eg: with interest or interest-free and automated limits. Only callable by Auths. Resets decay limit to 0.

solidity
function updateUserSupplyConfigs(AdminModuleStructs.UserSupplyConfig[] memory userSupplyConfigs_) external;

Parameters

NameTypeDescription
userSupplyConfigs_AdminModuleStructs.UserSupplyConfig[]struct array containing user supply config, see UserSupplyConfig struct for more info

updateUserWithdrawalLimit ​

sets a new withdrawal limit as the current limit for a certain user. Resets decay limit to 0

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

Parameters

NameTypeDescription
user_addressuser address for which to update the withdrawal limit
token_addresstoken address for which to update the withdrawal limit
newLimit_uint256new limit until which user supply can decrease to. Important: input in raw. Must account for exchange price in input param calculation. Note any limit that is < max expansion or > current user supply will set max expansion limit or current user supply as limit respectively. - set 0 to make maximum possible withdrawable: instant full expansion, and if that goes below base limit then fully down to 0. - set type(uint256).max to make current withdrawable 0 (sets current user supply as limit).

updateUserBorrowConfigs ​

setting user borrow configs per token basis. Eg: with interest or interest-free and automated limits. Only callable by Auths.

solidity
function updateUserBorrowConfigs(AdminModuleStructs.UserBorrowConfig[] memory userBorrowConfigs_) external;

Parameters

NameTypeDescription
userBorrowConfigs_AdminModuleStructs.UserBorrowConfig[]struct array containing user borrow config, see UserBorrowConfig struct for more info

pauseUserSupply ​

pause selected supply-side operations for a user per _userClass: class 2 reverts on any pause flag; class 1 forbids pausing withdraw; class 0 allows all. Only callable by Guardians.

solidity
function pauseUserSupply(address user_, address[] calldata tokens_, bool pauseSupply_, bool pauseWithdraw_)
    external
    returns (bool[] memory actedSupply_, bool[] memory actedWithdraw_);

Parameters

NameTypeDescription
user_addressaddress of user to pause operations for
tokens_address[]token addresses to apply supply/withdraw pause flags for
pauseSupply_boolif true, deposits/supply are paused for tokens_
pauseWithdraw_boolif true, withdrawals are paused for tokens_

Returns

NameTypeDescription
actedSupply_bool[]per-token flags; true when that token's supply pause state changed
actedWithdraw_bool[]per-token flags; true when that token's withdraw pause state changed

pauseUserBorrow ​

pause selected borrow-side operations for a user per _userClass: class 2 reverts on any pause flag; class 1 forbids pausing payback; class 0 allows all. Only callable by Guardians.

solidity
function pauseUserBorrow(address user_, address[] calldata tokens_, bool pauseBorrow_, bool pausePayback_)
    external
    returns (bool[] memory actedBorrow_, bool[] memory actedPayback_);

Parameters

NameTypeDescription
user_addressaddress of user to pause operations for
tokens_address[]token addresses to apply borrow/payback pause flags for
pauseBorrow_boolif true, borrows are paused for tokens_
pausePayback_boolif true, paybacks are paused for tokens_

Returns

NameTypeDescription
actedBorrow_bool[]per-token flags; true when that token's borrow pause state changed
actedPayback_bool[]per-token flags; true when that token's payback pause state changed

unpauseUserSupply ​

unpause selected supply-side operations for a particular user. Only callable by Guardians.

solidity
function unpauseUserSupply(address user_, address[] calldata tokens_, bool unpauseSupply_, bool unpauseWithdraw_)
    external
    returns (bool[] memory actedSupply_, bool[] memory actedWithdraw_);

Parameters

NameTypeDescription
user_addressaddress of user to unpause operations for
tokens_address[]token addresses to apply supply/withdraw unpause flags for
unpauseSupply_boolif true, deposits/supply are unpaused for tokens_
unpauseWithdraw_boolif true, withdrawals are unpaused for tokens_

Returns

NameTypeDescription
actedSupply_bool[]per-token flags; true when that token's supply pause state changed
actedWithdraw_bool[]per-token flags; true when that token's withdraw pause state changed

unpauseUserBorrow ​

unpause selected borrow-side operations for a particular user. Only callable by Guardians.

solidity
function unpauseUserBorrow(address user_, address[] calldata tokens_, bool unpauseBorrow_, bool unpausePayback_)
    external
    returns (bool[] memory actedBorrow_, bool[] memory actedPayback_);

Parameters

NameTypeDescription
user_addressaddress of user to unpause operations for
tokens_address[]token addresses to apply borrow/payback unpause flags for
unpauseBorrow_boolif true, borrows are unpaused for tokens_
unpausePayback_boolif true, paybacks are unpaused for tokens_

Returns

NameTypeDescription
actedBorrow_bool[]per-token flags; true when that token's borrow pause state changed
actedPayback_bool[]per-token flags; true when that token's payback pause state changed

pauseTokens ​

pause selected operations for the given tokens. Only callable by Guardians.

solidity
function pauseTokens(
    address[] calldata tokens_,
    bool pauseSupply_,
    bool pauseWithdraw_,
    bool pauseBorrow_,
    bool pausePayback_
)
    external
    returns (
        bool[] memory actedSupply_,
        bool[] memory actedWithdraw_,
        bool[] memory actedBorrow_,
        bool[] memory actedPayback_
    );

Parameters

NameTypeDescription
tokens_address[]token addresses to pause
pauseSupply_boolif true, deposits/supply are paused
pauseWithdraw_boolif true, withdrawals are paused
pauseBorrow_boolif true, borrows are paused
pausePayback_boolif true, paybacks are paused

Returns

NameTypeDescription
actedSupply_bool[]per-token flags; true when that token's supply pause state changed
actedWithdraw_bool[]per-token flags; true when that token's withdraw pause state changed
actedBorrow_bool[]per-token flags; true when that token's borrow pause state changed
actedPayback_bool[]per-token flags; true when that token's payback pause state changed

unpauseTokens ​

unpause selected operations for the given tokens. Only callable by Guardians.

solidity
function unpauseTokens(
    address[] calldata tokens_,
    bool unpauseSupply_,
    bool unpauseWithdraw_,
    bool unpauseBorrow_,
    bool unpausePayback_
)
    external
    returns (
        bool[] memory actedSupply_,
        bool[] memory actedWithdraw_,
        bool[] memory actedBorrow_,
        bool[] memory actedPayback_
    );

Parameters

NameTypeDescription
tokens_address[]token addresses to unpause
unpauseSupply_boolif true, deposits/supply are unpaused
unpauseWithdraw_boolif true, withdrawals are unpaused
unpauseBorrow_boolif true, borrows are unpaused
unpausePayback_boolif true, paybacks are unpaused

Returns

NameTypeDescription
actedSupply_bool[]per-token flags; true when that token's supply pause state changed
actedWithdraw_bool[]per-token flags; true when that token's withdraw pause state changed
actedBorrow_bool[]per-token flags; true when that token's borrow pause state changed
actedPayback_bool[]per-token flags; true when that token's payback pause state changed

collectRevenue ​

collects revenue for tokens to configured revenueCollector address.

Note that this can revert if token balance is < revenueAmount (utilization > 100%)

solidity
function collectRevenue(address[] calldata tokens_) external;

Parameters

NameTypeDescription
tokens_address[]array of tokens to collect revenue for

updateExchangePrices ​

gets the current updated exchange prices for n tokens and updates all prices, rates related data in storage.

solidity
function updateExchangePrices(address[] calldata tokens_)
    external
    returns (uint256[] memory supplyExchangePrices_, uint256[] memory borrowExchangePrices_);

Parameters

NameTypeDescription
tokens_address[]tokens to update exchange prices for

Returns

NameTypeDescription
supplyExchangePrices_uint256[]new supply rates of overall system for each token
borrowExchangePrices_uint256[]new borrow rates of overall system for each token

operate ​

Single function which handles supply, withdraw, borrow & payback

to trigger skipping in / out transfers (gas optimization):

  • callbackData_ MUST be encoded so that "from" address is the last 20 bytes in the last 32 bytes slot, also for native token operations where liquidityCallback is not triggered! from address must come at last position if there is more data. I.e. encode like: abi.encode(otherVar1, otherVar2, FROM_ADDRESS). Note dynamic types used with abi.encode come at the end so if dynamic types are needed, you must use abi.encodePacked to ensure the from address is at the end.
  • this "from" address must match withdrawTo_ or borrowTo_ and must be == msg.sender
  • callbackData_ must in addition to the from address as described above include bytes32 SKIP_TRANSFERS in the slot before (bytes 32 to 63)
  • msg.value must be 0.
  • Amounts must be either:
  • supply(+) == borrow(+), withdraw(-) == payback(-).
  • Liquidity must be on the winning side (deposit < borrow OR payback < withdraw).
solidity
function operate(
    address token_,
    int256 supplyAmount_,
    int256 borrowAmount_,
    address withdrawTo_,
    address borrowTo_,
    bytes calldata callbackData_
) external payable returns (uint256 memVar3_, uint256 memVar4_);

Parameters

NameTypeDescription
token_addressaddress of token (0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native)
supplyAmount_int256if +ve then supply, if -ve then withdraw, if 0 then nothing
borrowAmount_int256if +ve then borrow, if -ve then payback, if 0 then nothing
withdrawTo_addressif withdrawal then to which address
borrowTo_addressif borrow then to which address
callbackData_bytescallback data passed to liquidityCallback method of protocol

Returns

NameTypeDescription
memVar3_uint256updated supplyExchangePrice
memVar4_uint256updated borrowExchangePrice

operateOnBehalfOf ​

Same as operate but executes against onBehalf_'s position instead of msg.sender's. Only callable by auths or governance. Token transfers still come from msg.sender: native token uses msg.value, while ERC20 still pulls funds via msg.sender.liquidityCallback(). Only supply (+ve supplyAmount) and payback (-ve borrowAmount) are allowed; no withdrawals or borrows. Bypasses user and token pauses, so a paused position can still be topped up or repaid.

solidity
function operateOnBehalfOf(
    address onBehalf_,
    address token_,
    int256 supplyAmount_,
    int256 borrowAmount_,
    bytes calldata callbackData_
) external payable returns (uint256 memVar3_, uint256 memVar4_);

Parameters

NameTypeDescription
onBehalf_addressthe address (protocol) whose position to operate on. Must be != address(0) and must have a configured position (via admin) for the given token.
token_addressaddress of token (0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native)
supplyAmount_int256if +ve then supply, if 0 then nothing. Must be >= 0.
borrowAmount_int256if -ve then payback, if 0 then nothing. Must be <= 0. At least one of supplyAmount_ or borrowAmount_ must be non-zero.
callbackData_bytesmust be empty (length 0). Custom callbackData-powered transfer shortcuts like SKIP_TRANSFERS / NET_TRANSFERS are not supported for onBehalfOf.

Returns

NameTypeDescription
memVar3_uint256updated supplyExchangePrice
memVar4_uint256updated borrowExchangePrice