Skip to content

Commit 2784e8b

Browse files
committed
ERC-7540 - Add IERC7540 interface
1 parent 332bcb5 commit 2784e8b

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

contracts/interfaces/IERC7540.sol

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// SPDX-License-Identifier: MIT
2+
3+
pragma solidity ^0.8.20;
4+
5+
import {IERC4626} from "../interfaces/IERC4626.sol";
6+
7+
/**
8+
* @dev Interface for the ERC-7540 Asynchronous Tokenized Vaults standard.
9+
* https://eips.ethereum.org/EIPS/eip-7540[ERC-7540]
10+
*/
11+
interface IERC7540 is IERC4626 {
12+
// Events
13+
event DepositRequest(
14+
address indexed controller,
15+
address indexed owner,
16+
uint256 indexed requestId,
17+
address sender,
18+
uint256 assets
19+
);
20+
21+
event RedeemRequest(
22+
address indexed controller,
23+
address indexed owner,
24+
uint256 indexed requestId,
25+
address sender,
26+
uint256 shares
27+
);
28+
29+
event OperatorSet(address indexed controller, address indexed operator, bool approved);
30+
31+
// Methods
32+
33+
/**
34+
* @dev Initiates a deposit request.
35+
* @param assets The amount of assets to deposit.
36+
* @param controller The address of the controller managing the request.
37+
* @param owner The owner of the assets.
38+
* @return requestId The unique identifier for this deposit request.
39+
*/
40+
function requestDeposit(uint256 assets, address controller, address owner) external returns (uint256 requestId);
41+
42+
/**
43+
* @dev Initiates a redeem request.
44+
* @param shares The amount of shares to redeem.
45+
* @param controller The address of the controller managing the request.
46+
* @param owner The owner of the shares.
47+
* @return requestId The unique identifier for this redeem request.
48+
*/
49+
function requestRedeem(uint256 shares, address controller, address owner) external returns (uint256 requestId);
50+
51+
/**
52+
* @dev Gets the pending deposit request amount for a given controller and requestId.
53+
* @param requestId The unique identifier for the request.
54+
* @param controller The address of the controller.
55+
* @return assets The amount of assets in the pending state.
56+
*/
57+
function pendingDepositRequest(uint256 requestId, address controller) external view returns (uint256 assets);
58+
59+
/**
60+
* @dev Gets the claimable deposit request amount for a given controller and requestId.
61+
* @param requestId The unique identifier for the request.
62+
* @param controller The address of the controller.
63+
* @return assets The amount of assets in the claimable state.
64+
*/
65+
function claimableDepositRequest(uint256 requestId, address controller) external view returns (uint256 assets);
66+
67+
/**
68+
* @dev Gets the pending redeem request amount for a given controller and requestId.
69+
* @param requestId The unique identifier for the request.
70+
* @param controller The address of the controller.
71+
* @return shares The amount of shares in the pending state.
72+
*/
73+
function pendingRedeemRequest(uint256 requestId, address controller) external view returns (uint256 shares);
74+
75+
/**
76+
* @dev Gets the claimable redeem request amount for a given controller and requestId.
77+
* @param requestId The unique identifier for the request.
78+
* @param controller The address of the controller.
79+
* @return shares The amount of shares in the claimable state.
80+
*/
81+
function claimableRedeemRequest(uint256 requestId, address controller) external view returns (uint256 shares);
82+
83+
/**
84+
* @dev Sets or revokes an operator for the given controller.
85+
* @param operator The address of the operator.
86+
* @param approved The approval status of the operator.
87+
* @return success Whether the operation was successful.
88+
*/
89+
function setOperator(address operator, bool approved) external returns (bool success);
90+
91+
/**
92+
* @dev Checks if an operator is approved for a controller.
93+
* @param controller The address of the controller.
94+
* @param operator The address of the operator.
95+
* @return status Whether the operator is approved.
96+
*/
97+
function isOperator(address controller, address operator) external view returns (bool status);
98+
}

0 commit comments

Comments
 (0)