IAsyncRedeemer
Inherits: IMachinePeriphery
Functions
nextRequestId
ID of the next redeem request to be created.
function nextRequestId() external view returns (uint256);Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
lastFinalizedRequestId
ID of the last finalized redeem request.
function lastFinalizedRequestId() external view returns (uint256);Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
finalizationDelay
Minimum time (in seconds) that must elapse between request submission and finalization.
function finalizationDelay() external view returns (uint256);Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
minRedeemAmount
Minimum amount of shares required to create a redeem request.
function minRedeemAmount() external view returns (uint256);Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
getShares
Request ID => Shares
function getShares(uint256 requestId) external view returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| requestId | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
getClaimableAssets
Request ID => Claimable Assets
Reverts if the request is not finalized.
function getClaimableAssets(uint256 requestId) external view returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| requestId | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
previewFinalizeRequests
Returns the total shares and current expected assets for a batch of unfinalized requests up to the given request ID.
function previewFinalizeRequests(uint256 upToRequestId) external view returns (uint256, uint256);Parameters
| Name | Type | Description |
|---|---|---|
| upToRequestId | uint256 | The request ID up to which to calculate the total shares and assets. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 | totalShares The total shares for the batch of requests. |
| <none> | uint256 | totalAssets The current total assets for the batch of requests. |
requestRedeem
Creates a redeem request and issues an associated NFT to the receiver.
function requestRedeem(uint256 shares, address receiver, uint256 minAssets) external returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| shares | uint256 | The amount of shares to redeem. |
| receiver | address | The receiver of the receipt NFT. |
| minAssets | uint256 | The minimum amount of assets for the request's entry price. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 | requestId The ID of the redeem request. |
finalizeRequests
Finalizes redeem requests up to a given request ID.
Can only be called by the operator of the associated machine.
function finalizeRequests(uint256 upToRequestId, uint256 minAssets) external returns (uint256, uint256);Parameters
| Name | Type | Description |
|---|---|---|
| upToRequestId | uint256 | The request ID up to which to finalize requests. |
| minAssets | uint256 | The minimum amount of assets that must be available for the requests to be finalized. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 | |
| <none> | uint256 |
claimAssets
Claims the assets associated with a finalized redeem request and burns the associated NFT.
function claimAssets(uint256 requestId) external returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| requestId | uint256 | The ID of the redeem request and associated NFT. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
setFinalizationDelay
Sets the finalization delay for redeem requests.
function setFinalizationDelay(uint256 newDelay) external;Parameters
| Name | Type | Description |
|---|---|---|
| newDelay | uint256 | The new finalization delay in seconds. |
setMinRedeemAmount
Sets the minimum redeem amount.
function setMinRedeemAmount(uint256 newMinRedeemAmount) external;Parameters
| Name | Type | Description |
|---|---|---|
| newMinRedeemAmount | uint256 | The new minimum redeem amount. |
Events
FinalizationDelayChanged
event FinalizationDelayChanged(uint256 indexed oldDelay, uint256 indexed newDelay);Parameters
| Name | Type | Description |
|---|---|---|
| oldDelay | uint256 | |
| newDelay | uint256 |
MinRedeemAmountChanged
event MinRedeemAmountChanged(uint256 indexed oldMinRedeemAmount, uint256 indexed newMinRedeemAmount);Parameters
| Name | Type | Description |
|---|---|---|
| oldMinRedeemAmount | uint256 | |
| newMinRedeemAmount | uint256 |
RedeemRequestCreated
event RedeemRequestCreated(uint256 indexed requestId, uint256 shares, address indexed receiver);Parameters
| Name | Type | Description |
|---|---|---|
| requestId | uint256 | |
| shares | uint256 | |
| receiver | address |
RedeemRequestClaimed
event RedeemRequestClaimed(uint256 indexed requestId, uint256 shares, uint256 assets, address indexed receiver);Parameters
| Name | Type | Description |
|---|---|---|
| requestId | uint256 | |
| shares | uint256 | |
| assets | uint256 | |
| receiver | address |
RedeemRequestsFinalized
event RedeemRequestsFinalized(
uint256 indexed fromRequestId, uint256 indexed toRequestId, uint256 totalShares, uint256 totalAssets
);Parameters
| Name | Type | Description |
|---|---|---|
| fromRequestId | uint256 | |
| toRequestId | uint256 | |
| totalShares | uint256 | |
| totalAssets | uint256 |
Structs
RedeemRequest
struct RedeemRequest {
uint256 shares;
uint256 assets;
uint256 requestTime;
}Properties
| Name | Type | Description |
|---|---|---|
| shares | uint256 | |
| assets | uint256 | |
| requestTime | uint256 |