Cyfrin / foundry-defi-stablecoin-cu

241 stars 107 forks source link

Replaced assert with assertGe in "invariant_protocolMustHaveMoreValueThatTotalSupplyDollars" tests #88

Closed SyedAsadKazmi closed 2 months ago

SyedAsadKazmi commented 2 months ago

In the latest foundry version, using assert in invariant tests is getting reverted with:

[FAIL. Reason: failed to set up invariant testing environment: panic: assertion failed (0x01)]

So, the solution would be to replace assert with either assertEq, assertGe or assertLe depending on the type of comparison while defining invariants.