ERC-4626 first-deposit inflation
In a near-empty vault, rounding and a sudden change in total assets can make a deposit mint very few shares.
Risk assessment
In a near-empty vault, rounding and a sudden change in total assets can make a deposit mint very few shares.
Mitigation
Use reviewed virtual assets and shares, keep the conversion policy consistent, and enforce user-selected minimum shares atomically.
Solidity mitigation excerpt
uint256 shares = vault.deposit(assets, receiver);
require(shares >= minShares, InsufficientShares());Foundry · Regression check
At low supply, compare preview and execution. Assert deposits below minShares revert and leave both balances unchanged.
Mitigation
Related topics
What should I verify first?
At low supply, compare preview and execution. Assert deposits below minShares revert and leave both balances unchanged.