-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c08a97
commit 8cf3c06
Showing
7 changed files
with
92 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { DeployFunction } from "hardhat-deploy/types"; | ||
import { BigNumber } from "ethers"; | ||
|
||
/** | ||
* Deploys a contract named "YourContract" using the deployer account and | ||
* constructor arguments set to the deployer address | ||
* | ||
* @param hre HardhatRuntimeEnvironment object. | ||
*/ | ||
const mintZeroNft: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
/* | ||
On localhost, the deployer account is the one that comes with Hardhat, which is already funded. | ||
When deploying to live networks (e.g `yarn deploy --network goerli`), the deployer account | ||
should have sufficient balance to pay for the gas fees for contract creation. | ||
You can generate a random account with `yarn generate` which will fill DEPLOYER_PRIVATE_KEY | ||
with a random private key in the .env file (then used on hardhat.config.ts) | ||
You can run the `yarn account` command to check your balance in every network. | ||
*/ | ||
const deployer = (await hre.ethers.getSigners())[0]; | ||
|
||
const HarbergerNFT = await hre.ethers.getContract("HarbergerNft", deployer); | ||
try { | ||
const tx = await HarbergerNFT.connect(deployer).mintHarberger(1, 123, { | ||
value: BigNumber.from(await HarbergerNFT.calculateMintPrice()).add(123), | ||
}); | ||
await tx.wait(); | ||
} catch (e) { | ||
console.log(e); | ||
} | ||
|
||
// Get the deployed contract | ||
// const yourContract = await hre.ethers.getContract("YourContract", deployer); | ||
}; | ||
|
||
export default mintZeroNft; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters