// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "@openzeppelin/contracts/interfaces/IERC165.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IAssetVault is IERC165 { /** * @dev Thrown when the asset is not is found among vault inventory. */ error AssetNotFound(); /** * @dev Thrown when the function is called on the vault in recovery mode. */ error VaultIsInRecoveryMode(); /** * @dev Thrown when the asset return is not allowed, due to the vault state or the caller permissions. */ error AssetReturnIsNotAllowed(); /** * @dev Thrown when the asset deposit is not allowed, due to the vault state or the caller permissions. */ error AssetDepositIsNotAllowed(); /** * @dev Emitted when the vault is switched to recovery mode by `account`. */ event RecoveryModeActivated(address account); /** * @dev Activates asset recovery mode. * Emits a {RecoveryModeActivated} event. */ function switchToRecoveryMode() external; /** * @notice Send ERC20 tokens to an address. */ function withdrawERC20Tokens( IERC20 token, address to, uint256 amount ) external; /** * @dev Pauses the vault. */ function pause() external; /** * @dev Unpauses the vault. */ function unpause() external; /** * @dev Returns vault asset class. * @return Asset class ID. */ function assetClass() external pure returns (bytes4); /** * @dev Returns the Metahub address. */ function metahub() external view returns (address); /** * @dev Returns vault recovery mode flag state. * @return True when the vault is in recovery mode. */ function isRecovery() external view returns (bool); }