methods {
function balances(address a) external returns(uint) envfree;
}
rule sameValue {
method f;
env e;
calldataarg a;
mathint initValue = nativeBalances[e.msg.sender] + balances(e, e.msg.sender);
f(e, a);
assert initValue == nativeBalances[e.msg.sender] + balances(e, e.msg.sender);
}
// SPDX-License-Identifier: UNKNOWN
pragma solidity ^0.8.30;
contract Vault {
mapping(address => uint) public balances;
function deposit() external payable {
//balances[msg.sender] += msg.value;
}
}
The code contains and obvious bug (balances not updated, but certoraRun happily accepts it!!!
It's either a bug in the prover, or a bug in my rule - in the second case sanity checker should detect it but doesn't.
The code contains and obvious bug (balances not updated, but
certoraRunhappily accepts it!!!It's either a bug in the prover, or a bug in my rule - in the second case sanity checker should detect it but doesn't.