Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit 367290f

Browse files
authored
feat: use latest core contracts, updated lib API, renamed to fhevm an… (#745)
* feat: use latest core contracts, updated lib API, renamed to fhevm and fhe chore: add dummy addresses for CI test: add tests for makePubliclyDecryptable method * chore: update package-lock.json for linux * chore: update package-lock.json * fix: solidity comments (#746) * chore: update oracle version * chore: update fhevm core-contracts version * feat: update fhevm sdk and mocked userDecrypt * chore: fix coverage
1 parent 3217b8b commit 367290f

Some content is hidden

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

69 files changed

+20141
-17991
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Pull request tests
22

33
on:
44
pull_request:
5-
branches:
6-
- main
75

86
jobs:
97
build:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,4 @@ typechain
137137
typechain-types
138138
.openzeppelin/unknown*
139139
.openzeppelin/sepolia.json
140-
httpzTemp/
140+
fhevmTemp/

.solcover.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
export const istanbulReporter = ["html", "lcov"];
2-
export const providerOptions = {
3-
mnemonic: process.env.MNEMONIC,
4-
};
5-
export const skipFiles = ["test"];
6-
export const mocha = {
7-
fgrep: "[skip-on-coverage]",
8-
invert: true,
1+
module.exports = {
2+
istanbulReporter: ["html", "lcov"],
3+
providerOptions: {
4+
mnemonic: process.env.MNEMONIC,
5+
},
6+
skipFiles: ["test"],
7+
mocha: {
8+
fgrep: "[skip-on-coverage]",
9+
invert: true,
10+
},
911
};

CustomProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class CustomProvider extends ProviderWrapper {
2727
this.lastBlockSnapshot = parseInt(blockNumberHex);
2828
this.lastBlockSnapshotForDecrypt = parseInt(blockNumberHex);
2929
const coprocAdd = dotenv.parse(
30-
fs.readFileSync(require.resolve('./httpzTemp/addresses/.env.exec')),
31-
).TFHE_EXECUTOR_CONTRACT_ADDRESS;
30+
fs.readFileSync(require.resolve('./fhevmTemp/addresses/.env.exec')),
31+
).FHEVM_EXECUTOR_CONTRACT_ADDRESS;
3232
this.lastCounterRand = await this._wrappedProvider.request({
3333
method: 'eth_getStorageAt',
3434
params: [coprocAdd, '0xa436a06f0efce5ea38c956a21e24202a59b3b746d48a23fb52b4a5bc33fe3e00', 'latest'],

codegen/main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from 'path';
44
import { validateFHETypes, validateOperators } from './common';
55
import { generateOverloads } from './generateOverloads';
66
import { ALL_OPERATORS } from './operators';
7-
import { generateSolidityFheType, generateSolidityHTTPZLib, generateSolidityImplLib } from './templates';
7+
import { generateSolidityFHELib, generateSolidityFheType, generateSolidityImplLib } from './templates';
88
import {
99
generateSolidityOverloadTestFiles,
1010
generateSolidityUnitTestContracts,
@@ -19,7 +19,7 @@ import { ALL_FHE_TYPES } from './types';
1919
* This function performs the following steps:
2020
* 1. Generates FHE types from a JSON file.
2121
* 2. Validates and processes the list of operators.
22-
* 3. Generates Solidity source code for HTTPZ and implementation contracts.
22+
* 3. Generates Solidity source code for FHE and implementation contracts.
2323
* 4. Splits the generated overloads into multiple shards to avoid exceeding Solidity's contract size limit.
2424
* 5. Writes the generated Solidity contracts and test files to the appropriate directories.
2525
* 6. Generates TypeScript test code for the split overloads and writes them to the test directory.
@@ -36,7 +36,7 @@ function generateAllFiles() {
3636
/// Generate core Solidity contract files.
3737
writeFileSync('lib/FheType.sol', generateSolidityFheType(ALL_FHE_TYPES));
3838
writeFileSync('lib/Impl.sol', generateSolidityImplLib(ALL_OPERATORS));
39-
writeFileSync('lib/HTTPZ.sol', generateSolidityHTTPZLib(ALL_OPERATORS, ALL_FHE_TYPES));
39+
writeFileSync('lib/FHE.sol', generateSolidityFHELib(ALL_OPERATORS, ALL_FHE_TYPES));
4040

4141
// TODO: For now, the testgen only supports automatically generated tests for euintXX.
4242
/// Generate overloads, split them into shards, and generate Solidity contracts to be used for TypeScript unit test files.
@@ -49,11 +49,11 @@ function generateAllFiles() {
4949
const overloadShards = splitOverloadsToShards(generateSolidityOverloadTestFiles(ALL_OPERATORS, ALL_FHE_TYPES));
5050
mkdirSync('contracts/tests', { recursive: true });
5151
overloadShards.forEach((os) => {
52-
writeFileSync(`examples/tests/HTTPZTestSuite${os.shardNumber}.sol`, generateSolidityUnitTestContracts(os));
52+
writeFileSync(`examples/tests/FHEVMTestSuite${os.shardNumber}.sol`, generateSolidityUnitTestContracts(os));
5353
});
5454

5555
const tsSplits: string[] = generateTypeScriptTestCode(overloadShards, numberOfTestSplits);
56-
tsSplits.forEach((split, splitIdx) => writeFileSync(`test/httpzOperations/httpzOperations${splitIdx + 1}.ts`, split));
56+
tsSplits.forEach((split, splitIdx) => writeFileSync(`test/fhevmOperations/fhevmOperations${splitIdx + 1}.ts`, split));
5757
}
5858

5959
generateAllFiles();

codegen/overloads.json

Lines changed: 2573 additions & 2576 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)