Skip to content

Commit 2f137de

Browse files
committed
Fix all warnings and errors
1 parent 77b41e4 commit 2f137de

File tree

5 files changed

+1113
-1124
lines changed

5 files changed

+1113
-1124
lines changed

docs/devdocs/FhenixJS/Sending-a-Transaction.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ To send transactions with fhenix.js, we'll first establish a connection to the b
1010

1111
Here's a step-by-step explanation, using `ethers`, though other libraries like `web3`can also be used in a similar way. 
1212

13-
Let's assume we have a deployed ERC20 contract, only this one uses encrypted inputs and outputs (you can find the solidity code [here](../../examples/reference-dapps/encrypted-erc20/)). Let's see how we can transfer some of our tokens to another address, while keeping the amount hidden.
13+
Let's assume we have a deployed ERC20 contract, only this one uses encrypted inputs and outputs (you can find the solidity code [here](../Examples%20and%20References/Examples-fheDapps.md). Let's see how we can transfer some of our tokens to another address, while keeping the amount hidden.
1414

1515
1. **Import fhenixjs and ethers**
1616

@@ -19,35 +19,37 @@ OUTDATED
1919
:::
2020

2121
```javascript
22-
import { FhenixClient } from 'fhenixjs';
22+
import { FhenixClient } from "fhenixjs";
2323
import { BrowserProvider } from "ethers";
2424
```
2525

26-
2. **Define the Smart Contract Address and Provider:** The smart contract address is the Ethereum address of the deployed contract. `provider` allows you to interact with the Ethereum blockchain.
26+
2. **Define the Smart Contract Address and Provider:** The smart contract address is the Ethereum address of the deployed contract. `provider` allows you to interact with the Ethereum blockchain.
2727

2828
```javascript
29-
const CONTRACT_ADDRESS = '0x1c786b8ca49D932AFaDCEc00827352B503edf16c';
29+
const CONTRACT_ADDRESS = "0x1c786b8ca49D932AFaDCEc00827352B503edf16c";
3030
const provider = new BrowserProvider(window.ethereum);
3131
```
3232

3333
3. **Create a Client to Interact With Fhenix:** The constructor of FhenixClient is used to create an instance of the client with the given provider.
3434

3535
```javascript
36-
const client = new FhenixClient({provider});
36+
const client = new FhenixClient({ provider });
3737
```
3838

3939
4. **Create the Transfer Function:** The `transfer` function is used to send a transaction on the blockchain. It requires the recipient address and the amount to be sent as parameters.
4040

4141
```javascript
4242
const transfer = async (to, amount) => {
4343
// Create client
44-
const client = new FhenixClient({provider});
44+
const client = new FhenixClient({ provider });
4545

4646
// get contract
4747
const contract = await ethers.getContractAt(CONTRACT_NAME, CONTRACT_ADDRESS);
4848
const encryptedAmount = await client.encrypt(number, EncryptionTypes.uint32);
4949

50-
const response = await contract.connect(SENDER_ACCOUNT).transfer(address, encryptedAmount);
50+
const response = await contract
51+
.connect(SENDER_ACCOUNT)
52+
.transfer(address, encryptedAmount);
5153
return response;
5254
};
5355
```
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# 🎧 Fhenix Encryption UI
22

33
Fhenix encryption UI can be found in the following [link](https://encrypt.fhenix.zone/)
4-
This UI is useful for those who are not using remix or using remix without using the [plugin]("./Fhenix-Remix-Plugin.md")
4+
This UI is useful for those who are not using remix or using remix without using the [plugin](Fhenix-Remix-Plugin.md)
55

6-
![]("../../../../../static/img/encui.png")
6+
![](encui.png)
77

88
#### Encryption
99

10-
In order to encrypt a number you can simply write the number you want to encrypt instead of the "Enter a number" text.
11-
You can choouse what Euint* type you want as an output and evantually you can choose one of the two options:
10+
In order to encrypt a number you can simply write the number you want to encrypt instead of the "Enter a number" text.
11+
You can choouse what Euint\* type you want as an output and evantually you can choose one of the two options:
12+
1213
1. Encrypt (Plain) - Will output hex encoded bytes (`0x04000...`) that can be used as "bytes calldata" input or as the input for the remix plugin
13-
2. Encrypt (InEuint) - Will output hex encoded bytes in a square brackets (`[0x04000...]`) that can be used in remix (not with the plugin) for function that receive inEuint*
14+
2. Encrypt (InEuint) - Will output hex encoded bytes in a square brackets (`[0x04000...]`) that can be used in remix (not with the plugin) for function that receive inEuint\*
1415

1516
All output will be copied to your clipboard and a notification will pop telling you that the output was coppied.
1617

@@ -19,4 +20,4 @@ All output will be copied to your clipboard and a notification will pop telling
1920
You can only unseal data that was sealed using your wallet public encryption key.
2021
In order to get your wallets public encryption key you can click on "Get Public Key" that will use metamask in order to retreive the key. The key will be shown as a notification on which you can click in order to copy the value to your clipboard.
2122

22-
Decryption can be done by simply pasting the encrypted value instead of the "Enter sealed value" text and clicking on the Unseal button which will use metamask to decrypt the value.
23+
Decryption can be done by simply pasting the encrypted value instead of the "Enter sealed value" text and clicking on the Unseal button which will use metamask to decrypt the value.
File renamed without changes.

docs/devdocs/Writing Smart Contracts/Select.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ if (a.lt(b)) {
2020

2121
When writing Solidity contracts for our blockchain, you'll need to consider all possible branches of a conditional at the same time. It's somewhat akin to writing constant-time cryptographic code, where you want to avoid timing attacks that could leak information about secret data.
2222

23-
To handle these conditionals, we use a concept called a "selector".
23+
To handle these conditionals, we use a concept called a "selector".
2424
A selector is a function that takes in a control and two branches, and returns the result of the branch that corresponds to the condition. A selector is like a traffic signal that decides which traffic to let through based on the color of the light (control signal).
2525

2626
In Fhenix, we utilize this by calling the `select` function. It's a function that takes in a condition and two inputs, and returns the input that corresponds to the state of the condition. You can think of this like a ternary boolean conditional (`condition ? "yes" : "no"`), but for encrypted data.
2727

28-
Let's take a look at an example of `select` usage from a [Blind Auction Smart Contract](../../examples/reference-dapps/blind-auction/):
28+
Let's take a look at an example of `select` usage from a Blind Auction Smart Contract: TBD(ADD LINK):
2929

3030
```Javascript
31-
ebool isHigher = existingBid.lt(value);
31+
ebool isHigher = existingBid.lt(value);
3232
bids[msg.sender] = FHE.select(isHigher, value, existingBid);
3333
```
3434

0 commit comments

Comments
 (0)