Merge pull request #10763 from blishko/smt-abi-fixes

[SMTChecker] Small fixes in handling ABI functions
This commit is contained in:
Leonardo
2021-01-14 16:00:49 +01:00
committed by GitHub
5 changed files with 44 additions and 10 deletions
@@ -0,0 +1,11 @@
pragma experimental SMTChecker;
contract C {
function f(bytes calldata data) external pure returns (uint256[] memory) {
return abi.decode(data, (uint256[]));
}
}
// ----
// Warning 8364: (148-157): Assertion checker does not yet implement type type(uint256[] memory)
// Warning 8364: (147-158): Assertion checker does not yet implement type type(uint256[] memory)
// Warning 8364: (148-157): Assertion checker does not yet implement type type(uint256[] memory)
// Warning 8364: (147-158): Assertion checker does not yet implement type type(uint256[] memory)
@@ -0,0 +1,9 @@
pragma experimental SMTChecker;
contract C {
function f() public view {
abi.encode(this.f);
}
}
// ----
// Warning 6031: (86-92): Internal error: Expression undefined for SMT solver.
// Warning 6031: (86-92): Internal error: Expression undefined for SMT solver.
@@ -0,0 +1,9 @@
pragma experimental SMTChecker;
contract C {
function abiEncodeStringLiteral(bytes4 sel) public pure {
bytes memory b1 = abi.encodeWithSelector("");
require(sel == "");
bytes memory b2 = abi.encodeWithSelector(sel);
assert(b1.length == b2.length); // should hold
}
}