Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Drjacky opened this issue Dec 25, 2021 · 5 comments
Open

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

Drjacky opened this issue Dec 25, 2021 · 5 comments

Comments

@Drjacky
Copy link

Drjacky commented Dec 25, 2021

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

@Drjacky Drjacky changed the title sol code How to put each NFT for sale while we're minting Dec 31, 2021
@tenumars
Copy link

did you find the sol code?

@Drjacky
Copy link
Author

Drjacky commented Feb 10, 2022

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

@tenumars
Copy link

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

@Drjacky
Copy link
Author

Drjacky commented Feb 10, 2022

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

}

@khanfar
Copy link

khanfar commented Nov 11, 2022

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants