Skip to content

FluidPauseAuthLiquidity ​

Git Source

Inherits:Variables, Events, Error, BasicValidations, IFluidPauseAuthLiquidity

Title: FluidPauseAuthLiquidity

Executes pause/unpause operations at the Fluid Liquidity layer. Callable only by the main FluidPauseAuth contract. Does NOT emit operational events — the main contract handles all event emission based on return values.

Functions ​

onlyPauseAuthContract ​

solidity
modifier onlyPauseAuthContract() ;

constructor ​

solidity
constructor(address liquidity_, address vaultFactory_, address dexFactory_, address authGate_)
    validAddress(liquidity_)
    validAddress(vaultFactory_)
    validAddress(dexFactory_)
    validAddress(authGate_);

setPauseAuthContract ​

Sets the FluidPauseAuth main contract address. Can only be called once (permanently locked after).

solidity
function setPauseAuthContract(address pauseAuth_) external validAddress(pauseAuth_);

pauseVault ​

Pauses selected vault operations at the Liquidity layer.

solidity
function pauseVault(uint256 vaultId_, bool pauseSupply_, bool pauseWithdraw_, bool pauseBorrow_, bool pausePayback_)
    external
    override
    onlyPauseAuthContract
    returns (
        address vault_,
        bool actedSupply_,
        bool actedWithdraw_,
        bool actedBorrow_,
        bool actedPayback_,
        uint256 skippedUserClass_
    );

Parameters

NameTypeDescription
vaultId_uint256Vault ID to pause.
pauseSupply_boolWhether to pause supply/deposit operations.
pauseWithdraw_boolWhether to pause withdraw operations.
pauseBorrow_boolWhether to pause borrow operations.
pausePayback_boolWhether to pause payback operations.

Returns

NameTypeDescription
vault_addressResolved vault address.
actedSupply_boolWhether supply/deposit pause state changed.
actedWithdraw_boolWhether withdraw pause state changed.
actedBorrow_boolWhether borrow pause state changed.
actedPayback_boolWhether payback pause state changed.
skippedUserClass_uint256Liquidity user class skipped by the helper, or zero if none.

unpauseVault ​

Unpauses selected vault operations at the Liquidity layer.

solidity
function unpauseVault(
    uint256 vaultId_,
    bool unpauseSupply_,
    bool unpauseWithdraw_,
    bool unpauseBorrow_,
    bool unpausePayback_
)
    external
    override
    onlyPauseAuthContract
    returns (
        address vault_,
        bool actedSupply_,
        bool actedWithdraw_,
        bool actedBorrow_,
        bool actedPayback_,
        uint256 skippedUserClass_
    );

Parameters

NameTypeDescription
vaultId_uint256Vault ID to unpause.
unpauseSupply_boolWhether to unpause supply/deposit operations.
unpauseWithdraw_boolWhether to unpause withdraw operations.
unpauseBorrow_boolWhether to unpause borrow operations.
unpausePayback_boolWhether to unpause payback operations.

Returns

NameTypeDescription
vault_addressResolved vault address.
actedSupply_boolWhether supply/deposit unpause state changed.
actedWithdraw_boolWhether withdraw unpause state changed.
actedBorrow_boolWhether borrow unpause state changed.
actedPayback_boolWhether payback unpause state changed.
skippedUserClass_uint256Liquidity user class skipped by the helper, or zero if none.

pauseDex ​

Pauses selected DEX-as-Liquidity-user operations.

solidity
function pauseDex(uint256 dexId_, bool pauseSupply_, bool pauseWithdraw_, bool pauseBorrow_, bool pausePayback_)
    external
    override
    onlyPauseAuthContract
    returns (
        address dex_,
        bool actedSupply_,
        bool actedWithdraw_,
        bool actedBorrow_,
        bool actedPayback_,
        uint256 skippedUserClass_
    );

Parameters

NameTypeDescription
dexId_uint256DEX ID to pause at the Liquidity layer.
pauseSupply_boolWhether to pause supply/deposit operations.
pauseWithdraw_boolWhether to pause withdraw operations.
pauseBorrow_boolWhether to pause borrow operations.
pausePayback_boolWhether to pause payback operations.

Returns

NameTypeDescription
dex_addressResolved DEX address.
actedSupply_boolWhether supply/deposit pause state changed.
actedWithdraw_boolWhether withdraw pause state changed.
actedBorrow_boolWhether borrow pause state changed.
actedPayback_boolWhether payback pause state changed.
skippedUserClass_uint256Liquidity user class skipped by the helper, or zero if none.

