Project Ready

This commit is contained in:
2024-08-06 20:52:02 +08:00
parent a76b612818
commit d1b444988e
7 changed files with 420 additions and 280 deletions
+18
View File
@@ -0,0 +1,18 @@
const { ethers, getNamedAccounts } = require("hardhat");
async function main() {
const { deployer } = await getNamedAccounts();
const fundMe = await ethers.getContract("FundMe", deployer);
console.log(`Got contract FundMe at ${fundMe.address}`);
console.log("Withdrawing from contract...");
const transactionResponse = await fundMe.withdraw();
await transactionResponse.wait();
console.log("Got it back!");
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});