InE* structs and pass them directly into a contract call.
encryptInputs returns EncryptedItemInput objects that match the Solidity InE* input structs. The on-chain CoFHE library validates the verifier signature before the contract can use the ciphertext.
Flow
- Ensure your contract function accepts encrypted
InE*parameters. - Encrypt the plaintext values with
encryptInputs. - Send a transaction and pass the encrypted structs as the
InE*arguments.
Prerequisites
- Create and connect a client.
- Your contract function must accept encrypted
InE*structs.
Encryptable.uint32(...)→InEuint32Encryptable.bool(...)→InEboolEncryptable.address(...)→InEaddress
Example: encrypt and call a contract
Common pitfalls
- Wrong
Encryptabletype: theEncryptable.*factory must match the Solidity parameter type (InEuint32vsInEuint64, etc). - Wrong account / chain: encrypted inputs are authorized for a specific
account + chainId. If you encrypt under the wrong wallet/network, the contract call may revert. - ABI struct shape mismatch: if you hand-write an ABI, ensure the tuple fields are
(ctHash, securityZone, utype, signature)in the same order your client library expects.