Skip to content

Commit 607dd2b

Browse files
authored
Update ERC-7540: Move to Review
Merged by EIP-Bot.
1 parent a6132a0 commit 607dd2b

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

ERCS/erc-7540.md

+21-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
eip: 7540
33
title: Asynchronous ERC-4626 Tokenized Vaults
44
description: Extension of ERC-4626 with asynchronous deposit and redemption support
5-
author: Jeroen Offerijns (@hieronx), Alina Sinelnikova (@ilinzweilin), Vikram Arun (@vikramarun), Joey Santoro (@joeysantoro)
5+
author: Jeroen Offerijns (@hieronx), Alina Sinelnikova (@ilinzweilin), Vikram Arun (@vikramarun), Joey Santoro (@joeysantoro), Farhaan Ali (@0xfarhaan)
66
discussions-to: https://ethereum-magicians.org/t/eip-7540-asynchronous-erc-4626-tokenized-vaults/16153
7-
status: Draft
7+
status: Review
88
type: Standards Track
99
category: ERC
1010
created: 2023-10-18
@@ -45,7 +45,7 @@ The existing definitions from [ERC-4626](./eip-4626.md) apply. In addition, this
4545

4646
### Request Flows
4747

48-
ERC-7540 Vaults MUST implement one or both of asynchronous deposit and redemption Request flows. If either flow is not implemented in a Request pattern, it MUST use the ERC-4626 standard synchronous interaction pattern.
48+
[ERC-7540 Vaults](./eip-7540.md) MUST implement one or both of asynchronous deposit and redemption Request flows. If either flow is not implemented in a Request pattern, it MUST use the ERC-4626 standard synchronous interaction pattern.
4949

5050
All ERC-7540 asynchronous tokenized Vaults MUST implement ERC-4626 with overrides for certain behavior described below.
5151

@@ -72,7 +72,7 @@ After submission, Requests go through Pending, Claimable, and Claimed stages. An
7272

7373
An important Vault inequality is that following a Request(s), the cumulative requested quantity MUST be more than `pendingDepositRequest + maxDeposit - claimed`. The inequality may come from fees or other state transitions outside implemented by Vault logic such as cancellation of a Request, otherwise this would be a strict equality.
7474

75-
Requests MUST NOT skip or otherwise short-circuit the Claim state. In other words, to initiate and claim a Request, a user MUST call both request* and the corresponding Claim function separately, even in the same block.
75+
Requests MUST NOT skip or otherwise short-circuit the Claim state. In other words, to initiate and claim a Request, a user MUST call both request* and the corresponding Claim function separately, even in the same block. Vaults MUST NOT "push" tokens onto the user after a Request, users MUST "pull" the tokens via the Claim function.
7676

7777
For asynchronous Vaults, the exchange rate between `shares` and `assets` including fees and yield is up to the Vault implementation. In other words, pending redemption Requests MAY NOT be yield bearing and MAY NOT have a fixed exchange rate.
7878

@@ -272,9 +272,17 @@ Likewise yield on redemption Requests can accrue or not, and the exchange rate o
272272

273273
### Not allowing short-circuiting for claims
274274

275-
If claims can short circuit, this creates ambiguity for integrators and complicates the interface with overloaded behavior on Request functions.
275+
If claims can short circuit, this creates ambiguity for integrators and complicates the interface with overloaded behavior on Request functions.
276276

277-
Instead there can be router contracts which atomically check for Claimable amounts immediately upon Request. Frontends can dynamically route Requests in this way depending on the state and implementation of the Vault.
277+
An example of a short-circuiting Request flow could be as follows: user triggers a Request which enters Pending state. When the Vault fulfills the Request, the corresponding `assets/shares` are pushed straight to the user. This requires only 1 step on the user's behalf.
278+
279+
This approach has a few issues:
280+
- cost/lack of scalability: as the number of vault users grows it can become intractably expensive to offload the Claim costs to the Vault operator
281+
- hinders integration potential: Vault integrators would need to handle both the 2-step and 1-step case, with the 1-step pushing arbitrary tokens in from an unknown Request at an unknown time. This pushes complexity out onto integrators and reduces the standard's utility.
282+
283+
The 2-step approach used in the standard may be abstracted into a 1-step approach from the user perspective through the use of routers, relayers, message signing, or account abstraction.
284+
285+
In the case where a Request may become Claimable immediately in the same block, there can be router contracts which atomically check for Claimable amounts immediately upon Request. Frontends can dynamically route Requests in this way depending on the state and implementation of the Vault to handle this edge case.
278286

279287
### Operator function parameter on requestDeposit and requestRedeem
280288

@@ -302,6 +310,9 @@ It reduces code and implementation complexity at little to no cost to simply man
302310

303311
Implementing support for [ERC-165](./eip-165.md) is mandated because of the [optionality of flows](#optionality-of-flows). Integrations can use the `supportsInterface` method to check whether a vault is fully asynchronous, partially asynchronous, or fully synchronous, and use a single contract to support all cases.
304312

313+
### Not Allowing Pending Claims to be Fungible
314+
The async pending claims represent a sort of semi-fungible intermediate share class. Vaults can elect to wrap these claims in any token standard they like, for example ERC-20, [ERC-1155](./eip-1155.md) or ERC-721 depending on the use case. This is intentionally left out of the spec to provide flexibility to implementers.
315+
305316
## Backwards Compatibility
306317

307318
The interface is fully backwards compatible with [ERC-4626](./eip-4626.md). The specification of the `deposit`, `mint`, `redeem`, and `withdraw` methods is different as described in [Specification](#specification).
@@ -316,6 +327,10 @@ The methods `pendingDepositRequest` and `pendingRedeemRequest` are estimates use
316327

317328
In general, asynchronicity concerns make state transitions in the Vault much more complex and vulnerable to security risks. Access control on Vault operations, clear documentation of state transitioning, and invariant checks should all be performed to mitigate these risks.
318329

330+
In particular, shares or assets locked for Requests can be stuck in the Pending state. Vaults may elect to allow for fungibility of pending claims or implement some cancellation functionality to protect users.
331+
332+
Moreover, users might not know what the final exchange rate will be on any Request due to the asynchronicity. Users therefore trust the implementation of the asynchronous Vault in the computation of the exchange rate and fulfillment of their Request.
333+
319334
It is worth highlighting again here that the Claim functions for any asynchronous flows MUST enforce that `msg.sender == operator/owner` to prevent theft of Claimable `assets` or `shares`
320335

321336
## Copyright

0 commit comments

Comments
 (0)