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 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