solidity/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_crypto.sol

33 lines
670 B
Solidity
Raw Permalink Normal View History

2020-12-18 18:10:32 +00:00
abstract contract D {
function d() virtual public;
}
contract C {
bytes data;
bytes32 kec;
constructor(bytes memory _data) {
data = _data;
kec = keccak256(data);
}
2020-12-28 18:49:10 +00:00
function check(bytes memory _data) public view {
2020-12-18 18:10:32 +00:00
bytes32 _kec = keccak256(data);
2020-12-28 18:49:10 +00:00
assert(_kec == kec); // should hold
assert(kec == keccak256(_data)); // should fail
2020-12-18 18:10:32 +00:00
}
function ext(D d) public {
d.d();
}
}
2021-03-31 15:11:54 +00:00
// ====
// SMTEngine: all
2022-11-23 18:53:21 +00:00
// SMTIgnoreCex: yes
2023-02-09 16:07:13 +00:00
// SMTIgnoreInv: yes
2020-12-28 18:49:10 +00:00
// ----
2022-11-23 18:53:21 +00:00
// Warning 6328: (302-333): CHC: Assertion violation happens here.
2023-02-09 16:07:13 +00:00
// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.