unpauseDex ​

Unpauses selected DEX-as-Liquidity-user operations.

solidity
function unpauseDex(
    uint256 dexId_,
    bool unpauseSupply_,
    bool unpauseWithdraw_,
    bool unpauseBorrow_,
    bool unpausePayback_
)
    external
    override
    onlyPauseAuthContract
    returns (
        address dex_,
        bool actedSupply_,
        bool actedWithdraw_,
        bool actedBorrow_,
        bool actedPayback_,
        uint256 skippedUserClass_
    );

Parameters

NameTypeDescription
dexId_uint256DEX ID to unpause at the Liquidity layer.
unpauseSupply_boolWhether to unpause supply/deposit operations.
unpauseWithdraw_boolWhether to unpause withdraw operations.
unpauseBorrow_boolWhether to unpause borrow operations.
unpausePayback_boolWhether to unpause payback operations.

Returns

NameTypeDescription
dex_addressResolved DEX address.
actedSupply_boolWhether supply/deposit unpause state changed.
actedWithdraw_boolWhether withdraw unpause state changed.
actedBorrow_boolWhether borrow unpause state changed.
actedPayback_boolWhether payback unpause state changed.
skippedUserClass_uint256Liquidity user class skipped by the helper, or zero if none.

pauseTokens ​

Pauses selected token operations at the Liquidity layer.

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

Parameters

NameTypeDescription
tokens_address[]Token addresses to pause.
pauseSupply_boolWhether to pause supply operations.
pauseWithdraw_boolWhether to pause withdraw operations.
pauseBorrow_boolWhether to pause borrow operations.
pausePayback_boolWhether to pause payback operations.

Returns

NameTypeDescription
actedSupply_bool[]Per-token flags for supply pause state changes.
actedWithdraw_bool[]Per-token flags for withdraw pause state changes.
actedBorrow_bool[]Per-token flags for borrow pause state changes.
actedPayback_bool[]Per-token flags for payback pause state changes.

unpauseTokens ​

Unpauses selected token operations at the Liquidity layer.

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

Parameters

NameTypeDescription
tokens_address[]Token addresses to unpause.
unpauseSupply_boolWhether to unpause supply operations.
unpauseWithdraw_boolWhether to unpause withdraw operations.
unpauseBorrow_boolWhether to unpause borrow operations.
unpausePayback_boolWhether to unpause payback operations.

Returns

NameTypeDescription
actedSupply_bool[]Per-token flags for supply pause state changes.
actedWithdraw_bool[]Per-token flags for withdraw pause state changes.
actedBorrow_bool[]Per-token flags for borrow pause state changes.
actedPayback_bool[]Per-token flags for payback pause state changes.

pauseUserSupply ​

Pauses a user's supply-side token operations at the Liquidity layer.

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

Parameters

NameTypeDescription
user_addressLiquidity user address to pause.
tokens_address[]Supply tokens to pause.
pauseSupply_boolWhether to pause supply operations.
pauseWithdraw_boolWhether to pause withdraw operations.

Returns

NameTypeDescription
actedSupply_bool[]Per-token flags for supply pause state changes.
actedWithdraw_bool[]Per-token flags for withdraw pause state changes.

pauseUserBorrow ​

Pauses a user's borrow-side token operations at the Liquidity layer.

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

Parameters

NameTypeDescription
user_addressLiquidity user address to pause.
tokens_address[]Borrow tokens to pause.
pauseBorrow_boolWhether to pause borrow operations.
pausePayback_boolWhether to pause payback operations.

Returns

NameTypeDescription
actedBorrow_bool[]Per-token flags for borrow pause state changes.
actedPayback_bool[]Per-token flags for payback pause state changes.

unpauseUserSupply ​

Unpauses a user's supply-side token operations at the Liquidity layer.

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

Parameters

NameTypeDescription
user_addressLiquidity user address to unpause.
tokens_address[]Supply tokens to unpause.
unpauseSupply_boolWhether to unpause supply operations.
unpauseWithdraw_boolWhether to unpause withdraw operations.

Returns

NameTypeDescription
actedSupply_bool[]Per-token flags for supply pause state changes.
actedWithdraw_bool[]Per-token flags for withdraw pause state changes.

unpauseUserBorrow ​

