Skip to content

Commit edcca1f

Browse files
committed
chore(protocol-contracts): improve fhevm-cli with prettier and usage comments
1 parent e76934d commit edcca1f

File tree

6 files changed

+474
-103
lines changed

6 files changed

+474
-103
lines changed

protocol-contracts/fhevm-cli/README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ This CLI tool contains tools for common useful tasks needed to interact with FHE
44

55
# Initial setup
66

7-
Install dependencies via:
7+
Install dependencies via:
8+
89
```
910
npm i
1011
```
1112

1213
And enter all needed values in a `.env` file (see available variables in [`.env.example`](./.env.example)).
1314

14-
If you want to interact with Ethereum mainnet, do not forget to get an API key and set it via:
15+
If you want to interact with Ethereum mainnet, do not forget to get an API key and set it via:
1516

1617
```
1718
npx hardhat vars set ZAMA_FHEVM_API_KEY <your-api-key>
@@ -21,34 +22,34 @@ npx hardhat vars set ZAMA_FHEVM_API_KEY <your-api-key>
2122

2223
Before running this command, ensure you have filled needed environement variables values inside your `.env` file: i.e `PRIVATE_KEY` for the user's private key requesting the user decryption, as well as `MAINNET_RPC_URL` (for mainnet) or `TESTNET_RPC_URL` (for testnet).
2324

24-
To request a user decryption, use a command similar to this example:
25+
To request a user decryption, use a command similar to this example:
2526

2627
```
2728
npx hardhat task:userDecrypt --handle 0x980769a416dbe44044fac20626c9521085a3ba57acff00000000000000010500 --contract-address 0xb1A7026C28cB91604FB7B1669f060aB74A30c255 --encrypted-type euint64 --network mainnet
2829
```
2930

30-
Replace the `handle` flag value from previous command by a handle you are allowed for, and the `contract-address` value with a contract address which is also allowed for this handle. Make sure to use the correct value for `encrypted-type` (e.g `euint64`, `ebool` , `eaddress`, `euint8`, etc), and to chose correct `network`, ie `mainnet` or `testnet`.
31+
Replace the `handle` flag value from previous command by a handle you are allowed for, and the `contract-address` value with a contract address which is also allowed for this handle. Make sure to use the correct value for `encrypted-type` (e.g `euint64`, `ebool` , `eaddress`, `euint8`, etc), and to chose correct `network`, ie `mainnet` or `testnet`.
3132

3233
# Request an encryption
3334

3435
Before running this command, ensure you have filled needed environement variables values inside your `.env` file: i.e just `MAINNET_RPC_URL` (for mainnet) or `TESTNET_RPC_URL` (for testnet).
3536

36-
To request an input encryption, use a command similar to this example:
37+
To request an input encryption, use a command similar to this example:
3738

3839
```
3940
npx hardhat task:encryptInput --input-value 600000 --user-address 0x22162CEAac09F115797A2ca29C96119B8bf63666 --contract-address 0xb1A7026C28cB91604FB7B1669f060aB74A30c255 --encrypted-type euint64 --network mainnet
4041
```
4142

42-
Replace the `input-value` flag value from previous command by the custom value you want to encrypt, and the `user-address` and `contract-address` values with a user address and a contract address respectively, which are expected to get access to the encrypted value. Make sure to use the correct value for `encrypted-type` (e.g `euint64`, `ebool` , `eaddress`, `euint8`, etc), and to chose correct `network`, ie `mainnet` or `testnet`.
43+
Replace the `input-value` flag value from previous command by the custom value you want to encrypt, and the `user-address` and `contract-address` values with a user address and a contract address respectively, which are expected to get access to the encrypted value. Make sure to use the correct value for `encrypted-type` (e.g `euint64`, `ebool` , `eaddress`, `euint8`, etc), and to chose correct `network`, ie `mainnet` or `testnet`.
4344

4445
# Request a public decryption
4546

4647
Before running this command, ensure you have filled needed environement variables values inside your `.env` file: i.e just `MAINNET_RPC_URL` (for mainnet) or `TESTNET_RPC_URL` (for testnet).
4748

48-
To request a public decryption, use a command similar to this example:
49+
To request a public decryption, use a command similar to this example:
4950

5051
```
5152
npx hardhat task:publicDecrypt --handle 0xb5681d0dae644b3ef76aa161b78e61cca125e9aed6ff00000000000000010500 --network mainnet
5253
```
5354

54-
Replace the `handle` flag value from previous command by the handle you which to public decrypt, after making sure that this handle was made publicly decryptable onchain. Make sure to use the correct value for `network`, ie `mainnet` or `testnet`.
55+
Replace the `handle` flag value from previous command by the handle you which to public decrypt, after making sure that this handle was made publicly decryptable onchain. Make sure to use the correct value for `network`, ie `mainnet` or `testnet`.

0 commit comments

Comments
 (0)