Skip to content
This repository was archived by the owner on Sep 15, 2022. It is now read-only.
This repository was archived by the owner on Sep 15, 2022. It is now read-only.

part 4 / mint operation cost is missing in the code #2

Description

@fixitornever

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}`);
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions