mirror of
https://github.com/luxfhe/example-confidential-voting.git
synced 2026-10-30 18:13:35 +00:00
- Update to unified FHE decryption API - Add foundry.toml for testing - Update dependencies to @luxfi/contracts
17 lines
551 B
TypeScript
17 lines
551 B
TypeScript
import { LuxFHEClient, Permit, getPermit } from "@luxfhe/sdk/node";
|
|
import { HardhatRuntimeEnvironment } from "hardhat/types/runtime";
|
|
|
|
export interface FheContract {
|
|
instance: LuxFHEClient;
|
|
permit: Permit;
|
|
}
|
|
|
|
export async function createFheInstance(contractAddress: string, hre: HardhatRuntimeEnvironment): Promise<FheContract> {
|
|
const provider = hre.ethers.provider;
|
|
|
|
let instance = new LuxFHEClient({ provider });
|
|
const permit = await getPermit(contractAddress, provider);
|
|
instance.storePermit(permit);
|
|
return { instance, permit };
|
|
}
|