Unpauses a user's borrow-side token operations at the Liquidity layer.

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

Parameters

NameTypeDescription
user_addressLiquidity user address to unpause.
tokens_address[]Borrow tokens to unpause.
unpauseBorrow_boolWhether to unpause borrow operations.
unpausePayback_boolWhether to unpause payback operations.

Returns

NameTypeDescription
actedBorrow_bool[]Per-token flags for borrow pause state changes.
actedPayback_bool[]Per-token flags for payback pause state changes.

_setVaultPauseState ​

Shared vault pause/unpause logic. wantsPaused_ == true -> pause, false -> unpause. Resolves vault tokens; DEX-backed sides return empty token arrays and are skipped here.

solidity
function _setVaultPauseState(
    uint256 vaultId_,
    bool pauseSupply_,
    bool pauseWithdraw_,
    bool pauseBorrow_,
    bool pausePayback_,
    bool wantsPaused_
)
    internal
    returns (
        address vault_,
        bool actedSupply_,
        bool actedWithdraw_,
        bool actedBorrow_,
        bool actedPayback_,
        uint256 skippedUserClass_
    );

_setDexPauseState ​

Shared DEX pause/unpause logic at the Liquidity layer. wantsPaused_ == true -> pause, false -> unpause.

solidity
function _setDexPauseState(
    uint256 dexId_,
    bool pauseSupply_,
    bool pauseWithdraw_,
    bool pauseBorrow_,
    bool pausePayback_,
    bool wantsPaused_
)
    internal
    returns (
        address dex_,
        bool actedSupply_,
        bool actedWithdraw_,
        bool actedBorrow_,
        bool actedPayback_,
        uint256 skippedUserClass_
    );

_setProtocolSupplyPauseState ​

Applies supply-side Liquidity pause state for any protocol represented as a Liquidity user.

solidity
function _setProtocolSupplyPauseState(
    address user_,
    address[] memory tokens_,
    bool pauseSupply_,
    bool pauseWithdraw_,
    bool wantsPaused_
) internal returns (bool actedSupply_, bool actedWithdraw_, uint256 skippedUserClass_);

_setProtocolBorrowPauseState ​

Applies borrow-side Liquidity pause state for any protocol represented as a Liquidity user.

solidity
function _setProtocolBorrowPauseState(
    address user_,
    address[] memory tokens_,
    bool pauseBorrow_,
    bool pausePayback_,
    bool wantsPaused_
) internal returns (bool actedBorrow_, bool actedPayback_, uint256 skippedUserClass_);

_filterDefinedTokens ​

Returns the subset of tokens_ for which user_ has a Liquidity row at mappingSlot_. Liquidity reverts AdminModule__UserNotDefined on an undefined (user, token) pair, which would take down an entire emergency batch over one protocol that was never configured at Liquidity.

solidity
function _filterDefinedTokens(address user_, address[] memory tokens_, uint256 mappingSlot_)
    internal
    view
    returns (address[] memory filtered_);

_getSkippedUserClass ​

Returns the adjusted secondary flag and user class that requires auth-level handling for pause calls.

solidity
function _getSkippedUserClass(address user_, bool secondary_)
    internal
    view
    returns (bool adjustedSecondary_, uint256 skippedUserClass_);

_any ​

solidity
function _any(bool[] memory values_) internal pure returns (bool);

_isVaultT1 ​

Returns whether vault_ is a T1 vault. Falls back to true on revert (older vaults without TYPE()).

solidity
function _isVaultT1(address vault_) internal view returns (bool);

_getVaultTokens ​

Resolves a vault to its LL-facing token arrays. DEX-backed sides return empty arrays.

solidity
function _getVaultTokens(address vault_)
    internal
    view
    returns (address[] memory supplyTokens_, address[] memory borrowTokens_);

_getDexTokens ​

Resolves a DEX to its LL-facing token arrays. Reverts if unresolvable.

solidity
function _getDexTokens(address dex_)
    internal
    view
    returns (address[] memory supplyTokens_, address[] memory borrowTokens_);

_buildTokenArray ​

Builds a one-token or two-token array from the provided token addresses.

solidity
function _buildTokenArray(address token0_, address token1_) internal pure returns (address[] memory tokens_);

Parameters

NameTypeDescription
token0_addressfirst token address, always included.
token1_addressoptional second token address, included when non-zero.

Returns

NameTypeDescription
tokens_address[]resulting token array.