Skip to content

Commit

Permalink
EIP 4626 - Fix parameter names (#4820)
Browse files Browse the repository at this point in the history
* fix parameter names

* revert to capitalized Vault

* Replace `sender` for `caller`

* Redeems -> Burns
  • Loading branch information
alcueca committed Feb 18, 2022
1 parent 844f115 commit 6c0b89e
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions EIPS/eip-4626.md
Expand Up @@ -97,7 +97,7 @@ MUST _NOT_ revert.

#### convertToShares

The amount of shares that the vault would exchange for the amount of assets provided, in an ideal scenario where all the conditions are met.
The amount of shares that the Vault would exchange for the amount of assets provided, in an ideal scenario where all the conditions are met.

MUST NOT be inclusive of any fees that are charged against assets in the Vault.

Expand Down Expand Up @@ -125,7 +125,7 @@ This calculation MAY NOT reflect the "per-user" price-per-share, and instead sho

#### convertToAssets

The amount of assets that the vault would exchange for the amount of shares provided, in an ideal scenario where all the conditions are met.
The amount of assets that the Vault would exchange for the amount of shares provided, in an ideal scenario where all the conditions are met.

MUST NOT be inclusive of any fees that are charged against assets in the Vault.

Expand Down Expand Up @@ -153,9 +153,9 @@ This calculation MAY NOT reflect the "per-user" price-per-share, and instead sho

#### maxDeposit

Total number of underlying assets that can be deposited by `to` into the Vault, where `to` corresponds to the input parameter of a `deposit` call.
Maximum amount of the underlying asset that can be deposited into the Vault for the `receiver`, through a `deposit` call.

MUST return a limited value if `to` is subject to some deposit limit.
MUST return a limited value if `receiver` is subject to some deposit limit.

MUST return `2 ** 256 - 1` if there is no limit on the maximum amount of assets that may be deposited.

Expand All @@ -167,7 +167,7 @@ MUST _NOT_ revert.
stateMutability: view

inputs:
- name: to
- name: receiver
type: address

outputs:
Expand Down Expand Up @@ -233,9 +233,9 @@ Note that most implementations will require pre-approval of the Vault with the V

#### maxMint

Total number of underlying shares that can be minted for `to`, where `to` corresponds to the input parameter of a `mint` call.
Maximum amount of the Vault shares that can be minted for the `receiver`, through a `mint` call.

MUST return a limited value if `to` is subject to some deposit limit.
MUST return a limited value if `receiver` is subject to some mint limit.

MUST return `2 ** 256 - 1` if there is no limit on the maximum amount of shares that may be minted.

Expand All @@ -247,7 +247,7 @@ MUST _NOT_ revert.
stateMutability: view

inputs:
- name: to
- name: receiver
type: address

outputs:
Expand Down Expand Up @@ -314,9 +314,9 @@ Note that most implementations will require pre-approval of the Vault with the V

#### maxWithdraw

Total number of underlying assets that can be withdrawn from the Vault by `from`, where `from` corresponds to the input parameter of a `withdraw` call.
Maximum amount of the underlying asset that can be withdrawn from the `owner` balance in the Vault, through a `withdraw` call.

MUST return a limited value if `from` is subject to some withdrawal limit or timelock.
MUST return a limited value if `owner` is subject to some withdrawal limit or timelock.

MUST _NOT_ revert.

Expand All @@ -326,7 +326,7 @@ MUST _NOT_ revert.
stateMutability: view

inputs:
- name: from
- name: owner
type: address

outputs:
Expand Down Expand Up @@ -365,7 +365,7 @@ Note that any unfavorable discrepancy between `convertToShares` and `previewWith

#### withdraw

Redeems `shares` from `owner` and sends `assets` of underlying tokens to `receiver`.
Burns `shares` from `owner` and sends exactly `assets` of underlying tokens to `receiver`.

MUST emit the `Withdraw` event.

Expand Down Expand Up @@ -395,11 +395,11 @@ Note that some implementations will require pre-requesting to the Vault before a

#### maxRedeem

Total number of underlying shares that can redeemed from the Vault by `from`, where `from` corresponds to the input parameter of a `redeem` call.
Maximum amount of Vault shares that can be redeemed from the `owner` balance in the Vault, through a `redeem` call.

MUST return a limited value if `from` is subject to some withdrawal limit or timelock.
MUST return a limited value if `owner` is subject to some withdrawal limit or timelock.

MUST return `balanceOf(from)` if `from` is not subject to any withdrawal limit or timelock.
MUST return `balanceOf(owner)` if `owner` is not subject to any withdrawal limit or timelock.

MUST _NOT_ revert.

Expand All @@ -409,7 +409,7 @@ MUST _NOT_ revert.
stateMutability: view

inputs:
- name: caller
- name: owner
type: address

outputs:
Expand Down Expand Up @@ -447,7 +447,7 @@ Note that any unfavorable discrepancy between `convertToAssets` and `previewRede

#### redeem

Redeems `shares` from `owner` and sends `assets` of underlying tokens to `receiver`.
Burns exactly `shares` from `owner` and sends `assets` of underlying tokens to `receiver`.

MUST emit the `Withdraw` event.

Expand Down Expand Up @@ -479,7 +479,7 @@ Note that some implementations will require pre-requesting to the Vault before a

#### Deposit

`sender` has exchanged `assets` for `shares`, and transferred those `shares` to `receiver`.
`caller` has exchanged `assets` for `shares`, and transferred those `shares` to `receiver`.

MUST be emitted when tokens are deposited into the Vault via the `mint` and `deposit` methods.

Expand All @@ -489,7 +489,7 @@ MUST be emitted when tokens are deposited into the Vault via the `mint` and `dep
type: event

inputs:
- name: sender
- name: caller
indexed: true
type: address
- name: receiver
Expand All @@ -505,7 +505,7 @@ MUST be emitted when tokens are deposited into the Vault via the `mint` and `dep

#### Withdraw

`sender` has exchanged `shares` for `assets`, and transferred those `assets` to `receiver`.
`caller` has exchanged `shares` for `assets`, and transferred those `assets` to `receiver`.

MUST be emitted when shares are withdrawn from the Vault in `ERC4626.redeem` or `ERC4626.withdraw` methods.

Expand All @@ -514,7 +514,7 @@ MUST be emitted when shares are withdrawn from the Vault in `ERC4626.redeem` or
type: event

inputs:
- name: sender
- name: caller
indexed: true
type: address
- name: receiver
Expand Down Expand Up @@ -554,7 +554,7 @@ but `preview*` methods have been included for each one of the four mutable metho
In each case, the value of a preview method is only guaranteed to equal the return value of the related mutable method
if called immediately before in the same transaction.

The `max*` methods are used to check for deposit/withdraw limits on vault capacity. These can be consumed off-chain for more user focused applications or on-chain for more on-chain aggregation/integration use cases.
The `max*` methods are used to check for deposit/withdraw limits on Vault capacity. These can be consumed off-chain for more user focused applications or on-chain for more on-chain aggregation/integration use cases.

If implementors intend to support EOA account access directly, they should consider adding an additional function with the means to accommodate slippage loss or deposit/withdrawal limits,
since their transaction will revert if the exact amount is not achieved.
Expand Down

0 comments on commit 6c0b89e

Please sign in to comment.