From b2bf7b5b8a945d18b1dafde92ef85cfa3bfa0530 Mon Sep 17 00:00:00 2001 From: Kyle Koshiyama <43145199+kkoshiya@users.noreply.github.com> Date: Sat, 1 Jun 2024 10:54:34 -0700 Subject: [PATCH] code display --- docs/tutorial/earlyWin.md | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/docs/tutorial/earlyWin.md b/docs/tutorial/earlyWin.md index 9921408a..baaacf07 100644 --- a/docs/tutorial/earlyWin.md +++ b/docs/tutorial/earlyWin.md @@ -7,7 +7,8 @@ displayed_sidebar: tutorialSidebar In this short guide we’ll encrypt plaintext to ciphertext using FHE, demonstrating how simple it is to enable confidentiality in your smart contracts with Fhenix. - ```solidity +- **Contract Example:** + ```Javascript pragma solidity ^0.8.17; import "@fhenixprotocol/contracts/FHE.sol"; @@ -41,19 +42,8 @@ In this short guide we’ll encrypt plaintext to ciphertext using FHE, demonstra First, FHE is imported directly into your contract with a single line of code. Next we establish two numbers or unsigned integers, withhowever the _cipherText number beingwill be encrypted. This means that it will not be publicly accessible from anyone other than the intended viewer. The standard _plaintext unit8 represents a number that is public for all to view. On line 11 we have a setter function that allows us to pass in a new encrypted number that will stay private. On line 21 we have a decrypt function that allows us to view the number that was written to state in the setCipherText function. As you can see there is no requirement for off-chain proof generation or storage. - ```solidity - import "@fhenixprotocol/contracts/FHE.sol"; - ``` -We are able to import the FHE precompiles directly into the smart contract with a single line of code. The power of FHE in one single line of copy pasta. - - ```solidity - function getSensitiveData(Permission calldata perm) public view onlySender(perm) returns (string memory) { - // Logic to return sensitive data - } + ```Javascript + import "@fhenixprotocol/contracts/FHE.sol"; + ``` - ```solidity - function getSensitiveData(Permission calldata perm) public view onlySender(perm) returns (string memory) { - // Logic to return sensitive data - } - ```