Skip to content

Commit

Permalink
Merge pull request #48 from zama-ai/improvedMintTask
Browse files Browse the repository at this point in the history
chore: improved logs in mint task
  • Loading branch information
jatZama authored Dec 6, 2024
2 parents 951ab7b + b1a463d commit bf88a1d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tasks/mint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { task } from "hardhat/config";
import type { TaskArguments } from "hardhat/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

task("task:deployConfidentialERC20").setAction(async function (taskArguments: TaskArguments, { ethers }) {
const signers = await ethers.getSigners();
Expand All @@ -11,15 +12,16 @@ task("task:deployConfidentialERC20").setAction(async function (taskArguments: Ta

task("task:mint")
.addParam("mint", "Tokens to mint")
.setAction(async function (taskArguments: TaskArguments, hre) {
.setAction(async function (taskArguments: TaskArguments, hre: HardhatRuntimeEnvironment) {
const { ethers, deployments } = hre;
const ERC20 = await deployments.get("MyConfidentialERC20");

const signers = await ethers.getSigners();

const erc20 = (await ethers.getContractAt("MyConfidentialERC20", ERC20.address)) as any;

Check failure on line 21 in tasks/mint.ts

View workflow job for this annotation

GitHub Actions / ci

Unexpected any. Specify a different type

await erc20.connect(signers[0]).mint(+taskArguments.mint);

console.log("Mint done: ", taskArguments.mint);
const tx = await erc20.connect(signers[0]).mint(+taskArguments.mint);
const rcpt = await tx.wait();
console.log("Mint tx hash: ", rcpt.hash);
console.log("Mint done: ", taskArguments.mint, "tokens were minted succesfully");
});

0 comments on commit bf88a1d

Please sign in to comment.