This project is the first assignment in Polygon-Advance. The primary objectives of this project are:
- Deploy an NFT collection on the Ethereum blockchain.
- Map the NFT collection to the Polygon network.
- Transfer assets from Ethereum to Polygon using the Polygon Bridge.
-
Install the required dependencies by running the following command:
npm install
-
After installing the dependencies, you can run the test file using the following command:
npx hardhat test
Before deploying the ERC721 contract, you need to set up your environment variables. Rename the file .env.example
to .env
and provide your wallet private key where required, like this:
PRIVATE_KEY=your_wallet_private_key_here
Now, you can proceed to deploy the ERC721 contract to the Goerli Ethereum Testnet with the following command:
npx hardhat run scripts/deploy.js --network goerli
After successful deployment, an address will be generated. Copy that address into contractAddress.js
(located in the metadata folder) and also in batchMint.js
(stored in the scripts folder).
To mint a batch of NFTs using the deployed ERC721 contract, run the following command:
npx hardhat run scripts/batchMint.js --network goerli
This script will mint the specified number of NFTs and assign them to your address.
To transfer the minted NFTs from Ethereum to the Polygon Mumbai network using the FxPortal Bridge, execute the following commands:
npx hardhat run scripts/approveDeposit.js --network goerli
This project was developed by Uttam Kumar.
This project is licensed under the MIT License.