Euler Finance forgot to add a health check to the donation function
EToken::mint
EToken::donateToReserves
without any health checks
donateToReserves
function, so why would they have added an assertion for this?
The answer is that they wouldn’t. They would have added the assertion way in the beginning when the protocol was deployed first as an additional layer of security.
They would have done that to exactly prevent what happened. Someone forgot to perform basic invariant checks at a protocol extension, and that’s why the assertion acts as an additional layer of security which enforces protocol wide invariants, exactly to prevent insufficient checks in protocol extensions.
In other words, regardless of whether the devs simply forgot to do the checks or if they thought they don’t need to do the checks, it shows that extensions are prone to forgetting protocol wide checks.
Whereas assertions implicitly check protocol wide assertions by default.