How to list NFTs with price to opensea on Polygon

with all the tutorial I found there is smart contract which mint nfts and we can see those open sea

but how I list ERC1155 nft because I have 5000 generative NFT and I don’t want to add pricing to each one of them and list them using open sea

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC1155/ERC1155.sol';


contract TradeNFT {
    mapping(address => mapping(uint256 => Listing)) public listings; 
    struct Listing {
        uint256 price;
        address seller;
    }

    function addListing(uint256 price,address contractAddress,uint256 tokenId) public {
        ERC1155 token = ERC1155(contractAddress);
        require(token.balanceOf(msg.sender,tokenId) > 0 , "caller must own given token");
        require(token.isApprovedForAll(msg.sender,address(this)),"contract must be approved");
        listings[contractAddress][tokenId] = Listing(price,msg.sender);
    }

    
}

I uses this code but Still after 3 hours my Nfts were not listed in opensea

who would call that function addListing from this contract?

me after deploy this smart contract

and how would opensea know about your new smart contract where you added those listings?

1 Like

I thought when I Call This function with price, contract address [‘the address of my NFT mint Smart contract the one I used to mint NFts’] and tokenId [‘the token Which I want to list’] Opensea also know about that because I am playing with same Contract which I can see on Opensea after minting.

so where I am missing, if you guide me or let me know some blog post that would be great help.
still on learning Phase so for sure I am missing something.

thanks

and if you got my question then that’s the thing I need to solve.

I don’t know how you set the price for an NFT on open sea, but I don’t expect it to work with that method with creating a new smart contract

ok thanks let for your reply,
but wooo we can easily found method to mint 10000 NFTs but How to set price is something we miss or what

I need something similar to Moralis.Plugins.opensea.createSellOrder

I used this and it works for Riskeby I need for polygon Which moralis won’t support

@cryptokid

I used this and it works for Riskeby

So, you published the TradeNFT contract and then you called addListing method, and then those NFTs were out for sale? :open_mouth:

So, any idea how to do it? Specially on Polygon

No it didn’t work with addlisting contaract. It work with opensea plugin which currently supports eth and rinkeby network

The OpenSea plugin uses the OpenSea SDK that only supports Mainnet and Rinkeby.
We will provide Polygon support as soon as they add it.

1 Like