Last active
March 17, 2024 20:46
-
-
Save shobhitic/23fe001c784208a7f9706053ab7df192 to your computer and use it in GitHub Desktop.
Generate BaseURI and bulk upload NFTs - https://www.youtube.com/watch?v=GU2ZHXbrt90
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.15; | |
import "erc721a/contracts/ERC721A.sol"; | |
contract BASENFT is ERC721A { | |
constructor() ERC721A("BASE URI NFT", "BUN") {} | |
function mint(uint256 quantity) external payable { | |
// `_mint`'s second argument now takes in a `quantity`, not a `tokenId`. | |
_mint(msg.sender, quantity); | |
} | |
function _baseURI() override internal view virtual returns (string memory) { | |
return "ipfs://bafybeifgxh2lo3jpx6xg2bl3wlnifgpahcdvmktl42jz7d7m7x7y6yap3i/"; | |
} | |
} |
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
var fs = require('fs'); | |
for (var i = 0; i < 27; i++) { | |
var json = {} | |
json.name = "Token #" + i; | |
json.description = "This is the description for token #" + i; | |
json.image = "ipfs://CHANGE TO YOUR IMAGES CID/" + i + ".png"; | |
fs.writeFileSync('' + i, JSON.stringify(json)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment