FluidPauseAuth ​
Inherits:PauseAuthLevels, Events, BasicValidations
Title: FluidPauseAuth
Single entry point for pause/unpause across Fluid Liquidity and DEX layers. Handles all authorization, routes operations to FluidPauseAuthLiquidity and FluidPauseAuthDex, and emits all operational events.
Functions ​
constructor ​
constructor(
address liquidity_,
address vaultFactory_,
address dexFactory_,
address pauseAuthLiquidity_,
address pauseAuthDex_,
address pauseAuthOracleV2_,
address authGate_
)
validAddress(liquidity_)
validAddress(vaultFactory_)
validAddress(dexFactory_)
validAddress(pauseAuthLiquidity_)
validAddress(pauseAuthDex_)
validAddress(pauseAuthOracleV2_)
validAddress(authGate_);setPauseAuth ​
Sets or removes a pause auth role.
Level 1 can pause new borrows and DEX swap/arbitrage only, level 2 can also pause deposit/supply, withdraw, payback, tokens, and smart lending, level 3 can also unpause/remove level 1. Gate tiers never drop below their implied level (MID 2, HIGH 3).
function setPauseAuth(address pauseAuth_, uint256 class_) external onlyAuthLevelHigh validAddress(pauseAuth_);Parameters
| Name | Type | Description |
|---|---|---|
pauseAuth_ | address | address to update in the pause auth allow list. |
class_ | uint256 | auth level to assign: 0 = remove, 1 = bot pause, 2 = manual pause, 3 = level 2 + unpause. |
setNotPausableVaultId ​
Sets whether a vault ID is NOT pausable by pause auths. All vaults are pausable by default.
Reverts if vaultId_ does not resolve to a deployed vault from the vault factory.
function setNotPausableVaultId(uint256 vaultId_, bool notPausable_) external onlyAuthLevelHigh;Parameters
| Name | Type | Description |
|---|---|---|
vaultId_ | uint256 | vault ID to configure. |
notPausable_ | bool | true = vault can NOT be paused by pause auths, false = vault CAN be paused (default). |
setNotPausableDexId ​
Sets whether a DEX ID is NOT pausable by pause auths. All DEXes are pausable by default.
Reverts if dexId_ does not resolve to a deployed DEX from the DEX factory.
function setNotPausableDexId(uint256 dexId_, bool notPausable_) external onlyAuthLevelHigh;Parameters
| Name | Type | Description |
|---|---|---|
dexId_ | uint256 | DEX ID to configure. |
notPausable_ | bool | true = DEX can NOT be paused by pause auths, false = DEX CAN be paused (default). |
setNotPausableToken ​
Sets whether a token is NOT pausable by pause auths. All tokens are pausable by default.
function setNotPausableToken(address token_, bool notPausable_) external onlyAuthLevelHigh validAddress(token_);Parameters
| Name | Type | Description |
|---|---|---|
token_ | address | token address to configure. |
notPausable_ | bool | true = token can NOT be paused by pause auths, false = token CAN be paused (default). |
removeClass1PauseAuth ​
Removes a level 1 pause auth.
Callable by level 3 pause auths or the team multisig. Intended for compromised level 1 auth removal.
function removeClass1PauseAuth(address pauseAuth_)
external
validAddress(pauseAuth_)
onlyPauseAuth(PAUSE_AUTH_LEVEL_UNPAUSE);Parameters
| Name | Type | Description |
|---|---|---|
pauseAuth_ | address | level 1 pause auth address to remove. |
pauseVault ​
Pauses all vault operations by vault ID at both the Liquidity and DEX layers.
function pauseVault(uint256 vaultId_) external onlyPauseAuth(PAUSE_AUTH_LEVEL_MANUAL);pauseVault ​
Pauses a vault by vault ID at both the Liquidity and DEX layers.
function pauseVault(uint256 vaultId_, bool pauseSupply_, bool pauseWithdraw_, bool pauseBorrow_, bool pausePayback_)
public
onlyPauseAuth(PAUSE_AUTH_LEVEL_BOT);pauseVaults ​
Pauses multiple vaults at both the Liquidity and DEX layers.
function pauseVaults(
uint256[] calldata vaultIds_,
bool[] calldata pauseSupply_,
bool[] calldata pauseWithdraw_,
bool[] calldata pauseBorrow_,
bool[] calldata pausePayback_
) external onlyPauseAuth(PAUSE_AUTH_LEVEL_BOT);unpauseVault ​
Unpauses a vault by vault ID at both the Liquidity and DEX layers.
function unpauseVault(
uint256 vaultId_,
bool unpauseSupply_,
bool unpauseWithdraw_,
bool unpauseBorrow_,
bool unpausePayback_
) public onlyPauseAuth(PAUSE_AUTH_LEVEL_UNPAUSE);unpauseVaults ​
Unpauses multiple vaults at both the Liquidity and DEX layers.
function unpauseVaults(
uint256[] calldata vaultIds_,
bool[] calldata unpauseSupply_,
bool[] calldata unpauseWithdraw_,
bool[] calldata unpauseBorrow_,
bool[] calldata unpausePayback_
) external onlyPauseAuth(PAUSE_AUTH_LEVEL_UNPAUSE);pauseDex ​
Pauses all DEX operations by DEX ID.
function pauseDex(uint256 dexId_) external onlyPauseAuth(PAUSE_AUTH_LEVEL_MANUAL);pauseDex ​
Pauses a DEX by DEX ID. Routes supply/borrow pause to Liquidity layer and swap pause to DEX layer.
function pauseDex(
uint256 dexId_,
bool pauseSupply_,
bool pauseWithdraw_,
bool pauseBorrow_,
bool pausePayback_,
bool pauseSwapAndArbitrage_
) public onlyPauseAuth(PAUSE_AUTH_LEVEL_BOT);pauseDexes ​
Pauses multiple DEXes. Routes supply/borrow pause to Liquidity layer and swap pause to DEX layer.
function pauseDexes(
uint256[] calldata dexIds_,
bool[] calldata pauseSupply_,
bool[] calldata pauseWithdraw_,
bool[] calldata pauseBorrow_,
bool[] calldata pausePayback_,
bool[] calldata pauseSwapAndArbitrage_
) external onlyPauseAuth(PAUSE_AUTH_LEVEL_BOT);unpauseDex ​
Unpauses a DEX by DEX ID. Routes supply/borrow unpause to Liquidity layer and swap unpause to DEX layer.
function unpauseDex(
uint256 dexId_,
bool unpauseSupply_,
bool unpauseWithdraw_,
bool unpauseBorrow_,
bool unpausePayback_,
bool unpauseSwapAndArbitrage_
) public onlyPauseAuth(PAUSE_AUTH_LEVEL_UNPAUSE);unpauseDexes ​
Unpauses multiple DEXes. Routes supply/borrow unpause to Liquidity layer and swap unpause to DEX layer.
function unpauseDexes(
uint256[] calldata dexIds_,
bool[] calldata unpauseSupply_,
bool[] calldata unpauseWithdraw_,
bool[] calldata unpauseBorrow_,
bool[] calldata unpausePayback_,
bool[] calldata unpauseSwapAndArbitrage_
) external onlyPauseAuth(PAUSE_AUTH_LEVEL_UNPAUSE);pauseSmartLending ​
Pauses a DEX pool's smart lending; both flags must be set, else 100143. Respects notPausableDexIds.
function pauseSmartLending(uint256 dexId_, bool pauseSupply_, bool pauseWithdraw_)
public
onlyPauseAuth(PAUSE_AUTH_LEVEL_BOT);Parameters
| Name | Type | Description |
|---|---|---|
dexId_ | uint256 | DEX ID whose smart lending contract should be paused. |
pauseSupply_ | bool | whether to pause smart lending supply/deposit operations. |
pauseWithdraw_ | bool | whether to pause smart lending withdraw operations. |
unpauseSmartLending ​
Unpauses a DEX pool's smart lending; both flags must be set, else 100143. Respects notPausableDexIds.
function unpauseSmartLending(uint256 dexId_, bool unpauseSupply_, bool unpauseWithdraw_)
public
onlyPauseAuth(PAUSE_AUTH_LEVEL_UNPAUSE);Parameters
| Name | Type | Description |
|---|---|---|
dexId_ | uint256 | DEX ID whose smart lending contract should be unpaused. |
unpauseSupply_ | bool | whether to unpause smart lending supply/deposit operations. |
unpauseWithdraw_ | bool | whether to unpause smart lending withdraw operations. |
pauseTokens ​
Pauses all four token operations at the Liquidity layer (token pause bitmask, bits 252-255 of exchangePricesAndConfig).
Team multisig can pause any token. Level 2+ auths skip notPausableTokens (emits LogSkipTokenNotPausable).
function pauseTokens(address[] calldata tokens_) external onlyPauseAuth(PAUSE_AUTH_LEVEL_MANUAL);Parameters
| Name | Type | Description |
|---|---|---|
tokens_ | address[] | token addresses to pause. |
pauseTokens ​
Pauses selected token operations at the Liquidity layer.
function pauseTokens(
address[] calldata tokens_,
bool pauseSupply_,
bool pauseWithdraw_,
bool pauseBorrow_,
bool pausePayback_
) public onlyPauseAuth(PAUSE_AUTH_LEVEL_MANUAL);unpauseTokens ​
Unpauses all four token operations at the Liquidity layer (token pause bitmask, bits 252-255 of exchangePricesAndConfig).
Team multisig can unpause any token. Level 3 auths skip notPausableTokens (emits LogSkipTokenNotPausable).
function unpauseTokens(address[] calldata tokens_) external onlyPauseAuth(PAUSE_AUTH_LEVEL_UNPAUSE);Parameters
| Name | Type | Description |
|---|---|---|
tokens_ | address[] | token addresses to unpause. |
unpauseTokens ​
Unpauses selected token operations at the Liquidity layer.
function unpauseTokens(
address[] calldata tokens_,
bool unpauseSupply_,
bool unpauseWithdraw_,
bool unpauseBorrow_,
bool unpausePayback_
) public onlyPauseAuth(PAUSE_AUTH_LEVEL_UNPAUSE);pauseOracleV2 ​
Pauses OracleV2 operate prices of tokens_: borrows and withdrawals with debt stop in every vault priced with them, liquidations keep working. Emits LogPauseOracleV2 per token paused.
Team multisig can pause any token. Level 2+ auths skip notPausableTokens (emits LogSkipTokenNotPausable).
function pauseOracleV2(address[] calldata tokens_) external onlyPauseAuth(PAUSE_AUTH_LEVEL_MANUAL);unpauseOracleV2 ​
Lifts the OracleV2 operate pause of tokens_. Emits LogUnpauseOracleV2 per token unpaused.
Team multisig can unpause any token. Level 3 auths skip notPausableTokens (emits LogSkipTokenNotPausable).
function unpauseOracleV2(address[] calldata tokens_) external onlyPauseAuth(PAUSE_AUTH_LEVEL_UNPAUSE);pauseUserSupplyLiquidity ​
Pauses a user's supply side at the Liquidity layer.
Restricted to the MID tier at AUTH_GATE. Passes through to PAUSE_AUTH_LIQUIDITY.
function pauseUserSupplyLiquidity(address user_, address[] calldata tokens_, bool pauseSupply_, bool pauseWithdraw_)
external
onlyAuthLevelMid;Parameters
| Name | Type | Description |
|---|---|---|
user_ | address | Liquidity user address to pause. |
tokens_ | address[] | supply tokens whose supply and withdraw operations should be paused. |
pauseSupply_ | bool | whether to pause supply operations. |
pauseWithdraw_ | bool | whether to pause withdraw operations. |
pauseUserBorrowLiquidity ​
Pauses a user's borrow side at the Liquidity layer.
Restricted to the MID tier at AUTH_GATE. Passes through to PAUSE_AUTH_LIQUIDITY.
function pauseUserBorrowLiquidity(address user_, address[] calldata tokens_, bool pauseBorrow_, bool pausePayback_)
external
onlyAuthLevelMid;Parameters
| Name | Type | Description |
|---|---|---|
user_ | address | Liquidity user address to pause. |
tokens_ | address[] | borrow tokens whose borrow and payback operations should be paused. |
pauseBorrow_ | bool | whether to pause borrow operations. |
pausePayback_ | bool | whether to pause payback operations. |
unpauseUserSupplyLiquidity ​
Unpauses a user's supply side at the Liquidity layer.
Restricted to the team multisig. Passes through to PAUSE_AUTH_LIQUIDITY.
function unpauseUserSupplyLiquidity(
address user_,
address[] calldata tokens_,
bool unpauseSupply_,
bool unpauseWithdraw_
) external onlyAuthLevelHigh;Parameters
| Name | Type | Description |
|---|---|---|
user_ | address | Liquidity user address to unpause. |
tokens_ | address[] | supply tokens whose supply and withdraw operations should be unpaused. |
unpauseSupply_ | bool | whether to unpause supply operations. |
unpauseWithdraw_ | bool | whether to unpause withdraw operations. |
unpauseUserBorrowLiquidity ​
Unpauses a user's borrow side at the Liquidity layer.
Restricted to the team multisig. Passes through to PAUSE_AUTH_LIQUIDITY.
function unpauseUserBorrowLiquidity(
address user_,
address[] calldata tokens_,
bool unpauseBorrow_,
bool unpausePayback_
) external onlyAuthLevelHigh;Parameters
| Name | Type | Description |
|---|---|---|
user_ | address | Liquidity user address to unpause. |
tokens_ | address[] | borrow tokens whose borrow and payback operations should be unpaused. |
unpauseBorrow_ | bool | whether to unpause borrow operations. |
unpausePayback_ | bool | whether to unpause payback operations. |
pauseUserDex ​
Pauses a specific user on a DEX pool (supply/borrow sides). Reverts if user_ has no row on the pool for a requested side.
Restricted to the MID tier at AUTH_GATE. Passes through to PAUSE_AUTH_DEX.
function pauseUserDex(
uint256 dexId_,
address user_,
bool pauseSupply_,
bool pauseWithdraw_,
bool pauseBorrow_,
bool pausePayback_
) external onlyAuthLevelMid;Parameters
| Name | Type | Description |
|---|---|---|
dexId_ | uint256 | DEX ID where the user should be paused. |
user_ | address | user address to pause on the DEX. |
pauseSupply_ | bool | whether to pause the user's supply/deposit operations. |
pauseWithdraw_ | bool | whether to pause the user's withdraw operations. |
pauseBorrow_ | bool | whether to pause the user's borrow operations. |
pausePayback_ | bool | whether to pause the user's payback operations. |
unpauseUserDex ​
Unpauses a specific user on a DEX pool. Reverts if user_ has no row on the pool for a requested side.
Restricted to the team multisig. Passes through to PAUSE_AUTH_DEX.
function unpauseUserDex(
uint256 dexId_,
address user_,
bool unpauseSupply_,
bool unpauseWithdraw_,
bool unpauseBorrow_,
bool unpausePayback_
) external onlyAuthLevelHigh;Parameters
| Name | Type | Description |
|---|---|---|
dexId_ | uint256 | DEX ID where the user should be unpaused. |
user_ | address | user address to unpause on the DEX. |
unpauseSupply_ | bool | whether to unpause the user's supply/deposit operations. |
unpauseWithdraw_ | bool | whether to unpause the user's withdraw operations. |
unpauseBorrow_ | bool | whether to unpause the user's borrow operations. |
unpausePayback_ | bool | whether to unpause the user's payback operations. |
_validatePauseFlags ​
Level 1 (bot) may only pause new borrows; deposit, withdraw, and payback require level 2+.
function _validatePauseFlags(bool requestedSupply_, bool requestedWithdraw_, bool, bool requestedPayback_)
internal
view;_pauseVault ​
Pauses a vault at both LL (via PAUSE_AUTH_LIQUIDITY) and DEX (via PAUSE_AUTH_DEX) layers.
function _pauseVault(
uint256 vaultId_,
bool pauseSupply_,
bool pauseWithdraw_,
bool pauseBorrow_,
bool pausePayback_
) internal;_unpauseVault ​
Unpauses a vault at both LL (via PAUSE_AUTH_LIQUIDITY) and DEX (via PAUSE_AUTH_DEX) layers.
function _unpauseVault(
uint256 vaultId_,
bool unpauseSupply_,
bool unpauseWithdraw_,
bool unpauseBorrow_,
bool unpausePayback_
) internal;_pauseDex ​
Pauses a DEX: supply/borrow at LL (via PAUSE_AUTH_LIQUIDITY), swap at DEX (via PAUSE_AUTH_DEX).
function _pauseDex(
uint256 dexId_,
bool pauseSupply_,
bool pauseWithdraw_,
bool pauseBorrow_,
bool pausePayback_,
bool pauseSwapAndArbitrage_
) internal;_unpauseDex ​
Unpauses a DEX: supply/borrow at LL (via PAUSE_AUTH_LIQUIDITY), swap at DEX (via PAUSE_AUTH_DEX).
function _unpauseDex(
uint256 dexId_,
bool unpauseSupply_,
bool unpauseWithdraw_,
bool unpauseBorrow_,
bool unpausePayback_,
bool unpauseSwapAndArbitrage_
) internal;_emitVaultEvents ​
function _emitVaultEvents(
uint256 vaultId_,
address vault_,
bool actedSupply_,
bool actedWithdraw_,
bool actedBorrow_,
bool actedPayback_,
uint256 skippedClass_,
bool wantsPaused_
) internal;_emitDexEvents ​
function _emitDexEvents(
uint256 dexId_,
address dex_,
bool actedSupply_,
bool actedWithdraw_,
bool actedBorrow_,
bool actedPayback_,
uint256 skippedClass_,
bool wantsPaused_
) internal;_emitOracleV2Events ​
function _emitOracleV2Events(address[] memory tokens_, bool[] memory acted_, bool wantsPaused_) internal;_filterNotPausableTokens ​
Filters out notPausableTokens for non-multisig callers, emitting LogSkipTokenNotPausable for each skip.
function _filterNotPausableTokens(address[] calldata tokens_) internal returns (address[] memory filtered_);