create-fhevm-example 1.4.1 โ 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scripts/shared/generators.d.ts +12 -0
- package/dist/scripts/shared/generators.d.ts.map +1 -1
- package/dist/scripts/shared/generators.js +131 -2
- package/dist/scripts/shared/utils.d.ts +2 -0
- package/dist/scripts/shared/utils.d.ts.map +1 -1
- package/dist/scripts/shared/utils.js +28 -1
- package/package.json +1 -1
|
@@ -12,6 +12,18 @@ export declare function cleanupTemplate(outputDir: string): void;
|
|
|
12
12
|
* Generates a deploy script for a contract
|
|
13
13
|
*/
|
|
14
14
|
export declare function generateDeployScript(contractName: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Extracts FHE function names used in contract
|
|
17
|
+
*/
|
|
18
|
+
export declare function extractFHEFunctions(contractContent: string): string[];
|
|
19
|
+
/**
|
|
20
|
+
* Extracts FHE types used in contract (from imports and declarations)
|
|
21
|
+
*/
|
|
22
|
+
export declare function extractFHETypes(contractContent: string): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Generates FHE API Reference markdown section (collapsible format)
|
|
25
|
+
*/
|
|
26
|
+
export declare function generateFHEApiSection(functions: string[], types: string[]): string;
|
|
15
27
|
/**
|
|
16
28
|
* Generates GitBook-compatible markdown documentation
|
|
17
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators.d.ts","sourceRoot":"","sources":["../../../scripts/shared/generators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"generators.d.ts","sourceRoot":"","sources":["../../../scripts/shared/generators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAuDvD;AAMD;;GAEG;AACH,wB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41,6 +41,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
exports.cleanupTemplate = cleanupTemplate;
|
|
43
43
|
exports.generateDeployScript = generateDeployScript;
|
|
44
|
+
exports.extractFHEFunctions = extractFHEFunctions;
|
|
45
|
+
exports.extractFHETypes = extractFHETypes;
|
|
46
|
+
exports.generateFHEApiSection = generateFHEApiSection;
|
|
44
47
|
exports.generateGitBookMarkdown = generateGitBookMarkdown;
|
|
45
48
|
exports.updateProjectPackageJson = updateProjectPackageJson;
|
|
46
49
|
exports.runCommand = runCommand;
|
|
@@ -93,6 +96,11 @@ function cleanupTemplate(outputDir) {
|
|
|
93
96
|
fs.unlinkSync(oldTaskFile);
|
|
94
97
|
}
|
|
95
98
|
fs.writeFileSync(path.join(outputDir, "test", "types.ts"), utils_1.TEST_TYPES_CONTENT);
|
|
99
|
+
// Create .gitignore (npm ignores .gitignore files during publish)
|
|
100
|
+
const gitignorePath = path.join(outputDir, ".gitignore");
|
|
101
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
102
|
+
fs.writeFileSync(gitignorePath, utils_1.GITIGNORE_CONTENT);
|
|
103
|
+
}
|
|
96
104
|
}
|
|
97
105
|
// =============================================================================
|
|
98
106
|
// Code Generators
|
|
@@ -135,6 +143,121 @@ func.id = "deploy_${contractName.toLowerCase()}";
|
|
|
135
143
|
func.tags = ["${contractName}"];
|
|
136
144
|
`;
|
|
137
145
|
}
|
|
146
|
+
// =============================================================================
|
|
147
|
+
// FHE API Reference (from @fhevm/solidity)
|
|
148
|
+
// =============================================================================
|
|
149
|
+
/** FHE Library Functions with developer-friendly descriptions */
|
|
150
|
+
const FHE_FUNCTION_DESCRIPTIONS = {
|
|
151
|
+
// Type Conversion & Initialization
|
|
152
|
+
asEbool: "Encrypts a plaintext boolean into ebool",
|
|
153
|
+
asEuint8: "Encrypts a plaintext uint8 value into euint8",
|
|
154
|
+
asEuint16: "Encrypts a plaintext uint16 value into euint16",
|
|
155
|
+
asEuint32: "Encrypts a plaintext uint32 value into euint32",
|
|
156
|
+
asEuint64: "Encrypts a plaintext uint64 value into euint64",
|
|
157
|
+
asEuint128: "Encrypts a plaintext uint128 value into euint128",
|
|
158
|
+
asEuint256: "Encrypts a plaintext uint256 value into euint256",
|
|
159
|
+
asEaddress: "Encrypts a plaintext address into eaddress",
|
|
160
|
+
fromExternal: "Validates and converts external encrypted input using inputProof",
|
|
161
|
+
isInitialized: "Checks if an encrypted value has been set (handle != 0)",
|
|
162
|
+
// Arithmetic Operations
|
|
163
|
+
add: "Homomorphic addition: result = a + b (overflow wraps)",
|
|
164
|
+
sub: "Homomorphic subtraction: result = a - b (underflow wraps)",
|
|
165
|
+
mul: "Homomorphic multiplication: result = a * b",
|
|
166
|
+
div: "Homomorphic division: result = a / b (plaintext divisor only)",
|
|
167
|
+
rem: "Homomorphic remainder: result = a % b (plaintext divisor only)",
|
|
168
|
+
neg: "Homomorphic negation (two's complement)",
|
|
169
|
+
min: "Returns smaller of two encrypted values",
|
|
170
|
+
max: "Returns larger of two encrypted values",
|
|
171
|
+
// Comparison Operations (return ebool)
|
|
172
|
+
eq: "Encrypted equality: returns ebool(a == b)",
|
|
173
|
+
ne: "Encrypted inequality: returns ebool(a != b)",
|
|
174
|
+
gt: "Encrypted greater-than: returns ebool(a > b)",
|
|
175
|
+
lt: "Encrypted less-than: returns ebool(a < b)",
|
|
176
|
+
ge: "Encrypted greater-or-equal: returns ebool(a >= b)",
|
|
177
|
+
le: "Encrypted less-or-equal: returns ebool(a <= b)",
|
|
178
|
+
// Bitwise Operations
|
|
179
|
+
and: "Homomorphic bitwise AND",
|
|
180
|
+
or: "Homomorphic bitwise OR",
|
|
181
|
+
xor: "Homomorphic bitwise XOR",
|
|
182
|
+
not: "Homomorphic bitwise NOT",
|
|
183
|
+
shl: "Homomorphic shift left",
|
|
184
|
+
shr: "Homomorphic shift right",
|
|
185
|
+
rotl: "Homomorphic rotate left",
|
|
186
|
+
rotr: "Homomorphic rotate right",
|
|
187
|
+
// Conditional Logic
|
|
188
|
+
select: "Encrypted if-then-else: select(cond, a, b) โ returns a if true, b if false",
|
|
189
|
+
// Random Number Generation
|
|
190
|
+
randEbool: "Generates random encrypted boolean",
|
|
191
|
+
randEuint8: "Generates random encrypted 8-bit integer",
|
|
192
|
+
randEuint16: "Generates random encrypted 16-bit integer",
|
|
193
|
+
randEuint32: "Generates random encrypted 32-bit integer",
|
|
194
|
+
randEuint64: "Generates random encrypted 64-bit integer",
|
|
195
|
+
randEuint128: "Generates random encrypted 128-bit integer",
|
|
196
|
+
randEuint256: "Generates random encrypted 256-bit integer",
|
|
197
|
+
// Access Control
|
|
198
|
+
allow: "Grants PERMANENT permission for address to decrypt/use value",
|
|
199
|
+
allowThis: "Grants contract permission to operate on ciphertext",
|
|
200
|
+
allowTransient: "Grants TEMPORARY permission (expires at tx end)",
|
|
201
|
+
isAllowed: "Checks if address has permission to use ciphertext",
|
|
202
|
+
isSenderAllowed: "Checks if msg.sender has permission",
|
|
203
|
+
// Decryption
|
|
204
|
+
makePubliclyDecryptable: "Marks ciphertext for public decryption via relayer",
|
|
205
|
+
isPubliclyDecryptable: "Checks if ciphertext is publicly decryptable",
|
|
206
|
+
checkSignatures: "Verifies KMS decryption proof (reverts if invalid)",
|
|
207
|
+
toBytes32: "Converts encrypted handle to bytes32 for proof arrays",
|
|
208
|
+
// Utility
|
|
209
|
+
cleanTransientStorage: "Clears transient permissions (for AA bundled UserOps)",
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Extracts FHE function names used in contract
|
|
213
|
+
*/
|
|
214
|
+
function extractFHEFunctions(contractContent) {
|
|
215
|
+
const pattern = /FHE\.([a-zA-Z0-9]+)\s*[(<]/g;
|
|
216
|
+
const matches = new Set();
|
|
217
|
+
let match;
|
|
218
|
+
while ((match = pattern.exec(contractContent)) !== null) {
|
|
219
|
+
if (FHE_FUNCTION_DESCRIPTIONS[match[1]]) {
|
|
220
|
+
matches.add(match[1]);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return Array.from(matches).sort();
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Extracts FHE types used in contract (from imports and declarations)
|
|
227
|
+
*/
|
|
228
|
+
function extractFHETypes(contractContent) {
|
|
229
|
+
const pattern = /\b(ebool|euint(?:8|16|32|64|128|256)|eaddress|externalEbool|externalEuint(?:8|16|32|64|128|256)|externalEaddress)\b/g;
|
|
230
|
+
const matches = new Set();
|
|
231
|
+
let match;
|
|
232
|
+
while ((match = pattern.exec(contractContent)) !== null) {
|
|
233
|
+
matches.add(match[1]);
|
|
234
|
+
}
|
|
235
|
+
return Array.from(matches).sort();
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Generates FHE API Reference markdown section (collapsible format)
|
|
239
|
+
*/
|
|
240
|
+
function generateFHEApiSection(functions, types) {
|
|
241
|
+
if (functions.length === 0 && types.length === 0)
|
|
242
|
+
return "";
|
|
243
|
+
const totalCount = functions.length + types.length;
|
|
244
|
+
let section = `<details>\n`;
|
|
245
|
+
section += `<summary>๐ FHE API Reference (${totalCount} items)</summary>\n\n`;
|
|
246
|
+
// Types
|
|
247
|
+
if (types.length > 0) {
|
|
248
|
+
section += `**Types:** ${types.map((t) => `\`${t}\``).join(" ยท ")}\n\n`;
|
|
249
|
+
}
|
|
250
|
+
// Functions as list
|
|
251
|
+
if (functions.length > 0) {
|
|
252
|
+
section += `**Functions:**\n`;
|
|
253
|
+
for (const f of functions) {
|
|
254
|
+
section += `- \`FHE.${f}()\` - ${FHE_FUNCTION_DESCRIPTIONS[f]}\n`;
|
|
255
|
+
}
|
|
256
|
+
section += `\n`;
|
|
257
|
+
}
|
|
258
|
+
section += `</details>\n\n`;
|
|
259
|
+
return section;
|
|
260
|
+
}
|
|
138
261
|
/**
|
|
139
262
|
* Generates GitBook-compatible markdown documentation
|
|
140
263
|
*/
|
|
@@ -146,6 +269,10 @@ function generateGitBookMarkdown(description, contractContent, testContent, cont
|
|
|
146
269
|
markdown += `- \`.ts\` file โ \`<your-project-root-dir>/test/\`\n\n`;
|
|
147
270
|
markdown += `This ensures Hardhat can compile and test your contracts as expected.\n`;
|
|
148
271
|
markdown += `{% endhint %}\n\n`;
|
|
272
|
+
// Extract and add FHE API Reference section
|
|
273
|
+
const fheFunctions = extractFHEFunctions(contractContent);
|
|
274
|
+
const fheTypes = extractFHETypes(contractContent);
|
|
275
|
+
markdown += generateFHEApiSection(fheFunctions, fheTypes);
|
|
149
276
|
markdown += `{% tabs %}\n\n`;
|
|
150
277
|
markdown += `{% tab title="${contractName}.sol" %}\n\n`;
|
|
151
278
|
markdown += `\`\`\`solidity\n`;
|
|
@@ -189,7 +316,8 @@ function updateProjectPackageJson(outputDir, projectName, description, npmDepend
|
|
|
189
316
|
*/
|
|
190
317
|
function runCommand(cmd, args, cwd) {
|
|
191
318
|
return new Promise((resolve, reject) => {
|
|
192
|
-
const
|
|
319
|
+
const fullCommand = [cmd, ...args].join(" ");
|
|
320
|
+
const child = (0, child_process_1.spawn)(fullCommand, [], {
|
|
193
321
|
cwd,
|
|
194
322
|
shell: true,
|
|
195
323
|
stdio: "pipe",
|
|
@@ -219,7 +347,8 @@ function runCommand(cmd, args, cwd) {
|
|
|
219
347
|
function runCommandWithStatus(cmd, args, cwd) {
|
|
220
348
|
return new Promise((resolve) => {
|
|
221
349
|
let output = "";
|
|
222
|
-
const
|
|
350
|
+
const fullCommand = [cmd, ...args].join(" ");
|
|
351
|
+
const proc = (0, child_process_1.spawn)(fullCommand, [], {
|
|
223
352
|
cwd,
|
|
224
353
|
shell: true,
|
|
225
354
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -12,6 +12,8 @@ export declare const TEMPLATE_DIR_NAME = "fhevm-hardhat-template";
|
|
|
12
12
|
export declare const MAX_DESCRIPTION_LENGTH = 80;
|
|
13
13
|
/** Directories to exclude when copying template */
|
|
14
14
|
export declare const EXCLUDE_DIRS: string[];
|
|
15
|
+
/** Gitignore content for scaffolded projects (npm ignores .gitignore during publish) */
|
|
16
|
+
export declare const GITIGNORE_CONTENT = "# fhevm\nfhevmTemp\n\n# directories\n.coverage_artifacts\n.coverage_cache\n.coverage_contracts\nartifacts\nbuild\ncache\ncoverage\ndist\nnode_modules\ntypes\ndeployments\ntmp\n\n# files\n*.env\n*.log\n.DS_Store\n.pnp.*\ncoverage.json\npnpm-lock.yaml\nyarn.lock\n";
|
|
15
17
|
/** FHEVM package versions for --add mode */
|
|
16
18
|
export declare const FHEVM_DEPENDENCIES: {
|
|
17
19
|
dependencies: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../scripts/shared/utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEhD,eAAO,MAAM,aAAa,iBAAO,CAAC;AAElC,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,2BAA2B,CAAC;AAE1D,gDAAgD;AAChD,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,mDAAmD;AACnD,eAAO,MAAM,YAAY,UAQxB,CAAC;AAEF,4CAA4C;AAC5C,eAAO,MAAM,kBAAkB;;;;;;;;;CAS9B,CAAC;AAEF,eAAO,MAAM,cAAc,UAQ1B,CAAC;AAEF,eAAO,MAAM,kBAAkB,yPAS9B,CAAC;AAEF,eAAO,MAAM,cAAc;;;4BAGD,MAAM;6BACL,MAAM;uBACZ,MAAM;;;;CAI1B,CAAC;AAMF,eAAO,MAAM,GAAG;mBACC,MAAM;iBACR,MAAM;gBACP,MAAM;eACP,MAAM;mBACF,MAAM;CACtB,CAAC;AAEF;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,SAAI,GAAG,KAAK,CAI/D;AAMD,sDAAsD;AACtD,wBAAgB,UAAU,IAAI,MAAM,CAUnC;AAED,uCAAu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AO,MAAM,kBAAkB,yPAS9B,CAAC;AAEF,eAAO,MAAM,cAAc;;;4BAGD,MAAM;6BACL,MAAM;uBACZ,MAAM;;;;CAI1B,CAAC;AAMF,eAAO,MAAM,GAAG;mBACC,MAAM;iBACR,MAAM;gBACP,MAAM;eACP,MAAM;mBACF,MAAM;CACtB,CAAC;AAEF;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,SAAI,GAAG,KAAK,CAI/D;AAMD,sDAAsD;AACtD,wBAAgB,UAAU,IAAI,MAAM,CAUnC;AAED,uCAAuC;AACvC,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,oEAAoE;AACpE,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,WAAW,GAAE,MAAM,EAAiB,GACnC,IAAI,CAoBN;AAMD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM/C;AAED,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAKhE;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAK7D;AAED,wBAAgB,eAAe,CAAC,qBAAqB,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqB5E;AAMD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAIlD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAInD;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAIhE"}
|
|
@@ -42,7 +42,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
42
42
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
43
43
|
};
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
exports.log = exports.ERROR_MESSAGES = exports.TEST_TYPES_CONTENT = exports.CATEGORY_ORDER = exports.FHEVM_DEPENDENCIES = exports.EXCLUDE_DIRS = exports.MAX_DESCRIPTION_LENGTH = exports.TEMPLATE_DIR_NAME = exports.CATEGORY_ICON = void 0;
|
|
45
|
+
exports.log = exports.ERROR_MESSAGES = exports.TEST_TYPES_CONTENT = exports.CATEGORY_ORDER = exports.FHEVM_DEPENDENCIES = exports.GITIGNORE_CONTENT = exports.EXCLUDE_DIRS = exports.MAX_DESCRIPTION_LENGTH = exports.TEMPLATE_DIR_NAME = exports.CATEGORY_ICON = void 0;
|
|
46
46
|
exports.handleError = handleError;
|
|
47
47
|
exports.getRootDir = getRootDir;
|
|
48
48
|
exports.getTemplateDir = getTemplateDir;
|
|
@@ -74,6 +74,33 @@ exports.EXCLUDE_DIRS = [
|
|
|
74
74
|
"dist",
|
|
75
75
|
".git",
|
|
76
76
|
];
|
|
77
|
+
/** Gitignore content for scaffolded projects (npm ignores .gitignore during publish) */
|
|
78
|
+
exports.GITIGNORE_CONTENT = `# fhevm
|
|
79
|
+
fhevmTemp
|
|
80
|
+
|
|
81
|
+
# directories
|
|
82
|
+
.coverage_artifacts
|
|
83
|
+
.coverage_cache
|
|
84
|
+
.coverage_contracts
|
|
85
|
+
artifacts
|
|
86
|
+
build
|
|
87
|
+
cache
|
|
88
|
+
coverage
|
|
89
|
+
dist
|
|
90
|
+
node_modules
|
|
91
|
+
types
|
|
92
|
+
deployments
|
|
93
|
+
tmp
|
|
94
|
+
|
|
95
|
+
# files
|
|
96
|
+
*.env
|
|
97
|
+
*.log
|
|
98
|
+
.DS_Store
|
|
99
|
+
.pnp.*
|
|
100
|
+
coverage.json
|
|
101
|
+
pnpm-lock.yaml
|
|
102
|
+
yarn.lock
|
|
103
|
+
`;
|
|
77
104
|
/** FHEVM package versions for --add mode */
|
|
78
105
|
exports.FHEVM_DEPENDENCIES = {
|
|
79
106
|
dependencies: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-fhevm-example",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "Create FHEVM example projects with a single command - A comprehensive toolkit for building privacy-preserving smart contracts",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-fhevm-example": "./dist/scripts/index.js"
|