Skip to content

FhenixProtocol/cofhe-contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cofhe-contracts NPM Package License: MIT

Solidity contracts for working with FHE smart contract on CoFHE.

Need help getting started? Check out the fhenix documentation!

These contracts are still under heavy constructions and will be changing frequently. Consider binding your contracts to a specific version, and keep an eye on the changelog

Install

npm install @fhenixprotocol/cofhe-contracts

Usage

Import FHE.sol or any of the helper contracts

import "@fhenixprotocol/cofhe-contracts/FHE.sol";

Example

pragma solidity ^0.8.20;

import {FHE, euint8, inEuint8} from "@fhenixprotocol/contracts/FHE.sol";

contract Example {
    
    euint8 _output;

    function setOutput(inEuint8 calldata _encryptedNumber) public  {
        _output = FHE.asEuint8(_encryptedNumber);
    }

    function getOutputEncrypted(bytes32 publicKey) public view returns (bytes memory) {
        return _output.seal(publicKey);
    }
}

License

This project is licensed under MIT.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published