@@ -12,6 +12,7 @@ import {AvailableAgentInfo} from "./data/AvailableAgentInfo.sol";
1212import {RedemptionTicketInfo} from "./data/RedemptionTicketInfo.sol " ;
1313import {RedemptionRequestInfo} from "./data/RedemptionRequestInfo.sol " ;
1414import {CollateralReservationInfo} from "./data/CollateralReservationInfo.sol " ;
15+ import {EmergencyPause} from "./data/EmergencyPause.sol " ;
1516import {IAssetManagerEvents} from "./IAssetManagerEvents.sol " ;
1617import {IAgentPing} from "./IAgentPing.sol " ;
1718import {IRedemptionTimeExtension} from "./IRedemptionTimeExtension.sol " ;
@@ -96,22 +97,18 @@ interface IAssetManager is
9697 function emergencyPaused () external view returns (bool );
9798
9899 /**
99- * The time when emergency pause mode will end automatically.
100- */
101- function emergencyPausedUntil () external view returns (uint256 );
102-
103- ////////////////////////////////////////////////////////////////////////////////////
104- // Emergency pause transfers
105-
106- /**
107- * If true, the system is in emergency pause mode and most operations (mint, redeem, liquidate) are disabled.
100+ * Emergency pause level defines which operations are paused:
101+ * NONE - pause is not active,
102+ * START_OPERATIONS - prevent starting mint, redeem, liquidation (start/liquidate) and core vault transfer/return,
103+ * FULL - everything from START_OPERATIONS, plus prevent finishing or defulating already started mints and redeems,
104+ * FULL_AND_TRANSFER - everything from FULL, plus prevent FAsset transfers.
108105 */
109- function transfersEmergencyPaused () external view returns (bool );
106+ function emergencyPauseLevel () external view returns (EmergencyPause.Level );
110107
111108 /**
112109 * The time when emergency pause mode will end automatically.
113110 */
114- function transfersEmergencyPausedUntil () external view returns (uint256 );
111+ function emergencyPausedUntil () external view returns (uint256 );
115112
116113 ////////////////////////////////////////////////////////////////////////////////////
117114 // Asset manager upgrading state
@@ -264,13 +261,6 @@ interface IAssetManager is
264261 string memory _name
265262 ) external ;
266263
267- /**
268- * If the current agent's vault collateral token gets deprecated, the agent must switch with this method.
269- * NOTE: may only be called by the agent vault owner.
270- * NOTE: at the time of switch, the agent must have enough of both collaterals in the vault.
271- */
272- function switchVaultCollateral (address _agentVault , IERC20 _token ) external ;
273-
274264 /**
275265 * When current pool collateral token contract (WNat) is replaced by the method setPoolWNatCollateralType,
276266 * pools don't switch automatically. Instead, the agent must call this method that swaps old WNat tokens for
@@ -808,7 +798,7 @@ interface IAssetManager is
808798 );
809799
810800 ////////////////////////////////////////////////////////////////////////////////////
811- // Dust
801+ // Dust and small ticket management
812802
813803 /**
814804 * Due to the minting pool fees or after a lot size change by the governance,
@@ -824,6 +814,20 @@ interface IAssetManager is
824814 */
825815 function convertDustToTicket (address _agentVault ) external ;
826816
817+ /**
818+ * If lot size is increased, there may be many tickets less than one lot in the queue.
819+ * In extreme cases, this could prevent redemptions, if there weren't any tickets above 1 lot
820+ * among the first `maxRedeemedTickets` tickets.
821+ * To fix this, call this method. It converts small tickets to dust and when the dust exceeds one lot
822+ * adds it to the ticket.
823+ * Since the method just cleans the redemption queue it can be called by anybody.
824+ * @param _firstTicketId if nonzero, the ticket id of starting ticket; if zero, the starting ticket will
825+ * be the redemption queue's first ticket id.
826+ * When the method finishes, it emits RedemptionTicketsConsolidated event with the nextTicketId
827+ * parameter. If it is nonzero, the method should be invoked again with this value as _firstTicketId.
828+ */
829+ function consolidateSmallTickets (uint256 _firstTicketId ) external ;
830+
827831 ////////////////////////////////////////////////////////////////////////////////////
828832 // Liquidation
829833
0 commit comments