mirror of
https://github.com/luxfhe/example-playground.git
synced 2026-10-30 18:13:21 +00:00
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
// TODO: Enable when @luxfhe/sdk is available
|
|
// import { task } from "hardhat/config";
|
|
// import type { TaskArguments } from "hardhat/types";
|
|
// import { FHERC20 } from "../../typechain-types";
|
|
// import * as luxfhe from "@luxfhe/sdk/node";
|
|
//
|
|
// task("task:getBalance").setAction(async function (
|
|
// _taskArguments: TaskArguments,
|
|
// hre,
|
|
// ) {
|
|
// const { ethers, deployments } = hre;
|
|
// const [signer] = await ethers.getSigners();
|
|
//
|
|
// const erc20 = await deployments.get("FHERC20");
|
|
// const address = await signer.getAddress();
|
|
// console.log(`Running getCount, targeting contract at: ${erc20.address}`);
|
|
//
|
|
// const contract = (await ethers.getContractAt(
|
|
// "FHERC20",
|
|
// erc20.address,
|
|
// )) as unknown as FHERC20;
|
|
//
|
|
// let permit = await luxfhe.generatePermit(
|
|
// erc20.address,
|
|
// undefined, // use the internal provider
|
|
// signer,
|
|
// );
|
|
//
|
|
// const sealedResult = await contract.balanceOfEncrypted(address, permit);
|
|
// let unsealed = luxfhe.unseal(erc20.address, sealedResult);
|
|
//
|
|
// console.log(`got balance result: ${unsealed.toString()}`);
|
|
// });
|