Skip to content

Commit b03323e

Browse files
12.02.26 Release
12.02.26 Release 9e6c54f0588d545afa38db49e18043ca5a93310d
2 parents 2cf089d + 3f2b19c commit b03323e

File tree

90 files changed

+3686
-1634
lines changed

Some content is hidden

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

90 files changed

+3686
-1634
lines changed

.circleci/config.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,6 @@ jobs:
385385
- attach_workspace:
386386
at: ~/
387387
- release_certora_cli
388-
- run:
389-
name: Create mutation container
390-
command: |
391-
curl -X POST https://circleci.com/api/v2/project/gh/Certora/mutation-test-container/pipeline \
392-
--header "Circle-Token: $CIRCLE_TOKEN" \
393-
--header "content-type: application/json" \
394-
--data '{"branch":"master"}'
395388

396389
upload_artifact:
397390
parameters:
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.0;
3+
4+
// Contract A: transfer() returning bool
5+
contract A {
6+
bool public executed;
7+
8+
function transfer() external returns (bool) {
9+
executed = true;
10+
return true;
11+
}
12+
}
13+
14+
// Contract B: transfer() returning void
15+
contract B {
16+
bool public executed;
17+
18+
function transfer() external {
19+
executed = true;
20+
}
21+
}
22+
23+
// Contract C: multi() returning (uint, uint)
24+
contract C {
25+
function multi() external pure returns (uint, uint) {
26+
return (42, 84);
27+
}
28+
}
29+
30+
// Contract D: multi() returning (uint)
31+
contract D {
32+
function multi() external pure returns (uint) {
33+
return (100);
34+
}
35+
}
36+
37+
// Contract E: transfer() returning bool (same as A, tests multiple matching)
38+
contract E {
39+
function transfer() external returns (bool) {
40+
return false;
41+
}
42+
}
43+
44+
// Contract F: getValue() returning uint8
45+
contract F {
46+
function getValue() external pure returns (uint8) {
47+
return 42;
48+
}
49+
}
50+
51+
// Contract G: getValue() returning uint256
52+
contract G {
53+
function getValue() external pure returns (uint256) {
54+
return 100;
55+
}
56+
}
57+
58+
// Contract H: getPair() returning (uint, bool)
59+
contract H {
60+
function getPair() external pure returns (uint, bool) {
61+
return (1, true);
62+
}
63+
}
64+
65+
// Contract I: getPair() returning (bool, uint)
66+
contract I {
67+
function getPair() external pure returns (bool, uint) {
68+
return (true, 2);
69+
}
70+
}
71+
72+
// Contract J: getTriple() returning (uint, uint, uint)
73+
contract J {
74+
function getTriple() external pure returns (uint, uint, uint) {
75+
return (1, 2, 3);
76+
}
77+
}
78+
79+
// Main contract for verification
80+
contract Main {
81+
}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
using A as a;
2+
using B as b;
3+
using C as c;
4+
using D as d;
5+
using E as ee;
6+
using F as f;
7+
using G as g;
8+
using H as h;
9+
using I as i;
10+
using J as j;
11+
12+
// TEST 1: Explicit bool type declaration -> dispatches to A (returns bool)
13+
rule explicitBoolTypeDispatchesToA(env e) {
14+
address addr;
15+
bool result = addr.transfer(e);
16+
assert addr == a || addr == ee, "Explicit bool LHS should dispatch to contract A";
17+
assert addr == a => result == true;
18+
assert addr == ee => result == false;
19+
}
20+
21+
// TEST 2: Command form (no LHS) -> should work with A, B, E
22+
rule commandFormWorksWithVoid(env e) {
23+
address addr;
24+
addr.transfer(e); // No return value captured
25+
assert addr == a || addr == b || addr == ee, "Command form should accept all";
26+
}
27+
28+
// TEST 3: Multi-return with two variables -> dispatches to C (uint, uint)
29+
rule multiReturnTwoVarsDispatchesToC(env e) {
30+
address addr;
31+
uint x;
32+
uint y;
33+
x, y = addr.multi(e);
34+
assert addr == c, "Two LHS vars should dispatch to C";
35+
assert x == 42 && y == 84;
36+
}
37+
38+
// TEST 4: Single return -> dispatches to D (uint)
39+
rule singleReturnDispatchesToD(env e) {
40+
address addr;
41+
uint result = addr.multi(e);
42+
assert addr == d, "Single LHS var should dispatch to D";
43+
assert result == 100;
44+
}
45+
46+
// TEST 5: Assignment without type declaration (variable pre-declared)
47+
rule assignmentToPreDeclaredBoolVar(env e) {
48+
address addr;
49+
bool existingVar;
50+
existingVar = addr.transfer(e); // No type on this line, but existingVar is bool
51+
assert addr == a || addr == ee, "Pre-declared bool var should provide type hint";
52+
}
53+
54+
// TEST 6: Assignment without type declaration for uint
55+
rule assignmentToPreDeclaredUintVar(env e) {
56+
address addr;
57+
uint existingVar;
58+
existingVar = addr.multi(e); // No type on this line
59+
assert addr == d, "Pre-declared uint var should dispatch to D";
60+
}
61+
62+
// TEST 7: Multiple contracts with same return type - both are valid targets
63+
rule multipleMatchingContractsBool(env e) {
64+
address addr;
65+
bool result = addr.transfer(e);
66+
// Both A and E return bool
67+
assert addr == a || addr == ee, "Both A and E should be valid for bool return";
68+
}
69+
70+
// TEST 8: Subtype - uint8 result assigned to uint256 variable
71+
rule subtypeUint8ToUint256(env e) {
72+
address addr;
73+
uint256 result = addr.getValue(e);
74+
// G returns uint256 (exact match), F returns uint8 (convertible?)
75+
assert addr == g || addr == f, "Check subtype compatibility";
76+
}
77+
78+
// TEST 9: Tuple order (uint, bool) -> dispatches to H
79+
rule tupleOrderUintBool(env e) {
80+
address addr;
81+
uint x;
82+
bool y;
83+
x, y = addr.getPair(e);
84+
assert addr == h, "(uint, bool) order should dispatch to H";
85+
assert x == 1 && y == true;
86+
}
87+
88+
// TEST 10: Tuple order (bool, uint) -> dispatches to I
89+
rule tupleOrderBoolUint(env e) {
90+
address addr;
91+
bool x;
92+
uint y;
93+
x, y = addr.getPair(e);
94+
assert addr == i, "(bool, uint) order should dispatch to I";
95+
assert x == true && y == 2;
96+
}
97+
98+
// TEST 11: Triple return value
99+
rule tripleReturnValues(env e) {
100+
address addr;
101+
uint x;
102+
uint y;
103+
uint z;
104+
x, y, z = addr.getTriple(e);
105+
assert addr == j, "Triple return should dispatch to J";
106+
assert x == 1 && y == 2 && z == 3;
107+
}
108+
109+
// TEST 12: Wildcard with one variable - x, _ = addr.multi(e)
110+
rule wildcardWithOneVar(env e) {
111+
address addr;
112+
uint x;
113+
x, _ = addr.multi(e);
114+
assert addr == c, "One var + wildcard should dispatch to C (uint, uint)";
115+
assert x == 42;
116+
}
117+
118+
// TEST 13: Double wildcard - _, _ = addr.multi(e)
119+
rule doubleWildcard(env e) {
120+
address addr;
121+
_, _ = addr.multi(e);
122+
assert addr == c, "Double wildcard with 2 positions should dispatch to C";
123+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"files": [
3+
"Contracts.sol:Main",
4+
"Contracts.sol:A",
5+
"Contracts.sol:B",
6+
"Contracts.sol:C",
7+
"Contracts.sol:D",
8+
"Contracts.sol:E",
9+
"Contracts.sol:F",
10+
"Contracts.sol:G",
11+
"Contracts.sol:H",
12+
"Contracts.sol:I",
13+
"Contracts.sol:J"
14+
],
15+
"rule_sanity": "basic",
16+
"solc": "solc8.25",
17+
"verify": "Main:Contracts.spec"
18+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"rules": {
3+
"assignmentToPreDeclaredBoolVar": "SUCCESS",
4+
"assignmentToPreDeclaredUintVar": "SUCCESS",
5+
"commandFormWorksWithVoid": "SUCCESS",
6+
"doubleWildcard": "SUCCESS",
7+
"explicitBoolTypeDispatchesToA": "SUCCESS",
8+
"multiReturnTwoVarsDispatchesToC": "SUCCESS",
9+
"multipleMatchingContractsBool": "SUCCESS",
10+
"singleReturnDispatchesToD": "SUCCESS",
11+
"subtypeUint8ToUint256": "SUCCESS",
12+
"tripleReturnValues": "SUCCESS",
13+
"tupleOrderBoolUint": "SUCCESS",
14+
"tupleOrderUintBool": "SUCCESS",
15+
"wildcardWithOneVar": "SUCCESS"
16+
}
17+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {B} from "B.sol";
2+
3+
contract A is B {}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
contract A {
2+
function foo() internal returns (uint) { return 0; }
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {A} from "AnotherA.sol";
2+
3+
contract B is A {}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"files": ["A.sol"],
3+
"verify": "A:test.spec"
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"trivial": "SUCCESS"
4+
}
5+
}

0 commit comments

Comments
 (0)