@@ -14,25 +14,30 @@ library ReserveFlagsMap {
1414 uint8 internal constant FROZEN_MASK = 0x02 ;
1515 /// @dev Mask for the `borrowable` flag.
1616 uint8 internal constant BORROWABLE_MASK = 0x04 ;
17+ /// @dev Mask for the `liquidatable` flag.
18+ uint8 internal constant LIQUIDATABLE_MASK = 0x08 ;
1719 /// @dev Mask for the `receiveSharesEnabled` flag.
18- uint8 internal constant RECEIVE_SHARES_ENABLED_MASK = 0x08 ;
20+ uint8 internal constant RECEIVE_SHARES_ENABLED_MASK = 0x10 ;
1921
2022 /// @notice Initializes the ReserveFlags with the given values.
2123 /// @param initPaused The initial `paused` flag status.
2224 /// @param initFrozen The initial `frozen` flag status.
2325 /// @param initBorrowable The initial `borrowable` flag status.
26+ /// @param initLiquidatable The initial `liquidatable` flag status.
2427 /// @param initReceiveSharesEnabled The initial `receiveSharesEnabled` flag status.
2528 /// @return The initialized ReserveFlags.
2629 function create (
2730 bool initPaused ,
2831 bool initFrozen ,
2932 bool initBorrowable ,
33+ bool initLiquidatable ,
3034 bool initReceiveSharesEnabled
3135 ) internal pure returns (ReserveFlags) {
3236 uint8 flags = 0 ;
3337 flags = _setStatus (flags, PAUSED_MASK, initPaused);
3438 flags = _setStatus (flags, FROZEN_MASK, initFrozen);
3539 flags = _setStatus (flags, BORROWABLE_MASK, initBorrowable);
40+ flags = _setStatus (flags, LIQUIDATABLE_MASK, initLiquidatable);
3641 flags = _setStatus (flags, RECEIVE_SHARES_ENABLED_MASK, initReceiveSharesEnabled);
3742 return ReserveFlags.wrap (flags);
3843 }
@@ -61,6 +66,14 @@ library ReserveFlagsMap {
6166 return ReserveFlags.wrap (_setStatus (ReserveFlags.unwrap (flags), BORROWABLE_MASK, status));
6267 }
6368
69+ /// @notice Sets the new status for the `liquidatable` flag.
70+ /// @param flags The current ReserveFlags.
71+ /// @param status The new status for the `liquidatable` flag.
72+ /// @return The updated ReserveFlags.
73+ function setLiquidatable (ReserveFlags flags , bool status ) internal pure returns (ReserveFlags) {
74+ return ReserveFlags.wrap (_setStatus (ReserveFlags.unwrap (flags), LIQUIDATABLE_MASK, status));
75+ }
76+
6477 /// @notice Sets the new status for the `receiveSharesEnabled` flag.
6578 /// @param flags The current ReserveFlags.
6679 /// @param status The new status for the `receiveSharesEnabled` flag.
@@ -96,6 +109,13 @@ library ReserveFlagsMap {
96109 return (ReserveFlags.unwrap (flags) & BORROWABLE_MASK) != 0 ;
97110 }
98111
112+ /// @notice Returns the `liquidatable` flag status.
113+ /// @param flags The current ReserveFlags.
114+ /// @return True if the flag is set.
115+ function liquidatable (ReserveFlags flags ) internal pure returns (bool ) {
116+ return (ReserveFlags.unwrap (flags) & LIQUIDATABLE_MASK) != 0 ;
117+ }
118+
99119 /// @notice Returns the `receiveSharesEnabled` flag status.
100120 /// @param flags The current ReserveFlags.
101121 /// @return True if the flag is set.
0 commit comments