[SMTChecker] Replace constants by their value in-place

This commit is contained in:
Leonardo Alt
2020-12-18 14:22:28 +01:00
parent 6b482d4b41
commit 034d1ab90f
2 changed files with 37 additions and 1 deletions
@@ -0,0 +1,17 @@
pragma experimental SMTChecker;
contract DepositContract {
uint constant MAX_DEPOSIT_COUNT = 2**32 - 1;
uint256 deposit_count;
uint256 deposit_count_2;
function deposit() external {
require(deposit_count < MAX_DEPOSIT_COUNT);
deposit_count += 1;
deposit_count_2 += 10; // should fail
}
}
// ----
// Warning 4984: (289-310): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 2661: (289-310): BMC: Overflow (resulting value larger than 2**256 - 1) happens here.