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 / withdrawal task is missing in hardhat #3

@fixitornever

Description

@fixitornever

During Step 4 we add the support of withdrawPayments() to our smart contract however if you want to call that method you need a new hardhat task which is not proposed in the guide.

I suggest something like:

task("withdraw", "*** Transfer the ETH hold by the SC to the account")
.setAction(async function (taskArguments, hre) {
    const account = getAccount();
    const contract = await getContract("NFT", hre);
    const transactionResponse = await contract.withdrawPayments(account.address,
    {
        gasLimit: 500_000,
    });
    console.log(`Transaction Hash: ${transactionResponse.hash}`);
});

This way calling npx hardhat withdraw should withdraw the SC ETH to the account specified with the ACCOUNT_PRIVATE_KEY env variable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions