youtube-tutorials icon indicating copy to clipboard operation
youtube-tutorials copied to clipboard

How to put each NFT for sale while we're minting

Open Drjacky opened this issue 3 years ago • 5 comments

1- How to upload NFTs to an existing collection? 2- How to put each NFT for sale while we're uploading?

Drjacky avatar Dec 25 '21 12:12 Drjacky

did you find the sol code?

tenumars avatar Feb 10 '22 13:02 tenumars

To set them for sale (listing) while minting? No.

Drjacky avatar Feb 10 '22 13:02 Drjacky

Oh, not that but the sol code for the smart contract?

tenumars avatar Feb 10 '22 13:02 tenumars

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;
    }

}

Drjacky avatar Feb 10 '22 14:02 Drjacky

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 ?

khanfar avatar Nov 11 '22 01:11 khanfar