You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 15, 2022. It is now read-only.
During part 4 of the tutorial we add an operation cost to the mintTo() operation of the smart contract.
However passing the cost to the method from the hardhat task is missing.
As said in a PR comments you need to add something like value: ethers.utils.parseEther("0.08") to pass along the value with the transaction
Full code is:
task("mint", "*** Mints from the NFT contract")
.addParam("address", "The address to receive a token")
.setAction(async function (taskArguments, hre)
{
const contract = await getContract("NFT", hre);
const transactionResponse = await contract.mintTo(taskArguments.address,
{
gasLimit: 500_000,
value: ethers.utils.parseEther("0.08") // Cost of the operation is 0.08 ETH
});
console.log(`Transaction Hash: ${transactionResponse.hash}`);
});