FluidPauseAuthDex ​
Inherits:Variables, Events, Error, BasicValidations, IFluidPauseAuthDex
Title: FluidPauseAuthDex
Executes pause/unpause operations at the DEX layer. Callable only by the main FluidPauseAuth contract. Emits only the borrow-limit freeze / restore events; the main contract emits the rest from return values.
Functions ​
onlyPauseAuthContract ​
modifier onlyPauseAuthContract() ;constructor ​
constructor(
address liquidity_,
address vaultFactory_,
address dexFactory_,
address smartLendingFactory_,
address authGate_
)
validAddress(liquidity_)
validAddress(vaultFactory_)
validAddress(dexFactory_)
validAddress(smartLendingFactory_)
validAddress(authGate_);setPauseAuthContract ​
Sets the FluidPauseAuth main contract address. Can only be called once (permanently locked after).
function setPauseAuthContract(address pauseAuth_) external validAddress(pauseAuth_);isDexUserBorrowFrozen ​
Whether user_'s borrow limits on dex_ are frozen by this contract: a snapshot is held and the pool carries the preset. The preset alone means governance parked the user; nothing is restored then. False if the config changed under a held snapshot; the next unpause then only drops it.
function isDexUserBorrowFrozen(address dex_, address user_) external view returns (bool);pauseVault ​
Pauses selected vault operations at the DEX layer.
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_);Parameters
| Name | Type | Description |
|---|---|---|
vaultId_ | uint256 | Vault ID to pause. |
pauseSupply_ | bool | Whether to pause supply/deposit operations. |
pauseWithdraw_ | bool | Whether to pause withdraw operations. |
pauseBorrow_ | bool | Whether to pause borrow operations. |
pausePayback_ | bool | Whether to pause payback operations. |
Returns
| Name | Type | Description |
|---|---|---|
vault_ | address | Resolved vault address. |
actedSupply_ | bool | Whether supply/deposit pause state changed. |
actedWithdraw_ | bool | Whether withdraw pause state changed. |
actedBorrow_ | bool | Whether borrow state changed (pause bit, or limits freeze for borrow-only). |
actedPayback_ | bool | Whether payback pause state changed. |
unpauseVault ​
Unpauses selected vault operations at the DEX layer.
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_);Parameters
| Name | Type | Description |
|---|---|---|
vaultId_ | uint256 | Vault ID to unpause. |
unpauseSupply_ | bool | Whether to unpause supply/deposit operations. |
unpauseWithdraw_ | bool | Whether to unpause withdraw operations. |
unpauseBorrow_ | bool | Whether to unpause borrow operations. |
unpausePayback_ | bool | Whether to unpause payback operations. |
Returns
| Name | Type | Description |
|---|---|---|
vault_ | address | Resolved vault address. |
actedSupply_ | bool | Whether supply/deposit unpause state changed. |
actedWithdraw_ | bool | Whether withdraw unpause state changed. |
actedBorrow_ | bool | Whether borrow state changed (pause bit, or frozen limits restored). |
actedPayback_ | bool | Whether payback unpause state changed. |
pauseSwapAndArbitrage ​
Pauses swap and arbitrage on a DEX pool.
function pauseSwapAndArbitrage(uint256 dexId_)
external
override
onlyPauseAuthContract
returns (address dex_, bool acted_);Parameters
| Name | Type | Description |
|---|---|---|
dexId_ | uint256 | DEX ID to pause. |
Returns
| Name | Type | Description |
|---|---|---|
dex_ | address | Resolved DEX address. |
acted_ | bool | Whether swap and arbitrage pause state changed. |
unpauseSwapAndArbitrage ​
Unpauses swap and arbitrage on a DEX pool.
function unpauseSwapAndArbitrage(uint256 dexId_)
external
override
onlyPauseAuthContract
returns (address dex_, bool acted_);Parameters
| Name | Type | Description |
|---|---|---|
dexId_ | uint256 | DEX ID to unpause. |
Returns
| Name | Type | Description |
|---|---|---|
dex_ | address | Resolved DEX address. |
acted_ | bool | Whether swap and arbitrage unpause state changed. |
pauseSmartLending ​
Pauses the smart lending contract on a DEX pool; both flags must be set, else 100143.
function pauseSmartLending(uint256 dexId_, bool pauseSupply_, bool pauseWithdraw_)
external
override
onlyPauseAuthContract
returns (address dex_, address smartLending_, bool actedSupply_, bool actedWithdraw_);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. |
Returns
| Name | Type | Description |
|---|---|---|
dex_ | address | Resolved DEX address. |
smartLending_ | address | Resolved smart lending address. |
actedSupply_ | bool | Whether smart lending supply/deposit pause state changed. |
actedWithdraw_ | bool | Whether smart lending withdraw pause state changed. |
unpauseSmartLending ​
Unpauses the smart lending contract on a DEX pool; both flags must be set, else 100143.
function unpauseSmartLending(uint256 dexId_, bool unpauseSupply_, bool unpauseWithdraw_)
external
override
onlyPauseAuthContract
returns (address dex_, address smartLending_, bool actedSupply_, bool actedWithdraw_);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. |
Returns
| Name | Type | Description |
|---|---|---|
dex_ | address | Resolved DEX address. |
smartLending_ | address | Resolved smart lending address. |
actedSupply_ | bool | Whether smart lending supply/deposit unpause state changed. |
actedWithdraw_ | bool | Whether smart lending withdraw unpause state changed. |
pauseUser ​
Pauses a user's selected operations on a DEX pool. Reverts PauseAuthDex__InvalidParams if a requested side has no row on the pool.
function pauseUser(
uint256 dexId_,
address user_,
bool pauseSupply_,
bool pauseWithdraw_,
bool pauseBorrow_,
bool pausePayback_
)
external
override
onlyPauseAuthContract
returns (address dex_, bool actedSupply_, bool actedWithdraw_, bool actedBorrow_, bool actedPayback_);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 supply/deposit operations. |
pauseWithdraw_ | bool | Whether to pause withdraw operations. |
pauseBorrow_ | bool | Whether to pause borrow operations. |
pausePayback_ | bool | Whether to pause payback operations. |
Returns
| Name | Type | Description |
|---|---|---|
dex_ | address | Resolved DEX address. |
actedSupply_ | bool | Whether supply/deposit pause state changed. |
actedWithdraw_ | bool | Whether withdraw pause state changed. |
actedBorrow_ | bool | Whether borrow state changed (pause bit, or limits freeze for borrow-only). |
actedPayback_ | bool | Whether payback pause state changed. |
unpauseUser ​
Unpauses a user's selected operations on a DEX pool. Reverts PauseAuthDex__InvalidParams if a requested side has no row on the pool.
function unpauseUser(
uint256 dexId_,
address user_,
bool unpauseSupply_,
bool unpauseWithdraw_,
bool unpauseBorrow_,
bool unpausePayback_
)
external
override
onlyPauseAuthContract
returns (address dex_, bool actedSupply_, bool actedWithdraw_, bool actedBorrow_, bool actedPayback_);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 supply/deposit operations. |
unpauseWithdraw_ | bool | Whether to unpause withdraw operations. |
unpauseBorrow_ | bool | Whether to unpause borrow operations. |
unpausePayback_ | bool | Whether to unpause payback operations. |
Returns
| Name | Type | Description |
|---|---|---|
dex_ | address | Resolved DEX address. |
actedSupply_ | bool | Whether supply/deposit unpause state changed. |
actedWithdraw_ | bool | Whether withdraw unpause state changed. |
actedBorrow_ | bool | Whether borrow state changed (pause bit, or frozen limits restored). |
actedPayback_ | bool | Whether payback unpause state changed. |
_setSwapPauseState ​
Shared swap & arbitrage pause/unpause logic. wantsPaused_ == true → pause, false → unpause.
function _setSwapPauseState(uint256 dexId_, bool wantsPaused_) internal returns (address dex_, bool acted_);_setVaultPauseState ​
Shared vault pause/unpause logic at DEX layer. wantsPaused_ == true → pause, false → unpause.
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_);_setDexUserPauseState ​
whole sides toggle the pause bit; borrow without payback freezes limits; other half sides revert
function _setDexUserPauseState(
address dex_,
address user_,
bool actSupply_,
bool actWithdraw_,
bool actBorrow_,
bool actPayback_,
bool wantsPaused_
) internal returns (bool actedSupply_, bool actedWithdraw_, bool actedBorrow_, bool actedPayback_);_freezeDexUserBorrow ​
no-op for a missing row, a paused side (already stronger) and a leg already carrying the preset
function _freezeDexUserBorrow(address dex_, address user_) internal returns (bool);_restoreDexUserBorrow ​
a pool off the preset was re-configured behind the freeze by another auth; that newer config wins
function _restoreDexUserBorrow(address dex_, address user_) internal returns (bool);_revertIfNoDexUserRow ​
the pass-throughs name an exact pair, so like Liquidity's they revert for a side with no row
function _revertIfNoDexUserRow(address dex_, address user_, bool supplySide_, bool borrowSide_) internal view;_dexUserBorrowData ​
function _dexUserBorrowData(address dex_, address user_) internal view returns (uint256);_isFreezeConfig ​
function _isFreezeConfig(uint256 userBorrowData_) internal pure returns (bool);_dexUserSideChanges ​
Whether the whole isBorrow_ side of user_ on dex_ would change state. False for an undefined user, whose side cannot be toggled.
function _dexUserSideChanges(address dex_, address user_, bool isBorrow_, bool wantsPaused_)
internal
view
returns (bool);_setSmartLendingPauseState ​
Shared smart lending pause/unpause logic. wantsPaused_ == true → pause, false → unpause.
function _setSmartLendingPauseState(uint256 dexId_, bool actSupply_, bool actWithdraw_, bool wantsPaused_)
internal
returns (address dex_, address smartLending_, bool actedSupply_, bool actedWithdraw_);_getDexAddress ​
Reverts only for id 0; an undeployed id resolves to a codeless address that reverts on first call.
function _getDexAddress(uint256 dexId_) internal view returns (address dex_);_isDexPausable ​
Returns whether a DEX address is a deployed DEX that can be interacted with.
function _isDexPausable(address dex_) internal view returns (bool);_isVaultT1 ​
Returns whether vault_ is a T1 vault. Falls back to true on revert (older vaults without TYPE()).
function _isVaultT1(address vault_) internal view returns (bool);_getVaultDexes ​
Resolves a vault to its connected supply-side and borrow-side DEX addresses. Reverts if unresolvable. Returns address(0) for sides that go through Liquidity instead of a DEX. T1 vaults always use Liquidity directly, so both returned values are address(0).
function _getVaultDexes(address vault_) internal view returns (address supplyDex_, address borrowDex_);