Skip to content

GuardianModule ​

Git Source

Inherits:AuthModule

Fluid Liquidity Guardians only related methods

Functions ​

onlyGuardians ​

only guardians guard

solidity
modifier onlyGuardians() ;

_getUserPauseMode ​

solidity
function _getUserPauseMode(uint256 userData_, uint256 pauseModeBits_)
    internal
    pure
    returns (bool pauseSupplyOrBorrow_, bool pauseWithdrawOrPayback_);

_storeUserPauseMode ​

solidity
function _storeUserPauseMode(
    uint256 userData_,
    bool pauseSupplyOrBorrow_,
    bool pauseWithdrawOrPayback_,
    uint256 pauseModeBits_
) internal pure returns (uint256);

_revertIfUserClassAbove ​

solidity
function _revertIfUserClassAbove(address user_, uint256 maxUserClass_) internal view;

_updateUserSupplyPause ​

solidity
function _updateUserSupplyPause(
    address user_,
    address[] calldata tokens_,
    bool pauseSupply_,
    bool pauseWithdraw_,
    bool isUnpause_
) internal returns (bool[] memory actedSupply_, bool[] memory actedWithdraw_);

_updateUserBorrowPause ​

solidity
function _updateUserBorrowPause(
    address user_,
    address[] calldata tokens_,
    bool pauseBorrow_,
    bool pausePayback_,
    bool isUnpause_
) internal returns (bool[] memory actedBorrow_, bool[] memory actedPayback_);

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_)
    public
    onlyGuardians
    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_)
    public
    onlyGuardians
    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_)
    public
    onlyGuardians
    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_)
    public
    onlyGuardians
    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

_updateTokenPause ​

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

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_
)
    public
    onlyGuardians
    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_
)
    public
    onlyGuardians
    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