You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/devdocs/FhenixJS/Sending-a-Transaction.md
+9-7
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ To send transactions with fhenix.js, we'll first establish a connection to the b
10
10
11
11
Here's a step-by-step explanation, using `ethers`, though other libraries like `web3`can also be used in a similar way. 
12
12
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.
14
14
15
15
1.**Import fhenixjs and ethers**
16
16
@@ -19,35 +19,37 @@ OUTDATED
19
19
:::
20
20
21
21
```javascript
22
-
import { FhenixClient } from'fhenixjs';
22
+
import { FhenixClient } from"fhenixjs";
23
23
import { BrowserProvider } from"ethers";
24
24
```
25
25
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.
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.
34
34
35
35
```javascript
36
-
constclient=newFhenixClient({provider});
36
+
constclient=newFhenixClient({provider});
37
37
```
38
38
39
39
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.
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)
5
5
6
-

6
+

7
7
8
8
#### Encryption
9
9
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
+
12
13
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\*
14
15
15
16
All output will be copied to your clipboard and a notification will pop telling you that the output was coppied.
16
17
@@ -19,4 +20,4 @@ All output will be copied to your clipboard and a notification will pop telling
19
20
You can only unseal data that was sealed using your wallet public encryption key.
20
21
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.
21
22
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.
Copy file name to clipboardExpand all lines: docs/devdocs/Writing Smart Contracts/Select.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -20,15 +20,15 @@ if (a.lt(b)) {
20
20
21
21
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.
22
22
23
-
To handle these conditionals, we use a concept called a "selector".
23
+
To handle these conditionals, we use a concept called a "selector".
24
24
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).
25
25
26
26
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.
27
27
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):
0 commit comments