EIP-4626: Yield Bearing Vault Standard

The EIP states that the “preview” functions should not revert. This leaves me wondering what to do with absurd input:

  • what should previewDeposit and previewWithdraw return is the “expected” value doesn’t fit into a uint256 ?
    • this could happen if each asset unit is represented by multiple shares units, and the previewDeposit is called with type(uint256).max as an input.
  • what should previewWithdraw and previewRedeem return is the input is higher then totalAssets / totalSupply ?

Has anyone worked on an ERC4626 implementation based on bounding curve, I’d be curious to see that.

2 Likes