This project involves the creation and deployment of an ERC721A-compliant NFT (Non-Fungible Token) contract named MetaTokenNFT on Sepolia Ethereum testnet then approve and deposit the NFT to Polygon Amoy using their fxPortal bridge.
- Install nvm.
- Use Node.js version 18 or higher.
nvm install 18
nvm use 18git clone <this-repo-url>cd <the-repo>npm installFirst compile the contract using npx hardhat compile then deploy the contract onto
Sepolia Ethereum testnet using the following command:
npx hardhat run --network sepolia scripts/nft/deploy.jsThen, if everything is set up right, you get a console response like this:
MetaToken NFT deployed to: <CONTRACT-ADDRESS>
To batch mint NFTs to the deployed contract, update the contract address in the
.env.example. file and rename the file to .env. Also, subsequently update
the required variables in the .env file.
Then run the batchMint.js script with this hardhat command:
npx hardhat run --network sepolia scripts/nft/batchMint.jsThe response log will look like:
Successfully minted: <number> MetaToken NFTs to <WALLET-ADDRESS>
Pass in the Polygon Amoy bridged address of your contract to BRIDGE-ADDRESS in
.env, then run the approveTransfer.js script with hardhat:
npx hardhat run --network sepolia scripts/nft/approveTransfer.jsThe response should look like this:
NFT approval confirmed
NFT deposited on Polygon Amoy
Onanike Samuel Chisom @samtheanalysts