mirror of
https://github.com/zama-ai/fhevm-solidity.git
synced 2026-01-11 13:38:06 -05:00
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()
27 lines
1.2 KiB
TypeScript
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();
|