ERC-7887 Tokenized vault request cancellation feature (Cancelation for ERC-7540 Tokenized Vaults)

Draft · Vaults & DeFi · created 2025-02-18

An extension standard for ERC-7540 asynchronous tokenized vaults that allows canceling pending deposit or redemption requests and reclaiming the canceled assets or shares.

Why it is needed

When a deposit or redemption request is made to an ERC-7540 asynchronous vault, the assets or shares are locked in a Pending state. Processing can take a long time, as in the case of redemptions from long-duration real-world asset pools, but the original ERC-7540 has no way to reverse this request. Even if a user changes their mind or processing is delayed, they cannot withdraw their assets, creating a problem where funds remain locked for extended periods. This standard addresses the problem by adding a procedure to cancel the request and claim the result.

In depth

The three stages of a cancellation request

A cancellation request passes through three stages after submission: Pending, Claimable, and Claimed. Calling cancelDepositRequest or cancelRedeemRequest sets pendingCancelCancelDepositRequest or pendingCancelRedeemRequest to true, entering the Pending state. Once the vault processes the cancellation internally, claimableCancelDepositRequest or claimableCancelRedeemRequest increases by the corresponding amount, entering the Claimable state. Only after claimCancelDepositRequest or claimCancelRedeemRequest is called does it enter the Claimed state, at which point the assets or shares are transferred. The Claim step cannot be skipped, and the cancel call and the claim call must be made separately even within the same block. The vault pushing tokens to the user first is prohibited; only the user pulling the tokens themselves is allowed. However, in a synchronous cancellation flow, it is possible to move directly to Claimable without passing through Pending.

New requests are blocked during cancellation

While a deposit cancellation request is in the Pending state, a new requestDeposit call from the same controller MUST revert. Likewise, while a redemption cancellation request is Pending, a new requestRedeem call MUST also revert. This rule exists to entirely prevent the complex combination of states that would arise from a new request arriving while a cancellation is pending, with the goal of making it easier for integrating services to read the vault's current state.

controller and operator permissions

For calls to cancelDepositRequest, claimCancelDepositRequest, and cancelRedeemRequest, controller must equal msg.sender; for another address to call on its behalf, the controller must have approved that address as an operator in advance. The input parameter for claimCancelRedeemRequest is named owner, but the body text likewise specifies that controller must equal msg.sender or be an approved operator.

Four events

CancelDepositRequest is emitted when cancelDepositRequest is called, and CancelDepositClaim is emitted when assets are claimed via claimCancelDepositRequest. Similarly, CancelRedeemRequest is emitted when cancelRedeemRequest is called, and CancelRedeemClaim is emitted when shares are claimed via claimCancelRedeemRequest. Each event records the controller and requestId, and the Claim events additionally record the receiver and the actual amount of assets or shares delivered. sender is the address that actually called the function and may differ from controller.

ERC-165 interface identifier

Contracts implementing this standard MUST implement ERC-165's supportsInterface. An asynchronous deposit vault with cancel functionality MUST return true for interfaceID 0x8bf840e3, and an asynchronous redeem vault with cancel functionality MUST return true for 0xe76cffc7. Because ERC-7540 itself optionally allows fully asynchronous, partially asynchronous, and fully synchronous flows, this identifier lets integrating services distinguish which flow a given contract supports.

Backward compatibility with ERC-7540

This interface is fully backward compatible with ERC-7540. It adds cancellation-related functions and events to existing ERC-7540 vaults, so it does not change the behavior of existing vaults that do not support cancellation.

This is a proposal still in Draft status

This document is currently in Draft status, meaning it is still a proposal stage where the content may change or be abandoned.

Original ERC · ← ERCs