solidity/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_crypto.sol
2023-03-09 14:59:32 +01:00

33 lines
670 B
Solidity

abstract contract D {
function d() virtual public;
}
contract C {
bytes data;
bytes32 kec;
constructor(bytes memory _data) {
data = _data;
kec = keccak256(data);
}
function check(bytes memory _data) public view {
bytes32 _kec = keccak256(data);
assert(_kec == kec); // should hold
assert(kec == keccak256(_data)); // should fail
}
function ext(D d) public {
d.d();
}
}
// ====
// SMTEngine: all
// SMTIgnoreCex: yes
// SMTIgnoreInv: yes
// ----
// Warning 6328: (302-333): CHC: Assertion violation happens here.
// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.