A disclaimer before we begin - in all parametric rules that try to invoke the getters name()
and symbol()
you will get a violation. That happens because the way that the prover handles strings - basically a dynamic array. This representation forces the tool to use loops to handle this data type. Loops are a complex problem in the space of formal verification which we're going to explain and address in later lesson. For now just add the flag --optimistic_loop
to the run command or shell script to mitigate this problem.
Hint:
What are the values in the assertion that does not align correctly? Is it possible that the failing function got the final values to such relation?Hint 1:
How is it possible to overspend and in the same time gain funds?Hint 2:
remember that code inside theunchecked{}
isn't checked for overflow or underflow, so we need to check it manually
Hint 1:
Is there anything in common to the 3 function that fail?Hint 1:
You've already fixed a similar bug onERC20Bug2.sol