The EIP states that the “preview” functions should not revert. This leaves me wondering what to do with absurd input:
- what should
previewDeposit
andpreviewWithdraw
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
andpreviewRedeem
return is the input is higher thentotalAssets
/totalSupply
?
Has anyone worked on an ERC4626 implementation based on bounding curve, I’d be curious to see that.