While this is an obvious bug, an invariant could have prevented an exploit of the bug.Invariant:
Copy
Ask AI
function assertionIsSolvent() public view { require(visr.balanceOf(address(adopter)) >= vvisr.totalSupply(), "Reward tokens are undercollateralized");}
Alternatively, the assertion could test the correct behavior of the previous transaction.
The assertion could be triggered by a call to the deposit function.