youtube-tutorials
youtube-tutorials copied to clipboard
How to put each NFT for sale while we're minting
1- How to upload NFTs to an existing collection? 2- How to put each NFT for sale while we're uploading?
did you find the sol code?
To set them for sale (listing) while minting? No.
Oh, not that but the sol code for the smart contract?
This is my code:
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
// import "../utils/Base64.sol";
import "@openzeppelin/contracts/utils/Base64.sol";
contract bulk_nft is ERC1155, Ownable {
using SafeMath for uint256;
using Base64 for bytes;
string private baseURI;
string public name;
string private _contractURI = "https://.....ipfs...path...to.../collection.json";
constructor() ERC1155("https://ipfs...path....to..../metadata/{id}.json") {
setName("Collection Name Here");
// endd - startt + 1 = total number of files
uint startt = 1;
uint endd = 2;
for (uint i = startt; i <= endd; i++) {
_mint(msg.sender, i, 1, "");
}
}
function setURI(string memory _newuri) public onlyOwner {
_setURI(_newuri);
}
function setName(string memory _name) public onlyOwner {
name = _name;
}
function setContractURI(string memory contractURI_) public onlyOwner() {
_contractURI = string(abi.encodePacked(
"data:application/json;base64,",
Base64.encode(
bytes(
contractURI_
)
)
));
}
// // for opensea collection
// function contractURI() public pure returns (string memory) {
// return _contractURI;
// }
function contractURI() public view returns (string memory) {
return _contractURI;
}
}
hi , im just setup and run molaris server in my pc and connect it to my metamask , now how to ment nft ? and how to run minter-nft ?