'Bulk Minting NFTs with Hardhat on Polygon Mainnet not working on Testnet it is working fine
I followed the instruction on creating a own erc721 contract on Polygon(Matic) on nftschool.dev and on the Mumbai Testnetwork it is everything fine.
But when I change to the Mainnet in the hardhar.config.js I can create the ERC721 Contract but on bulk minting I got an error:
replacement fee too low.
I rewrote the minting function from the example to not only mint 1 so I can mint a few 100 or 1000s. This is my code for the Bulk Minting which is working fine on Mumbai:
const CONTRACT_ADDRESS = "0xb5d4d3d3669C5067d40F09318734D79E114C9280"
import fs from 'fs'
async function mintNFT(contractAddress, metaDataURL, count) {
const ExampleNFT = await ethers.getContractFactory("ExampleNFT")
const [owner] = await ethers.getSigners()
await ExampleNFT.attach(contractAddress).mintNFT(owner.address, metaDataURL) //.then((tx) => tx.wait(5))
console.log(count + " - NFT minted to: ", owner.address)
}
var metadata = JSON.parse('{"1":"ipfs://bafyreifwgvbzropvmptvdfxm3ss22ywkcvds3reege6n6dne65ybpvtgvi/metadata.json","2":"ipfs://bafyreihj2rupmle5wxlvxmwvknjepwybqafldkpmmb6qu4jv7uopugt2nq/metadata.json","3":"ipfs://bafyreie3nnhalud6jkkaddslmwhzcvyrvggiojuxz2uwgjtt5m3362wdqm/metadata.json","4":"ipfs://bafyreicyslxpyamhnju3lrgnhh5lwnwewkfyagje4mmjekxjdc45rpdto4/metadata.json","5":"ipfs://bafyreiefmh6bfqgwkdjckbuk7uiu7xdg4aliou2dn5caovkc7dnnnah5ry/metadata.json","6":"ipfs://bafyreibh3sphaehpty4jkvt36zxoo5bvzxda3se2ydftwajhptnvyqttqq/metadata.json"}');
for (let index = 1; index < 201; index++) {
console.log(index + " - " + metadata[index]);
await mintNFT(CONTRACT_ADDRESS, metadata[index], index)
}
Why is it not working on the mainet? is there a better solution for bulk minting?
thank you
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
