Dapp Use Cases
ERC4626 Assets to Shares
Make sure that the total shares are not more than the total assets
Use Case
ERC4626 is a standard for creating yield-bearing tokens that are compatible with ERC20. It is used in many DeFi protocols. In ERC4626, there is an invariant that the total shares are not more than the total assets. This is a common requirement for ERC4626 compliant protocols.
Explanation
This assertion makes sure that the total shares are not more than the total assets. It also handles the edge case where the total shares are 0.