-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Hello,
I am implementing this test suite on a new ERC4626 project and am seeing some failing properties related to "shares roundtrip."
In particular, both test_RT_withdraw_deposit and test_RT_deposit_withdraw fail for an ERC4626 vault that holds shares in another ERC4626 vault. You can take a look at the code here.
I have added a concrete test scenario here.
Although this project has not been audited yet, which means the likelihood of it containing a real issue is higher than erc4626-tests containing an issue, I question if failing "share roundtrip" properties are a real problem.
In this particular case, it seems that due to how totalAssets is calculated (i.e., as convertToAssets(balanceOf) on the other vault we hold shares), you can indeed withdraw, then deposit and have more shares than what you started with.
However, if you later attempt to withdraw the new, larger amount of shares, you don't end up with more assets than what you started with. And I believe this is what matters. i.e., broken "assets roundtrip" (such as in test_RT_redeem_mint or test_RT_mint_redeem) means loss of funds, but broken "shares roundtrip" means a slippage that can happen when entering/exiting the vault (still not 100% clear to me though), which is not necessarily a vulnerability (?)
Thoughts?