Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
Multichain Info
N/A
Latest 25 from a total of 274,052 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Deploy | 10026089 | 12 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9989767 | 18 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9989767 | 18 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9958399 | 23 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9893006 | 33 days ago | IN | 0 ETH | 0.00000071 | ||||
| Deploy | 9880082 | 35 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9873480 | 36 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9873351 | 36 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9864576 | 37 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9864576 | 37 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9856369 | 39 days ago | IN | 0 ETH | 0.00000071 | ||||
| Deploy | 9856369 | 39 days ago | IN | 0 ETH | 0.00000078 | ||||
| Deploy | 9856369 | 39 days ago | IN | 0 ETH | 0.00000075 | ||||
| Deploy | 9856369 | 39 days ago | IN | 0 ETH | 0.00000073 | ||||
| Deploy | 9856369 | 39 days ago | IN | 0 ETH | 0.00000071 | ||||
| Deploy | 9856367 | 39 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9856367 | 39 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9856367 | 39 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9856367 | 39 days ago | IN | 0 ETH | 0.00000071 | ||||
| Deploy | 9856367 | 39 days ago | IN | 0 ETH | 0.00000073 | ||||
| Deploy | 9844716 | 40 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9844716 | 40 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9844716 | 40 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9844716 | 40 days ago | IN | 0 ETH | 0.0000007 | ||||
| Deploy | 9844716 | 40 days ago | IN | 0 ETH | 0.0000007 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
To
|
Amount
|
||
|---|---|---|---|---|---|---|---|
| 0x60806040 | 10026089 | 12 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9989767 | 18 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9989767 | 18 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9958399 | 23 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9893006 | 33 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9880082 | 35 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9873480 | 36 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9873351 | 36 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9864576 | 37 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9864576 | 37 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9856369 | 39 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9856369 | 39 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9856369 | 39 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9856369 | 39 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9856369 | 39 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9856367 | 39 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9856367 | 39 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9856367 | 39 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9856367 | 39 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9856367 | 39 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9844716 | 40 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9844716 | 40 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9844716 | 40 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9844716 | 40 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 9844716 | 40 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Contract Name:
ContractFactory
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 800 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "./FHE.sol";
contract ContractFactory {
address[] public deployedCounters;
mapping(address => address[]) public userCounters;
event CounterDeployed(address indexed deployer, address counterAddress);
function deploy() external {
FHECounter newCounter = new FHECounter();
address newAddress = address(newCounter);
deployedCounters.push(newAddress);
userCounters[msg.sender].push(newAddress);
emit CounterDeployed(msg.sender, newAddress);
}
function getAllDeployedCounters() external view returns (address[] memory) {
return deployedCounters;
}
function getLastDeployedCounter() external view returns (address) {
require(deployedCounters.length > 0, "No counters deployed yet");
return deployedCounters[deployedCounters.length - 1];
}
function getLastCounterByAddress(address user) external view returns (address) {
require(userCounters[user].length > 0, "No counters deployed by this user");
return userCounters[user][userCounters[user].length - 1];
}
function getAllCountersByAddress(address user) external view returns (address[] memory) {
return userCounters[user];
}
}// SPDX-License-Identifier: BSD-3-Clause-Clear
pragma solidity ^0.8.24;
import {SepoliaZamaOracleAddress} from "@zama-fhe/oracle-solidity/address/ZamaOracleAddress.sol";
import {FHE} from "@fhevm/solidity/lib/FHE.sol";
import {FHEVMConfigStruct} from "@fhevm/solidity/lib/Impl.sol";
/**
* @title ZamaConfig.
* @notice This library returns the FHEVM config for different networks
* with the contract addresses for (1) ACL, (2) FHEVMExecutor, (3) KMSVerifier, (4) InputVerifier
* which are deployed & maintained by Zama. It also returns the address of the decryption oracle.
*/
library ZamaConfig {
function getSepoliaConfig() internal pure returns (FHEVMConfigStruct memory) {
return
FHEVMConfigStruct({
ACLAddress: 0x687820221192C5B662b25367F70076A37bc79b6c,
FHEVMExecutorAddress: 0x848B0066793BcC60346Da1F49049357399B8D595,
KMSVerifierAddress: 0x1364cBBf2cDF5032C47d8226a6f6FBD2AFCDacAC,
InputVerifierAddress: 0xbc91f3daD1A5F19F8390c400196e58073B6a0BC4
});
}
function getSepoliaOracleAddress() internal pure returns (address) {
return SepoliaZamaOracleAddress;
}
function getEthereumConfig() internal pure returns (FHEVMConfigStruct memory) {
/// @note The addresses below are placeholders and should be replaced with actual addresses
/// once deployed on the Ethereum mainnet.
return
FHEVMConfigStruct({
ACLAddress: address(0),
FHEVMExecutorAddress: address(0),
KMSVerifierAddress: address(0),
InputVerifierAddress: address(0)
});
}
function getEthereumOracleAddress() internal pure returns (address) {
/// @note Placeholder, should be replaced with actual address once deployed.
return address(0);
}
}
/**
* @title SepoliaConfig.
* @dev This contract can be inherited by a contract wishing to use the FHEVM contracts provided by Zama
* on the Sepolia network (chainId = 11155111).
* Other providers may offer similar contracts deployed at different addresses.
* If you wish to use them, you should rely on the instructions from these providers.
*/
contract SepoliaConfig {
constructor() {
FHE.setCoprocessor(ZamaConfig.getSepoliaConfig());
FHE.setDecryptionOracle(ZamaConfig.getSepoliaOracleAddress());
}
}
/**
* @title EthereumConfig.
* @dev This contract can be inherited by a contract wishing to use the FHEVM contracts provided by Zama
* on the Ethereum (mainnet) network (chainId = 1).
* Other providers may offer similar contracts deployed at different addresses.
* If you wish to use them, you should rely on the instructions from these providers.
*/
contract EthereumConfig {
constructor() {
FHE.setCoprocessor(ZamaConfig.getEthereumConfig());
FHE.setDecryptionOracle(ZamaConfig.getEthereumOracleAddress());
}
}// SPDX-License-Identifier: BSD-3-Clause-Clear
pragma solidity ^0.8.24;
import "./Impl.sol";
import {FheType} from "./FheType.sol";
import "encrypted-types/EncryptedTypes.sol";
/**
* @title IKMSVerifier
* @notice This interface contains the only function required from KMSVerifier.
*/
interface IKMSVerifier {
function verifyDecryptionEIP712KMSSignatures(
bytes32[] memory handlesList,
bytes memory decryptedResult,
bytes[] memory signatures
) external returns (bool);
}
/**
* @title IDecryptionOracle
* @notice This interface contains the only function required from DecryptionOracle.
*/
interface IDecryptionOracle {
function requestDecryption(
uint256 requestID,
bytes32[] calldata ctsHandles,
bytes4 callbackSelector
) external payable;
}
/**
* @title FHE
* @notice This library is the interaction point for all smart contract developers
* that interact with the FHEVM protocol.
*/
library FHE {
/// @notice Returned if some handles were already saved for corresponding ID.
error HandlesAlreadySavedForRequestID();
/// @notice Returned if there was not handle found for the requested ID.
error NoHandleFoundForRequestID();
/// @notice Returned if the returned KMS signatures are not valid.
error InvalidKMSSignatures();
/// @notice Returned if the requested handle to be decrypted is not of a supported type.
error UnsupportedHandleType();
/// @notice This event is emitted when requested decryption has been fulfilled.
event DecryptionFulfilled(uint256 indexed requestID);
/**
* @notice Sets the coprocessor addresses.
* @param fhevmConfig FHEVM config struct that contains contract addresses.
*/
function setCoprocessor(FHEVMConfigStruct memory fhevmConfig) internal {
Impl.setCoprocessor(fhevmConfig);
}
/**
* @notice Sets the decryption oracle address.
* @param decryptionOracle The decryption oracle address.
*/
function setDecryptionOracle(address decryptionOracle) internal {
Impl.setDecryptionOracle(decryptionOracle);
}
/**
* @dev Returns true if the encrypted integer is initialized and false otherwise.
*/
function isInitialized(ebool v) internal pure returns (bool) {
return ebool.unwrap(v) != 0;
}
/**
* @dev Returns true if the encrypted integer is initialized and false otherwise.
*/
function isInitialized(euint8 v) internal pure returns (bool) {
return euint8.unwrap(v) != 0;
}
/**
* @dev Returns true if the encrypted integer is initialized and false otherwise.
*/
function isInitialized(euint16 v) internal pure returns (bool) {
return euint16.unwrap(v) != 0;
}
/**
* @dev Returns true if the encrypted integer is initialized and false otherwise.
*/
function isInitialized(euint32 v) internal pure returns (bool) {
return euint32.unwrap(v) != 0;
}
/**
* @dev Returns true if the encrypted integer is initialized and false otherwise.
*/
function isInitialized(euint64 v) internal pure returns (bool) {
return euint64.unwrap(v) != 0;
}
/**
* @dev Returns true if the encrypted integer is initialized and false otherwise.
*/
function isInitialized(euint128 v) internal pure returns (bool) {
return euint128.unwrap(v) != 0;
}
/**
* @dev Returns true if the encrypted integer is initialized and false otherwise.
*/
function isInitialized(eaddress v) internal pure returns (bool) {
return eaddress.unwrap(v) != 0;
}
/**
* @dev Returns true if the encrypted integer is initialized and false otherwise.
*/
function isInitialized(euint256 v) internal pure returns (bool) {
return euint256.unwrap(v) != 0;
}
/**
* @dev Evaluates and(ebool a, ebool b) and returns the result.
*/
function and(ebool a, ebool b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEbool(false);
}
if (!isInitialized(b)) {
b = asEbool(false);
}
return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b), false));
}
/**
* @dev Evaluates or(ebool a, ebool b) and returns the result.
*/
function or(ebool a, ebool b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEbool(false);
}
if (!isInitialized(b)) {
b = asEbool(false);
}
return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b), false));
}
/**
* @dev Evaluates xor(ebool a, ebool b) and returns the result.
*/
function xor(ebool a, ebool b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEbool(false);
}
if (!isInitialized(b)) {
b = asEbool(false);
}
return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b), false));
}
/**
* @dev Evaluates eq(ebool a, ebool b) and returns the result.
*/
function eq(ebool a, ebool b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEbool(false);
}
if (!isInitialized(b)) {
b = asEbool(false);
}
return ebool.wrap(Impl.eq(ebool.unwrap(a), ebool.unwrap(b), false));
}
/**
* @dev Evaluates ne(ebool a, ebool b) and returns the result.
*/
function ne(ebool a, ebool b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEbool(false);
}
if (!isInitialized(b)) {
b = asEbool(false);
}
return ebool.wrap(Impl.ne(ebool.unwrap(a), ebool.unwrap(b), false));
}
/**
* @dev Evaluates add(euint8 a, euint8 b) and returns the result.
*/
function add(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint8 a, euint8 b) and returns the result.
*/
function sub(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint8 a, euint8 b) and returns the result.
*/
function mul(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates and(euint8 a, euint8 b) and returns the result.
*/
function and(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates or(euint8 a, euint8 b) and returns the result.
*/
function or(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint8 a, euint8 b) and returns the result.
*/
function xor(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint8 a, euint8 b) and returns the result.
*/
function eq(euint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint8 a, euint8 b) and returns the result.
*/
function ne(euint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint8 a, euint8 b) and returns the result.
*/
function ge(euint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint8 a, euint8 b) and returns the result.
*/
function gt(euint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates le(euint8 a, euint8 b) and returns the result.
*/
function le(euint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint8 a, euint8 b) and returns the result.
*/
function lt(euint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates min(euint8 a, euint8 b) and returns the result.
*/
function min(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates max(euint8 a, euint8 b) and returns the result.
*/
function max(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates add(euint8 a, euint16 b) and returns the result.
*/
function add(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.add(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint8 a, euint16 b) and returns the result.
*/
function sub(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.sub(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint8 a, euint16 b) and returns the result.
*/
function mul(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.mul(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates and(euint8 a, euint16 b) and returns the result.
*/
function and(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.and(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates or(euint8 a, euint16 b) and returns the result.
*/
function or(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.or(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint8 a, euint16 b) and returns the result.
*/
function xor(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.xor(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint8 a, euint16 b) and returns the result.
*/
function eq(euint8 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.eq(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint8 a, euint16 b) and returns the result.
*/
function ne(euint8 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.ne(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint8 a, euint16 b) and returns the result.
*/
function ge(euint8 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.ge(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint8 a, euint16 b) and returns the result.
*/
function gt(euint8 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.gt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates le(euint8 a, euint16 b) and returns the result.
*/
function le(euint8 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.le(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint8 a, euint16 b) and returns the result.
*/
function lt(euint8 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.lt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates min(euint8 a, euint16 b) and returns the result.
*/
function min(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.min(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates max(euint8 a, euint16 b) and returns the result.
*/
function max(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.max(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
/**
* @dev Evaluates add(euint8 a, euint32 b) and returns the result.
*/
function add(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint8 a, euint32 b) and returns the result.
*/
function sub(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint8 a, euint32 b) and returns the result.
*/
function mul(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates and(euint8 a, euint32 b) and returns the result.
*/
function and(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates or(euint8 a, euint32 b) and returns the result.
*/
function or(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint8 a, euint32 b) and returns the result.
*/
function xor(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint8 a, euint32 b) and returns the result.
*/
function eq(euint8 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint8 a, euint32 b) and returns the result.
*/
function ne(euint8 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint8 a, euint32 b) and returns the result.
*/
function ge(euint8 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint8 a, euint32 b) and returns the result.
*/
function gt(euint8 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates le(euint8 a, euint32 b) and returns the result.
*/
function le(euint8 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint8 a, euint32 b) and returns the result.
*/
function lt(euint8 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates min(euint8 a, euint32 b) and returns the result.
*/
function min(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates max(euint8 a, euint32 b) and returns the result.
*/
function max(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates add(euint8 a, euint64 b) and returns the result.
*/
function add(euint8 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint8 a, euint64 b) and returns the result.
*/
function sub(euint8 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint8 a, euint64 b) and returns the result.
*/
function mul(euint8 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates and(euint8 a, euint64 b) and returns the result.
*/
function and(euint8 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates or(euint8 a, euint64 b) and returns the result.
*/
function or(euint8 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint8 a, euint64 b) and returns the result.
*/
function xor(euint8 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint8 a, euint64 b) and returns the result.
*/
function eq(euint8 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint8 a, euint64 b) and returns the result.
*/
function ne(euint8 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint8 a, euint64 b) and returns the result.
*/
function ge(euint8 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint8 a, euint64 b) and returns the result.
*/
function gt(euint8 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates le(euint8 a, euint64 b) and returns the result.
*/
function le(euint8 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint8 a, euint64 b) and returns the result.
*/
function lt(euint8 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates min(euint8 a, euint64 b) and returns the result.
*/
function min(euint8 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates max(euint8 a, euint64 b) and returns the result.
*/
function max(euint8 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates add(euint8 a, euint128 b) and returns the result.
*/
function add(euint8 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint8 a, euint128 b) and returns the result.
*/
function sub(euint8 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint8 a, euint128 b) and returns the result.
*/
function mul(euint8 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates and(euint8 a, euint128 b) and returns the result.
*/
function and(euint8 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates or(euint8 a, euint128 b) and returns the result.
*/
function or(euint8 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint8 a, euint128 b) and returns the result.
*/
function xor(euint8 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint8 a, euint128 b) and returns the result.
*/
function eq(euint8 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint8 a, euint128 b) and returns the result.
*/
function ne(euint8 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint8 a, euint128 b) and returns the result.
*/
function ge(euint8 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint8 a, euint128 b) and returns the result.
*/
function gt(euint8 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates le(euint8 a, euint128 b) and returns the result.
*/
function le(euint8 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint8 a, euint128 b) and returns the result.
*/
function lt(euint8 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates min(euint8 a, euint128 b) and returns the result.
*/
function min(euint8 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates max(euint8 a, euint128 b) and returns the result.
*/
function max(euint8 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates and(euint8 a, euint256 b) and returns the result.
*/
function and(euint8 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates or(euint8 a, euint256 b) and returns the result.
*/
function or(euint8 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint8 a, euint256 b) and returns the result.
*/
function xor(euint8 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint8 a, euint256 b) and returns the result.
*/
function eq(euint8 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint8 a, euint256 b) and returns the result.
*/
function ne(euint8 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates add(euint16 a, euint8 b) and returns the result.
*/
function add(euint16 a, euint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates sub(euint16 a, euint8 b) and returns the result.
*/
function sub(euint16 a, euint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates mul(euint16 a, euint8 b) and returns the result.
*/
function mul(euint16 a, euint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates and(euint16 a, euint8 b) and returns the result.
*/
function and(euint16 a, euint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates or(euint16 a, euint8 b) and returns the result.
*/
function or(euint16 a, euint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates xor(euint16 a, euint8 b) and returns the result.
*/
function xor(euint16 a, euint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates eq(euint16 a, euint8 b) and returns the result.
*/
function eq(euint16 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates ne(euint16 a, euint8 b) and returns the result.
*/
function ne(euint16 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates ge(euint16 a, euint8 b) and returns the result.
*/
function ge(euint16 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates gt(euint16 a, euint8 b) and returns the result.
*/
function gt(euint16 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates le(euint16 a, euint8 b) and returns the result.
*/
function le(euint16 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates lt(euint16 a, euint8 b) and returns the result.
*/
function lt(euint16 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates min(euint16 a, euint8 b) and returns the result.
*/
function min(euint16 a, euint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates max(euint16 a, euint8 b) and returns the result.
*/
function max(euint16 a, euint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates add(euint16 a, euint16 b) and returns the result.
*/
function add(euint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint16 a, euint16 b) and returns the result.
*/
function sub(euint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint16 a, euint16 b) and returns the result.
*/
function mul(euint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates and(euint16 a, euint16 b) and returns the result.
*/
function and(euint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates or(euint16 a, euint16 b) and returns the result.
*/
function or(euint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint16 a, euint16 b) and returns the result.
*/
function xor(euint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint16 a, euint16 b) and returns the result.
*/
function eq(euint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint16 a, euint16 b) and returns the result.
*/
function ne(euint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint16 a, euint16 b) and returns the result.
*/
function ge(euint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint16 a, euint16 b) and returns the result.
*/
function gt(euint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates le(euint16 a, euint16 b) and returns the result.
*/
function le(euint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint16 a, euint16 b) and returns the result.
*/
function lt(euint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates min(euint16 a, euint16 b) and returns the result.
*/
function min(euint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates max(euint16 a, euint16 b) and returns the result.
*/
function max(euint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(b), false));
}
/**
* @dev Evaluates add(euint16 a, euint32 b) and returns the result.
*/
function add(euint16 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint16 a, euint32 b) and returns the result.
*/
function sub(euint16 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint16 a, euint32 b) and returns the result.
*/
function mul(euint16 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates and(euint16 a, euint32 b) and returns the result.
*/
function and(euint16 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates or(euint16 a, euint32 b) and returns the result.
*/
function or(euint16 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint16 a, euint32 b) and returns the result.
*/
function xor(euint16 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint16 a, euint32 b) and returns the result.
*/
function eq(euint16 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint16 a, euint32 b) and returns the result.
*/
function ne(euint16 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint16 a, euint32 b) and returns the result.
*/
function ge(euint16 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint16 a, euint32 b) and returns the result.
*/
function gt(euint16 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates le(euint16 a, euint32 b) and returns the result.
*/
function le(euint16 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint16 a, euint32 b) and returns the result.
*/
function lt(euint16 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates min(euint16 a, euint32 b) and returns the result.
*/
function min(euint16 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates max(euint16 a, euint32 b) and returns the result.
*/
function max(euint16 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
/**
* @dev Evaluates add(euint16 a, euint64 b) and returns the result.
*/
function add(euint16 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint16 a, euint64 b) and returns the result.
*/
function sub(euint16 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint16 a, euint64 b) and returns the result.
*/
function mul(euint16 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates and(euint16 a, euint64 b) and returns the result.
*/
function and(euint16 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates or(euint16 a, euint64 b) and returns the result.
*/
function or(euint16 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint16 a, euint64 b) and returns the result.
*/
function xor(euint16 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint16 a, euint64 b) and returns the result.
*/
function eq(euint16 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint16 a, euint64 b) and returns the result.
*/
function ne(euint16 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint16 a, euint64 b) and returns the result.
*/
function ge(euint16 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint16 a, euint64 b) and returns the result.
*/
function gt(euint16 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates le(euint16 a, euint64 b) and returns the result.
*/
function le(euint16 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint16 a, euint64 b) and returns the result.
*/
function lt(euint16 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates min(euint16 a, euint64 b) and returns the result.
*/
function min(euint16 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates max(euint16 a, euint64 b) and returns the result.
*/
function max(euint16 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates add(euint16 a, euint128 b) and returns the result.
*/
function add(euint16 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint16 a, euint128 b) and returns the result.
*/
function sub(euint16 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint16 a, euint128 b) and returns the result.
*/
function mul(euint16 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates and(euint16 a, euint128 b) and returns the result.
*/
function and(euint16 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates or(euint16 a, euint128 b) and returns the result.
*/
function or(euint16 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint16 a, euint128 b) and returns the result.
*/
function xor(euint16 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint16 a, euint128 b) and returns the result.
*/
function eq(euint16 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint16 a, euint128 b) and returns the result.
*/
function ne(euint16 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint16 a, euint128 b) and returns the result.
*/
function ge(euint16 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint16 a, euint128 b) and returns the result.
*/
function gt(euint16 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates le(euint16 a, euint128 b) and returns the result.
*/
function le(euint16 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint16 a, euint128 b) and returns the result.
*/
function lt(euint16 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates min(euint16 a, euint128 b) and returns the result.
*/
function min(euint16 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates max(euint16 a, euint128 b) and returns the result.
*/
function max(euint16 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates and(euint16 a, euint256 b) and returns the result.
*/
function and(euint16 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates or(euint16 a, euint256 b) and returns the result.
*/
function or(euint16 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint16 a, euint256 b) and returns the result.
*/
function xor(euint16 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint16 a, euint256 b) and returns the result.
*/
function eq(euint16 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint16 a, euint256 b) and returns the result.
*/
function ne(euint16 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates add(euint32 a, euint8 b) and returns the result.
*/
function add(euint32 a, euint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates sub(euint32 a, euint8 b) and returns the result.
*/
function sub(euint32 a, euint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates mul(euint32 a, euint8 b) and returns the result.
*/
function mul(euint32 a, euint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates and(euint32 a, euint8 b) and returns the result.
*/
function and(euint32 a, euint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates or(euint32 a, euint8 b) and returns the result.
*/
function or(euint32 a, euint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates xor(euint32 a, euint8 b) and returns the result.
*/
function xor(euint32 a, euint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates eq(euint32 a, euint8 b) and returns the result.
*/
function eq(euint32 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates ne(euint32 a, euint8 b) and returns the result.
*/
function ne(euint32 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates ge(euint32 a, euint8 b) and returns the result.
*/
function ge(euint32 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates gt(euint32 a, euint8 b) and returns the result.
*/
function gt(euint32 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates le(euint32 a, euint8 b) and returns the result.
*/
function le(euint32 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates lt(euint32 a, euint8 b) and returns the result.
*/
function lt(euint32 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates min(euint32 a, euint8 b) and returns the result.
*/
function min(euint32 a, euint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates max(euint32 a, euint8 b) and returns the result.
*/
function max(euint32 a, euint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates add(euint32 a, euint16 b) and returns the result.
*/
function add(euint32 a, euint16 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates sub(euint32 a, euint16 b) and returns the result.
*/
function sub(euint32 a, euint16 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates mul(euint32 a, euint16 b) and returns the result.
*/
function mul(euint32 a, euint16 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates and(euint32 a, euint16 b) and returns the result.
*/
function and(euint32 a, euint16 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates or(euint32 a, euint16 b) and returns the result.
*/
function or(euint32 a, euint16 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates xor(euint32 a, euint16 b) and returns the result.
*/
function xor(euint32 a, euint16 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates eq(euint32 a, euint16 b) and returns the result.
*/
function eq(euint32 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates ne(euint32 a, euint16 b) and returns the result.
*/
function ne(euint32 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates ge(euint32 a, euint16 b) and returns the result.
*/
function ge(euint32 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates gt(euint32 a, euint16 b) and returns the result.
*/
function gt(euint32 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates le(euint32 a, euint16 b) and returns the result.
*/
function le(euint32 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates lt(euint32 a, euint16 b) and returns the result.
*/
function lt(euint32 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates min(euint32 a, euint16 b) and returns the result.
*/
function min(euint32 a, euint16 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates max(euint32 a, euint16 b) and returns the result.
*/
function max(euint32 a, euint16 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates add(euint32 a, euint32 b) and returns the result.
*/
function add(euint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint32 a, euint32 b) and returns the result.
*/
function sub(euint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint32 a, euint32 b) and returns the result.
*/
function mul(euint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates and(euint32 a, euint32 b) and returns the result.
*/
function and(euint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates or(euint32 a, euint32 b) and returns the result.
*/
function or(euint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint32 a, euint32 b) and returns the result.
*/
function xor(euint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint32 a, euint32 b) and returns the result.
*/
function eq(euint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint32 a, euint32 b) and returns the result.
*/
function ne(euint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint32 a, euint32 b) and returns the result.
*/
function ge(euint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint32 a, euint32 b) and returns the result.
*/
function gt(euint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates le(euint32 a, euint32 b) and returns the result.
*/
function le(euint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint32 a, euint32 b) and returns the result.
*/
function lt(euint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates min(euint32 a, euint32 b) and returns the result.
*/
function min(euint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates max(euint32 a, euint32 b) and returns the result.
*/
function max(euint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(b), false));
}
/**
* @dev Evaluates add(euint32 a, euint64 b) and returns the result.
*/
function add(euint32 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint32 a, euint64 b) and returns the result.
*/
function sub(euint32 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint32 a, euint64 b) and returns the result.
*/
function mul(euint32 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates and(euint32 a, euint64 b) and returns the result.
*/
function and(euint32 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates or(euint32 a, euint64 b) and returns the result.
*/
function or(euint32 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint32 a, euint64 b) and returns the result.
*/
function xor(euint32 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint32 a, euint64 b) and returns the result.
*/
function eq(euint32 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint32 a, euint64 b) and returns the result.
*/
function ne(euint32 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint32 a, euint64 b) and returns the result.
*/
function ge(euint32 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint32 a, euint64 b) and returns the result.
*/
function gt(euint32 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates le(euint32 a, euint64 b) and returns the result.
*/
function le(euint32 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint32 a, euint64 b) and returns the result.
*/
function lt(euint32 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates min(euint32 a, euint64 b) and returns the result.
*/
function min(euint32 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates max(euint32 a, euint64 b) and returns the result.
*/
function max(euint32 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
/**
* @dev Evaluates add(euint32 a, euint128 b) and returns the result.
*/
function add(euint32 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint32 a, euint128 b) and returns the result.
*/
function sub(euint32 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint32 a, euint128 b) and returns the result.
*/
function mul(euint32 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates and(euint32 a, euint128 b) and returns the result.
*/
function and(euint32 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates or(euint32 a, euint128 b) and returns the result.
*/
function or(euint32 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint32 a, euint128 b) and returns the result.
*/
function xor(euint32 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint32 a, euint128 b) and returns the result.
*/
function eq(euint32 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint32 a, euint128 b) and returns the result.
*/
function ne(euint32 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint32 a, euint128 b) and returns the result.
*/
function ge(euint32 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint32 a, euint128 b) and returns the result.
*/
function gt(euint32 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates le(euint32 a, euint128 b) and returns the result.
*/
function le(euint32 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint32 a, euint128 b) and returns the result.
*/
function lt(euint32 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates min(euint32 a, euint128 b) and returns the result.
*/
function min(euint32 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates max(euint32 a, euint128 b) and returns the result.
*/
function max(euint32 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates and(euint32 a, euint256 b) and returns the result.
*/
function and(euint32 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates or(euint32 a, euint256 b) and returns the result.
*/
function or(euint32 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint32 a, euint256 b) and returns the result.
*/
function xor(euint32 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint32 a, euint256 b) and returns the result.
*/
function eq(euint32 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint32 a, euint256 b) and returns the result.
*/
function ne(euint32 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates add(euint64 a, euint8 b) and returns the result.
*/
function add(euint64 a, euint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates sub(euint64 a, euint8 b) and returns the result.
*/
function sub(euint64 a, euint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates mul(euint64 a, euint8 b) and returns the result.
*/
function mul(euint64 a, euint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates and(euint64 a, euint8 b) and returns the result.
*/
function and(euint64 a, euint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates or(euint64 a, euint8 b) and returns the result.
*/
function or(euint64 a, euint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates xor(euint64 a, euint8 b) and returns the result.
*/
function xor(euint64 a, euint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates eq(euint64 a, euint8 b) and returns the result.
*/
function eq(euint64 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates ne(euint64 a, euint8 b) and returns the result.
*/
function ne(euint64 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates ge(euint64 a, euint8 b) and returns the result.
*/
function ge(euint64 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates gt(euint64 a, euint8 b) and returns the result.
*/
function gt(euint64 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates le(euint64 a, euint8 b) and returns the result.
*/
function le(euint64 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates lt(euint64 a, euint8 b) and returns the result.
*/
function lt(euint64 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates min(euint64 a, euint8 b) and returns the result.
*/
function min(euint64 a, euint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates max(euint64 a, euint8 b) and returns the result.
*/
function max(euint64 a, euint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates add(euint64 a, euint16 b) and returns the result.
*/
function add(euint64 a, euint16 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates sub(euint64 a, euint16 b) and returns the result.
*/
function sub(euint64 a, euint16 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates mul(euint64 a, euint16 b) and returns the result.
*/
function mul(euint64 a, euint16 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates and(euint64 a, euint16 b) and returns the result.
*/
function and(euint64 a, euint16 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates or(euint64 a, euint16 b) and returns the result.
*/
function or(euint64 a, euint16 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates xor(euint64 a, euint16 b) and returns the result.
*/
function xor(euint64 a, euint16 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates eq(euint64 a, euint16 b) and returns the result.
*/
function eq(euint64 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates ne(euint64 a, euint16 b) and returns the result.
*/
function ne(euint64 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates ge(euint64 a, euint16 b) and returns the result.
*/
function ge(euint64 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates gt(euint64 a, euint16 b) and returns the result.
*/
function gt(euint64 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates le(euint64 a, euint16 b) and returns the result.
*/
function le(euint64 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates lt(euint64 a, euint16 b) and returns the result.
*/
function lt(euint64 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates min(euint64 a, euint16 b) and returns the result.
*/
function min(euint64 a, euint16 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates max(euint64 a, euint16 b) and returns the result.
*/
function max(euint64 a, euint16 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates add(euint64 a, euint32 b) and returns the result.
*/
function add(euint64 a, euint32 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates sub(euint64 a, euint32 b) and returns the result.
*/
function sub(euint64 a, euint32 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates mul(euint64 a, euint32 b) and returns the result.
*/
function mul(euint64 a, euint32 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates and(euint64 a, euint32 b) and returns the result.
*/
function and(euint64 a, euint32 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates or(euint64 a, euint32 b) and returns the result.
*/
function or(euint64 a, euint32 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates xor(euint64 a, euint32 b) and returns the result.
*/
function xor(euint64 a, euint32 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates eq(euint64 a, euint32 b) and returns the result.
*/
function eq(euint64 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates ne(euint64 a, euint32 b) and returns the result.
*/
function ne(euint64 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates ge(euint64 a, euint32 b) and returns the result.
*/
function ge(euint64 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates gt(euint64 a, euint32 b) and returns the result.
*/
function gt(euint64 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates le(euint64 a, euint32 b) and returns the result.
*/
function le(euint64 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates lt(euint64 a, euint32 b) and returns the result.
*/
function lt(euint64 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates min(euint64 a, euint32 b) and returns the result.
*/
function min(euint64 a, euint32 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates max(euint64 a, euint32 b) and returns the result.
*/
function max(euint64 a, euint32 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates add(euint64 a, euint64 b) and returns the result.
*/
function add(euint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint64 a, euint64 b) and returns the result.
*/
function sub(euint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint64 a, euint64 b) and returns the result.
*/
function mul(euint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates and(euint64 a, euint64 b) and returns the result.
*/
function and(euint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates or(euint64 a, euint64 b) and returns the result.
*/
function or(euint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint64 a, euint64 b) and returns the result.
*/
function xor(euint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint64 a, euint64 b) and returns the result.
*/
function eq(euint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint64 a, euint64 b) and returns the result.
*/
function ne(euint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint64 a, euint64 b) and returns the result.
*/
function ge(euint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint64 a, euint64 b) and returns the result.
*/
function gt(euint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates le(euint64 a, euint64 b) and returns the result.
*/
function le(euint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint64 a, euint64 b) and returns the result.
*/
function lt(euint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates min(euint64 a, euint64 b) and returns the result.
*/
function min(euint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates max(euint64 a, euint64 b) and returns the result.
*/
function max(euint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(b), false));
}
/**
* @dev Evaluates add(euint64 a, euint128 b) and returns the result.
*/
function add(euint64 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint64 a, euint128 b) and returns the result.
*/
function sub(euint64 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint64 a, euint128 b) and returns the result.
*/
function mul(euint64 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates and(euint64 a, euint128 b) and returns the result.
*/
function and(euint64 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates or(euint64 a, euint128 b) and returns the result.
*/
function or(euint64 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint64 a, euint128 b) and returns the result.
*/
function xor(euint64 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint64 a, euint128 b) and returns the result.
*/
function eq(euint64 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint64 a, euint128 b) and returns the result.
*/
function ne(euint64 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint64 a, euint128 b) and returns the result.
*/
function ge(euint64 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint64 a, euint128 b) and returns the result.
*/
function gt(euint64 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates le(euint64 a, euint128 b) and returns the result.
*/
function le(euint64 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint64 a, euint128 b) and returns the result.
*/
function lt(euint64 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates min(euint64 a, euint128 b) and returns the result.
*/
function min(euint64 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates max(euint64 a, euint128 b) and returns the result.
*/
function max(euint64 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
/**
* @dev Evaluates and(euint64 a, euint256 b) and returns the result.
*/
function and(euint64 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates or(euint64 a, euint256 b) and returns the result.
*/
function or(euint64 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint64 a, euint256 b) and returns the result.
*/
function xor(euint64 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint64 a, euint256 b) and returns the result.
*/
function eq(euint64 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint64 a, euint256 b) and returns the result.
*/
function ne(euint64 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates add(euint128 a, euint8 b) and returns the result.
*/
function add(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates sub(euint128 a, euint8 b) and returns the result.
*/
function sub(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates mul(euint128 a, euint8 b) and returns the result.
*/
function mul(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates and(euint128 a, euint8 b) and returns the result.
*/
function and(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates or(euint128 a, euint8 b) and returns the result.
*/
function or(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates xor(euint128 a, euint8 b) and returns the result.
*/
function xor(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates eq(euint128 a, euint8 b) and returns the result.
*/
function eq(euint128 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates ne(euint128 a, euint8 b) and returns the result.
*/
function ne(euint128 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates ge(euint128 a, euint8 b) and returns the result.
*/
function ge(euint128 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates gt(euint128 a, euint8 b) and returns the result.
*/
function gt(euint128 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates le(euint128 a, euint8 b) and returns the result.
*/
function le(euint128 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates lt(euint128 a, euint8 b) and returns the result.
*/
function lt(euint128 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates min(euint128 a, euint8 b) and returns the result.
*/
function min(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates max(euint128 a, euint8 b) and returns the result.
*/
function max(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates add(euint128 a, euint16 b) and returns the result.
*/
function add(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates sub(euint128 a, euint16 b) and returns the result.
*/
function sub(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates mul(euint128 a, euint16 b) and returns the result.
*/
function mul(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates and(euint128 a, euint16 b) and returns the result.
*/
function and(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates or(euint128 a, euint16 b) and returns the result.
*/
function or(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates xor(euint128 a, euint16 b) and returns the result.
*/
function xor(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates eq(euint128 a, euint16 b) and returns the result.
*/
function eq(euint128 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates ne(euint128 a, euint16 b) and returns the result.
*/
function ne(euint128 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates ge(euint128 a, euint16 b) and returns the result.
*/
function ge(euint128 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates gt(euint128 a, euint16 b) and returns the result.
*/
function gt(euint128 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates le(euint128 a, euint16 b) and returns the result.
*/
function le(euint128 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates lt(euint128 a, euint16 b) and returns the result.
*/
function lt(euint128 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates min(euint128 a, euint16 b) and returns the result.
*/
function min(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates max(euint128 a, euint16 b) and returns the result.
*/
function max(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates add(euint128 a, euint32 b) and returns the result.
*/
function add(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates sub(euint128 a, euint32 b) and returns the result.
*/
function sub(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates mul(euint128 a, euint32 b) and returns the result.
*/
function mul(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates and(euint128 a, euint32 b) and returns the result.
*/
function and(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates or(euint128 a, euint32 b) and returns the result.
*/
function or(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates xor(euint128 a, euint32 b) and returns the result.
*/
function xor(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates eq(euint128 a, euint32 b) and returns the result.
*/
function eq(euint128 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates ne(euint128 a, euint32 b) and returns the result.
*/
function ne(euint128 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates ge(euint128 a, euint32 b) and returns the result.
*/
function ge(euint128 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates gt(euint128 a, euint32 b) and returns the result.
*/
function gt(euint128 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates le(euint128 a, euint32 b) and returns the result.
*/
function le(euint128 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates lt(euint128 a, euint32 b) and returns the result.
*/
function lt(euint128 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates min(euint128 a, euint32 b) and returns the result.
*/
function min(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates max(euint128 a, euint32 b) and returns the result.
*/
function max(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates add(euint128 a, euint64 b) and returns the result.
*/
function add(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates sub(euint128 a, euint64 b) and returns the result.
*/
function sub(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates mul(euint128 a, euint64 b) and returns the result.
*/
function mul(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates and(euint128 a, euint64 b) and returns the result.
*/
function and(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates or(euint128 a, euint64 b) and returns the result.
*/
function or(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates xor(euint128 a, euint64 b) and returns the result.
*/
function xor(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates eq(euint128 a, euint64 b) and returns the result.
*/
function eq(euint128 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates ne(euint128 a, euint64 b) and returns the result.
*/
function ne(euint128 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates ge(euint128 a, euint64 b) and returns the result.
*/
function ge(euint128 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates gt(euint128 a, euint64 b) and returns the result.
*/
function gt(euint128 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates le(euint128 a, euint64 b) and returns the result.
*/
function le(euint128 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates lt(euint128 a, euint64 b) and returns the result.
*/
function lt(euint128 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates min(euint128 a, euint64 b) and returns the result.
*/
function min(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates max(euint128 a, euint64 b) and returns the result.
*/
function max(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates add(euint128 a, euint128 b) and returns the result.
*/
function add(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates sub(euint128 a, euint128 b) and returns the result.
*/
function sub(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint128 a, euint128 b) and returns the result.
*/
function mul(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates and(euint128 a, euint128 b) and returns the result.
*/
function and(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates or(euint128 a, euint128 b) and returns the result.
*/
function or(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint128 a, euint128 b) and returns the result.
*/
function xor(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint128 a, euint128 b) and returns the result.
*/
function eq(euint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint128 a, euint128 b) and returns the result.
*/
function ne(euint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates ge(euint128 a, euint128 b) and returns the result.
*/
function ge(euint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates gt(euint128 a, euint128 b) and returns the result.
*/
function gt(euint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates le(euint128 a, euint128 b) and returns the result.
*/
function le(euint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates lt(euint128 a, euint128 b) and returns the result.
*/
function lt(euint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates min(euint128 a, euint128 b) and returns the result.
*/
function min(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates max(euint128 a, euint128 b) and returns the result.
*/
function max(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(b), false));
}
/**
* @dev Evaluates and(euint128 a, euint256 b) and returns the result.
*/
function and(euint128 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates or(euint128 a, euint256 b) and returns the result.
*/
function or(euint128 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint128 a, euint256 b) and returns the result.
*/
function xor(euint128 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint128 a, euint256 b) and returns the result.
*/
function eq(euint128 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint128 a, euint256 b) and returns the result.
*/
function ne(euint128 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
/**
* @dev Evaluates eq(eaddress a, eaddress b) and returns the result.
*/
function eq(eaddress a, eaddress b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEaddress(address(0));
}
if (!isInitialized(b)) {
b = asEaddress(address(0));
}
return ebool.wrap(Impl.eq(eaddress.unwrap(a), eaddress.unwrap(b), false));
}
/**
* @dev Evaluates ne(eaddress a, eaddress b) and returns the result.
*/
function ne(eaddress a, eaddress b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEaddress(address(0));
}
if (!isInitialized(b)) {
b = asEaddress(address(0));
}
return ebool.wrap(Impl.ne(eaddress.unwrap(a), eaddress.unwrap(b), false));
}
/**
* @dev Evaluates and(euint256 a, euint8 b) and returns the result.
*/
function and(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates or(euint256 a, euint8 b) and returns the result.
*/
function or(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates xor(euint256 a, euint8 b) and returns the result.
*/
function xor(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates eq(euint256 a, euint8 b) and returns the result.
*/
function eq(euint256 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates ne(euint256 a, euint8 b) and returns the result.
*/
function ne(euint256 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates and(euint256 a, euint16 b) and returns the result.
*/
function and(euint256 a, euint16 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates or(euint256 a, euint16 b) and returns the result.
*/
function or(euint256 a, euint16 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates xor(euint256 a, euint16 b) and returns the result.
*/
function xor(euint256 a, euint16 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates eq(euint256 a, euint16 b) and returns the result.
*/
function eq(euint256 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates ne(euint256 a, euint16 b) and returns the result.
*/
function ne(euint256 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates and(euint256 a, euint32 b) and returns the result.
*/
function and(euint256 a, euint32 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates or(euint256 a, euint32 b) and returns the result.
*/
function or(euint256 a, euint32 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates xor(euint256 a, euint32 b) and returns the result.
*/
function xor(euint256 a, euint32 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates eq(euint256 a, euint32 b) and returns the result.
*/
function eq(euint256 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates ne(euint256 a, euint32 b) and returns the result.
*/
function ne(euint256 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates and(euint256 a, euint64 b) and returns the result.
*/
function and(euint256 a, euint64 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates or(euint256 a, euint64 b) and returns the result.
*/
function or(euint256 a, euint64 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates xor(euint256 a, euint64 b) and returns the result.
*/
function xor(euint256 a, euint64 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates eq(euint256 a, euint64 b) and returns the result.
*/
function eq(euint256 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates ne(euint256 a, euint64 b) and returns the result.
*/
function ne(euint256 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates and(euint256 a, euint128 b) and returns the result.
*/
function and(euint256 a, euint128 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates or(euint256 a, euint128 b) and returns the result.
*/
function or(euint256 a, euint128 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates xor(euint256 a, euint128 b) and returns the result.
*/
function xor(euint256 a, euint128 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates eq(euint256 a, euint128 b) and returns the result.
*/
function eq(euint256 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates ne(euint256 a, euint128 b) and returns the result.
*/
function ne(euint256 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates and(euint256 a, euint256 b) and returns the result.
*/
function and(euint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(b), false));
}
/**
* @dev Evaluates or(euint256 a, euint256 b) and returns the result.
*/
function or(euint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(b), false));
}
/**
* @dev Evaluates xor(euint256 a, euint256 b) and returns the result.
*/
function xor(euint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(b), false));
}
/**
* @dev Evaluates eq(euint256 a, euint256 b) and returns the result.
*/
function eq(euint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(b), false));
}
/**
* @dev Evaluates ne(euint256 a, euint256 b) and returns the result.
*/
function ne(euint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(b), false));
}
/**
* @dev Evaluates and(ebool a, bool b) and returns the result.
*/
function and(ebool a, bool b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEbool(false);
}
return ebool.wrap(Impl.and(ebool.unwrap(a), bytes32(uint256(b ? 1 : 0)), true));
}
/**
* @dev Evaluates and(bool a, ebool b) and returns the result.
*/
function and(bool a, ebool b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEbool(false);
}
return ebool.wrap(Impl.and(ebool.unwrap(b), bytes32(uint256(a ? 1 : 0)), true));
}
/**
* @dev Evaluates or(ebool a, bool b) and returns the result.
*/
function or(ebool a, bool b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEbool(false);
}
return ebool.wrap(Impl.or(ebool.unwrap(a), bytes32(uint256(b ? 1 : 0)), true));
}
/**
* @dev Evaluates or(bool a, ebool b) and returns the result.
*/
function or(bool a, ebool b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEbool(false);
}
return ebool.wrap(Impl.or(ebool.unwrap(b), bytes32(uint256(a ? 1 : 0)), true));
}
/**
* @dev Evaluates xor(ebool a, bool b) and returns the result.
*/
function xor(ebool a, bool b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEbool(false);
}
return ebool.wrap(Impl.xor(ebool.unwrap(a), bytes32(uint256(b ? 1 : 0)), true));
}
/**
* @dev Evaluates xor(bool a, ebool b) and returns the result.
*/
function xor(bool a, ebool b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEbool(false);
}
return ebool.wrap(Impl.xor(ebool.unwrap(b), bytes32(uint256(a ? 1 : 0)), true));
}
/**
* @dev Evaluates eq(ebool a, bool b) and returns the result.
*/
function eq(ebool a, bool b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEbool(false);
}
return ebool.wrap(Impl.eq(ebool.unwrap(a), bytes32(uint256(b ? 1 : 0)), true));
}
/**
* @dev Evaluates eq(bool a, ebool b) and returns the result.
*/
function eq(bool a, ebool b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEbool(false);
}
return ebool.wrap(Impl.eq(ebool.unwrap(b), bytes32(uint256(a ? 1 : 0)), true));
}
/**
* @dev Evaluates ne(ebool a, bool b) and returns the result.
*/
function ne(ebool a, bool b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEbool(false);
}
return ebool.wrap(Impl.ne(ebool.unwrap(a), bytes32(uint256(b ? 1 : 0)), true));
}
/**
* @dev Evaluates ne(bool a, ebool b) and returns the result.
*/
function ne(bool a, ebool b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEbool(false);
}
return ebool.wrap(Impl.ne(ebool.unwrap(b), bytes32(uint256(a ? 1 : 0)), true));
}
/**
* @dev Evaluates add(euint8 a, uint8 b) and returns the result.
*/
function add(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.add(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates add(uint8 a, euint8 b) and returns the result.
*/
function add(uint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.add(euint8.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates sub(euint8 a, uint8 b) and returns the result.
*/
function sub(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.sub(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates sub(uint8 a, euint8 b) and returns the result.
*/
function sub(uint8 a, euint8 b) internal returns (euint8) {
euint8 aEnc = asEuint8(a);
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.sub(euint8.unwrap(aEnc), euint8.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint8 a, uint8 b) and returns the result.
*/
function mul(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.mul(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates mul(uint8 a, euint8 b) and returns the result.
*/
function mul(uint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.mul(euint8.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates div(euint8 a, uint8 b) and returns the result.
*/
function div(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.div(euint8.unwrap(a), bytes32(uint256(b))));
}
/**
* @dev Evaluates rem(euint8 a, uint8 b) and returns the result.
*/
function rem(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.rem(euint8.unwrap(a), bytes32(uint256(b))));
}
/**
* @dev Evaluates and(euint8 a, uint8 b) and returns the result.
*/
function and(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.and(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates and(uint8 a, euint8 b) and returns the result.
*/
function and(uint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.and(euint8.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates or(euint8 a, uint8 b) and returns the result.
*/
function or(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.or(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates or(uint8 a, euint8 b) and returns the result.
*/
function or(uint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.or(euint8.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates xor(euint8 a, uint8 b) and returns the result.
*/
function xor(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.xor(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates xor(uint8 a, euint8 b) and returns the result.
*/
function xor(uint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.xor(euint8.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates eq(euint8 a, uint8 b) and returns the result.
*/
function eq(euint8 a, uint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return ebool.wrap(Impl.eq(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates eq(uint8 a, euint8 b) and returns the result.
*/
function eq(uint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.eq(euint8.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates ne(euint8 a, uint8 b) and returns the result.
*/
function ne(euint8 a, uint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return ebool.wrap(Impl.ne(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates ne(uint8 a, euint8 b) and returns the result.
*/
function ne(uint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.ne(euint8.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates ge(euint8 a, uint8 b) and returns the result.
*/
function ge(euint8 a, uint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return ebool.wrap(Impl.ge(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates ge(uint8 a, euint8 b) and returns the result.
*/
function ge(uint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.le(euint8.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates gt(euint8 a, uint8 b) and returns the result.
*/
function gt(euint8 a, uint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return ebool.wrap(Impl.gt(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates gt(uint8 a, euint8 b) and returns the result.
*/
function gt(uint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.lt(euint8.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates le(euint8 a, uint8 b) and returns the result.
*/
function le(euint8 a, uint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return ebool.wrap(Impl.le(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates le(uint8 a, euint8 b) and returns the result.
*/
function le(uint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.ge(euint8.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates lt(euint8 a, uint8 b) and returns the result.
*/
function lt(euint8 a, uint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return ebool.wrap(Impl.lt(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates lt(uint8 a, euint8 b) and returns the result.
*/
function lt(uint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint8(0);
}
return ebool.wrap(Impl.gt(euint8.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates min(euint8 a, uint8 b) and returns the result.
*/
function min(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.min(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates min(uint8 a, euint8 b) and returns the result.
*/
function min(uint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.min(euint8.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates max(euint8 a, uint8 b) and returns the result.
*/
function max(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.max(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates max(uint8 a, euint8 b) and returns the result.
*/
function max(uint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.max(euint8.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates add(euint16 a, uint16 b) and returns the result.
*/
function add(euint16 a, uint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.add(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates add(uint16 a, euint16 b) and returns the result.
*/
function add(uint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.add(euint16.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates sub(euint16 a, uint16 b) and returns the result.
*/
function sub(euint16 a, uint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.sub(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates sub(uint16 a, euint16 b) and returns the result.
*/
function sub(uint16 a, euint16 b) internal returns (euint16) {
euint16 aEnc = asEuint16(a);
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.sub(euint16.unwrap(aEnc), euint16.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint16 a, uint16 b) and returns the result.
*/
function mul(euint16 a, uint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.mul(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates mul(uint16 a, euint16 b) and returns the result.
*/
function mul(uint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.mul(euint16.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates div(euint16 a, uint16 b) and returns the result.
*/
function div(euint16 a, uint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.div(euint16.unwrap(a), bytes32(uint256(b))));
}
/**
* @dev Evaluates rem(euint16 a, uint16 b) and returns the result.
*/
function rem(euint16 a, uint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.rem(euint16.unwrap(a), bytes32(uint256(b))));
}
/**
* @dev Evaluates and(euint16 a, uint16 b) and returns the result.
*/
function and(euint16 a, uint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.and(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates and(uint16 a, euint16 b) and returns the result.
*/
function and(uint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.and(euint16.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates or(euint16 a, uint16 b) and returns the result.
*/
function or(euint16 a, uint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.or(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates or(uint16 a, euint16 b) and returns the result.
*/
function or(uint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.or(euint16.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates xor(euint16 a, uint16 b) and returns the result.
*/
function xor(euint16 a, uint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.xor(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates xor(uint16 a, euint16 b) and returns the result.
*/
function xor(uint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.xor(euint16.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates eq(euint16 a, uint16 b) and returns the result.
*/
function eq(euint16 a, uint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return ebool.wrap(Impl.eq(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates eq(uint16 a, euint16 b) and returns the result.
*/
function eq(uint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.eq(euint16.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates ne(euint16 a, uint16 b) and returns the result.
*/
function ne(euint16 a, uint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return ebool.wrap(Impl.ne(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates ne(uint16 a, euint16 b) and returns the result.
*/
function ne(uint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.ne(euint16.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates ge(euint16 a, uint16 b) and returns the result.
*/
function ge(euint16 a, uint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return ebool.wrap(Impl.ge(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates ge(uint16 a, euint16 b) and returns the result.
*/
function ge(uint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.le(euint16.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates gt(euint16 a, uint16 b) and returns the result.
*/
function gt(euint16 a, uint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return ebool.wrap(Impl.gt(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates gt(uint16 a, euint16 b) and returns the result.
*/
function gt(uint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.lt(euint16.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates le(euint16 a, uint16 b) and returns the result.
*/
function le(euint16 a, uint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return ebool.wrap(Impl.le(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates le(uint16 a, euint16 b) and returns the result.
*/
function le(uint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.ge(euint16.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates lt(euint16 a, uint16 b) and returns the result.
*/
function lt(euint16 a, uint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return ebool.wrap(Impl.lt(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates lt(uint16 a, euint16 b) and returns the result.
*/
function lt(uint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint16(0);
}
return ebool.wrap(Impl.gt(euint16.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates min(euint16 a, uint16 b) and returns the result.
*/
function min(euint16 a, uint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.min(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates min(uint16 a, euint16 b) and returns the result.
*/
function min(uint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.min(euint16.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates max(euint16 a, uint16 b) and returns the result.
*/
function max(euint16 a, uint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.max(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates max(uint16 a, euint16 b) and returns the result.
*/
function max(uint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(b)) {
b = asEuint16(0);
}
return euint16.wrap(Impl.max(euint16.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates add(euint32 a, uint32 b) and returns the result.
*/
function add(euint32 a, uint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.add(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates add(uint32 a, euint32 b) and returns the result.
*/
function add(uint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.add(euint32.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates sub(euint32 a, uint32 b) and returns the result.
*/
function sub(euint32 a, uint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.sub(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates sub(uint32 a, euint32 b) and returns the result.
*/
function sub(uint32 a, euint32 b) internal returns (euint32) {
euint32 aEnc = asEuint32(a);
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.sub(euint32.unwrap(aEnc), euint32.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint32 a, uint32 b) and returns the result.
*/
function mul(euint32 a, uint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.mul(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates mul(uint32 a, euint32 b) and returns the result.
*/
function mul(uint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.mul(euint32.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates div(euint32 a, uint32 b) and returns the result.
*/
function div(euint32 a, uint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.div(euint32.unwrap(a), bytes32(uint256(b))));
}
/**
* @dev Evaluates rem(euint32 a, uint32 b) and returns the result.
*/
function rem(euint32 a, uint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.rem(euint32.unwrap(a), bytes32(uint256(b))));
}
/**
* @dev Evaluates and(euint32 a, uint32 b) and returns the result.
*/
function and(euint32 a, uint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.and(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates and(uint32 a, euint32 b) and returns the result.
*/
function and(uint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.and(euint32.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates or(euint32 a, uint32 b) and returns the result.
*/
function or(euint32 a, uint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.or(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates or(uint32 a, euint32 b) and returns the result.
*/
function or(uint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.or(euint32.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates xor(euint32 a, uint32 b) and returns the result.
*/
function xor(euint32 a, uint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.xor(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates xor(uint32 a, euint32 b) and returns the result.
*/
function xor(uint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.xor(euint32.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates eq(euint32 a, uint32 b) and returns the result.
*/
function eq(euint32 a, uint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return ebool.wrap(Impl.eq(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates eq(uint32 a, euint32 b) and returns the result.
*/
function eq(uint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.eq(euint32.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates ne(euint32 a, uint32 b) and returns the result.
*/
function ne(euint32 a, uint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return ebool.wrap(Impl.ne(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates ne(uint32 a, euint32 b) and returns the result.
*/
function ne(uint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.ne(euint32.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates ge(euint32 a, uint32 b) and returns the result.
*/
function ge(euint32 a, uint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return ebool.wrap(Impl.ge(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates ge(uint32 a, euint32 b) and returns the result.
*/
function ge(uint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.le(euint32.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates gt(euint32 a, uint32 b) and returns the result.
*/
function gt(euint32 a, uint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return ebool.wrap(Impl.gt(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates gt(uint32 a, euint32 b) and returns the result.
*/
function gt(uint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.lt(euint32.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates le(euint32 a, uint32 b) and returns the result.
*/
function le(euint32 a, uint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return ebool.wrap(Impl.le(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates le(uint32 a, euint32 b) and returns the result.
*/
function le(uint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.ge(euint32.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates lt(euint32 a, uint32 b) and returns the result.
*/
function lt(euint32 a, uint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return ebool.wrap(Impl.lt(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates lt(uint32 a, euint32 b) and returns the result.
*/
function lt(uint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint32(0);
}
return ebool.wrap(Impl.gt(euint32.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates min(euint32 a, uint32 b) and returns the result.
*/
function min(euint32 a, uint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.min(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates min(uint32 a, euint32 b) and returns the result.
*/
function min(uint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.min(euint32.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates max(euint32 a, uint32 b) and returns the result.
*/
function max(euint32 a, uint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.max(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates max(uint32 a, euint32 b) and returns the result.
*/
function max(uint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(b)) {
b = asEuint32(0);
}
return euint32.wrap(Impl.max(euint32.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates add(euint64 a, uint64 b) and returns the result.
*/
function add(euint64 a, uint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.add(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates add(uint64 a, euint64 b) and returns the result.
*/
function add(uint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.add(euint64.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates sub(euint64 a, uint64 b) and returns the result.
*/
function sub(euint64 a, uint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.sub(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates sub(uint64 a, euint64 b) and returns the result.
*/
function sub(uint64 a, euint64 b) internal returns (euint64) {
euint64 aEnc = asEuint64(a);
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.sub(euint64.unwrap(aEnc), euint64.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint64 a, uint64 b) and returns the result.
*/
function mul(euint64 a, uint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.mul(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates mul(uint64 a, euint64 b) and returns the result.
*/
function mul(uint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.mul(euint64.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates div(euint64 a, uint64 b) and returns the result.
*/
function div(euint64 a, uint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.div(euint64.unwrap(a), bytes32(uint256(b))));
}
/**
* @dev Evaluates rem(euint64 a, uint64 b) and returns the result.
*/
function rem(euint64 a, uint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.rem(euint64.unwrap(a), bytes32(uint256(b))));
}
/**
* @dev Evaluates and(euint64 a, uint64 b) and returns the result.
*/
function and(euint64 a, uint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.and(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates and(uint64 a, euint64 b) and returns the result.
*/
function and(uint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.and(euint64.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates or(euint64 a, uint64 b) and returns the result.
*/
function or(euint64 a, uint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.or(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates or(uint64 a, euint64 b) and returns the result.
*/
function or(uint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.or(euint64.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates xor(euint64 a, uint64 b) and returns the result.
*/
function xor(euint64 a, uint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.xor(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates xor(uint64 a, euint64 b) and returns the result.
*/
function xor(uint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.xor(euint64.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates eq(euint64 a, uint64 b) and returns the result.
*/
function eq(euint64 a, uint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return ebool.wrap(Impl.eq(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates eq(uint64 a, euint64 b) and returns the result.
*/
function eq(uint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.eq(euint64.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates ne(euint64 a, uint64 b) and returns the result.
*/
function ne(euint64 a, uint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return ebool.wrap(Impl.ne(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates ne(uint64 a, euint64 b) and returns the result.
*/
function ne(uint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.ne(euint64.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates ge(euint64 a, uint64 b) and returns the result.
*/
function ge(euint64 a, uint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return ebool.wrap(Impl.ge(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates ge(uint64 a, euint64 b) and returns the result.
*/
function ge(uint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.le(euint64.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates gt(euint64 a, uint64 b) and returns the result.
*/
function gt(euint64 a, uint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return ebool.wrap(Impl.gt(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates gt(uint64 a, euint64 b) and returns the result.
*/
function gt(uint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.lt(euint64.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates le(euint64 a, uint64 b) and returns the result.
*/
function le(euint64 a, uint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return ebool.wrap(Impl.le(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates le(uint64 a, euint64 b) and returns the result.
*/
function le(uint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.ge(euint64.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates lt(euint64 a, uint64 b) and returns the result.
*/
function lt(euint64 a, uint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return ebool.wrap(Impl.lt(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates lt(uint64 a, euint64 b) and returns the result.
*/
function lt(uint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint64(0);
}
return ebool.wrap(Impl.gt(euint64.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates min(euint64 a, uint64 b) and returns the result.
*/
function min(euint64 a, uint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.min(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates min(uint64 a, euint64 b) and returns the result.
*/
function min(uint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.min(euint64.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates max(euint64 a, uint64 b) and returns the result.
*/
function max(euint64 a, uint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.max(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates max(uint64 a, euint64 b) and returns the result.
*/
function max(uint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(b)) {
b = asEuint64(0);
}
return euint64.wrap(Impl.max(euint64.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates add(euint128 a, uint128 b) and returns the result.
*/
function add(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.add(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates add(uint128 a, euint128 b) and returns the result.
*/
function add(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.add(euint128.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates sub(euint128 a, uint128 b) and returns the result.
*/
function sub(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.sub(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates sub(uint128 a, euint128 b) and returns the result.
*/
function sub(uint128 a, euint128 b) internal returns (euint128) {
euint128 aEnc = asEuint128(a);
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.sub(euint128.unwrap(aEnc), euint128.unwrap(b), false));
}
/**
* @dev Evaluates mul(euint128 a, uint128 b) and returns the result.
*/
function mul(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.mul(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates mul(uint128 a, euint128 b) and returns the result.
*/
function mul(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.mul(euint128.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates div(euint128 a, uint128 b) and returns the result.
*/
function div(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.div(euint128.unwrap(a), bytes32(uint256(b))));
}
/**
* @dev Evaluates rem(euint128 a, uint128 b) and returns the result.
*/
function rem(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.rem(euint128.unwrap(a), bytes32(uint256(b))));
}
/**
* @dev Evaluates and(euint128 a, uint128 b) and returns the result.
*/
function and(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.and(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates and(uint128 a, euint128 b) and returns the result.
*/
function and(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.and(euint128.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates or(euint128 a, uint128 b) and returns the result.
*/
function or(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.or(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates or(uint128 a, euint128 b) and returns the result.
*/
function or(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.or(euint128.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates xor(euint128 a, uint128 b) and returns the result.
*/
function xor(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.xor(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates xor(uint128 a, euint128 b) and returns the result.
*/
function xor(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.xor(euint128.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates eq(euint128 a, uint128 b) and returns the result.
*/
function eq(euint128 a, uint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return ebool.wrap(Impl.eq(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates eq(uint128 a, euint128 b) and returns the result.
*/
function eq(uint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.eq(euint128.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates ne(euint128 a, uint128 b) and returns the result.
*/
function ne(euint128 a, uint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return ebool.wrap(Impl.ne(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates ne(uint128 a, euint128 b) and returns the result.
*/
function ne(uint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.ne(euint128.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates ge(euint128 a, uint128 b) and returns the result.
*/
function ge(euint128 a, uint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return ebool.wrap(Impl.ge(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates ge(uint128 a, euint128 b) and returns the result.
*/
function ge(uint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.le(euint128.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates gt(euint128 a, uint128 b) and returns the result.
*/
function gt(euint128 a, uint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return ebool.wrap(Impl.gt(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates gt(uint128 a, euint128 b) and returns the result.
*/
function gt(uint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.lt(euint128.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates le(euint128 a, uint128 b) and returns the result.
*/
function le(euint128 a, uint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return ebool.wrap(Impl.le(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates le(uint128 a, euint128 b) and returns the result.
*/
function le(uint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.ge(euint128.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates lt(euint128 a, uint128 b) and returns the result.
*/
function lt(euint128 a, uint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return ebool.wrap(Impl.lt(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates lt(uint128 a, euint128 b) and returns the result.
*/
function lt(uint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint128(0);
}
return ebool.wrap(Impl.gt(euint128.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates min(euint128 a, uint128 b) and returns the result.
*/
function min(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.min(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates min(uint128 a, euint128 b) and returns the result.
*/
function min(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.min(euint128.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates max(euint128 a, uint128 b) and returns the result.
*/
function max(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.max(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates max(uint128 a, euint128 b) and returns the result.
*/
function max(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
b = asEuint128(0);
}
return euint128.wrap(Impl.max(euint128.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates eq(eaddress a, address b) and returns the result.
*/
function eq(eaddress a, address b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEaddress(address(0));
}
return ebool.wrap(Impl.eq(eaddress.unwrap(a), bytes32(uint256(uint160(b))), true));
}
/**
* @dev Evaluates eq(address a, eaddress b) and returns the result.
*/
function eq(address a, eaddress b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEaddress(address(0));
}
return ebool.wrap(Impl.eq(eaddress.unwrap(b), bytes32(uint256(uint160(a))), true));
}
/**
* @dev Evaluates ne(eaddress a, address b) and returns the result.
*/
function ne(eaddress a, address b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEaddress(address(0));
}
return ebool.wrap(Impl.ne(eaddress.unwrap(a), bytes32(uint256(uint160(b))), true));
}
/**
* @dev Evaluates ne(address a, eaddress b) and returns the result.
*/
function ne(address a, eaddress b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEaddress(address(0));
}
return ebool.wrap(Impl.ne(eaddress.unwrap(b), bytes32(uint256(uint160(a))), true));
}
/**
* @dev Evaluates and(euint256 a, uint256 b) and returns the result.
*/
function and(euint256 a, uint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
return euint256.wrap(Impl.and(euint256.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates and(uint256 a, euint256 b) and returns the result.
*/
function and(uint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.and(euint256.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates or(euint256 a, uint256 b) and returns the result.
*/
function or(euint256 a, uint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
return euint256.wrap(Impl.or(euint256.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates or(uint256 a, euint256 b) and returns the result.
*/
function or(uint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.or(euint256.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates xor(euint256 a, uint256 b) and returns the result.
*/
function xor(euint256 a, uint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
return euint256.wrap(Impl.xor(euint256.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates xor(uint256 a, euint256 b) and returns the result.
*/
function xor(uint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(b)) {
b = asEuint256(0);
}
return euint256.wrap(Impl.xor(euint256.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates eq(euint256 a, uint256 b) and returns the result.
*/
function eq(euint256 a, uint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
return ebool.wrap(Impl.eq(euint256.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates eq(uint256 a, euint256 b) and returns the result.
*/
function eq(uint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.eq(euint256.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates ne(euint256 a, uint256 b) and returns the result.
*/
function ne(euint256 a, uint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
return ebool.wrap(Impl.ne(euint256.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates ne(uint256 a, euint256 b) and returns the result.
*/
function ne(uint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(b)) {
b = asEuint256(0);
}
return ebool.wrap(Impl.ne(euint256.unwrap(b), bytes32(uint256(a)), true));
}
/**
* @dev Evaluates shl(euint8 a, euint8 b) and returns the result.
*/
function shl(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.shl(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates shl(euint8 a, uint8) and returns the result.
*/
function shl(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.shl(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates shr(euint8 a, euint8 b) and returns the result.
*/
function shr(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.shr(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates shr(euint8 a, uint8) and returns the result.
*/
function shr(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.shr(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates rotl(euint8 a, euint8 b) and returns the result.
*/
function rotl(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.rotl(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates rotl(euint8 a, uint8) and returns the result.
*/
function rotl(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.rotl(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates rotr(euint8 a, euint8 b) and returns the result.
*/
function rotr(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint8.wrap(Impl.rotr(euint8.unwrap(a), euint8.unwrap(b), false));
}
/**
* @dev Evaluates rotr(euint8 a, uint8) and returns the result.
*/
function rotr(euint8 a, uint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
return euint8.wrap(Impl.rotr(euint8.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates shl(euint16 a, euint8 b) and returns the result.
*/
function shl(euint16 a, euint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint16.wrap(Impl.shl(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates shl(euint16 a, uint8) and returns the result.
*/
function shl(euint16 a, uint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.shl(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates shr(euint16 a, euint8 b) and returns the result.
*/
function shr(euint16 a, euint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint16.wrap(Impl.shr(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates shr(euint16 a, uint8) and returns the result.
*/
function shr(euint16 a, uint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.shr(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates rotl(euint16 a, euint8 b) and returns the result.
*/
function rotl(euint16 a, euint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint16.wrap(Impl.rotl(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates rotl(euint16 a, uint8) and returns the result.
*/
function rotl(euint16 a, uint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.rotl(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates rotr(euint16 a, euint8 b) and returns the result.
*/
function rotr(euint16 a, euint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint16.wrap(Impl.rotr(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
/**
* @dev Evaluates rotr(euint16 a, uint8) and returns the result.
*/
function rotr(euint16 a, uint8 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint16(0);
}
return euint16.wrap(Impl.rotr(euint16.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates shl(euint32 a, euint8 b) and returns the result.
*/
function shl(euint32 a, euint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint32.wrap(Impl.shl(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates shl(euint32 a, uint8) and returns the result.
*/
function shl(euint32 a, uint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.shl(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates shr(euint32 a, euint8 b) and returns the result.
*/
function shr(euint32 a, euint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint32.wrap(Impl.shr(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates shr(euint32 a, uint8) and returns the result.
*/
function shr(euint32 a, uint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.shr(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates rotl(euint32 a, euint8 b) and returns the result.
*/
function rotl(euint32 a, euint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint32.wrap(Impl.rotl(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates rotl(euint32 a, uint8) and returns the result.
*/
function rotl(euint32 a, uint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.rotl(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates rotr(euint32 a, euint8 b) and returns the result.
*/
function rotr(euint32 a, euint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint32.wrap(Impl.rotr(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
}
/**
* @dev Evaluates rotr(euint32 a, uint8) and returns the result.
*/
function rotr(euint32 a, uint8 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint32(0);
}
return euint32.wrap(Impl.rotr(euint32.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates shl(euint64 a, euint8 b) and returns the result.
*/
function shl(euint64 a, euint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint64.wrap(Impl.shl(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates shl(euint64 a, uint8) and returns the result.
*/
function shl(euint64 a, uint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.shl(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates shr(euint64 a, euint8 b) and returns the result.
*/
function shr(euint64 a, euint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint64.wrap(Impl.shr(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates shr(euint64 a, uint8) and returns the result.
*/
function shr(euint64 a, uint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.shr(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates rotl(euint64 a, euint8 b) and returns the result.
*/
function rotl(euint64 a, euint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint64.wrap(Impl.rotl(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates rotl(euint64 a, uint8) and returns the result.
*/
function rotl(euint64 a, uint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.rotl(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates rotr(euint64 a, euint8 b) and returns the result.
*/
function rotr(euint64 a, euint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint64.wrap(Impl.rotr(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
}
/**
* @dev Evaluates rotr(euint64 a, uint8) and returns the result.
*/
function rotr(euint64 a, uint8 b) internal returns (euint64) {
if (!isInitialized(a)) {
a = asEuint64(0);
}
return euint64.wrap(Impl.rotr(euint64.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates shl(euint128 a, euint8 b) and returns the result.
*/
function shl(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint128.wrap(Impl.shl(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates shl(euint128 a, uint8) and returns the result.
*/
function shl(euint128 a, uint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.shl(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates shr(euint128 a, euint8 b) and returns the result.
*/
function shr(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint128.wrap(Impl.shr(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates shr(euint128 a, uint8) and returns the result.
*/
function shr(euint128 a, uint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.shr(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates rotl(euint128 a, euint8 b) and returns the result.
*/
function rotl(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint128.wrap(Impl.rotl(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates rotl(euint128 a, uint8) and returns the result.
*/
function rotl(euint128 a, uint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.rotl(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates rotr(euint128 a, euint8 b) and returns the result.
*/
function rotr(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint128.wrap(Impl.rotr(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
/**
* @dev Evaluates rotr(euint128 a, uint8) and returns the result.
*/
function rotr(euint128 a, uint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint128(0);
}
return euint128.wrap(Impl.rotr(euint128.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates shl(euint256 a, euint8 b) and returns the result.
*/
function shl(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint256.wrap(Impl.shl(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates shl(euint256 a, uint8) and returns the result.
*/
function shl(euint256 a, uint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
return euint256.wrap(Impl.shl(euint256.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates shr(euint256 a, euint8 b) and returns the result.
*/
function shr(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint256.wrap(Impl.shr(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates shr(euint256 a, uint8) and returns the result.
*/
function shr(euint256 a, uint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
return euint256.wrap(Impl.shr(euint256.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates rotl(euint256 a, euint8 b) and returns the result.
*/
function rotl(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint256.wrap(Impl.rotl(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates rotl(euint256 a, uint8) and returns the result.
*/
function rotl(euint256 a, uint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
return euint256.wrap(Impl.rotl(euint256.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev Evaluates rotr(euint256 a, euint8 b) and returns the result.
*/
function rotr(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
if (!isInitialized(b)) {
b = asEuint8(0);
}
return euint256.wrap(Impl.rotr(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
/**
* @dev Evaluates rotr(euint256 a, uint8) and returns the result.
*/
function rotr(euint256 a, uint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
a = asEuint256(0);
}
return euint256.wrap(Impl.rotr(euint256.unwrap(a), bytes32(uint256(b)), true));
}
/**
* @dev If 'control's value is 'true', the result has the same value as 'ifTrue'.
* If 'control's value is 'false', the result has the same value as 'ifFalse'.
*/
function select(ebool control, ebool a, ebool b) internal returns (ebool) {
return ebool.wrap(Impl.select(ebool.unwrap(control), ebool.unwrap(a), ebool.unwrap(b)));
}
/**
* @dev If 'control's value is 'true', the result has the same value as 'ifTrue'.
* If 'control's value is 'false', the result has the same value as 'ifFalse'.
*/
function select(ebool control, euint8 a, euint8 b) internal returns (euint8) {
return euint8.wrap(Impl.select(ebool.unwrap(control), euint8.unwrap(a), euint8.unwrap(b)));
}
/**
* @dev If 'control's value is 'true', the result has the same value as 'ifTrue'.
* If 'control's value is 'false', the result has the same value as 'ifFalse'.
*/
function select(ebool control, euint16 a, euint16 b) internal returns (euint16) {
return euint16.wrap(Impl.select(ebool.unwrap(control), euint16.unwrap(a), euint16.unwrap(b)));
}
/**
* @dev If 'control's value is 'true', the result has the same value as 'ifTrue'.
* If 'control's value is 'false', the result has the same value as 'ifFalse'.
*/
function select(ebool control, euint32 a, euint32 b) internal returns (euint32) {
return euint32.wrap(Impl.select(ebool.unwrap(control), euint32.unwrap(a), euint32.unwrap(b)));
}
/**
* @dev If 'control's value is 'true', the result has the same value as 'ifTrue'.
* If 'control's value is 'false', the result has the same value as 'ifFalse'.
*/
function select(ebool control, euint64 a, euint64 b) internal returns (euint64) {
return euint64.wrap(Impl.select(ebool.unwrap(control), euint64.unwrap(a), euint64.unwrap(b)));
}
/**
* @dev If 'control's value is 'true', the result has the same value as 'ifTrue'.
* If 'control's value is 'false', the result has the same value as 'ifFalse'.
*/
function select(ebool control, euint128 a, euint128 b) internal returns (euint128) {
return euint128.wrap(Impl.select(ebool.unwrap(control), euint128.unwrap(a), euint128.unwrap(b)));
}
/**
* @dev If 'control's value is 'true', the result has the same value as 'ifTrue'.
* If 'control's value is 'false', the result has the same value as 'ifFalse'.
*/
function select(ebool control, eaddress a, eaddress b) internal returns (eaddress) {
return eaddress.wrap(Impl.select(ebool.unwrap(control), eaddress.unwrap(a), eaddress.unwrap(b)));
}
/**
* @dev If 'control's value is 'true', the result has the same value as 'ifTrue'.
* If 'control's value is 'false', the result has the same value as 'ifFalse'.
*/
function select(ebool control, euint256 a, euint256 b) internal returns (euint256) {
return euint256.wrap(Impl.select(ebool.unwrap(control), euint256.unwrap(a), euint256.unwrap(b)));
}
/**
* @dev Casts an encrypted integer from 'euint16' to 'euint8'.
*/
function asEuint8(euint16 value) internal returns (euint8) {
return euint8.wrap(Impl.cast(euint16.unwrap(value), FheType.Uint8));
}
/**
* @dev Casts an encrypted integer from 'euint32' to 'euint8'.
*/
function asEuint8(euint32 value) internal returns (euint8) {
return euint8.wrap(Impl.cast(euint32.unwrap(value), FheType.Uint8));
}
/**
* @dev Casts an encrypted integer from 'euint64' to 'euint8'.
*/
function asEuint8(euint64 value) internal returns (euint8) {
return euint8.wrap(Impl.cast(euint64.unwrap(value), FheType.Uint8));
}
/**
* @dev Casts an encrypted integer from 'euint128' to 'euint8'.
*/
function asEuint8(euint128 value) internal returns (euint8) {
return euint8.wrap(Impl.cast(euint128.unwrap(value), FheType.Uint8));
}
/**
* @dev Casts an encrypted integer from 'euint256' to 'euint8'.
*/
function asEuint8(euint256 value) internal returns (euint8) {
return euint8.wrap(Impl.cast(euint256.unwrap(value), FheType.Uint8));
}
/**
/**
* @dev Converts an 'ebool' to an 'euint8'.
*/
function asEuint8(ebool b) internal returns (euint8) {
return euint8.wrap(Impl.cast(ebool.unwrap(b), FheType.Uint8));
}
/**
* @dev Casts an encrypted integer from 'euint8' to 'ebool'.
*/
function asEbool(euint8 value) internal returns (ebool) {
return ne(value, 0);
}
/**
* @dev Casts an encrypted integer from 'euint8' to 'euint16'.
*/
function asEuint16(euint8 value) internal returns (euint16) {
return euint16.wrap(Impl.cast(euint8.unwrap(value), FheType.Uint16));
}
/**
* @dev Casts an encrypted integer from 'euint32' to 'euint16'.
*/
function asEuint16(euint32 value) internal returns (euint16) {
return euint16.wrap(Impl.cast(euint32.unwrap(value), FheType.Uint16));
}
/**
* @dev Casts an encrypted integer from 'euint64' to 'euint16'.
*/
function asEuint16(euint64 value) internal returns (euint16) {
return euint16.wrap(Impl.cast(euint64.unwrap(value), FheType.Uint16));
}
/**
* @dev Casts an encrypted integer from 'euint128' to 'euint16'.
*/
function asEuint16(euint128 value) internal returns (euint16) {
return euint16.wrap(Impl.cast(euint128.unwrap(value), FheType.Uint16));
}
/**
* @dev Casts an encrypted integer from 'euint256' to 'euint16'.
*/
function asEuint16(euint256 value) internal returns (euint16) {
return euint16.wrap(Impl.cast(euint256.unwrap(value), FheType.Uint16));
}
/**
/**
* @dev Converts an 'ebool' to an 'euint16'.
*/
function asEuint16(ebool b) internal returns (euint16) {
return euint16.wrap(Impl.cast(ebool.unwrap(b), FheType.Uint16));
}
/**
* @dev Casts an encrypted integer from 'euint16' to 'ebool'.
*/
function asEbool(euint16 value) internal returns (ebool) {
return ne(value, 0);
}
/**
* @dev Casts an encrypted integer from 'euint8' to 'euint32'.
*/
function asEuint32(euint8 value) internal returns (euint32) {
return euint32.wrap(Impl.cast(euint8.unwrap(value), FheType.Uint32));
}
/**
* @dev Casts an encrypted integer from 'euint16' to 'euint32'.
*/
function asEuint32(euint16 value) internal returns (euint32) {
return euint32.wrap(Impl.cast(euint16.unwrap(value), FheType.Uint32));
}
/**
* @dev Casts an encrypted integer from 'euint64' to 'euint32'.
*/
function asEuint32(euint64 value) internal returns (euint32) {
return euint32.wrap(Impl.cast(euint64.unwrap(value), FheType.Uint32));
}
/**
* @dev Casts an encrypted integer from 'euint128' to 'euint32'.
*/
function asEuint32(euint128 value) internal returns (euint32) {
return euint32.wrap(Impl.cast(euint128.unwrap(value), FheType.Uint32));
}
/**
* @dev Casts an encrypted integer from 'euint256' to 'euint32'.
*/
function asEuint32(euint256 value) internal returns (euint32) {
return euint32.wrap(Impl.cast(euint256.unwrap(value), FheType.Uint32));
}
/**
/**
* @dev Converts an 'ebool' to an 'euint32'.
*/
function asEuint32(ebool b) internal returns (euint32) {
return euint32.wrap(Impl.cast(ebool.unwrap(b), FheType.Uint32));
}
/**
* @dev Casts an encrypted integer from 'euint32' to 'ebool'.
*/
function asEbool(euint32 value) internal returns (ebool) {
return ne(value, 0);
}
/**
* @dev Casts an encrypted integer from 'euint8' to 'euint64'.
*/
function asEuint64(euint8 value) internal returns (euint64) {
return euint64.wrap(Impl.cast(euint8.unwrap(value), FheType.Uint64));
}
/**
* @dev Casts an encrypted integer from 'euint16' to 'euint64'.
*/
function asEuint64(euint16 value) internal returns (euint64) {
return euint64.wrap(Impl.cast(euint16.unwrap(value), FheType.Uint64));
}
/**
* @dev Casts an encrypted integer from 'euint32' to 'euint64'.
*/
function asEuint64(euint32 value) internal returns (euint64) {
return euint64.wrap(Impl.cast(euint32.unwrap(value), FheType.Uint64));
}
/**
* @dev Casts an encrypted integer from 'euint128' to 'euint64'.
*/
function asEuint64(euint128 value) internal returns (euint64) {
return euint64.wrap(Impl.cast(euint128.unwrap(value), FheType.Uint64));
}
/**
* @dev Casts an encrypted integer from 'euint256' to 'euint64'.
*/
function asEuint64(euint256 value) internal returns (euint64) {
return euint64.wrap(Impl.cast(euint256.unwrap(value), FheType.Uint64));
}
/**
/**
* @dev Converts an 'ebool' to an 'euint64'.
*/
function asEuint64(ebool b) internal returns (euint64) {
return euint64.wrap(Impl.cast(ebool.unwrap(b), FheType.Uint64));
}
/**
* @dev Casts an encrypted integer from 'euint64' to 'ebool'.
*/
function asEbool(euint64 value) internal returns (ebool) {
return ne(value, 0);
}
/**
* @dev Casts an encrypted integer from 'euint8' to 'euint128'.
*/
function asEuint128(euint8 value) internal returns (euint128) {
return euint128.wrap(Impl.cast(euint8.unwrap(value), FheType.Uint128));
}
/**
* @dev Casts an encrypted integer from 'euint16' to 'euint128'.
*/
function asEuint128(euint16 value) internal returns (euint128) {
return euint128.wrap(Impl.cast(euint16.unwrap(value), FheType.Uint128));
}
/**
* @dev Casts an encrypted integer from 'euint32' to 'euint128'.
*/
function asEuint128(euint32 value) internal returns (euint128) {
return euint128.wrap(Impl.cast(euint32.unwrap(value), FheType.Uint128));
}
/**
* @dev Casts an encrypted integer from 'euint64' to 'euint128'.
*/
function asEuint128(euint64 value) internal returns (euint128) {
return euint128.wrap(Impl.cast(euint64.unwrap(value), FheType.Uint128));
}
/**
* @dev Casts an encrypted integer from 'euint256' to 'euint128'.
*/
function asEuint128(euint256 value) internal returns (euint128) {
return euint128.wrap(Impl.cast(euint256.unwrap(value), FheType.Uint128));
}
/**
/**
* @dev Converts an 'ebool' to an 'euint128'.
*/
function asEuint128(ebool b) internal returns (euint128) {
return euint128.wrap(Impl.cast(ebool.unwrap(b), FheType.Uint128));
}
/**
* @dev Casts an encrypted integer from 'euint128' to 'ebool'.
*/
function asEbool(euint128 value) internal returns (ebool) {
return ne(value, 0);
}
/**
* @dev Casts an encrypted integer from 'euint8' to 'euint256'.
*/
function asEuint256(euint8 value) internal returns (euint256) {
return euint256.wrap(Impl.cast(euint8.unwrap(value), FheType.Uint256));
}
/**
* @dev Casts an encrypted integer from 'euint16' to 'euint256'.
*/
function asEuint256(euint16 value) internal returns (euint256) {
return euint256.wrap(Impl.cast(euint16.unwrap(value), FheType.Uint256));
}
/**
* @dev Casts an encrypted integer from 'euint32' to 'euint256'.
*/
function asEuint256(euint32 value) internal returns (euint256) {
return euint256.wrap(Impl.cast(euint32.unwrap(value), FheType.Uint256));
}
/**
* @dev Casts an encrypted integer from 'euint64' to 'euint256'.
*/
function asEuint256(euint64 value) internal returns (euint256) {
return euint256.wrap(Impl.cast(euint64.unwrap(value), FheType.Uint256));
}
/**
* @dev Casts an encrypted integer from 'euint128' to 'euint256'.
*/
function asEuint256(euint128 value) internal returns (euint256) {
return euint256.wrap(Impl.cast(euint128.unwrap(value), FheType.Uint256));
}
/**
/**
* @dev Converts an 'ebool' to an 'euint256'.
*/
function asEuint256(ebool b) internal returns (euint256) {
return euint256.wrap(Impl.cast(ebool.unwrap(b), FheType.Uint256));
}
/**
* @dev Casts an encrypted integer from 'euint256' to 'ebool'.
*/
function asEbool(euint256 value) internal returns (ebool) {
return ne(value, 0);
}
/**
* @dev Evaluates not(ebool value) and returns the result.
*/
function not(ebool value) internal returns (ebool) {
return ebool.wrap(Impl.not(ebool.unwrap(value)));
}
/**
* @dev Evaluates neg(euint8 value) and returns the result.
*/
function neg(euint8 value) internal returns (euint8) {
return euint8.wrap(Impl.neg(euint8.unwrap(value)));
}
/**
* @dev Evaluates not(euint8 value) and returns the result.
*/
function not(euint8 value) internal returns (euint8) {
return euint8.wrap(Impl.not(euint8.unwrap(value)));
}
/**
* @dev Evaluates neg(euint16 value) and returns the result.
*/
function neg(euint16 value) internal returns (euint16) {
return euint16.wrap(Impl.neg(euint16.unwrap(value)));
}
/**
* @dev Evaluates not(euint16 value) and returns the result.
*/
function not(euint16 value) internal returns (euint16) {
return euint16.wrap(Impl.not(euint16.unwrap(value)));
}
/**
* @dev Evaluates neg(euint32 value) and returns the result.
*/
function neg(euint32 value) internal returns (euint32) {
return euint32.wrap(Impl.neg(euint32.unwrap(value)));
}
/**
* @dev Evaluates not(euint32 value) and returns the result.
*/
function not(euint32 value) internal returns (euint32) {
return euint32.wrap(Impl.not(euint32.unwrap(value)));
}
/**
* @dev Evaluates neg(euint64 value) and returns the result.
*/
function neg(euint64 value) internal returns (euint64) {
return euint64.wrap(Impl.neg(euint64.unwrap(value)));
}
/**
* @dev Evaluates not(euint64 value) and returns the result.
*/
function not(euint64 value) internal returns (euint64) {
return euint64.wrap(Impl.not(euint64.unwrap(value)));
}
/**
* @dev Evaluates neg(euint128 value) and returns the result.
*/
function neg(euint128 value) internal returns (euint128) {
return euint128.wrap(Impl.neg(euint128.unwrap(value)));
}
/**
* @dev Evaluates not(euint128 value) and returns the result.
*/
function not(euint128 value) internal returns (euint128) {
return euint128.wrap(Impl.not(euint128.unwrap(value)));
}
/**
* @dev Evaluates neg(euint256 value) and returns the result.
*/
function neg(euint256 value) internal returns (euint256) {
return euint256.wrap(Impl.neg(euint256.unwrap(value)));
}
/**
* @dev Evaluates not(euint256 value) and returns the result.
*/
function not(euint256 value) internal returns (euint256) {
return euint256.wrap(Impl.not(euint256.unwrap(value)));
}
/**
* @dev Convert an inputHandle with corresponding inputProof to an encrypted ebool integer.
*/
function fromExternal(externalEbool inputHandle, bytes memory inputProof) internal returns (ebool) {
return ebool.wrap(Impl.verify(externalEbool.unwrap(inputHandle), inputProof, FheType.Bool));
}
/**
* @dev Converts a plaintext boolean to an encrypted boolean.
*/
function asEbool(bool value) internal returns (ebool) {
return ebool.wrap(Impl.trivialEncrypt(value ? 1 : 0, FheType.Bool));
}
/**
* @dev Convert an inputHandle with corresponding inputProof to an encrypted euint8 integer.
*/
function fromExternal(externalEuint8 inputHandle, bytes memory inputProof) internal returns (euint8) {
return euint8.wrap(Impl.verify(externalEuint8.unwrap(inputHandle), inputProof, FheType.Uint8));
}
/**
* @dev Convert a plaintext value to an encrypted euint8 integer.
*/
function asEuint8(uint8 value) internal returns (euint8) {
return euint8.wrap(Impl.trivialEncrypt(uint256(value), FheType.Uint8));
}
/**
* @dev Convert an inputHandle with corresponding inputProof to an encrypted euint16 integer.
*/
function fromExternal(externalEuint16 inputHandle, bytes memory inputProof) internal returns (euint16) {
return euint16.wrap(Impl.verify(externalEuint16.unwrap(inputHandle), inputProof, FheType.Uint16));
}
/**
* @dev Convert a plaintext value to an encrypted euint16 integer.
*/
function asEuint16(uint16 value) internal returns (euint16) {
return euint16.wrap(Impl.trivialEncrypt(uint256(value), FheType.Uint16));
}
/**
* @dev Convert an inputHandle with corresponding inputProof to an encrypted euint32 integer.
*/
function fromExternal(externalEuint32 inputHandle, bytes memory inputProof) internal returns (euint32) {
return euint32.wrap(Impl.verify(externalEuint32.unwrap(inputHandle), inputProof, FheType.Uint32));
}
/**
* @dev Convert a plaintext value to an encrypted euint32 integer.
*/
function asEuint32(uint32 value) internal returns (euint32) {
return euint32.wrap(Impl.trivialEncrypt(uint256(value), FheType.Uint32));
}
/**
* @dev Convert an inputHandle with corresponding inputProof to an encrypted euint64 integer.
*/
function fromExternal(externalEuint64 inputHandle, bytes memory inputProof) internal returns (euint64) {
return euint64.wrap(Impl.verify(externalEuint64.unwrap(inputHandle), inputProof, FheType.Uint64));
}
/**
* @dev Convert a plaintext value to an encrypted euint64 integer.
*/
function asEuint64(uint64 value) internal returns (euint64) {
return euint64.wrap(Impl.trivialEncrypt(uint256(value), FheType.Uint64));
}
/**
* @dev Convert an inputHandle with corresponding inputProof to an encrypted euint128 integer.
*/
function fromExternal(externalEuint128 inputHandle, bytes memory inputProof) internal returns (euint128) {
return euint128.wrap(Impl.verify(externalEuint128.unwrap(inputHandle), inputProof, FheType.Uint128));
}
/**
* @dev Convert a plaintext value to an encrypted euint128 integer.
*/
function asEuint128(uint128 value) internal returns (euint128) {
return euint128.wrap(Impl.trivialEncrypt(uint256(value), FheType.Uint128));
}
/**
* @dev Convert an inputHandle with corresponding inputProof to an encrypted eaddress integer.
*/
function fromExternal(externalEaddress inputHandle, bytes memory inputProof) internal returns (eaddress) {
return eaddress.wrap(Impl.verify(externalEaddress.unwrap(inputHandle), inputProof, FheType.Uint160));
}
/**
* @dev Convert a plaintext value to an encrypted eaddress integer.
*/
function asEaddress(address value) internal returns (eaddress) {
return eaddress.wrap(Impl.trivialEncrypt(uint256(uint160(value)), FheType.Uint160));
}
/**
* @dev Convert an inputHandle with corresponding inputProof to an encrypted euint256 integer.
*/
function fromExternal(externalEuint256 inputHandle, bytes memory inputProof) internal returns (euint256) {
return euint256.wrap(Impl.verify(externalEuint256.unwrap(inputHandle), inputProof, FheType.Uint256));
}
/**
* @dev Convert a plaintext value to an encrypted euint256 integer.
*/
function asEuint256(uint256 value) internal returns (euint256) {
return euint256.wrap(Impl.trivialEncrypt(uint256(value), FheType.Uint256));
}
/**
* @dev Generates a random encrypted value.
*/
function randEbool() internal returns (ebool) {
return ebool.wrap(Impl.rand(FheType.Bool));
}
/**
* @dev Generates a random encrypted value.
*/
function randEuint8() internal returns (euint8) {
return euint8.wrap(Impl.rand(FheType.Uint8));
}
/**
* @dev Generates a random encrypted 8-bit unsigned integer in the [0, upperBound) range.
* The upperBound must be a power of 2.
*/
function randEuint8(uint8 upperBound) internal returns (euint8) {
return euint8.wrap(Impl.randBounded(upperBound, FheType.Uint8));
}
/**
* @dev Generates a random encrypted value.
*/
function randEuint16() internal returns (euint16) {
return euint16.wrap(Impl.rand(FheType.Uint16));
}
/**
* @dev Generates a random encrypted 16-bit unsigned integer in the [0, upperBound) range.
* The upperBound must be a power of 2.
*/
function randEuint16(uint16 upperBound) internal returns (euint16) {
return euint16.wrap(Impl.randBounded(upperBound, FheType.Uint16));
}
/**
* @dev Generates a random encrypted value.
*/
function randEuint32() internal returns (euint32) {
return euint32.wrap(Impl.rand(FheType.Uint32));
}
/**
* @dev Generates a random encrypted 32-bit unsigned integer in the [0, upperBound) range.
* The upperBound must be a power of 2.
*/
function randEuint32(uint32 upperBound) internal returns (euint32) {
return euint32.wrap(Impl.randBounded(upperBound, FheType.Uint32));
}
/**
* @dev Generates a random encrypted value.
*/
function randEuint64() internal returns (euint64) {
return euint64.wrap(Impl.rand(FheType.Uint64));
}
/**
* @dev Generates a random encrypted 64-bit unsigned integer in the [0, upperBound) range.
* The upperBound must be a power of 2.
*/
function randEuint64(uint64 upperBound) internal returns (euint64) {
return euint64.wrap(Impl.randBounded(upperBound, FheType.Uint64));
}
/**
* @dev Generates a random encrypted value.
*/
function randEuint128() internal returns (euint128) {
return euint128.wrap(Impl.rand(FheType.Uint128));
}
/**
* @dev Generates a random encrypted 128-bit unsigned integer in the [0, upperBound) range.
* The upperBound must be a power of 2.
*/
function randEuint128(uint128 upperBound) internal returns (euint128) {
return euint128.wrap(Impl.randBounded(upperBound, FheType.Uint128));
}
/**
* @dev Generates a random encrypted value.
*/
function randEuint256() internal returns (euint256) {
return euint256.wrap(Impl.rand(FheType.Uint256));
}
/**
* @dev Generates a random encrypted 256-bit unsigned integer in the [0, upperBound) range.
* The upperBound must be a power of 2.
*/
function randEuint256(uint256 upperBound) internal returns (euint256) {
return euint256.wrap(Impl.randBounded(upperBound, FheType.Uint256));
}
/**
* @dev This function cleans the transient storage for the ACL (accounts) and the InputVerifier
* (input proofs).
* This could be useful for integration with Account Abstraction when bundling several
* UserOps calling the FHEVMExecutor.
*/
function cleanTransientStorage() internal {
Impl.cleanTransientStorageACL();
Impl.cleanTransientStorageInputVerifier();
}
/**
* @dev Returns whether the account is allowed to use the value.
*/
function isAllowed(ebool value, address account) internal view returns (bool) {
return Impl.isAllowed(ebool.unwrap(value), account);
}
/**
* @dev Returns whether the sender is allowed to use the value.
*/
function isSenderAllowed(ebool value) internal view returns (bool) {
return Impl.isAllowed(ebool.unwrap(value), msg.sender);
}
/**
* @dev Allows the use of value for the address account.
*/
function allow(ebool value, address account) internal returns (ebool) {
Impl.allow(ebool.unwrap(value), account);
return value;
}
/**
* @dev Allows the use of value for this address (address(this)).
*/
function allowThis(ebool value) internal returns (ebool) {
Impl.allow(ebool.unwrap(value), address(this));
return value;
}
/**
* @dev Allows the use of value by address account for this transaction.
*/
function allowTransient(ebool value, address account) internal returns (ebool) {
Impl.allowTransient(ebool.unwrap(value), account);
return value;
}
/**
* @dev Makes the value publicly decryptable.
*/
function makePubliclyDecryptable(ebool value) internal returns (ebool) {
Impl.makePubliclyDecryptable(ebool.unwrap(value));
return value;
}
/**
* @dev Returns whether the the value is publicly decryptable.
*/
function isPubliclyDecryptable(ebool value) internal view returns (bool) {
return Impl.isPubliclyDecryptable(ebool.unwrap(value));
}
/**
* @dev Returns whether the account is allowed to use the value.
*/
function isAllowed(euint8 value, address account) internal view returns (bool) {
return Impl.isAllowed(euint8.unwrap(value), account);
}
/**
* @dev Returns whether the sender is allowed to use the value.
*/
function isSenderAllowed(euint8 value) internal view returns (bool) {
return Impl.isAllowed(euint8.unwrap(value), msg.sender);
}
/**
* @dev Allows the use of value for the address account.
*/
function allow(euint8 value, address account) internal returns (euint8) {
Impl.allow(euint8.unwrap(value), account);
return value;
}
/**
* @dev Allows the use of value for this address (address(this)).
*/
function allowThis(euint8 value) internal returns (euint8) {
Impl.allow(euint8.unwrap(value), address(this));
return value;
}
/**
* @dev Allows the use of value by address account for this transaction.
*/
function allowTransient(euint8 value, address account) internal returns (euint8) {
Impl.allowTransient(euint8.unwrap(value), account);
return value;
}
/**
* @dev Makes the value publicly decryptable.
*/
function makePubliclyDecryptable(euint8 value) internal returns (euint8) {
Impl.makePubliclyDecryptable(euint8.unwrap(value));
return value;
}
/**
* @dev Returns whether the the value is publicly decryptable.
*/
function isPubliclyDecryptable(euint8 value) internal view returns (bool) {
return Impl.isPubliclyDecryptable(euint8.unwrap(value));
}
/**
* @dev Returns whether the account is allowed to use the value.
*/
function isAllowed(euint16 value, address account) internal view returns (bool) {
return Impl.isAllowed(euint16.unwrap(value), account);
}
/**
* @dev Returns whether the sender is allowed to use the value.
*/
function isSenderAllowed(euint16 value) internal view returns (bool) {
return Impl.isAllowed(euint16.unwrap(value), msg.sender);
}
/**
* @dev Allows the use of value for the address account.
*/
function allow(euint16 value, address account) internal returns (euint16) {
Impl.allow(euint16.unwrap(value), account);
return value;
}
/**
* @dev Allows the use of value for this address (address(this)).
*/
function allowThis(euint16 value) internal returns (euint16) {
Impl.allow(euint16.unwrap(value), address(this));
return value;
}
/**
* @dev Allows the use of value by address account for this transaction.
*/
function allowTransient(euint16 value, address account) internal returns (euint16) {
Impl.allowTransient(euint16.unwrap(value), account);
return value;
}
/**
* @dev Makes the value publicly decryptable.
*/
function makePubliclyDecryptable(euint16 value) internal returns (euint16) {
Impl.makePubliclyDecryptable(euint16.unwrap(value));
return value;
}
/**
* @dev Returns whether the the value is publicly decryptable.
*/
function isPubliclyDecryptable(euint16 value) internal view returns (bool) {
return Impl.isPubliclyDecryptable(euint16.unwrap(value));
}
/**
* @dev Returns whether the account is allowed to use the value.
*/
function isAllowed(euint32 value, address account) internal view returns (bool) {
return Impl.isAllowed(euint32.unwrap(value), account);
}
/**
* @dev Returns whether the sender is allowed to use the value.
*/
function isSenderAllowed(euint32 value) internal view returns (bool) {
return Impl.isAllowed(euint32.unwrap(value), msg.sender);
}
/**
* @dev Allows the use of value for the address account.
*/
function allow(euint32 value, address account) internal returns (euint32) {
Impl.allow(euint32.unwrap(value), account);
return value;
}
/**
* @dev Allows the use of value for this address (address(this)).
*/
function allowThis(euint32 value) internal returns (euint32) {
Impl.allow(euint32.unwrap(value), address(this));
return value;
}
/**
* @dev Allows the use of value by address account for this transaction.
*/
function allowTransient(euint32 value, address account) internal returns (euint32) {
Impl.allowTransient(euint32.unwrap(value), account);
return value;
}
/**
* @dev Makes the value publicly decryptable.
*/
function makePubliclyDecryptable(euint32 value) internal returns (euint32) {
Impl.makePubliclyDecryptable(euint32.unwrap(value));
return value;
}
/**
* @dev Returns whether the the value is publicly decryptable.
*/
function isPubliclyDecryptable(euint32 value) internal view returns (bool) {
return Impl.isPubliclyDecryptable(euint32.unwrap(value));
}
/**
* @dev Returns whether the account is allowed to use the value.
*/
function isAllowed(euint64 value, address account) internal view returns (bool) {
return Impl.isAllowed(euint64.unwrap(value), account);
}
/**
* @dev Returns whether the sender is allowed to use the value.
*/
function isSenderAllowed(euint64 value) internal view returns (bool) {
return Impl.isAllowed(euint64.unwrap(value), msg.sender);
}
/**
* @dev Allows the use of value for the address account.
*/
function allow(euint64 value, address account) internal returns (euint64) {
Impl.allow(euint64.unwrap(value), account);
return value;
}
/**
* @dev Allows the use of value for this address (address(this)).
*/
function allowThis(euint64 value) internal returns (euint64) {
Impl.allow(euint64.unwrap(value), address(this));
return value;
}
/**
* @dev Allows the use of value by address account for this transaction.
*/
function allowTransient(euint64 value, address account) internal returns (euint64) {
Impl.allowTransient(euint64.unwrap(value), account);
return value;
}
/**
* @dev Makes the value publicly decryptable.
*/
function makePubliclyDecryptable(euint64 value) internal returns (euint64) {
Impl.makePubliclyDecryptable(euint64.unwrap(value));
return value;
}
/**
* @dev Returns whether the the value is publicly decryptable.
*/
function isPubliclyDecryptable(euint64 value) internal view returns (bool) {
return Impl.isPubliclyDecryptable(euint64.unwrap(value));
}
/**
* @dev Returns whether the account is allowed to use the value.
*/
function isAllowed(euint128 value, address account) internal view returns (bool) {
return Impl.isAllowed(euint128.unwrap(value), account);
}
/**
* @dev Returns whether the sender is allowed to use the value.
*/
function isSenderAllowed(euint128 value) internal view returns (bool) {
return Impl.isAllowed(euint128.unwrap(value), msg.sender);
}
/**
* @dev Allows the use of value for the address account.
*/
function allow(euint128 value, address account) internal returns (euint128) {
Impl.allow(euint128.unwrap(value), account);
return value;
}
/**
* @dev Allows the use of value for this address (address(this)).
*/
function allowThis(euint128 value) internal returns (euint128) {
Impl.allow(euint128.unwrap(value), address(this));
return value;
}
/**
* @dev Allows the use of value by address account for this transaction.
*/
function allowTransient(euint128 value, address account) internal returns (euint128) {
Impl.allowTransient(euint128.unwrap(value), account);
return value;
}
/**
* @dev Makes the value publicly decryptable.
*/
function makePubliclyDecryptable(euint128 value) internal returns (euint128) {
Impl.makePubliclyDecryptable(euint128.unwrap(value));
return value;
}
/**
* @dev Returns whether the the value is publicly decryptable.
*/
function isPubliclyDecryptable(euint128 value) internal view returns (bool) {
return Impl.isPubliclyDecryptable(euint128.unwrap(value));
}
/**
* @dev Returns whether the account is allowed to use the value.
*/
function isAllowed(eaddress value, address account) internal view returns (bool) {
return Impl.isAllowed(eaddress.unwrap(value), account);
}
/**
* @dev Returns whether the sender is allowed to use the value.
*/
function isSenderAllowed(eaddress value) internal view returns (bool) {
return Impl.isAllowed(eaddress.unwrap(value), msg.sender);
}
/**
* @dev Allows the use of value for the address account.
*/
function allow(eaddress value, address account) internal returns (eaddress) {
Impl.allow(eaddress.unwrap(value), account);
return value;
}
/**
* @dev Allows the use of value for this address (address(this)).
*/
function allowThis(eaddress value) internal returns (eaddress) {
Impl.allow(eaddress.unwrap(value), address(this));
return value;
}
/**
* @dev Allows the use of value by address account for this transaction.
*/
function allowTransient(eaddress value, address account) internal returns (eaddress) {
Impl.allowTransient(eaddress.unwrap(value), account);
return value;
}
/**
* @dev Makes the value publicly decryptable.
*/
function makePubliclyDecryptable(eaddress value) internal returns (eaddress) {
Impl.makePubliclyDecryptable(eaddress.unwrap(value));
return value;
}
/**
* @dev Returns whether the the value is publicly decryptable.
*/
function isPubliclyDecryptable(eaddress value) internal view returns (bool) {
return Impl.isPubliclyDecryptable(eaddress.unwrap(value));
}
/**
* @dev Returns whether the account is allowed to use the value.
*/
function isAllowed(euint256 value, address account) internal view returns (bool) {
return Impl.isAllowed(euint256.unwrap(value), account);
}
/**
* @dev Returns whether the sender is allowed to use the value.
*/
function isSenderAllowed(euint256 value) internal view returns (bool) {
return Impl.isAllowed(euint256.unwrap(value), msg.sender);
}
/**
* @dev Allows the use of value for the address account.
*/
function allow(euint256 value, address account) internal returns (euint256) {
Impl.allow(euint256.unwrap(value), account);
return value;
}
/**
* @dev Allows the use of value for this address (address(this)).
*/
function allowThis(euint256 value) internal returns (euint256) {
Impl.allow(euint256.unwrap(value), address(this));
return value;
}
/**
* @dev Allows the use of value by address account for this transaction.
*/
function allowTransient(euint256 value, address account) internal returns (euint256) {
Impl.allowTransient(euint256.unwrap(value), account);
return value;
}
/**
* @dev Makes the value publicly decryptable.
*/
function makePubliclyDecryptable(euint256 value) internal returns (euint256) {
Impl.makePubliclyDecryptable(euint256.unwrap(value));
return value;
}
/**
* @dev Returns whether the the value is publicly decryptable.
*/
function isPubliclyDecryptable(euint256 value) internal view returns (bool) {
return Impl.isPubliclyDecryptable(euint256.unwrap(value));
}
/**
* @dev Recovers the stored array of handles corresponding to requestID.
*/
function loadRequestedHandles(uint256 requestID) internal view returns (bytes32[] memory) {
DecryptionRequestsStruct storage $ = Impl.getDecryptionRequests();
if ($.requestedHandles[requestID].length == 0) {
revert NoHandleFoundForRequestID();
}
return $.requestedHandles[requestID];
}
/**
* @dev Calls the DecryptionOracle contract to request the decryption of a list of handles.
* @notice Also does the needed call to ACL::allowForDecryption with requested handles.
*/
function requestDecryption(
bytes32[] memory ctsHandles,
bytes4 callbackSelector
) internal returns (uint256 requestID) {
requestID = requestDecryption(ctsHandles, callbackSelector, 0);
}
/**
* @dev Calls the DecryptionOracle contract to request the decryption of a list of handles, with a custom msgValue.
* @notice Also does the needed call to ACL::allowForDecryption with requested handles.
*/
function requestDecryption(
bytes32[] memory ctsHandles,
bytes4 callbackSelector,
uint256 msgValue
) internal returns (uint256 requestID) {
DecryptionRequestsStruct storage $ = Impl.getDecryptionRequests();
requestID = $.counterRequest;
FHEVMConfigStruct storage $$ = Impl.getFHEVMConfig();
IACL($$.ACLAddress).allowForDecryption(ctsHandles);
IDecryptionOracle($.DecryptionOracleAddress).requestDecryption{value: msgValue}(
requestID,
ctsHandles,
callbackSelector
);
saveRequestedHandles(requestID, ctsHandles);
$.counterRequest++;
}
/**
* @dev MUST be called inside the callback function the dApp contract to verify the signatures,
* @dev otherwise fake decryption results could be submitted.
* @notice Warning: MUST be called directly in the callback function called by the relayer.
*/
function checkSignatures(uint256 requestID, bytes[] memory signatures) internal {
bytes32[] memory handlesList = loadRequestedHandles(requestID);
bool isVerified = verifySignatures(handlesList, signatures);
if (!isVerified) {
revert InvalidKMSSignatures();
}
emit DecryptionFulfilled(requestID);
}
/**
* @dev Private low-level function used to link in storage an array of handles to its associated requestID.
*/
function saveRequestedHandles(uint256 requestID, bytes32[] memory handlesList) private {
DecryptionRequestsStruct storage $ = Impl.getDecryptionRequests();
if ($.requestedHandles[requestID].length != 0) {
revert HandlesAlreadySavedForRequestID();
}
$.requestedHandles[requestID] = handlesList;
}
/**
* @dev Private low-level function used to extract the decryptedResult bytes array and verify the KMS signatures.
* @notice Warning: MUST be called directly in the callback function called by the relayer.
*/
function verifySignatures(bytes32[] memory handlesList, bytes[] memory signatures) private returns (bool) {
uint256 start = 4 + 32; // start position after skipping the selector (4 bytes) and the first argument (index, 32 bytes)
uint256 length = getSignedDataLength(handlesList);
bytes memory decryptedResult = new bytes(length);
assembly {
calldatacopy(add(decryptedResult, 0x20), start, length) // Copy the relevant part of calldata to decryptedResult memory
}
FHEVMConfigStruct storage $ = Impl.getFHEVMConfig();
return
IKMSVerifier($.KMSVerifierAddress).verifyDecryptionEIP712KMSSignatures(
handlesList,
decryptedResult,
signatures
);
}
/**
* @dev Private low-level function used to compute the length of the decryptedResult bytes array.
*/
function getSignedDataLength(bytes32[] memory handlesList) private pure returns (uint256) {
uint256 handlesListlen = handlesList.length;
uint256 signedDataLength;
for (uint256 i = 0; i < handlesListlen; i++) {
FheType typeCt = FheType(uint8(handlesList[i][30]));
if (uint8(typeCt) < 9) {
signedDataLength += 32;
} else {
revert UnsupportedHandleType();
}
}
signedDataLength += 32; // add offset of signatures
return signedDataLength;
}
/**
* @dev Converts handle from its custom type to the underlying bytes32. Used when requesting a decryption.
*/
function toBytes32(ebool value) internal pure returns (bytes32 ct) {
ct = ebool.unwrap(value);
}
/**
* @dev Converts handle from its custom type to the underlying bytes32. Used when requesting a decryption.
*/
function toBytes32(euint8 value) internal pure returns (bytes32 ct) {
ct = euint8.unwrap(value);
}
/**
* @dev Converts handle from its custom type to the underlying bytes32. Used when requesting a decryption.
*/
function toBytes32(euint16 value) internal pure returns (bytes32 ct) {
ct = euint16.unwrap(value);
}
/**
* @dev Converts handle from its custom type to the underlying bytes32. Used when requesting a decryption.
*/
function toBytes32(euint32 value) internal pure returns (bytes32 ct) {
ct = euint32.unwrap(value);
}
/**
* @dev Converts handle from its custom type to the underlying bytes32. Used when requesting a decryption.
*/
function toBytes32(euint64 value) internal pure returns (bytes32 ct) {
ct = euint64.unwrap(value);
}
/**
* @dev Converts handle from its custom type to the underlying bytes32. Used when requesting a decryption.
*/
function toBytes32(euint128 value) internal pure returns (bytes32 ct) {
ct = euint128.unwrap(value);
}
/**
* @dev Converts handle from its custom type to the underlying bytes32. Used when requesting a decryption.
*/
function toBytes32(eaddress value) internal pure returns (bytes32 ct) {
ct = eaddress.unwrap(value);
}
/**
* @dev Converts handle from its custom type to the underlying bytes32. Used when requesting a decryption.
*/
function toBytes32(euint256 value) internal pure returns (bytes32 ct) {
ct = euint256.unwrap(value);
}
}// SPDX-License-Identifier: BSD-3-Clause-Clear
pragma solidity ^0.8.24;
enum FheType {
Bool,
Uint4,
Uint8,
Uint16,
Uint32,
Uint64,
Uint128,
Uint160,
Uint256,
Uint512,
Uint1024,
Uint2048,
Uint2,
Uint6,
Uint10,
Uint12,
Uint14,
Int2,
Int4,
Int6,
Int8,
Int10,
Int12,
Int14,
Int16,
Int32,
Int64,
Int128,
Int160,
Int256,
AsciiString,
Int512,
Int1024,
Int2048,
Uint24,
Uint40,
Uint48,
Uint56,
Uint72,
Uint80,
Uint88,
Uint96,
Uint104,
Uint112,
Uint120,
Uint136,
Uint144,
Uint152,
Uint168,
Uint176,
Uint184,
Uint192,
Uint200,
Uint208,
Uint216,
Uint224,
Uint232,
Uint240,
Uint248,
Int24,
Int40,
Int48,
Int56,
Int72,
Int80,
Int88,
Int96,
Int104,
Int112,
Int120,
Int136,
Int144,
Int152,
Int168,
Int176,
Int184,
Int192,
Int200,
Int208,
Int216,
Int224,
Int232,
Int240,
Int248
}// SPDX-License-Identifier: BSD-3-Clause-Clear
pragma solidity ^0.8.24;
import {FheType} from "./FheType.sol";
/**
* @title FHEVMConfigStruct
* @notice This struct contains all addresses of core contracts, which are needed in a typical dApp.
*/
struct FHEVMConfigStruct {
address ACLAddress;
address FHEVMExecutorAddress;
address KMSVerifierAddress;
address InputVerifierAddress;
}
/**
* @title DecryptionRequestsStruct
* @notice This struct contains the address of the decryption oracle contract,
* the internal counter for requestIDs generated by the dapp,
* and the mapping from internal requestIDs to list of handles requested for decryption.
*/
struct DecryptionRequestsStruct {
address DecryptionOracleAddress;
uint256 counterRequest;
mapping(uint256 => bytes32[]) requestedHandles;
}
/**
* @title IFHEVMExecutor
* @notice This interface contains all functions to conduct FHE operations.
*/
interface IFHEVMExecutor {
/**
* @notice Computes fheAdd operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheAdd(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheSub operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheSub(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheMul operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheMul(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheDiv operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheDiv(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheRem operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheRem(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheBitAnd operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheBitAnd(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheBitOr operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheBitOr(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheBitXor operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheBitXor(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheShl operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheShl(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheShr operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheShr(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheRotl operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheRotl(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheRotr operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheRotr(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheEq operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheEq(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheNe operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheNe(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheGe operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheGe(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheGt operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheGt(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheLe operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheLe(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheLt operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheLt(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheMin operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheMin(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheMax operation.
* @param lhs LHS.
* @param rhs RHS.
* @param scalarByte Scalar byte.
* @return result Result.
*/
function fheMax(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) external returns (bytes32 result);
/**
* @notice Computes fheNeg operation.
* @param ct Ct
* @return result Result.
*/
function fheNeg(bytes32 ct) external returns (bytes32 result);
/**
* @notice Computes fheNot operation.
* @param ct Ct
* @return result Result.
*/
function fheNot(bytes32 ct) external returns (bytes32 result);
/**
* @notice Verifies the ciphertext.
* @param inputHandle Input handle.
* @param callerAddress Address of the caller.
* @param inputProof Input proof.
* @param inputType Input type.
* @return result Result.
*/
function verifyCiphertext(
bytes32 inputHandle,
address callerAddress,
bytes memory inputProof,
FheType inputType
) external returns (bytes32 result);
/**
* @notice Performs the casting to a target type.
* @param ct Value to cast.
* @param toType Target type.
* @return result Result value of the target type.
*/
function cast(bytes32 ct, FheType toType) external returns (bytes32 result);
/**
* @notice Does trivial encryption.
* @param ct Value to encrypt.
* @param toType Target type.
* @return result Result value of the target type.
*/
function trivialEncrypt(uint256 ct, FheType toType) external returns (bytes32 result);
/**
* @notice Computes FHEIfThenElse operation.
* @param control Control value.
* @param ifTrue If true.
* @param ifFalse If false.
* @return result Result.
*/
function fheIfThenElse(bytes32 control, bytes32 ifTrue, bytes32 ifFalse) external returns (bytes32 result);
/**
* @notice Computes FHERand operation.
* @param randType Type for the random result.
* @return result Result.
*/
function fheRand(FheType randType) external returns (bytes32 result);
/**
* @notice Computes FHERandBounded operation.
* @param upperBound Upper bound value.
* @param randType Type for the random result.
* @return result Result.
*/
function fheRandBounded(uint256 upperBound, FheType randType) external returns (bytes32 result);
}
/**
* @title IACL.
* @notice This interface contains all functions that are used to conduct operations
* with the ACL contract.
*/
interface IACL {
/**
* @notice Allows the use of handle by address account for this transaction.
* @dev The caller must be allowed to use handle for allowTransient() to succeed.
* If not, allowTransient() reverts.
* The Coprocessor contract can always allowTransient(), contrarily to allow().
* @param ciphertext Ciphertext.
* @param account Address of the account.
*/
function allowTransient(bytes32 ciphertext, address account) external;
/**
* @notice Allows the use of handle for the address account.
* @dev The caller must be allowed to use handle for allow() to succeed. If not, allow() reverts.
* @param handle Handle.
* @param account Address of the account.
*/
function allow(bytes32 handle, address account) external;
/**
* @dev This function removes the transient allowances, which could be useful for integration with
* Account Abstraction when bundling several UserOps calling the FHEVMExecutor Coprocessor.
*/
function cleanTransientStorage() external;
/**
* @notice Returns whether the account is allowed to use the handle, either due to
* allowTransient() or allow().
* @param handle Handle.
* @param account Address of the account.
* @return isAllowed Whether the account can access the handle.
*/
function isAllowed(bytes32 handle, address account) external view returns (bool);
/**
* @notice Allows a list of handles to be decrypted.
* @param handlesList List of handles.
*/
function allowForDecryption(bytes32[] memory handlesList) external;
/**
* @notice Returns wether a handle is allowed to be publicly decrypted.
* @param handle Handle.
* @return isDecryptable Whether the handle can be publicly decrypted.
*/
function isAllowedForDecryption(bytes32 handle) external view returns (bool);
}
/**
* @title IInputVerifier
* @notice This interface contains the only function required from InputVerifier.
*/
interface IInputVerifier {
/**
* @dev This function removes the transient allowances, which could be useful for integration with
* Account Abstraction when bundling several UserOps calling the FHEVMExecutor Coprocessor.
*/
function cleanTransientStorage() external;
}
/**
* @title Impl
* @notice This library is the core implementation for computing FHE operations (e.g. add, sub, xor).
*/
library Impl {
/// keccak256(abi.encode(uint256(keccak256("fhevm.storage.FHEVMConfig")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant FHEVMConfigLocation = 0xed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600;
/// keccak256(abi.encode(uint256(keccak256("fhevm.storage.DecryptionRequests")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant DecryptionRequestsStorageLocation =
0x5ea69329017273582817d320489fbd94f775580e90c092699ca6f3d12fdf7d00;
/**
* @dev Returns the FHEVM config.
*/
function getFHEVMConfig() internal pure returns (FHEVMConfigStruct storage $) {
assembly {
$.slot := FHEVMConfigLocation
}
}
/**
* @dev Returns the DecryptionRequestsStruct storage struct.
*/
function getDecryptionRequests() internal pure returns (DecryptionRequestsStruct storage $) {
assembly {
$.slot := DecryptionRequestsStorageLocation
}
}
/**
* @notice Sets the coprocessor addresses.
* @param fhevmConfig FHEVM config struct that contains contract addresses.
*/
function setCoprocessor(FHEVMConfigStruct memory fhevmConfig) internal {
FHEVMConfigStruct storage $ = getFHEVMConfig();
$.ACLAddress = fhevmConfig.ACLAddress;
$.FHEVMExecutorAddress = fhevmConfig.FHEVMExecutorAddress;
$.KMSVerifierAddress = fhevmConfig.KMSVerifierAddress;
$.InputVerifierAddress = fhevmConfig.InputVerifierAddress;
}
/**
* @notice Sets the decryption oracle address.
* @param decryptionOracle The decryption oracle address.
*/
function setDecryptionOracle(address decryptionOracle) internal {
DecryptionRequestsStruct storage $ = getDecryptionRequests();
$.DecryptionOracleAddress = decryptionOracle;
}
function add(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheAdd(lhs, rhs, scalarByte);
}
function sub(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheSub(lhs, rhs, scalarByte);
}
function mul(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheMul(lhs, rhs, scalarByte);
}
function div(bytes32 lhs, bytes32 rhs) internal returns (bytes32 result) {
bytes1 scalarByte = 0x01;
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheDiv(lhs, rhs, scalarByte);
}
function rem(bytes32 lhs, bytes32 rhs) internal returns (bytes32 result) {
bytes1 scalarByte = 0x01;
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheRem(lhs, rhs, scalarByte);
}
function and(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheBitAnd(lhs, rhs, scalarByte);
}
function or(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheBitOr(lhs, rhs, scalarByte);
}
function xor(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheBitXor(lhs, rhs, scalarByte);
}
function shl(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheShl(lhs, rhs, scalarByte);
}
function shr(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheShr(lhs, rhs, scalarByte);
}
function rotl(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheRotl(lhs, rhs, scalarByte);
}
function rotr(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheRotr(lhs, rhs, scalarByte);
}
function eq(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheEq(lhs, rhs, scalarByte);
}
function ne(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheNe(lhs, rhs, scalarByte);
}
function ge(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheGe(lhs, rhs, scalarByte);
}
function gt(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheGt(lhs, rhs, scalarByte);
}
function le(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheLe(lhs, rhs, scalarByte);
}
function lt(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheLt(lhs, rhs, scalarByte);
}
function min(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheMin(lhs, rhs, scalarByte);
}
function max(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) {
bytes1 scalarByte;
if (scalar) {
scalarByte = 0x01;
} else {
scalarByte = 0x00;
}
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheMax(lhs, rhs, scalarByte);
}
function neg(bytes32 ct) internal returns (bytes32 result) {
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheNeg(ct);
}
function not(bytes32 ct) internal returns (bytes32 result) {
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheNot(ct);
}
/**
* @dev If 'control's value is 'true', the result has the same value as 'ifTrue'.
* If 'control's value is 'false', the result has the same value as 'ifFalse'.
*/
function select(bytes32 control, bytes32 ifTrue, bytes32 ifFalse) internal returns (bytes32 result) {
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheIfThenElse(control, ifTrue, ifFalse);
}
/**
* @notice Verifies the ciphertext (FHEVMExecutor) and allows transient (ACL).
* @param inputHandle Input handle.
* @param inputProof Input proof.
* @param toType Input type.
* @return result Result.
*/
function verify(bytes32 inputHandle, bytes memory inputProof, FheType toType) internal returns (bytes32 result) {
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).verifyCiphertext(inputHandle, msg.sender, inputProof, toType);
IACL($.ACLAddress).allowTransient(result, msg.sender);
}
/**
* @notice Performs the casting to a target type.
* @param ciphertext Ciphertext to cast.
* @param toType Target type.
* @return result Result value of the target type.
*/
function cast(bytes32 ciphertext, FheType toType) internal returns (bytes32 result) {
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).cast(ciphertext, toType);
}
/**
* @notice Does trivial encryption.
* @param value Value to encrypt.
* @param toType Target type.
* @return result Result value of the target type.
*/
function trivialEncrypt(uint256 value, FheType toType) internal returns (bytes32 result) {
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).trivialEncrypt(value, toType);
}
function rand(FheType randType) internal returns (bytes32 result) {
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheRand(randType);
}
function randBounded(uint256 upperBound, FheType randType) internal returns (bytes32 result) {
FHEVMConfigStruct storage $ = getFHEVMConfig();
result = IFHEVMExecutor($.FHEVMExecutorAddress).fheRandBounded(upperBound, randType);
}
/**
* @notice Allows the use of handle by address account for this transaction.
* @dev The caller must be allowed to use handle for allowTransient() to succeed.
* If not, allowTransient() reverts.
* The Coprocessor contract can always allowTransient(), contrarily to allow().
* @param handle Handle.
* @param account Address of the account.
*/
function allowTransient(bytes32 handle, address account) internal {
FHEVMConfigStruct storage $ = getFHEVMConfig();
IACL($.ACLAddress).allowTransient(handle, account);
}
/**
* @notice Allows the use of handle for the address account.
* @dev The caller must be allowed to use handle for allow() to succeed. If not, allow() reverts.
* @param handle Handle.
* @param account Address of the account.
*/
function allow(bytes32 handle, address account) internal {
FHEVMConfigStruct storage $ = getFHEVMConfig();
IACL($.ACLAddress).allow(handle, account);
}
/**
* @notice Allows the handle to be publicly decryptable.
* @dev The caller must be allowed to use handle for makePubliclyDecryptable() to succeed.
* If not, makePubliclyDecryptable() reverts.
* @param handle Handle.
*/
function makePubliclyDecryptable(bytes32 handle) internal {
FHEVMConfigStruct storage $ = getFHEVMConfig();
bytes32[] memory handleArray = new bytes32[](1);
handleArray[0] = handle;
IACL($.ACLAddress).allowForDecryption(handleArray);
}
/**
* @dev This function removes the transient allowances in the ACL, which could be useful for integration
* with Account Abstraction when bundling several UserOps calling the FHEVMExecutor Coprocessor.
*/
function cleanTransientStorageACL() internal {
FHEVMConfigStruct storage $ = getFHEVMConfig();
IACL($.ACLAddress).cleanTransientStorage();
}
/**
* @dev This function removes the transient proofs in the InputVerifier, which could be useful for integration
* with Account Abstraction when bundling several UserOps calling the FHEVMExecutor Coprocessor.
*/
function cleanTransientStorageInputVerifier() internal {
FHEVMConfigStruct storage $ = getFHEVMConfig();
IInputVerifier($.InputVerifierAddress).cleanTransientStorage();
}
/**
* @notice Returns whether the account is allowed to use the handle, either due to
* allowTransient() or allow().
* @param handle Handle.
* @param account Address of the account.
* @return isAllowed Whether the account can access the handle.
*/
function isAllowed(bytes32 handle, address account) internal view returns (bool) {
FHEVMConfigStruct storage $ = getFHEVMConfig();
return IACL($.ACLAddress).isAllowed(handle, account);
}
/**
* @notice Returns whether the handle is allowed to be publicly decrypted.
* @param handle Handle.
* @return isAllowed Whether the handle can be publicly decrypted.
*/
function isPubliclyDecryptable(bytes32 handle) internal view returns (bool) {
FHEVMConfigStruct storage $ = getFHEVMConfig();
return IACL($.ACLAddress).isAllowedForDecryption(handle);
}
}// SPDX-License-Identifier: BSD-3-Clause-Clear pragma solidity ^0.8.24; address constant SepoliaZamaOracleAddress = 0xa02Cda4Ca3a71D7C46997716F4283aa851C28812;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {FHE, euint32, externalEuint32} from "@fhevm/solidity/lib/FHE.sol";
import {SepoliaConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
/// @title A simple FHE counter contract
contract FHECounter is SepoliaConfig {
euint32 private _count;
/// @notice Returns the current count
function getCount() external view returns (euint32) {
return _count;
}
/// @notice Increments the counter by a specified encrypted value.
/// @dev This example omits overflow/underflow checks for simplicity and readability.
/// In a production contract, proper range checks should be implemented.
function increment(externalEuint32 inputEuint32, bytes calldata inputProof) external {
euint32 encryptedEuint32 = FHE.fromExternal(inputEuint32, inputProof);
_count = FHE.add(_count, encryptedEuint32);
FHE.allowThis(_count);
FHE.allow(_count, msg.sender);
}
/// @notice Decrements the counter by a specified encrypted value.
/// @dev This example omits overflow/underflow checks for simplicity and readability.
/// In a production contract, proper range checks should be implemented.
function decrement(externalEuint32 inputEuint32, bytes calldata inputProof) external {
euint32 encryptedEuint32 = FHE.fromExternal(inputEuint32, inputProof);
_count = FHE.sub(_count, encryptedEuint32);
FHE.allowThis(_count);
FHE.allow(_count, msg.sender);
}
}// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; type ebool is bytes32; type euint8 is bytes32; type euint16 is bytes32; type euint24 is bytes32; type euint32 is bytes32; type euint40 is bytes32; type euint48 is bytes32; type euint56 is bytes32; type euint64 is bytes32; type euint72 is bytes32; type euint80 is bytes32; type euint88 is bytes32; type euint96 is bytes32; type euint104 is bytes32; type euint112 is bytes32; type euint120 is bytes32; type euint128 is bytes32; type euint136 is bytes32; type euint144 is bytes32; type euint152 is bytes32; type euint160 is bytes32; type euint168 is bytes32; type euint176 is bytes32; type euint184 is bytes32; type euint192 is bytes32; type euint200 is bytes32; type euint208 is bytes32; type euint216 is bytes32; type euint224 is bytes32; type euint232 is bytes32; type euint240 is bytes32; type euint248 is bytes32; type euint256 is bytes32; type eint8 is bytes32; type eint16 is bytes32; type eint24 is bytes32; type eint32 is bytes32; type eint40 is bytes32; type eint48 is bytes32; type eint56 is bytes32; type eint64 is bytes32; type eint72 is bytes32; type eint80 is bytes32; type eint88 is bytes32; type eint96 is bytes32; type eint104 is bytes32; type eint112 is bytes32; type eint120 is bytes32; type eint128 is bytes32; type eint136 is bytes32; type eint144 is bytes32; type eint152 is bytes32; type eint160 is bytes32; type eint168 is bytes32; type eint176 is bytes32; type eint184 is bytes32; type eint192 is bytes32; type eint200 is bytes32; type eint208 is bytes32; type eint216 is bytes32; type eint224 is bytes32; type eint232 is bytes32; type eint240 is bytes32; type eint248 is bytes32; type eint256 is bytes32; type eaddress is bytes32; type ebytes1 is bytes32; type ebytes2 is bytes32; type ebytes3 is bytes32; type ebytes4 is bytes32; type ebytes5 is bytes32; type ebytes6 is bytes32; type ebytes7 is bytes32; type ebytes8 is bytes32; type ebytes9 is bytes32; type ebytes10 is bytes32; type ebytes11 is bytes32; type ebytes12 is bytes32; type ebytes13 is bytes32; type ebytes14 is bytes32; type ebytes15 is bytes32; type ebytes16 is bytes32; type ebytes17 is bytes32; type ebytes18 is bytes32; type ebytes19 is bytes32; type ebytes20 is bytes32; type ebytes21 is bytes32; type ebytes22 is bytes32; type ebytes23 is bytes32; type ebytes24 is bytes32; type ebytes25 is bytes32; type ebytes26 is bytes32; type ebytes27 is bytes32; type ebytes28 is bytes32; type ebytes29 is bytes32; type ebytes30 is bytes32; type ebytes31 is bytes32; type ebytes32 is bytes32; type externalEbool is bytes32; type externalEuint8 is bytes32; type externalEuint16 is bytes32; type externalEuint24 is bytes32; type externalEuint32 is bytes32; type externalEuint40 is bytes32; type externalEuint48 is bytes32; type externalEuint56 is bytes32; type externalEuint64 is bytes32; type externalEuint72 is bytes32; type externalEuint80 is bytes32; type externalEuint88 is bytes32; type externalEuint96 is bytes32; type externalEuint104 is bytes32; type externalEuint112 is bytes32; type externalEuint120 is bytes32; type externalEuint128 is bytes32; type externalEuint136 is bytes32; type externalEuint144 is bytes32; type externalEuint152 is bytes32; type externalEuint160 is bytes32; type externalEuint168 is bytes32; type externalEuint176 is bytes32; type externalEuint184 is bytes32; type externalEuint192 is bytes32; type externalEuint200 is bytes32; type externalEuint208 is bytes32; type externalEuint216 is bytes32; type externalEuint224 is bytes32; type externalEuint232 is bytes32; type externalEuint240 is bytes32; type externalEuint248 is bytes32; type externalEuint256 is bytes32; type externalEint8 is bytes32; type externalEint16 is bytes32; type externalEint24 is bytes32; type externalEint32 is bytes32; type externalEint40 is bytes32; type externalEint48 is bytes32; type externalEint56 is bytes32; type externalEint64 is bytes32; type externalEint72 is bytes32; type externalEint80 is bytes32; type externalEint88 is bytes32; type externalEint96 is bytes32; type externalEint104 is bytes32; type externalEint112 is bytes32; type externalEint120 is bytes32; type externalEint128 is bytes32; type externalEint136 is bytes32; type externalEint144 is bytes32; type externalEint152 is bytes32; type externalEint160 is bytes32; type externalEint168 is bytes32; type externalEint176 is bytes32; type externalEint184 is bytes32; type externalEint192 is bytes32; type externalEint200 is bytes32; type externalEint208 is bytes32; type externalEint216 is bytes32; type externalEint224 is bytes32; type externalEint232 is bytes32; type externalEint240 is bytes32; type externalEint248 is bytes32; type externalEint256 is bytes32; type externalEaddress is bytes32; type externalEbytes1 is bytes32; type externalEbytes2 is bytes32; type externalEbytes3 is bytes32; type externalEbytes4 is bytes32; type externalEbytes5 is bytes32; type externalEbytes6 is bytes32; type externalEbytes7 is bytes32; type externalEbytes8 is bytes32; type externalEbytes9 is bytes32; type externalEbytes10 is bytes32; type externalEbytes11 is bytes32; type externalEbytes12 is bytes32; type externalEbytes13 is bytes32; type externalEbytes14 is bytes32; type externalEbytes15 is bytes32; type externalEbytes16 is bytes32; type externalEbytes17 is bytes32; type externalEbytes18 is bytes32; type externalEbytes19 is bytes32; type externalEbytes20 is bytes32; type externalEbytes21 is bytes32; type externalEbytes22 is bytes32; type externalEbytes23 is bytes32; type externalEbytes24 is bytes32; type externalEbytes25 is bytes32; type externalEbytes26 is bytes32; type externalEbytes27 is bytes32; type externalEbytes28 is bytes32; type externalEbytes29 is bytes32; type externalEbytes30 is bytes32; type externalEbytes31 is bytes32; type externalEbytes32 is bytes32;
{
"metadata": {
"bytecodeHash": "none",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 800
},
"evmVersion": "cancun",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"deployer","type":"address"},{"indexed":false,"internalType":"address","name":"counterAddress","type":"address"}],"name":"CounterDeployed","type":"event"},{"inputs":[],"name":"deploy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"deployedCounters","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getAllCountersByAddress","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllDeployedCounters","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getLastCounterByAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastDeployedCounter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userCounters","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561000f575f80fd5b50610ea18061001d5f395ff3fe608060405234801561000f575f80fd5b506004361061007a575f3560e01c80636e5253a3116100585780636e5253a3146100da578063775c300c146100ed5780637cb5ba55146100f75780638c438c9c1461010a575f80fd5b806333ca902d1461007e57806337d1e0fe1461009c5780634fd10883146100c7575b5f80fd5b610086610112565b6040516100939190610482565b60405180910390f35b6100af6100aa3660046104ce565b610171565b6040516001600160a01b039091168152602001610093565b6100af6100d5366004610500565b610198565b6100866100e8366004610528565b6101cc565b6100f561023f565b005b6100af610105366004610528565b61032a565b6100af6103ee565b60605f80548060200260200160405190810160405280929190818152602001828054801561016757602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311610149575b5050505050905090565b5f818154811061017f575f80fd5b5f918252602090912001546001600160a01b0316905081565b6001602052815f5260405f2081815481106101b1575f80fd5b5f918252602090912001546001600160a01b03169150829050565b6001600160a01b0381165f9081526001602090815260409182902080548351818402810184019094528084526060939283018282801561023357602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311610215575b50505050509050919050565b5f60405161024c90610475565b604051809103905ff080158015610265573d5f803e3d5ffd5b505f8054600180820183557f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56390910180546001600160a01b0385167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216811790925533808552602084815260408087208054968701815587529581902090940180549092168317909155925190815292935083927f4a63b21a08939139d77a0dec6735b4928ef562473a1e0e96a2fff0fe3c8ca63f910160405180910390a25050565b6001600160a01b0381165f9081526001602052604081205461039d5760405162461bcd60e51b815260206004820152602160248201527f4e6f20636f756e74657273206465706c6f7965642062792074686973207573656044820152603960f91b60648201526084015b60405180910390fd5b6001600160a01b0382165f908152600160208190526040909120805490916103c491610548565b815481106103d4576103d461056d565b5f918252602090912001546001600160a01b031692915050565b5f805461043d5760405162461bcd60e51b815260206004820152601860248201527f4e6f20636f756e74657273206465706c6f7965642079657400000000000000006044820152606401610394565b5f805461044c90600190610548565b8154811061045c5761045c61056d565b5f918252602090912001546001600160a01b0316919050565b6109138061058283390190565b602080825282518282018190525f9190848201906040850190845b818110156104c25783516001600160a01b03168352928401929184019160010161049d565b50909695505050505050565b5f602082840312156104de575f80fd5b5035919050565b80356001600160a01b03811681146104fb575f80fd5b919050565b5f8060408385031215610511575f80fd5b61051a836104e5565b946020939093013593505050565b5f60208284031215610538575f80fd5b610541826104e5565b9392505050565b8181038181111561056757634e487b7160e01b5f52601160045260245ffd5b92915050565b634e487b7160e01b5f52603260045260245ffdfe608060405234801561000f575f80fd5b5061018a6100ae604080516080810182525f808252602082018190529181018290526060810191909152506040805160808101825273687820221192c5b662b25367f70076a37bc79b6c815273848b0066793bcc60346da1f49049357399b8d5956020820152731364cbbf2cdf5032c47d8226a6f6fbd2afcdacac9181019190915273bc91f3dad1a5f19f8390c400196e58073b6a0bc4606082015290565b80517fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea60080546001600160a01b03199081166001600160a01b039384161790915560208301517fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6018054831691841691909117905560408301517fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6028054831691841691909117905560608301517fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6038054909216921691909117905550565b7f5ea69329017273582817d320489fbd94f775580e90c092699ca6f3d12fdf7d0080546001600160a01b03191673a02cda4ca3a71d7c46997716f4283aa851c28812179055610737806101dc5f395ff3fe608060405234801561000f575f80fd5b506004361061003f575f3560e01c80635941195d14610043578063a87d942c14610058578063e055f8f91461006c575b5f80fd5b6100566100513660046105f8565b61007f565b005b5f5460405190815260200160405180910390f35b61005661007a3660046105f8565b6100ec565b5f6100bf8484848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061013992505050565b90506100cc5f548261014d565b5f8190556100d99061017b565b506100e55f543361018a565b5050505050565b5f61012c8484848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061013992505050565b90506100cc5f548261019c565b5f610146838360046101ca565b9392505050565b5f8261015f5761015c5f6102ea565b92505b816101705761016d5f6102ea565b91505b61014683835f610302565b5f61018682306103fd565b5090565b5f61019583836103fd565b5090919050565b5f826101ae576101ab5f6102ea565b92505b816101bf576101bc5f6102ea565b91505b61014683835f610486565b7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6015460405163196d0b9b60e01b81525f917fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600916001600160a01b039091169063196d0b9b9061024390889033908990899060040161068d565b6020604051808303815f875af115801561025f573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061028391906106ff565b8154604051630f8e573b60e21b8152600481018390523360248201529193506001600160a01b031690633e395cec906044015f604051808303815f87803b1580156102cc575f80fd5b505af11580156102de573d5f803e3d5ffd5b50505050509392505050565b5f6102fc8263ffffffff16600461053b565b92915050565b5f8082156103155750600160f81b610318565b505f5b7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6015460405163022f65e760e31b815260048101879052602481018690527fff00000000000000000000000000000000000000000000000000000000000000831660448201527fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600916001600160a01b03169063117b2f38906064015b6020604051808303815f875af11580156103cf573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103f391906106ff565b9695505050505050565b5f7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6008054604051635ca4b5b160e11b8152600481018690526001600160a01b03858116602483015292935091169063b9496b62906044015f604051808303815f87803b15801561046b575f80fd5b505af115801561047d573d5f803e3d5ffd5b50505050505050565b5f8082156104995750600160f81b61049c565b505f5b7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea601546040516303056db360e31b815260048101879052602481018690527fff00000000000000000000000000000000000000000000000000000000000000831660448201527fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600916001600160a01b03169063182b6d98906064016103b3565b7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea60154604051639cd07acb60e01b81525f917fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600916001600160a01b0390911690639cd07acb906105b09087908790600401610716565b6020604051808303815f875af11580156105cc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105f091906106ff565b949350505050565b5f805f6040848603121561060a575f80fd5b83359250602084013567ffffffffffffffff80821115610628575f80fd5b818601915086601f83011261063b575f80fd5b813581811115610649575f80fd5b87602082850101111561065a575f80fd5b6020830194508093505050509250925092565b6054811061068957634e487b7160e01b5f52602160045260245ffd5b9052565b8481525f60206001600160a01b03861660208401526080604084015284518060808501525f5b818110156106cf5786810183015185820160a0015282016106b3565b505f60a0828601015260a0601f19601f830116850101925050506106f6606083018461066d565b95945050505050565b5f6020828403121561070f575f80fd5b5051919050565b82815260408101610146602083018461066d56fea164736f6c6343000818000aa164736f6c6343000818000a
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061007a575f3560e01c80636e5253a3116100585780636e5253a3146100da578063775c300c146100ed5780637cb5ba55146100f75780638c438c9c1461010a575f80fd5b806333ca902d1461007e57806337d1e0fe1461009c5780634fd10883146100c7575b5f80fd5b610086610112565b6040516100939190610482565b60405180910390f35b6100af6100aa3660046104ce565b610171565b6040516001600160a01b039091168152602001610093565b6100af6100d5366004610500565b610198565b6100866100e8366004610528565b6101cc565b6100f561023f565b005b6100af610105366004610528565b61032a565b6100af6103ee565b60605f80548060200260200160405190810160405280929190818152602001828054801561016757602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311610149575b5050505050905090565b5f818154811061017f575f80fd5b5f918252602090912001546001600160a01b0316905081565b6001602052815f5260405f2081815481106101b1575f80fd5b5f918252602090912001546001600160a01b03169150829050565b6001600160a01b0381165f9081526001602090815260409182902080548351818402810184019094528084526060939283018282801561023357602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311610215575b50505050509050919050565b5f60405161024c90610475565b604051809103905ff080158015610265573d5f803e3d5ffd5b505f8054600180820183557f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56390910180546001600160a01b0385167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216811790925533808552602084815260408087208054968701815587529581902090940180549092168317909155925190815292935083927f4a63b21a08939139d77a0dec6735b4928ef562473a1e0e96a2fff0fe3c8ca63f910160405180910390a25050565b6001600160a01b0381165f9081526001602052604081205461039d5760405162461bcd60e51b815260206004820152602160248201527f4e6f20636f756e74657273206465706c6f7965642062792074686973207573656044820152603960f91b60648201526084015b60405180910390fd5b6001600160a01b0382165f908152600160208190526040909120805490916103c491610548565b815481106103d4576103d461056d565b5f918252602090912001546001600160a01b031692915050565b5f805461043d5760405162461bcd60e51b815260206004820152601860248201527f4e6f20636f756e74657273206465706c6f7965642079657400000000000000006044820152606401610394565b5f805461044c90600190610548565b8154811061045c5761045c61056d565b5f918252602090912001546001600160a01b0316919050565b6109138061058283390190565b602080825282518282018190525f9190848201906040850190845b818110156104c25783516001600160a01b03168352928401929184019160010161049d565b50909695505050505050565b5f602082840312156104de575f80fd5b5035919050565b80356001600160a01b03811681146104fb575f80fd5b919050565b5f8060408385031215610511575f80fd5b61051a836104e5565b946020939093013593505050565b5f60208284031215610538575f80fd5b610541826104e5565b9392505050565b8181038181111561056757634e487b7160e01b5f52601160045260245ffd5b92915050565b634e487b7160e01b5f52603260045260245ffdfe608060405234801561000f575f80fd5b5061018a6100ae604080516080810182525f808252602082018190529181018290526060810191909152506040805160808101825273687820221192c5b662b25367f70076a37bc79b6c815273848b0066793bcc60346da1f49049357399b8d5956020820152731364cbbf2cdf5032c47d8226a6f6fbd2afcdacac9181019190915273bc91f3dad1a5f19f8390c400196e58073b6a0bc4606082015290565b80517fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea60080546001600160a01b03199081166001600160a01b039384161790915560208301517fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6018054831691841691909117905560408301517fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6028054831691841691909117905560608301517fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6038054909216921691909117905550565b7f5ea69329017273582817d320489fbd94f775580e90c092699ca6f3d12fdf7d0080546001600160a01b03191673a02cda4ca3a71d7c46997716f4283aa851c28812179055610737806101dc5f395ff3fe608060405234801561000f575f80fd5b506004361061003f575f3560e01c80635941195d14610043578063a87d942c14610058578063e055f8f91461006c575b5f80fd5b6100566100513660046105f8565b61007f565b005b5f5460405190815260200160405180910390f35b61005661007a3660046105f8565b6100ec565b5f6100bf8484848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061013992505050565b90506100cc5f548261014d565b5f8190556100d99061017b565b506100e55f543361018a565b5050505050565b5f61012c8484848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061013992505050565b90506100cc5f548261019c565b5f610146838360046101ca565b9392505050565b5f8261015f5761015c5f6102ea565b92505b816101705761016d5f6102ea565b91505b61014683835f610302565b5f61018682306103fd565b5090565b5f61019583836103fd565b5090919050565b5f826101ae576101ab5f6102ea565b92505b816101bf576101bc5f6102ea565b91505b61014683835f610486565b7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6015460405163196d0b9b60e01b81525f917fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600916001600160a01b039091169063196d0b9b9061024390889033908990899060040161068d565b6020604051808303815f875af115801561025f573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061028391906106ff565b8154604051630f8e573b60e21b8152600481018390523360248201529193506001600160a01b031690633e395cec906044015f604051808303815f87803b1580156102cc575f80fd5b505af11580156102de573d5f803e3d5ffd5b50505050509392505050565b5f6102fc8263ffffffff16600461053b565b92915050565b5f8082156103155750600160f81b610318565b505f5b7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6015460405163022f65e760e31b815260048101879052602481018690527fff00000000000000000000000000000000000000000000000000000000000000831660448201527fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600916001600160a01b03169063117b2f38906064015b6020604051808303815f875af11580156103cf573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103f391906106ff565b9695505050505050565b5f7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6008054604051635ca4b5b160e11b8152600481018690526001600160a01b03858116602483015292935091169063b9496b62906044015f604051808303815f87803b15801561046b575f80fd5b505af115801561047d573d5f803e3d5ffd5b50505050505050565b5f8082156104995750600160f81b61049c565b505f5b7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea601546040516303056db360e31b815260048101879052602481018690527fff00000000000000000000000000000000000000000000000000000000000000831660448201527fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600916001600160a01b03169063182b6d98906064016103b3565b7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea60154604051639cd07acb60e01b81525f917fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600916001600160a01b0390911690639cd07acb906105b09087908790600401610716565b6020604051808303815f875af11580156105cc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105f091906106ff565b949350505050565b5f805f6040848603121561060a575f80fd5b83359250602084013567ffffffffffffffff80821115610628575f80fd5b818601915086601f83011261063b575f80fd5b813581811115610649575f80fd5b87602082850101111561065a575f80fd5b6020830194508093505050509250925092565b6054811061068957634e487b7160e01b5f52602160045260245ffd5b9052565b8481525f60206001600160a01b03861660208401526080604084015284518060808501525f5b818110156106cf5786810183015185820160a0015282016106b3565b505f60a0828601015260a0601f19601f830116850101925050506106f6606083018461066d565b95945050505050565b5f6020828403121561070f575f80fd5b5051919050565b82815260408101610146602083018461066d56fea164736f6c6343000818000aa164736f6c6343000818000a
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.