Cyfrin / foundry-defi-stablecoin-cu

250 stars 117 forks source link

Replaced assert with assertGe in "invariant_protocolMustHaveMoreValueThatTotalSupplyDollars" tests #88

Closed SyedAsadKazmi closed 4 months ago

SyedAsadKazmi commented 4 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.