Input
// We first create a buffer for values to encrypt and register to the fhevm
const buffer = instance.createEncryptedInput(
// The address of the contract allowed to interact with the "fresh" ciphertexts
contractAddress,
// The address of the entity allowed to import ciphertexts to the contract at `contractAddress`
userAddress,
);
// We add the values with associated data-type method
buffer.add64(BigInt(23393893233));
buffer.add64(BigInt(1));
// buffer.addBool(false);
// buffer.add8(BigInt(43));
// buffer.add16(BigInt(87));
// buffer.add32(BigInt(2339389323));
// buffer.add128(BigInt(233938932390));
// buffer.addAddress('0xa5e1defb98EFe38EBb2D958CEe052410247F4c80');
// buffer.add256(BigInt('2339389323922393930'));
// This will encrypt the values, generate a proof of knowledge for it, and then upload the ciphertexts using the relayer.
// This action will return the list of ciphertext handles.
const ciphertexts = await buffer.encrypt();Last updated