Installation
Types
ebool: Encryptedbooleuint256: Encrypteduint256eaddress: Encryptedaddress
Math operations
All arithmetic operations return aneuint256.
All binary operations may use either an euint256 or a regular uint256 as the first or second argument, or two euint256s.
Bitwise operations work on both euint256 and ebool types, and may use either encrypted or plain values as arguments.
Comparison operations
Multiplexer
e.select(ebool, euint256, euint256) returns(euint256): Select between twoeuint256s based on aneboolconditione.select(ebool, ebool, ebool) returns(ebool): Select between twoebools based on aneboolconditione.select(ebool, eaddress, eaddress) returns(eaddress): Select between twoeaddresses based on aneboolcondition
Random Functions
All random functions require payment of the Inco fee.e.rand() returns(euint256): Generate a randomeuint256valuee.randBounded(uint256) returns(euint256): Generate a randomeuint256value bounded by auint256upper limite.randBounded(euint256) returns(euint256): Generate a randomeuint256value bounded by aneuint256upper limit
Inputs
e.asEuint256(uint256) returns(euint256): Convert auint256to aneuint256(trivial encrypt)e.asEaddress(address) returns(eaddress): Convert anaddressto aneaddress(trivial encrypt)e.newEuint256(bytes memory input) returns(euint256): Create a neweuint256from a ciphertexte.newEbool(bytes memory input) returns(ebool): Create a neweboolfrom a ciphertexte.newEaddress(bytes memory input) returns(eaddress): Create a neweaddressfrom a ciphertext
Type Casting
e.asEuint256(ebool) returns(euint256): Cast aneboolto aneuint256
Access control
e.allow(euint256, address): Allow a user to access aneuint256value permanentlye.allow(ebool, address): Allow a user to access aneboolvalue permanentlye.allow(eaddress, address): Allow a user to access aneaddressvalue permanentlye.allowThis(euint256): Allow the current contract to access aneuint256value permanentlye.allowThis(ebool): Allow the current contract to access aneboolvalue permanentlye.allowThis(eaddress): Allow the current contract to access aneaddressvalue permanentlye.reveal(euint256): Make aneuint256value publicly accessiblee.reveal(ebool): Make aneboolvalue publicly accessiblee.reveal(eaddress): Make aneaddressvalue publicly accessiblee.isAllowed(address, euint256) returns(bool): Check if a user is allowed to access aneuint256value