| 3 | const { WHITELIST_CONTRACT_ADDRESS, METADATA_URL } = require("../constants"); |
| 4 | |
| 5 | async function main() { |
| 6 | // Address of the whitelist contract that you deployed in the previous module |
| 7 | const whitelistContract = WHITELIST_CONTRACT_ADDRESS; |
| 8 | |
| 9 | // URL from where we can extract the metadata for a Crypto Dev NFT |
| 10 | const metadataURL = METADATA_URL; |
| 11 | /* |
| 12 | A ContractFactory in ethers.js is an abstraction used to deploy new smart contracts, |
| 13 | so cryptoDevsContract here is a factory for instances of our CryptoDevs contract. |
| 14 | */ |
| 15 | const cryptoDevsContract = await ethers.getContractFactory("CryptoDevs"); |
| 16 | |
| 17 | // deploy the contract |
| 18 | const deployedCryptoDevsContract = await cryptoDevsContract.deploy( |
| 19 | metadataURL, |
| 20 | whitelistContract |
| 21 | ); |
| 22 | |
| 23 | // print the address of the deployed contract |
| 24 | console.log( |
| 25 | "Crypto Devs Contract Address:", |
| 26 | deployedCryptoDevsContract.address |
| 27 | ); |
| 28 | } |
| 29 | |
| 30 | // Call the main function and catch if there is any error |
| 31 | main() |