Emerge Yul recompiler (#1)

Provide a modified (and incomplete) version of ZKSync zksolc that can compile the most basic contracts
This commit is contained in:
Cyrill Leutwiler
2024-03-12 12:06:02 +01:00
committed by GitHub
parent d238d8f39e
commit cffa14a4d2
247 changed files with 35357 additions and 4905 deletions
@@ -0,0 +1,19 @@
contract Computation {
function triangle_number(int64 n) public pure returns (int64 sum) {
unchecked {
for (int64 x = 1; x <= n; x++) {
sum += x;
}
}
}
function odd_product(int32 n) public pure returns (int64) {
unchecked {
int64 prod = 1;
for (int32 x = 1; x <= n; x++) {
prod *= 2 * int64(x) - 1;
}
return prod;
}
}
}