Skip to content

Commit

Permalink
fix enclave deploy task
Browse files Browse the repository at this point in the history
  • Loading branch information
auryn-macmillan committed Jun 6, 2024
1 parent 7ae874a commit 156da6f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/evm/tasks/lock.ts → packages/evm/tasks/enclave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ import { task } from "hardhat/config";
import type { TaskArguments } from "hardhat/types";

task("task:deployEnclave", "Deploys Enclave contract")
.addParam("owner", "Account that will own this contract")
.addParam("registry", "Address of the cyphernode registry")
.addParam("maxDuration", "The maximum duration of a computation in seconds")
.setAction(async function (taskArguments: TaskArguments, { ethers }) {
const signers = await ethers.getSigners();
const enclaveFactory = await ethers.getContractFactory("Enclave");
console.log(`Deploying Enclave...`);
const enclave = await enclaveFactory
.connect(signers[0])
.deploy(taskArguments.maxDuration);
.deploy(
taskArguments.owner,
taskArguments.registry,
taskArguments.maxDuration,
);
await enclave.waitForDeployment();
console.log("Enclave deployed to: ", await enclave.getAddress());
});

0 comments on commit 156da6f

Please sign in to comment.