Skip to content

Commit

Permalink
Update Permissions.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoshiya authored Apr 5, 2024
1 parent e6b9524 commit 431ec34
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/devdocs/Writing Smart Contracts/Permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,25 @@ The patient, after obtaining the appropriate signature using their private key,
In this example we are just showcasing the usage of permissions. `string` and `address` are still public data types and can be read directly from the chain!
:::

## Example Scenario 2

pragma solidity ^0.8.20;
import {FHE, euint8, inEuint8} from "@fhenixprotocol/contracts/FHE.sol";
contract Test {
euint8 _output;

function setOutput(inEuint8 calldata _encryptedNumber) public {
// convert inEuint8 type structure to euint8
_output = FHE.asEuint8(_encryptedNumber);
}

function getSealedOutput(bytes32 publicKey) public view returns (bytes memory) {
// Seal the output for a specific publicKey
return FHE.sealoutput(_output, publicKey);
}
}


## Notes

- Permissioned view functions only allow access upon successful signature verification, enhancing contract's data privacy.
Expand Down

0 comments on commit 431ec34

Please sign in to comment.