Incorrect use of assert()
. See Solidity best practices.
contract A {
uint s_a;
function bad() public {
assert((s_a += 1) > 10);
}
}
The assert in bad()
increments the state variable s_a
while checking for the condition.
Use require
for invariants modifying the state.
assert-state-change on Slither's wiki.