Skip to content

Commit af254da

Browse files
8.4.0 Release
8.4.0 Release fe3e454eff8850df835089fef7939f97f6298ea1
2 parents 3c8a0dd + edc4d1e commit af254da

File tree

145 files changed

+10844
-516
lines changed

Some content is hidden

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

145 files changed

+10844
-516
lines changed

.circleci/config.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ jobs:
245245
- ./repo/src
246246
- ./repo/Public
247247
- ./repo/Typechecker/src
248+
- ./repo/PrefixGen/src
248249
- ./repo/tac_optimizer
249250
- ./repo/fried-egg/target/release
250251
- ./repo/certora_jars
@@ -425,7 +426,7 @@ jobs:
425426
- attach_workspace:
426427
at: ~/
427428
- release_certora_cli
428-
429+
429430
release_production_with_api:
430431
parameters:
431432
tag_name:
@@ -569,9 +570,9 @@ workflows:
569570
- *all
570571

571572
release_prod_with_ui:
572-
when:
573-
and:
574-
- << pipeline.parameters.release_prod_version >>
573+
when:
574+
and:
575+
- << pipeline.parameters.release_prod_version >>
575576
- << pipeline.parameters.release_tag_name >>
576577
jobs:
577578
- release_production_with_api:
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
* The Certora Prover
3+
* Copyright (C) 2025 Certora Ltd.
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, version 3 of the License.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
package prefixgen
19+
20+
import bridge.types.SolidityTypeDescription
21+
22+
/**
23+
* Utilities for the code generation process.
24+
*/
25+
object CodeGen {
26+
27+
/**
28+
* Bound some expression given by [syntax] to be between `[0,maxValueInclusive]`.
29+
* This is done by simply applying a modulus.
30+
*/
31+
fun bound(syntax: String, maxValueInclusive: Int) = "$syntax % ${maxValueInclusive + 1}"
32+
33+
/**
34+
* Pretty print the given soliidty type for use in a *local* variable declaration.
35+
*/
36+
fun SolidityTypeDescription.pp() = when(this) {
37+
is SolidityTypeDescription.Contract -> {
38+
this.contractName
39+
}
40+
is SolidityTypeDescription.Array,
41+
is SolidityTypeDescription.Function,
42+
is SolidityTypeDescription.StaticArray,
43+
is SolidityTypeDescription.UserDefined.Struct,
44+
is SolidityTypeDescription.Mapping -> throw UnsupportedOperationException("nope")
45+
is SolidityTypeDescription.PackedBytes -> "bytes memory"
46+
is SolidityTypeDescription.Primitive -> this.primitiveName.name
47+
is SolidityTypeDescription.StringType -> "string memory"
48+
is SolidityTypeDescription.UserDefined.Enum -> this.containingContract?.let { "$it." }.orEmpty() + this.enumName
49+
is SolidityTypeDescription.UserDefined.ValueType -> throw UnsupportedOperationException("not yet")
50+
}
51+
52+
/**
53+
* Pretty print the given solidity type for use in *storage* (or struct definition) declaration.
54+
* For most types, this is just [pp], with the exception of `string` and `bytes`, which do not have the `memory`
55+
* location.
56+
*/
57+
fun SolidityTypeDescription.storagePP() = when(this) {
58+
is SolidityTypeDescription.PackedBytes -> "bytes"
59+
is SolidityTypeDescription.StringType -> "string"
60+
else -> this.pp()
61+
}
62+
63+
64+
/**
65+
* Indicates whether the type described by `this` is something we know how to build via fuzzing.
66+
* These are (smallish) static arrays of buildable types, dynamic arrays of primitive types,
67+
* primitive types, bytes and strings, enums, and structs of buildable types.
68+
*/
69+
fun SolidityTypeDescription.buildable() : Boolean = when(this) {
70+
is SolidityTypeDescription.Array -> this.dynamicArrayBaseType is SolidityTypeDescription.Primitive
71+
is SolidityTypeDescription.Contract -> true
72+
is SolidityTypeDescription.Function,
73+
is SolidityTypeDescription.Mapping -> false
74+
is SolidityTypeDescription.PackedBytes,
75+
is SolidityTypeDescription.StringType,
76+
is SolidityTypeDescription.Primitive -> true
77+
is SolidityTypeDescription.StaticArray -> this.staticArrayBaseType.buildable() && this.staticArraySize <= 4.toBigInteger()
78+
is SolidityTypeDescription.UserDefined.ValueType -> false
79+
is SolidityTypeDescription.UserDefined.Enum -> true
80+
is SolidityTypeDescription.UserDefined.Struct -> this.structMembers.all {
81+
it.type.buildable()
82+
}
83+
}
84+
}

0 commit comments

Comments
 (0)