Files
2025-12-31 21:13:02 -08:00

37 lines
1.0 KiB
TypeScript

import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { luxfhe, ethers } = hre;
const { deploy } = hre.deployments;
const [signer] = await ethers.getSigners();
if (hre.network.name === "localluxfhe") {
if (await signer.getBalance() < ethers.utils.parseEther("1.0")) {
await luxfhe.getFunds(signer.address);
}
}
const token = await deploy("FHERC20", {
from: signer.address,
args: ["token", "FHE"],
log: true,
skipIfAlreadyDeployed: true,
});
console.log(`auction fherc20 contract: `, token.address);
const voting = await deploy("Auction", {
from: signer.address,
args: [token.address, 3600],
log: true,
skipIfAlreadyDeployed: false,
});
console.log(`Auction contract: `, voting.address);
};
export default func;
func.id = "deploy_auction";
func.tags = ["Auction", "FHERC20-Auction"];