Skip to content

Commit 0d90215

Browse files
8.4.3 Release
90eb59649f9e84bb4491031326ca3a50e58ac5a1
2 parents b945191 + b24d0ac commit 0d90215

File tree

81 files changed

+3343
-617
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+3343
-617
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"equivalence_contracts": "V1=V2",
3+
"files": [
4+
"./Test.sol:V1",
5+
"./Test.sol:V2"
6+
],
7+
"method": [
8+
"impl(address,bytes)"
9+
],
10+
"optimistic_hashing": true,
11+
"prover_args": [
12+
" -equivalenceCheck true -maxHeuristicFoldingDepth 5"
13+
],
14+
"solc": "solc8.29"
15+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
contract V1 {
2+
function impl(address a, bytes calldata g) external {
3+
a.call(g);
4+
}
5+
}
6+
7+
contract V2 {
8+
function impl(address a, bytes calldata g) external {
9+
bytes memory buf = g;
10+
a.call(buf);
11+
}
12+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"Equivalence of V1 and V2 on impl(address,bytes)": "SUCCESS"
4+
}
5+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"files": [
3+
"Test.sol",
4+
"Test.sol:Handler",
5+
"Test.sol:Manager",
6+
],
7+
"link": [
8+
"Test:manager=Manager",
9+
"Manager:handler=Handler"
10+
],
11+
"solc": "solc8.22",
12+
"verify": "Test:Test.spec"
13+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
interface ITest {
2+
function beep() external returns (uint);
3+
}
4+
contract Handler {
5+
function whatever() external returns (uint) {
6+
return ITest(address(this)).beep();
7+
}
8+
}
9+
10+
contract Manager {
11+
address immutable handler;
12+
13+
constructor(address _handler) {
14+
handler = _handler;
15+
}
16+
17+
function getHandler() external returns (address) {
18+
return handler;
19+
}
20+
}
21+
22+
contract Test is ITest {
23+
Manager manager;
24+
function entry() external returns (uint) {
25+
// This delegatecall cannot be resolved until after storage analysis, and so must be inlined late, during
26+
// summarization.
27+
(bool success, bytes memory ret) = address(manager.getHandler()).delegatecall(
28+
abi.encodeCall(Handler.whatever, ())
29+
);
30+
require(success);
31+
return abi.decode(ret, (uint));
32+
}
33+
34+
function beep() external override returns (uint) {
35+
return 987345;
36+
}
37+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
rule test() {
2+
env e;
3+
assert entry(e) == 987345;
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"test": "SUCCESS"
4+
}
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"files": [
3+
"./Test.sol:Test"
4+
],
5+
"solc": "solc8.29",
6+
"solc_via_ir": true,
7+
"verify": "Test:./test.spec"
8+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
uint constant DOUBLE_CACHE_LENGTH = 2;
2+
interface Intf {
3+
struct SubStruct {
4+
uint104 f1;
5+
int104 f2;
6+
uint48 f3;
7+
}
8+
9+
struct SignedSubStruct {
10+
int104 signedF1;
11+
int104 f2;
12+
uint48 f3;
13+
}
14+
15+
struct Record {
16+
SubStruct report;
17+
uint96 f1;
18+
uint96 f2;
19+
SignedSubStruct[2] staticStructs;
20+
uint128 postField1;
21+
uint128 postField2;
22+
uint128 postField3;
23+
uint128 postField4;
24+
}
25+
26+
function getRecord() external returns (Record memory);
27+
}
28+
29+
contract Test {
30+
address handler;
31+
32+
Intf.SignedSubStruct[2] field;
33+
34+
function entry() external returns (uint) {
35+
Intf.Record memory record = Intf(handler).getRecord();
36+
field = record.staticStructs;
37+
return this.pleaseSummarize(record.postField4);
38+
}
39+
40+
function pleaseSummarize(uint256 a) external returns (uint) {
41+
return a + 1;
42+
}
43+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"basic_rule": "SUCCESS"
4+
}
5+
}

0 commit comments

Comments
 (0)