create-fhevm-example 1.0.4 → 1.0.6
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/README.md +74 -246
- package/dist/config.d.ts +6 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +197 -193
- package/dist/config.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -2,317 +2,145 @@
|
|
|
2
2
|
|
|
3
3
|
Create FHEVM example projects with a single command.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
### Interactive Mode
|
|
5
|
+
## Quick Start
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
8
|
npx create-fhevm-example
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
This
|
|
14
|
-
|
|
15
|
-
1. Choosing between a single example or category project
|
|
16
|
-
2. **For single examples**: First selecting a category, then choosing an example from that category
|
|
17
|
-
3. **For category projects**: Selecting the category directly
|
|
18
|
-
4. Setting the project name and output directory
|
|
19
|
-
5. Optionally installing dependencies and running tests
|
|
20
|
-
|
|
21
|
-
### Direct Mode
|
|
11
|
+
This launches an interactive CLI that guides you through creating a project.
|
|
22
12
|
|
|
23
|
-
|
|
13
|
+
## Direct Mode
|
|
24
14
|
|
|
25
15
|
```bash
|
|
16
|
+
# Create single example
|
|
26
17
|
npx create-fhevm-example --example fhe-counter
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Create a category project:
|
|
30
18
|
|
|
31
|
-
|
|
19
|
+
# Create category project
|
|
32
20
|
npx create-fhevm-example --category basic
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
With custom output directory:
|
|
36
21
|
|
|
37
|
-
|
|
38
|
-
npx create-fhevm-example --example fhe-counter --output ./my-project
|
|
22
|
+
# With options
|
|
23
|
+
npx create-fhevm-example --example fhe-counter --output ./my-project --install
|
|
39
24
|
```
|
|
40
25
|
|
|
41
|
-
|
|
26
|
+
## CLI Options
|
|
42
27
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
28
|
+
| Option | Description |
|
|
29
|
+
|--------|-------------|
|
|
30
|
+
| `--example <name>` | Create a single example project |
|
|
31
|
+
| `--category <name>` | Create a category project |
|
|
32
|
+
| `--output <dir>` | Output directory |
|
|
33
|
+
| `--install` | Auto-install dependencies |
|
|
34
|
+
| `--test` | Auto-run tests |
|
|
35
|
+
| `--help` | Show help |
|
|
46
36
|
|
|
47
37
|
## Available Examples
|
|
48
38
|
|
|
49
|
-
|
|
50
|
-
- `encrypt-single-value` - FHE encryption mechanism
|
|
51
|
-
- `encrypt-multiple-values` - Multiple value encryption
|
|
52
|
-
- `user-decrypt-single-value` - User decryption mechanism
|
|
53
|
-
- `user-decrypt-multiple-values` - Multiple value decryption
|
|
54
|
-
- `public-decrypt-single-value` - Public decryption
|
|
55
|
-
- `public-decrypt-multiple-values` - Multiple public decryption
|
|
56
|
-
- `fhe-add` - Addition operations on encrypted values
|
|
57
|
-
- `fhe-if-then-else` - Conditional operations with FHE
|
|
58
|
-
- `fhe-arithmetic` - All arithmetic operations
|
|
59
|
-
- `fhe-comparison` - All comparison operations
|
|
60
|
-
- `fhe-access-control` - Access control patterns
|
|
61
|
-
- `fhe-input-proof` - Input proof validation
|
|
62
|
-
- `fhe-handles` - FHE handle lifecycle
|
|
63
|
-
- `fhe-anti-patterns` - Common mistakes and solutions
|
|
64
|
-
- `erc7984` - Confidential token standard
|
|
65
|
-
- `erc7984-erc20-wrapper` - ERC20 to ERC7984 wrapper
|
|
66
|
-
- `swap-erc7984-to-erc20` - Token swap example
|
|
67
|
-
- `swap-erc7984-to-erc7984` - Confidential token swap
|
|
68
|
-
- `vesting-wallet` - Token vesting example
|
|
69
|
-
- `blind-auction` - Encrypted blind auction
|
|
70
|
-
- `hidden-voting` - Encrypted voting system
|
|
39
|
+
**Basic**: `fhe-counter`, `encrypt-single-value`, `encrypt-multiple-values`, `user-decrypt-single-value`, `user-decrypt-multiple-values`, `public-decrypt-single-value`, `public-decrypt-multiple-values`
|
|
71
40
|
|
|
72
|
-
|
|
41
|
+
**FHE Operations**: `fhe-add`, `fhe-if-then-else`, `fhe-arithmetic`, `fhe-comparison`
|
|
73
42
|
|
|
74
|
-
- `
|
|
75
|
-
- `concepts` - Critical Concepts (4 contracts)
|
|
76
|
-
- `operations` - FHE Operations (4 contracts)
|
|
77
|
-
- `openzeppelin` - OpenZeppelin Confidential Contracts (5 contracts)
|
|
78
|
-
- `advanced` - Advanced Examples (2 contracts)
|
|
43
|
+
**Concepts**: `fhe-access-control`, `fhe-input-proof`, `fhe-handles`, `fhe-anti-patterns`
|
|
79
44
|
|
|
80
|
-
|
|
45
|
+
**OpenZeppelin**: `erc7984`, `erc7984-erc20-wrapper`, `swap-erc7984-to-erc20`, `swap-erc7984-to-erc7984`, `vesting-wallet`
|
|
81
46
|
|
|
82
|
-
-
|
|
83
|
-
- `--category <name>` - Create a category project
|
|
84
|
-
- `--output <dir>` - Output directory (default: `./<project-name>`)
|
|
85
|
-
- `--install` - Auto-install dependencies
|
|
86
|
-
- `--test` - Auto-run tests (requires `--install`)
|
|
87
|
-
- `--help`, `-h` - Show help message
|
|
47
|
+
**Advanced**: `blind-auction`, `hidden-voting`
|
|
88
48
|
|
|
89
|
-
##
|
|
49
|
+
## Available Categories
|
|
50
|
+
|
|
51
|
+
| Category | Description |
|
|
52
|
+
|----------|-------------|
|
|
53
|
+
| `basic` | Encryption, decryption, basic operations (9 contracts) |
|
|
54
|
+
| `concepts` | Access control, proofs, handles (4 contracts) |
|
|
55
|
+
| `operations` | Arithmetic, comparison operations (4 contracts) |
|
|
56
|
+
| `openzeppelin` | ERC7984, wrappers, swaps (5 contracts) |
|
|
57
|
+
| `advanced` | Blind auction, voting (2 contracts) |
|
|
90
58
|
|
|
91
|
-
|
|
59
|
+
## What Gets Created
|
|
92
60
|
|
|
93
61
|
- ✅ Hardhat configuration for FHEVM
|
|
94
|
-
- ✅ Smart contracts
|
|
95
|
-
- ✅ Comprehensive test files
|
|
62
|
+
- ✅ Smart contracts and test files
|
|
96
63
|
- ✅ Deployment scripts
|
|
97
|
-
- ✅
|
|
98
|
-
- ✅ All necessary dependencies configured
|
|
64
|
+
- ✅ All dependencies configured
|
|
99
65
|
|
|
100
66
|
## Requirements
|
|
101
67
|
|
|
102
68
|
- Node.js >= 20
|
|
103
|
-
- Git
|
|
104
|
-
|
|
105
|
-
## Configuration
|
|
106
|
-
|
|
107
|
-
### Repository Settings
|
|
69
|
+
- Git
|
|
108
70
|
|
|
109
|
-
|
|
71
|
+
---
|
|
110
72
|
|
|
111
|
-
|
|
112
|
-
export const REPO_URL = "https://github.com/NecipAkgz/fhevm-example-factory";
|
|
113
|
-
export const REPO_BRANCH = "main";
|
|
114
|
-
export const TEMPLATE_SUBMODULE_PATH = "fhevm-hardhat-template";
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
**Important**: If you fork this repository or want to use a different source:
|
|
118
|
-
|
|
119
|
-
1. Update `REPO_URL` to your repository URL
|
|
120
|
-
2. Ensure the repository has the same structure (contracts, test, fhevm-hardhat-template submodule)
|
|
121
|
-
3. Rebuild the package: `npm run build`
|
|
73
|
+
## Developer Only
|
|
122
74
|
|
|
123
|
-
|
|
75
|
+
>This section is for contributors and maintainers of the package.
|
|
124
76
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
### 1. Add Example Configuration
|
|
128
|
-
|
|
129
|
-
Edit [`src/config.ts`](./src/config.ts) and add your example to the `EXAMPLES` object:
|
|
77
|
+
### Configuration
|
|
130
78
|
|
|
131
|
-
|
|
132
|
-
export const EXAMPLES: Record<string, ExampleConfig> = {
|
|
133
|
-
// ... existing examples
|
|
134
|
-
"my-new-example": {
|
|
135
|
-
contract: "contracts/path/to/MyContract.sol",
|
|
136
|
-
test: "test/path/to/MyContract.ts",
|
|
137
|
-
description: "Description of what this example demonstrates",
|
|
138
|
-
category: "Basic", // or "Concepts", "Operations", "OpenZeppelin", "Advanced"
|
|
139
|
-
title: "My New Example",
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
```
|
|
79
|
+
The CLI uses a configuration file that defines all available examples and categories. This file is **auto-generated** from the main repository.
|
|
143
80
|
|
|
144
|
-
|
|
81
|
+
**Source of Truth**: [`scripts/shared/config.ts`](https://github.com/NecipAkgz/fhevm-example-factory/blob/main/scripts/shared/config.ts)
|
|
82
|
+
**Generated File**: `src/config.ts` (do not edit manually)
|
|
145
83
|
|
|
146
|
-
|
|
84
|
+
To customize the repository URL or branch:
|
|
147
85
|
|
|
148
86
|
```typescript
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
description: "...",
|
|
153
|
-
contracts: [
|
|
154
|
-
// ... existing contracts
|
|
155
|
-
{
|
|
156
|
-
sol: "contracts/path/to/MyContract.sol",
|
|
157
|
-
test: "test/path/to/MyContract.ts",
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
},
|
|
161
|
-
};
|
|
87
|
+
// In src/config.ts (after sync)
|
|
88
|
+
export const REPO_URL = "https://github.com/YourUsername/your-repo";
|
|
89
|
+
export const REPO_BRANCH = "main";
|
|
162
90
|
```
|
|
163
91
|
|
|
164
|
-
###
|
|
165
|
-
|
|
166
|
-
Make sure the contract and test files exist in your repository at the specified paths:
|
|
92
|
+
### Adding New Examples
|
|
167
93
|
|
|
168
|
-
|
|
169
|
-
- `test/path/to/MyContract.ts`
|
|
94
|
+
To add a new example to the CLI:
|
|
170
95
|
|
|
171
|
-
|
|
96
|
+
1. **Edit the source config** in the main repository:
|
|
97
|
+
```bash
|
|
98
|
+
# Edit scripts/shared/config.ts
|
|
99
|
+
# Add your example to EXAMPLES and CATEGORIES
|
|
100
|
+
```
|
|
172
101
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
102
|
+
2. **Publish**:
|
|
103
|
+
```bash
|
|
104
|
+
npm version patch # Increments version
|
|
105
|
+
npm publish # Auto-runs: sync:config → build → publish
|
|
106
|
+
```
|
|
177
107
|
|
|
178
|
-
|
|
108
|
+
The `prepublishOnly` hook automatically:
|
|
109
|
+
- Syncs config from `scripts/shared/config.ts` to `src/config.ts`
|
|
110
|
+
- Builds TypeScript to `dist/`
|
|
111
|
+
- Publishes to NPM
|
|
179
112
|
|
|
180
|
-
### Local Development
|
|
113
|
+
### Local Development
|
|
181
114
|
|
|
182
115
|
```bash
|
|
183
|
-
# Clone
|
|
116
|
+
# Clone and setup
|
|
184
117
|
git clone https://github.com/NecipAkgz/fhevm-example-factory.git
|
|
185
118
|
cd fhevm-example-factory/packages/create-fhevm-example
|
|
186
|
-
|
|
187
|
-
# Install dependencies
|
|
188
119
|
npm install
|
|
189
120
|
|
|
190
|
-
# Build
|
|
121
|
+
# Build
|
|
191
122
|
npm run build
|
|
192
123
|
|
|
193
|
-
#
|
|
124
|
+
# Test locally
|
|
194
125
|
npm link
|
|
195
|
-
|
|
196
|
-
# Now you can use it globally
|
|
197
126
|
create-fhevm-example --help
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### Making Changes
|
|
201
127
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
3. **Test locally**: `create-fhevm-example --example fhe-counter --output /tmp/test`
|
|
205
|
-
|
|
206
|
-
### File Structure
|
|
207
|
-
|
|
208
|
-
```
|
|
209
|
-
src/
|
|
210
|
-
├── index.ts # Main CLI entry point (interactive + direct modes)
|
|
211
|
-
├── config.ts # Examples and categories configuration
|
|
212
|
-
└── utils.ts # Helper functions (GitHub download, file ops, README generation)
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
## Publishing to NPM
|
|
216
|
-
|
|
217
|
-
### Pre-publish Checklist
|
|
218
|
-
|
|
219
|
-
- [ ] Update version in `package.json`
|
|
220
|
-
- [ ] Test locally with `npm link`
|
|
221
|
-
- [ ] Verify all examples work
|
|
222
|
-
- [ ] Update README if needed
|
|
223
|
-
- [ ] Commit all changes
|
|
224
|
-
|
|
225
|
-
### Publish Steps
|
|
226
|
-
|
|
227
|
-
```bash
|
|
228
|
-
# Dry run to see what will be published
|
|
229
|
-
npm publish --dry-run
|
|
230
|
-
|
|
231
|
-
# Check package contents
|
|
232
|
-
npm pack
|
|
233
|
-
tar -xvzf create-fhevm-example-*.tgz
|
|
234
|
-
rm -rf package create-fhevm-example-*.tgz
|
|
235
|
-
|
|
236
|
-
# Publish to NPM
|
|
237
|
-
npm publish
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
### Post-publish Verification
|
|
241
|
-
|
|
242
|
-
```bash
|
|
243
|
-
# Test from NPM in a clean directory
|
|
244
|
-
cd /tmp
|
|
245
|
-
npx create-fhevm-example@latest --example fhe-counter
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
## Troubleshooting
|
|
249
|
-
|
|
250
|
-
### "Repository not found" Error
|
|
251
|
-
|
|
252
|
-
**Problem**: Git clone fails with repository not found.
|
|
253
|
-
|
|
254
|
-
**Solution**: Check `REPO_URL` in `src/config.ts`. Make sure:
|
|
255
|
-
|
|
256
|
-
- The repository exists and is public
|
|
257
|
-
- The URL is correct (without trailing slash)
|
|
258
|
-
- You have internet connection
|
|
259
|
-
|
|
260
|
-
### "Failed to download" Error
|
|
261
|
-
|
|
262
|
-
**Problem**: File download from GitHub fails.
|
|
263
|
-
|
|
264
|
-
**Solution**:
|
|
265
|
-
|
|
266
|
-
- Verify the file paths in `config.ts` match actual files in the repository
|
|
267
|
-
- Check that `REPO_BRANCH` is correct (usually "main" or "master")
|
|
268
|
-
- Ensure the repository is public or you have access
|
|
269
|
-
|
|
270
|
-
### Build Errors
|
|
271
|
-
|
|
272
|
-
**Problem**: TypeScript compilation fails.
|
|
273
|
-
|
|
274
|
-
**Solution**:
|
|
275
|
-
|
|
276
|
-
```bash
|
|
277
|
-
# Clean and rebuild
|
|
278
|
-
rm -rf dist
|
|
279
|
-
npm run build
|
|
128
|
+
# Unlink when done
|
|
129
|
+
npm unlink -g create-fhevm-example
|
|
280
130
|
```
|
|
281
131
|
|
|
282
|
-
###
|
|
283
|
-
|
|
284
|
-
**Problem**: New example doesn't appear in the CLI.
|
|
285
|
-
|
|
286
|
-
**Solution**:
|
|
287
|
-
|
|
288
|
-
- Make sure you added it to `EXAMPLES` in `config.ts`
|
|
289
|
-
- Rebuild: `npm run build`
|
|
290
|
-
- If using `npm link`, unlink and relink:
|
|
291
|
-
```bash
|
|
292
|
-
npm unlink -g create-fhevm-example
|
|
293
|
-
npm link
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
## Maintenance
|
|
297
|
-
|
|
298
|
-
### Updating Template Repository
|
|
299
|
-
|
|
300
|
-
When the `fhevm-hardhat-template` submodule is updated:
|
|
301
|
-
|
|
302
|
-
1. No changes needed in this package - it clones fresh each time
|
|
303
|
-
2. Users will automatically get the latest template
|
|
304
|
-
|
|
305
|
-
### Syncing Examples
|
|
132
|
+
### Scripts
|
|
306
133
|
|
|
307
|
-
|
|
134
|
+
- `npm run build` - Compile TypeScript
|
|
135
|
+
- `npm run dev` - Watch mode
|
|
136
|
+
- `npm run sync:config` - Sync config from main repo
|
|
137
|
+
- `npm run prepublishOnly` - Auto-runs sync + build before publish
|
|
308
138
|
|
|
309
|
-
|
|
310
|
-
2. Increment version in `package.json`
|
|
311
|
-
3. Rebuild and publish: `npm run build && npm publish`
|
|
139
|
+
---
|
|
312
140
|
|
|
313
141
|
## Learn More
|
|
314
142
|
|
|
315
|
-
- [FHEVM Documentation](https://docs.zama.
|
|
143
|
+
- [FHEVM Documentation](https://docs.zama.org/protocol)
|
|
316
144
|
- [Example Repository](https://github.com/NecipAkgz/fhevm-example-factory)
|
|
317
145
|
- [Zama](https://www.zama.ai/)
|
|
318
146
|
|
package/dist/config.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* ⚠️ AUTO-GENERATED FILE - DO NOT EDIT MANUALLY ⚠️
|
|
3
3
|
*
|
|
4
|
-
* This
|
|
4
|
+
* This file is auto-generated from scripts/shared/config.ts
|
|
5
|
+
* Run 'npm run sync:config' to update it.
|
|
6
|
+
*
|
|
7
|
+
* Source: scripts/shared/config.ts
|
|
8
|
+
* Generated: 2025-12-09T16:46:12.589Z
|
|
5
9
|
*/
|
|
6
10
|
export interface ExampleConfig {
|
|
7
11
|
/** Path to the Solidity contract file */
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,SAAS,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClD;AAMD,eAAO,MAAM,QAAQ,uDAAuD,CAAC;AAC7E,eAAO,MAAM,WAAW,SAAS,CAAC;AAClC,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAMhE,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CA2JlD,CAAC;AAMF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CA+HrD,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* ⚠️ AUTO-GENERATED FILE - DO NOT EDIT MANUALLY ⚠️
|
|
3
3
|
*
|
|
4
|
-
* This
|
|
4
|
+
* This file is auto-generated from scripts/shared/config.ts
|
|
5
|
+
* Run 'npm run sync:config' to update it.
|
|
6
|
+
*
|
|
7
|
+
* Source: scripts/shared/config.ts
|
|
8
|
+
* Generated: 2025-12-09T16:46:12.589Z
|
|
5
9
|
*/
|
|
6
10
|
// =============================================================================
|
|
7
11
|
// GitHub Repository Configuration
|
|
@@ -14,289 +18,289 @@ export const TEMPLATE_SUBMODULE_PATH = "fhevm-hardhat-template";
|
|
|
14
18
|
// =============================================================================
|
|
15
19
|
export const EXAMPLES = {
|
|
16
20
|
"fhe-counter": {
|
|
17
|
-
contract: "contracts/basic/FHECounter.sol",
|
|
18
|
-
test: "test/basic/FHECounter.ts",
|
|
19
|
-
description: "Confidential counter implementation using FHEVM, compared with a standard counter to highlight encryption benefits.",
|
|
20
|
-
category: "Basic",
|
|
21
|
-
title: "FHE Counter"
|
|
21
|
+
"contract": "contracts/basic/FHECounter.sol",
|
|
22
|
+
"test": "test/basic/FHECounter.ts",
|
|
23
|
+
"description": "Confidential counter implementation using FHEVM, compared with a standard counter to highlight encryption benefits.",
|
|
24
|
+
"category": "Basic",
|
|
25
|
+
"title": "FHE Counter"
|
|
22
26
|
},
|
|
23
27
|
"encrypt-single-value": {
|
|
24
|
-
contract: "contracts/basic/encrypt/EncryptSingleValue.sol",
|
|
25
|
-
test: "test/basic/encrypt/EncryptSingleValue.ts",
|
|
26
|
-
description: "FHE encryption mechanism with single values, including common pitfalls and best practices for developers.",
|
|
27
|
-
category: "Basic - Encryption",
|
|
28
|
-
title: "Encrypt Single Value"
|
|
28
|
+
"contract": "contracts/basic/encrypt/EncryptSingleValue.sol",
|
|
29
|
+
"test": "test/basic/encrypt/EncryptSingleValue.ts",
|
|
30
|
+
"description": "FHE encryption mechanism with single values, including common pitfalls and best practices for developers.",
|
|
31
|
+
"category": "Basic - Encryption",
|
|
32
|
+
"title": "Encrypt Single Value"
|
|
29
33
|
},
|
|
30
34
|
"encrypt-multiple-values": {
|
|
31
|
-
contract: "contracts/basic/encrypt/EncryptMultipleValues.sol",
|
|
32
|
-
test: "test/basic/encrypt/EncryptMultipleValues.ts",
|
|
33
|
-
description: "Encrypting and handling multiple values in a single transaction efficiently.",
|
|
34
|
-
category: "Basic - Encryption",
|
|
35
|
-
title: "Encrypt Multiple Values"
|
|
35
|
+
"contract": "contracts/basic/encrypt/EncryptMultipleValues.sol",
|
|
36
|
+
"test": "test/basic/encrypt/EncryptMultipleValues.ts",
|
|
37
|
+
"description": "Encrypting and handling multiple values in a single transaction efficiently.",
|
|
38
|
+
"category": "Basic - Encryption",
|
|
39
|
+
"title": "Encrypt Multiple Values"
|
|
36
40
|
},
|
|
37
41
|
"user-decrypt-single-value": {
|
|
38
|
-
contract: "contracts/basic/decrypt/UserDecryptSingleValue.sol",
|
|
39
|
-
test: "test/basic/decrypt/UserDecryptSingleValue.ts",
|
|
40
|
-
description: "FHE user decryption mechanism for single values, with common pitfalls and correct implementation patterns.",
|
|
41
|
-
category: "Basic - Decryption",
|
|
42
|
-
title: "User Decrypt Single Value"
|
|
42
|
+
"contract": "contracts/basic/decrypt/UserDecryptSingleValue.sol",
|
|
43
|
+
"test": "test/basic/decrypt/UserDecryptSingleValue.ts",
|
|
44
|
+
"description": "FHE user decryption mechanism for single values, with common pitfalls and correct implementation patterns.",
|
|
45
|
+
"category": "Basic - Decryption",
|
|
46
|
+
"title": "User Decrypt Single Value"
|
|
43
47
|
},
|
|
44
48
|
"user-decrypt-multiple-values": {
|
|
45
|
-
contract: "contracts/basic/decrypt/UserDecryptMultipleValues.sol",
|
|
46
|
-
test: "test/basic/decrypt/UserDecryptMultipleValues.ts",
|
|
47
|
-
description: "Decrypting multiple encrypted values for a user in a single operation.",
|
|
48
|
-
category: "Basic - Decryption",
|
|
49
|
-
title: "User Decrypt Multiple Values"
|
|
49
|
+
"contract": "contracts/basic/decrypt/UserDecryptMultipleValues.sol",
|
|
50
|
+
"test": "test/basic/decrypt/UserDecryptMultipleValues.ts",
|
|
51
|
+
"description": "Decrypting multiple encrypted values for a user in a single operation.",
|
|
52
|
+
"category": "Basic - Decryption",
|
|
53
|
+
"title": "User Decrypt Multiple Values"
|
|
50
54
|
},
|
|
51
55
|
"public-decrypt-single-value": {
|
|
52
|
-
contract: "contracts/basic/decrypt/PublicDecryptSingleValue.sol",
|
|
53
|
-
test: "test/basic/decrypt/PublicDecryptSingleValue.ts",
|
|
54
|
-
description: "Publicly decrypting a single encrypted value on-chain for transparent results.",
|
|
55
|
-
category: "Basic - Decryption",
|
|
56
|
-
title: "Public Decrypt Single Value"
|
|
56
|
+
"contract": "contracts/basic/decrypt/PublicDecryptSingleValue.sol",
|
|
57
|
+
"test": "test/basic/decrypt/PublicDecryptSingleValue.ts",
|
|
58
|
+
"description": "Publicly decrypting a single encrypted value on-chain for transparent results.",
|
|
59
|
+
"category": "Basic - Decryption",
|
|
60
|
+
"title": "Public Decrypt Single Value"
|
|
57
61
|
},
|
|
58
62
|
"public-decrypt-multiple-values": {
|
|
59
|
-
contract: "contracts/basic/decrypt/PublicDecryptMultipleValues.sol",
|
|
60
|
-
test: "test/basic/decrypt/PublicDecryptMultipleValues.ts",
|
|
61
|
-
description: "Publicly decrypting multiple encrypted values in a single transaction for batch transparency.",
|
|
62
|
-
category: "Basic - Decryption",
|
|
63
|
-
title: "Public Decrypt Multiple Values"
|
|
63
|
+
"contract": "contracts/basic/decrypt/PublicDecryptMultipleValues.sol",
|
|
64
|
+
"test": "test/basic/decrypt/PublicDecryptMultipleValues.ts",
|
|
65
|
+
"description": "Publicly decrypting multiple encrypted values in a single transaction for batch transparency.",
|
|
66
|
+
"category": "Basic - Decryption",
|
|
67
|
+
"title": "Public Decrypt Multiple Values"
|
|
64
68
|
},
|
|
65
69
|
"fhe-add": {
|
|
66
|
-
contract: "contracts/basic/fhe-operations/FHEAdd.sol",
|
|
67
|
-
test: "test/basic/fhe-operations/FHEAdd.ts",
|
|
68
|
-
description: "Addition operations on encrypted values using FHE.add() for homomorphic computation.",
|
|
69
|
-
category: "FHE Operations",
|
|
70
|
-
title: "FHE Add Operation"
|
|
70
|
+
"contract": "contracts/basic/fhe-operations/FHEAdd.sol",
|
|
71
|
+
"test": "test/basic/fhe-operations/FHEAdd.ts",
|
|
72
|
+
"description": "Addition operations on encrypted values using FHE.add() for homomorphic computation.",
|
|
73
|
+
"category": "FHE Operations",
|
|
74
|
+
"title": "FHE Add Operation"
|
|
71
75
|
},
|
|
72
76
|
"fhe-if-then-else": {
|
|
73
|
-
contract: "contracts/basic/fhe-operations/FHEIfThenElse.sol",
|
|
74
|
-
test: "test/basic/fhe-operations/FHEIfThenElse.ts",
|
|
75
|
-
description: "Conditional operations on encrypted values using FHE.select() for encrypted branching logic.",
|
|
76
|
-
category: "FHE Operations",
|
|
77
|
-
title: "FHE If-Then-Else"
|
|
77
|
+
"contract": "contracts/basic/fhe-operations/FHEIfThenElse.sol",
|
|
78
|
+
"test": "test/basic/fhe-operations/FHEIfThenElse.ts",
|
|
79
|
+
"description": "Conditional operations on encrypted values using FHE.select() for encrypted branching logic.",
|
|
80
|
+
"category": "FHE Operations",
|
|
81
|
+
"title": "FHE If-Then-Else"
|
|
78
82
|
},
|
|
79
83
|
"fhe-arithmetic": {
|
|
80
|
-
contract: "contracts/basic/fhe-operations/FHEArithmetic.sol",
|
|
81
|
-
test: "test/basic/fhe-operations/FHEArithmetic.ts",
|
|
82
|
-
description: "Comprehensive example demonstrating all FHE arithmetic operations: add, sub, mul, div, rem, min, max.",
|
|
83
|
-
category: "FHE Operations",
|
|
84
|
-
title: "FHE Arithmetic Operations"
|
|
84
|
+
"contract": "contracts/basic/fhe-operations/FHEArithmetic.sol",
|
|
85
|
+
"test": "test/basic/fhe-operations/FHEArithmetic.ts",
|
|
86
|
+
"description": "Comprehensive example demonstrating all FHE arithmetic operations: add, sub, mul, div, rem, min, max.",
|
|
87
|
+
"category": "FHE Operations",
|
|
88
|
+
"title": "FHE Arithmetic Operations"
|
|
85
89
|
},
|
|
86
90
|
"fhe-comparison": {
|
|
87
|
-
contract: "contracts/basic/fhe-operations/FHEComparison.sol",
|
|
88
|
-
test: "test/basic/fhe-operations/FHEComparison.ts",
|
|
89
|
-
description: "Demonstrates all FHE comparison operations: eq, ne, gt, lt, ge, le, and the select function for encrypted conditionals.",
|
|
90
|
-
category: "FHE Operations",
|
|
91
|
-
title: "FHE Comparison Operations"
|
|
91
|
+
"contract": "contracts/basic/fhe-operations/FHEComparison.sol",
|
|
92
|
+
"test": "test/basic/fhe-operations/FHEComparison.ts",
|
|
93
|
+
"description": "Demonstrates all FHE comparison operations: eq, ne, gt, lt, ge, le, and the select function for encrypted conditionals.",
|
|
94
|
+
"category": "FHE Operations",
|
|
95
|
+
"title": "FHE Comparison Operations"
|
|
92
96
|
},
|
|
93
97
|
"fhe-access-control": {
|
|
94
|
-
contract: "contracts/concepts/FHEAccessControl.sol",
|
|
95
|
-
test: "test/concepts/FHEAccessControl.ts",
|
|
96
|
-
description: "Critical access control patterns in FHEVM: FHE.allow, FHE.allowThis, FHE.allowTransient. Includes common mistakes and correct implementations.",
|
|
97
|
-
category: "Concepts",
|
|
98
|
-
title: "FHE Access Control"
|
|
98
|
+
"contract": "contracts/concepts/FHEAccessControl.sol",
|
|
99
|
+
"test": "test/concepts/FHEAccessControl.ts",
|
|
100
|
+
"description": "Critical access control patterns in FHEVM: FHE.allow, FHE.allowThis, FHE.allowTransient. Includes common mistakes and correct implementations.",
|
|
101
|
+
"category": "Concepts",
|
|
102
|
+
"title": "FHE Access Control"
|
|
99
103
|
},
|
|
100
104
|
"fhe-input-proof": {
|
|
101
|
-
contract: "contracts/concepts/FHEInputProof.sol",
|
|
102
|
-
test: "test/concepts/FHEInputProof.ts",
|
|
103
|
-
description: "Explains input proof validation in FHEVM: what proofs are, why they are needed, and how to use them correctly with single and batched inputs.",
|
|
104
|
-
category: "Concepts",
|
|
105
|
-
title: "FHE Input Proofs"
|
|
105
|
+
"contract": "contracts/concepts/FHEInputProof.sol",
|
|
106
|
+
"test": "test/concepts/FHEInputProof.ts",
|
|
107
|
+
"description": "Explains input proof validation in FHEVM: what proofs are, why they are needed, and how to use them correctly with single and batched inputs.",
|
|
108
|
+
"category": "Concepts",
|
|
109
|
+
"title": "FHE Input Proofs"
|
|
106
110
|
},
|
|
107
111
|
"fhe-handles": {
|
|
108
|
-
contract: "contracts/concepts/FHEHandles.sol",
|
|
109
|
-
test: "test/concepts/FHEHandles.ts",
|
|
110
|
-
description: "Understanding FHE handles: creation, computation, immutability, and symbolic execution in mock mode.",
|
|
111
|
-
category: "Concepts",
|
|
112
|
-
title: "FHE Handles & Lifecycle"
|
|
112
|
+
"contract": "contracts/concepts/FHEHandles.sol",
|
|
113
|
+
"test": "test/concepts/FHEHandles.ts",
|
|
114
|
+
"description": "Understanding FHE handles: creation, computation, immutability, and symbolic execution in mock mode.",
|
|
115
|
+
"category": "Concepts",
|
|
116
|
+
"title": "FHE Handles & Lifecycle"
|
|
113
117
|
},
|
|
114
118
|
"fhe-anti-patterns": {
|
|
115
|
-
contract: "contracts/concepts/FHEAntiPatterns.sol",
|
|
116
|
-
test: "test/concepts/FHEAntiPatterns.ts",
|
|
117
|
-
description: "Common FHE mistakes and their correct alternatives. Covers: branching, permissions, require/revert, re-encryption, loops, noise, and deprecated APIs.",
|
|
118
|
-
category: "Concepts",
|
|
119
|
-
title: "FHE Anti-Patterns"
|
|
119
|
+
"contract": "contracts/concepts/FHEAntiPatterns.sol",
|
|
120
|
+
"test": "test/concepts/FHEAntiPatterns.ts",
|
|
121
|
+
"description": "Common FHE mistakes and their correct alternatives. Covers: branching, permissions, require/revert, re-encryption, loops, noise, and deprecated APIs.",
|
|
122
|
+
"category": "Concepts",
|
|
123
|
+
"title": "FHE Anti-Patterns"
|
|
120
124
|
},
|
|
121
|
-
erc7984: {
|
|
122
|
-
contract: "contracts/openzeppelin/ERC7984.sol",
|
|
123
|
-
test: "test/openzeppelin/ERC7984.ts",
|
|
124
|
-
description: "Confidential token (ERC7984) with mint/burn functionality using OpenZeppelin's library powered by ZAMA's FHEVM.",
|
|
125
|
-
category: "OpenZeppelin",
|
|
126
|
-
title: "ERC7984 Tutorial"
|
|
125
|
+
"erc7984": {
|
|
126
|
+
"contract": "contracts/openzeppelin/ERC7984.sol",
|
|
127
|
+
"test": "test/openzeppelin/ERC7984.ts",
|
|
128
|
+
"description": "Confidential token (ERC7984) with mint/burn functionality using OpenZeppelin's library powered by ZAMA's FHEVM.",
|
|
129
|
+
"category": "OpenZeppelin",
|
|
130
|
+
"title": "ERC7984 Tutorial"
|
|
127
131
|
},
|
|
128
132
|
"erc7984-erc20-wrapper": {
|
|
129
|
-
contract: "contracts/openzeppelin/ERC7984ERC20Wrapper.sol",
|
|
130
|
-
test: "test/openzeppelin/ERC7984ERC20Wrapper.ts",
|
|
131
|
-
description: "Wrapping standard ERC20 tokens into confidential ERC7984 tokens to enable privacy for any existing ERC20.",
|
|
132
|
-
category: "OpenZeppelin",
|
|
133
|
-
title: "ERC7984 to ERC20 Wrapper"
|
|
133
|
+
"contract": "contracts/openzeppelin/ERC7984ERC20Wrapper.sol",
|
|
134
|
+
"test": "test/openzeppelin/ERC7984ERC20Wrapper.ts",
|
|
135
|
+
"description": "Wrapping standard ERC20 tokens into confidential ERC7984 tokens to enable privacy for any existing ERC20.",
|
|
136
|
+
"category": "OpenZeppelin",
|
|
137
|
+
"title": "ERC7984 to ERC20 Wrapper"
|
|
134
138
|
},
|
|
135
139
|
"swap-erc7984-to-erc20": {
|
|
136
|
-
contract: "contracts/openzeppelin/SwapERC7984ToERC20.sol",
|
|
137
|
-
test: "test/openzeppelin/SwapERC7984ToERC20.ts",
|
|
138
|
-
description: "Swapping between confidential ERC7984 and ERC20 tokens using the new v0.9 decryption API (makePubliclyDecryptable + checkSignatures).",
|
|
139
|
-
category: "OpenZeppelin",
|
|
140
|
-
title: "Swap ERC7984 to ERC20"
|
|
140
|
+
"contract": "contracts/openzeppelin/SwapERC7984ToERC20.sol",
|
|
141
|
+
"test": "test/openzeppelin/SwapERC7984ToERC20.ts",
|
|
142
|
+
"description": "Swapping between confidential ERC7984 and ERC20 tokens using the new v0.9 decryption API (makePubliclyDecryptable + checkSignatures).",
|
|
143
|
+
"category": "OpenZeppelin",
|
|
144
|
+
"title": "Swap ERC7984 to ERC20"
|
|
141
145
|
},
|
|
142
146
|
"swap-erc7984-to-erc7984": {
|
|
143
|
-
contract: "contracts/openzeppelin/SwapERC7984ToERC7984.sol",
|
|
144
|
-
test: "test/openzeppelin/SwapERC7984ToERC7984.ts",
|
|
145
|
-
description: "Fully confidential atomic swap between two ERC7984 tokens where both input and output amounts remain encrypted.",
|
|
146
|
-
category: "OpenZeppelin",
|
|
147
|
-
title: "Swap ERC7984 to ERC7984"
|
|
147
|
+
"contract": "contracts/openzeppelin/SwapERC7984ToERC7984.sol",
|
|
148
|
+
"test": "test/openzeppelin/SwapERC7984ToERC7984.ts",
|
|
149
|
+
"description": "Fully confidential atomic swap between two ERC7984 tokens where both input and output amounts remain encrypted.",
|
|
150
|
+
"category": "OpenZeppelin",
|
|
151
|
+
"title": "Swap ERC7984 to ERC7984"
|
|
148
152
|
},
|
|
149
153
|
"vesting-wallet": {
|
|
150
|
-
contract: "contracts/openzeppelin/VestingWallet.sol",
|
|
151
|
-
test: "test/openzeppelin/VestingWallet.ts",
|
|
152
|
-
description: "Linear vesting wallet for ERC7984 tokens where vested amounts remain encrypted for privacy.",
|
|
153
|
-
category: "OpenZeppelin",
|
|
154
|
-
title: "Vesting Wallet"
|
|
154
|
+
"contract": "contracts/openzeppelin/VestingWallet.sol",
|
|
155
|
+
"test": "test/openzeppelin/VestingWallet.ts",
|
|
156
|
+
"description": "Linear vesting wallet for ERC7984 tokens where vested amounts remain encrypted for privacy.",
|
|
157
|
+
"category": "OpenZeppelin",
|
|
158
|
+
"title": "Vesting Wallet"
|
|
155
159
|
},
|
|
156
160
|
"blind-auction": {
|
|
157
|
-
contract: "contracts/advanced/BlindAuction.sol",
|
|
158
|
-
test: "test/advanced/BlindAuction.ts",
|
|
159
|
-
description: "Encrypted blind auction where bids remain confidential. Uses FHE.gt() and FHE.select() to find the winner without revealing losing bids.",
|
|
160
|
-
category: "Advanced",
|
|
161
|
-
title: "Blind Auction"
|
|
161
|
+
"contract": "contracts/advanced/BlindAuction.sol",
|
|
162
|
+
"test": "test/advanced/BlindAuction.ts",
|
|
163
|
+
"description": "Encrypted blind auction where bids remain confidential. Uses FHE.gt() and FHE.select() to find the winner without revealing losing bids. Only the winning price is decrypted.",
|
|
164
|
+
"category": "Advanced",
|
|
165
|
+
"title": "Blind Auction"
|
|
162
166
|
},
|
|
163
167
|
"hidden-voting": {
|
|
164
|
-
contract: "contracts/advanced/HiddenVoting.sol",
|
|
165
|
-
test: "test/advanced/HiddenVoting.ts",
|
|
166
|
-
description: "Encrypted voting mechanism with homomorphic tallying. Individual votes remain private forever while final counts are revealed.",
|
|
167
|
-
category: "Advanced",
|
|
168
|
-
title: "Hidden Voting"
|
|
169
|
-
}
|
|
168
|
+
"contract": "contracts/advanced/HiddenVoting.sol",
|
|
169
|
+
"test": "test/advanced/HiddenVoting.ts",
|
|
170
|
+
"description": "Encrypted voting mechanism with homomorphic tallying. Individual votes remain private forever while final counts are revealed using FHE.makePubliclyDecryptable().",
|
|
171
|
+
"category": "Advanced",
|
|
172
|
+
"title": "Hidden Voting"
|
|
173
|
+
}
|
|
170
174
|
};
|
|
171
175
|
// =============================================================================
|
|
172
176
|
// Category Configurations
|
|
173
177
|
// =============================================================================
|
|
174
178
|
export const CATEGORIES = {
|
|
175
|
-
basic: {
|
|
176
|
-
name: "Basic FHEVM Examples",
|
|
177
|
-
description: "Fundamental FHEVM operations including encryption, decryption, and basic FHE operations",
|
|
178
|
-
contracts: [
|
|
179
|
+
"basic": {
|
|
180
|
+
"name": "Basic FHEVM Examples",
|
|
181
|
+
"description": "Fundamental FHEVM operations including encryption, decryption, and basic FHE operations",
|
|
182
|
+
"contracts": [
|
|
179
183
|
{
|
|
180
|
-
sol: "contracts/basic/FHECounter.sol",
|
|
181
|
-
test: "test/basic/FHECounter.ts"
|
|
184
|
+
"sol": "contracts/basic/FHECounter.sol",
|
|
185
|
+
"test": "test/basic/FHECounter.ts"
|
|
182
186
|
},
|
|
183
187
|
{
|
|
184
|
-
sol: "contracts/basic/encrypt/EncryptSingleValue.sol",
|
|
185
|
-
test: "test/basic/encrypt/EncryptSingleValue.ts"
|
|
188
|
+
"sol": "contracts/basic/encrypt/EncryptSingleValue.sol",
|
|
189
|
+
"test": "test/basic/encrypt/EncryptSingleValue.ts"
|
|
186
190
|
},
|
|
187
191
|
{
|
|
188
|
-
sol: "contracts/basic/encrypt/EncryptMultipleValues.sol",
|
|
189
|
-
test: "test/basic/encrypt/EncryptMultipleValues.ts"
|
|
192
|
+
"sol": "contracts/basic/encrypt/EncryptMultipleValues.sol",
|
|
193
|
+
"test": "test/basic/encrypt/EncryptMultipleValues.ts"
|
|
190
194
|
},
|
|
191
195
|
{
|
|
192
|
-
sol: "contracts/basic/decrypt/UserDecryptSingleValue.sol",
|
|
193
|
-
test: "test/basic/decrypt/UserDecryptSingleValue.ts"
|
|
196
|
+
"sol": "contracts/basic/decrypt/UserDecryptSingleValue.sol",
|
|
197
|
+
"test": "test/basic/decrypt/UserDecryptSingleValue.ts"
|
|
194
198
|
},
|
|
195
199
|
{
|
|
196
|
-
sol: "contracts/basic/decrypt/UserDecryptMultipleValues.sol",
|
|
197
|
-
test: "test/basic/decrypt/UserDecryptMultipleValues.ts"
|
|
200
|
+
"sol": "contracts/basic/decrypt/UserDecryptMultipleValues.sol",
|
|
201
|
+
"test": "test/basic/decrypt/UserDecryptMultipleValues.ts"
|
|
198
202
|
},
|
|
199
203
|
{
|
|
200
|
-
sol: "contracts/basic/decrypt/PublicDecryptSingleValue.sol",
|
|
201
|
-
test: "test/basic/decrypt/PublicDecryptSingleValue.ts"
|
|
204
|
+
"sol": "contracts/basic/decrypt/PublicDecryptSingleValue.sol",
|
|
205
|
+
"test": "test/basic/decrypt/PublicDecryptSingleValue.ts"
|
|
202
206
|
},
|
|
203
207
|
{
|
|
204
|
-
sol: "contracts/basic/decrypt/PublicDecryptMultipleValues.sol",
|
|
205
|
-
test: "test/basic/decrypt/PublicDecryptMultipleValues.ts"
|
|
208
|
+
"sol": "contracts/basic/decrypt/PublicDecryptMultipleValues.sol",
|
|
209
|
+
"test": "test/basic/decrypt/PublicDecryptMultipleValues.ts"
|
|
206
210
|
},
|
|
207
211
|
{
|
|
208
|
-
sol: "contracts/basic/fhe-operations/FHEAdd.sol",
|
|
209
|
-
test: "test/basic/fhe-operations/FHEAdd.ts"
|
|
212
|
+
"sol": "contracts/basic/fhe-operations/FHEAdd.sol",
|
|
213
|
+
"test": "test/basic/fhe-operations/FHEAdd.ts"
|
|
210
214
|
},
|
|
211
215
|
{
|
|
212
|
-
sol: "contracts/basic/fhe-operations/FHEIfThenElse.sol",
|
|
213
|
-
test: "test/basic/fhe-operations/FHEIfThenElse.ts"
|
|
214
|
-
}
|
|
215
|
-
]
|
|
216
|
+
"sol": "contracts/basic/fhe-operations/FHEIfThenElse.sol",
|
|
217
|
+
"test": "test/basic/fhe-operations/FHEIfThenElse.ts"
|
|
218
|
+
}
|
|
219
|
+
]
|
|
216
220
|
},
|
|
217
|
-
concepts: {
|
|
218
|
-
name: "Critical Concepts",
|
|
219
|
-
description: "Access control, input proofs, handles, and anti-patterns",
|
|
220
|
-
contracts: [
|
|
221
|
+
"concepts": {
|
|
222
|
+
"name": "Critical Concepts",
|
|
223
|
+
"description": "Access control, input proofs, handles, and anti-patterns",
|
|
224
|
+
"contracts": [
|
|
221
225
|
{
|
|
222
|
-
sol: "contracts/concepts/FHEAccessControl.sol",
|
|
223
|
-
test: "test/concepts/FHEAccessControl.ts"
|
|
226
|
+
"sol": "contracts/concepts/FHEAccessControl.sol",
|
|
227
|
+
"test": "test/concepts/FHEAccessControl.ts"
|
|
224
228
|
},
|
|
225
229
|
{
|
|
226
|
-
sol: "contracts/concepts/FHEInputProof.sol",
|
|
227
|
-
test: "test/concepts/FHEInputProof.ts"
|
|
230
|
+
"sol": "contracts/concepts/FHEInputProof.sol",
|
|
231
|
+
"test": "test/concepts/FHEInputProof.ts"
|
|
228
232
|
},
|
|
229
233
|
{
|
|
230
|
-
sol: "contracts/concepts/FHEHandles.sol",
|
|
231
|
-
test: "test/concepts/FHEHandles.ts"
|
|
234
|
+
"sol": "contracts/concepts/FHEHandles.sol",
|
|
235
|
+
"test": "test/concepts/FHEHandles.ts"
|
|
232
236
|
},
|
|
233
237
|
{
|
|
234
|
-
sol: "contracts/concepts/FHEAntiPatterns.sol",
|
|
235
|
-
test: "test/concepts/FHEAntiPatterns.ts"
|
|
236
|
-
}
|
|
237
|
-
]
|
|
238
|
+
"sol": "contracts/concepts/FHEAntiPatterns.sol",
|
|
239
|
+
"test": "test/concepts/FHEAntiPatterns.ts"
|
|
240
|
+
}
|
|
241
|
+
]
|
|
238
242
|
},
|
|
239
|
-
operations: {
|
|
240
|
-
name: "FHE Operations",
|
|
241
|
-
description: "Arithmetic, comparison, and conditional operations",
|
|
242
|
-
contracts: [
|
|
243
|
+
"operations": {
|
|
244
|
+
"name": "FHE Operations",
|
|
245
|
+
"description": "Arithmetic, comparison, and conditional operations",
|
|
246
|
+
"contracts": [
|
|
243
247
|
{
|
|
244
|
-
sol: "contracts/basic/fhe-operations/FHEAdd.sol",
|
|
245
|
-
test: "test/basic/fhe-operations/FHEAdd.ts"
|
|
248
|
+
"sol": "contracts/basic/fhe-operations/FHEAdd.sol",
|
|
249
|
+
"test": "test/basic/fhe-operations/FHEAdd.ts"
|
|
246
250
|
},
|
|
247
251
|
{
|
|
248
|
-
sol: "contracts/basic/fhe-operations/FHEArithmetic.sol",
|
|
249
|
-
test: "test/basic/fhe-operations/FHEArithmetic.ts"
|
|
252
|
+
"sol": "contracts/basic/fhe-operations/FHEArithmetic.sol",
|
|
253
|
+
"test": "test/basic/fhe-operations/FHEArithmetic.ts"
|
|
250
254
|
},
|
|
251
255
|
{
|
|
252
|
-
sol: "contracts/basic/fhe-operations/FHEComparison.sol",
|
|
253
|
-
test: "test/basic/fhe-operations/FHEComparison.ts"
|
|
256
|
+
"sol": "contracts/basic/fhe-operations/FHEComparison.sol",
|
|
257
|
+
"test": "test/basic/fhe-operations/FHEComparison.ts"
|
|
254
258
|
},
|
|
255
259
|
{
|
|
256
|
-
sol: "contracts/basic/fhe-operations/FHEIfThenElse.sol",
|
|
257
|
-
test: "test/basic/fhe-operations/FHEIfThenElse.ts"
|
|
258
|
-
}
|
|
259
|
-
]
|
|
260
|
+
"sol": "contracts/basic/fhe-operations/FHEIfThenElse.sol",
|
|
261
|
+
"test": "test/basic/fhe-operations/FHEIfThenElse.ts"
|
|
262
|
+
}
|
|
263
|
+
]
|
|
260
264
|
},
|
|
261
|
-
openzeppelin: {
|
|
262
|
-
name: "OpenZeppelin Confidential Contracts",
|
|
263
|
-
description: "ERC7984 confidential token standard, wrappers, swaps, and vesting",
|
|
264
|
-
contracts: [
|
|
265
|
+
"openzeppelin": {
|
|
266
|
+
"name": "OpenZeppelin Confidential Contracts",
|
|
267
|
+
"description": "ERC7984 confidential token standard, wrappers, swaps, and vesting",
|
|
268
|
+
"contracts": [
|
|
265
269
|
{
|
|
266
|
-
sol: "contracts/openzeppelin/ERC7984.sol",
|
|
267
|
-
test: "test/openzeppelin/ERC7984.ts"
|
|
270
|
+
"sol": "contracts/openzeppelin/ERC7984.sol",
|
|
271
|
+
"test": "test/openzeppelin/ERC7984.ts"
|
|
268
272
|
},
|
|
269
273
|
{
|
|
270
|
-
sol: "contracts/openzeppelin/ERC7984ERC20Wrapper.sol",
|
|
271
|
-
test: "test/openzeppelin/ERC7984ERC20Wrapper.ts"
|
|
274
|
+
"sol": "contracts/openzeppelin/ERC7984ERC20Wrapper.sol",
|
|
275
|
+
"test": "test/openzeppelin/ERC7984ERC20Wrapper.ts"
|
|
272
276
|
},
|
|
273
277
|
{
|
|
274
|
-
sol: "contracts/openzeppelin/SwapERC7984ToERC20.sol",
|
|
275
|
-
test: "test/openzeppelin/SwapERC7984ToERC20.ts"
|
|
278
|
+
"sol": "contracts/openzeppelin/SwapERC7984ToERC20.sol",
|
|
279
|
+
"test": "test/openzeppelin/SwapERC7984ToERC20.ts"
|
|
276
280
|
},
|
|
277
281
|
{
|
|
278
|
-
sol: "contracts/openzeppelin/SwapERC7984ToERC7984.sol",
|
|
279
|
-
test: "test/openzeppelin/SwapERC7984ToERC7984.ts"
|
|
282
|
+
"sol": "contracts/openzeppelin/SwapERC7984ToERC7984.sol",
|
|
283
|
+
"test": "test/openzeppelin/SwapERC7984ToERC7984.ts"
|
|
280
284
|
},
|
|
281
285
|
{
|
|
282
|
-
sol: "contracts/openzeppelin/VestingWallet.sol",
|
|
283
|
-
test: "test/openzeppelin/VestingWallet.ts"
|
|
284
|
-
}
|
|
285
|
-
]
|
|
286
|
+
"sol": "contracts/openzeppelin/VestingWallet.sol",
|
|
287
|
+
"test": "test/openzeppelin/VestingWallet.ts"
|
|
288
|
+
}
|
|
289
|
+
]
|
|
286
290
|
},
|
|
287
|
-
advanced: {
|
|
288
|
-
name: "Advanced Examples",
|
|
289
|
-
description: "Complex FHE applications: blind auctions, encrypted voting systems",
|
|
290
|
-
contracts: [
|
|
291
|
+
"advanced": {
|
|
292
|
+
"name": "Advanced Examples",
|
|
293
|
+
"description": "Complex FHE applications: blind auctions, encrypted voting systems",
|
|
294
|
+
"contracts": [
|
|
291
295
|
{
|
|
292
|
-
sol: "contracts/advanced/BlindAuction.sol",
|
|
293
|
-
test: "test/advanced/BlindAuction.ts"
|
|
296
|
+
"sol": "contracts/advanced/BlindAuction.sol",
|
|
297
|
+
"test": "test/advanced/BlindAuction.ts"
|
|
294
298
|
},
|
|
295
299
|
{
|
|
296
|
-
sol: "contracts/advanced/HiddenVoting.sol",
|
|
297
|
-
test: "test/advanced/HiddenVoting.ts"
|
|
298
|
-
}
|
|
299
|
-
]
|
|
300
|
-
}
|
|
300
|
+
"sol": "contracts/advanced/HiddenVoting.sol",
|
|
301
|
+
"test": "test/advanced/HiddenVoting.ts"
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
301
305
|
};
|
|
302
306
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA4BH,gFAAgF;AAChF,kCAAkC;AAClC,gFAAgF;AAEhF,MAAM,CAAC,MAAM,QAAQ,GAAG,oDAAoD,CAAC;AAC7E,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC;AAClC,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAC;AAEhE,gFAAgF;AAChF,yBAAyB;AACzB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,QAAQ,GAAkC;IACrD,aAAa,EAAE;QACb,UAAU,EAAE,gCAAgC;QAC5C,MAAM,EAAE,0BAA0B;QAClC,aAAa,EAAE,qHAAqH;QACpI,UAAU,EAAE,OAAO;QACnB,OAAO,EAAE,aAAa;KACvB;IACD,sBAAsB,EAAE;QACtB,UAAU,EAAE,gDAAgD;QAC5D,MAAM,EAAE,0CAA0C;QAClD,aAAa,EAAE,2GAA2G;QAC1H,UAAU,EAAE,oBAAoB;QAChC,OAAO,EAAE,sBAAsB;KAChC;IACD,yBAAyB,EAAE;QACzB,UAAU,EAAE,mDAAmD;QAC/D,MAAM,EAAE,6CAA6C;QACrD,aAAa,EAAE,8EAA8E;QAC7F,UAAU,EAAE,oBAAoB;QAChC,OAAO,EAAE,yBAAyB;KACnC;IACD,2BAA2B,EAAE;QAC3B,UAAU,EAAE,oDAAoD;QACh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,aAAa,EAAE,oEAAoE;QACnF,WAAW,EAAE;YACX;gBACE,KAAK,EAAE,qCAAqC;gBAC5C,MAAM,EAAE,+BAA+B;aACxC;YACD;gBACE,KAAK,EAAE,qCAAqC;gBAC5C,MAAM,EAAE,+BAA+B;aACxC;SACF;KACF;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-fhevm-example",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Create FHEVM example projects with a single command",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "tsc",
|
|
14
14
|
"dev": "tsc --watch",
|
|
15
|
-
"
|
|
15
|
+
"sync:config": "cd ../.. && npm run sync:config",
|
|
16
|
+
"prepublishOnly": "npm run sync:config && npm run build"
|
|
16
17
|
},
|
|
17
18
|
"keywords": [
|
|
18
19
|
"fhevm",
|