Files
fhevm-solidity/codegen/main.ts
Joseph-André Turk 45e860d577 feat: updated TFHEExecutor to support new types
chore: eq-neq  bool support and bitwise scalar support

chore: overloads for fheEq and fheNe

fix: reverts onchain when rhs is 0 in fheDiv-fheRem

feat: added support for scalar and,or,xor

chore: cleanup codegen

feat: adds euint128 and euint256 types

chore: removes ebool fheRandBounded and adds manual tests

feat: adds new types for fheRand

feat: adds trivialEncrypt for ebytesXXX

feat: adds fheEq fheNe ifThenElse for new types

chore: rename asyncDecrypt() to initGateway()
2024-10-18 02:33:10 +02:00

27 lines
1.2 KiB
TypeScript

import { mkdirSync, writeFileSync } from 'fs';
import { ALL_OPERATORS, SUPPORTED_BITS, checks } from './common';
import operatorsPrices from './operatorsPrices.json';
import { generateFHEPayment } from './payments';
import * as t from './templates';
import * as testgen from './testgen';
function generateAllFiles() {
const numSplits = 12;
const operators = checks(ALL_OPERATORS);
const [tfheSolSource, overloads] = t.tfheSol(operators, SUPPORTED_BITS, false);
const ovShards = testgen.splitOverloadsToShards(overloads);
writeFileSync('lib/Impl.sol', t.implSol(operators));
writeFileSync('lib/TFHE.sol', tfheSolSource);
writeFileSync('lib/FHEPayment.sol', generateFHEPayment(operatorsPrices));
writeFileSync('payment/Payment.sol', t.paymentSol());
mkdirSync('examples/tests', { recursive: true });
ovShards.forEach((os) => {
writeFileSync(`examples/tests/TFHETestSuite${os.shardNumber}.sol`, testgen.generateSmartContract(os));
});
const tsSplits: string[] = testgen.generateTestCode(ovShards, numSplits);
tsSplits.forEach((split, splitIdx) => writeFileSync(`test/tfheOperations/tfheOperations${splitIdx + 1}.ts`, split));
}
generateAllFiles();