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

31 lines
636 B
Solidity
Raw 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
// SMTIgnoreInv: yes
2020-12-28 18:49:10 +00:00
// ----
2022-11-23 15:51:06 +00:00
// Warning 6328: (302-333): CHC: Assertion violation happens here.\nCounterexample:\nkec = 0x0\n_kec = 0x0\n\nTransaction trace:\nC.constructor(_data)\nState: kec = 0x0\nC.check(_data)