flexible-voting
flexible-voting copied to clipboard
Add Invariant Testing
Set up invariant testing and add invariant tests where appropriate.
For example, testing that the total weight being voted with never exceeds the voting weight delegated by the gov token (would revert if so).
References for invariant testing patterns, lmk if you have any questions when implementing:
- https://github.com/foundry-rs/book/issues/497#issuecomment-1208473205
- https://github.com/mds1/solidity-sandbox/blob/main/test/4_InvariantNonceGoUp.t.sol
This should also help - https://github.com/foundry-rs/foundry/tree/master/testdata/fuzz/invariant