Cloning OpenSea NFT Boilerplate Questions

Tested just now querying 1230 rows with a limit as 10000. It retuned all the data.
image.

I guess there is no upper limit.

1 Like

You are the best. THANKS

Are you able to help me add these elements to my project? I copied the boilerplate & edited it but id like to add these as well, & im sure most others would as well. I need at least 1 or 2 done before I launch, but would like to have 3 done as well. Any help would be appreciated!

Hey guys I’m looking for the market place contract for remix but I cant find the one that he has in the video. Any assistance is appreciated.

That contract is here.

What have you done so far in your Explore page component? You can post a screenshot.

For items, you can use the total from your collection. You can get it from the API with getAllTokenIds.

For owners one way is to count all unique addresses from all Transfer events on the collection contract, similar to the process here. The API currently doesn’t have that available.

Floor price you could query all your market items from your table to get the first result based on ascending price.

I’m not sure what total volume would be, number of sales? If so you could use the total number of MarketItemSold events from the marketplace contract.

And then to add all of this data to your component to display it, you can use grids. As the boilerplate uses Ant Design, you can use their grid too.

For a search bar, you can read this and implement it similar to the filter code based on the syncing code example I posted. So you add a search input, add a handler which filters results based on what is entered in it, and then display these results.

For low to high, implement a select element as in the picture using similar code in the syncing example. But because you wanted all NFTs shown, it will have some conflicts because not all of them will have prices.

2 Likes

Thank you for all the advice. Ive got the contracts active & the collections uploaded. I customized the boilerplate & made the explore tab the marketplace tab. I only have the default functions from the boiler plate setup. Everything works but I just want to be able to filter everything the collections & display those elements. This is only my 2nd web3 project & im working alone so im just struggling to figure out how to make the front-end interact with the smart contracts.

1 Like

Hey guys I’m stuck on adding the smart contract ABI to my server. I keep getting the error message “Invalid ABI Please Verify” Any help

You can post your ABI here. It should be in the same format like this where it’s only the part that’s relevant to the event/topic you want to sync:

{
  "anonymous": false,
  "inputs": [
    {
      "indexed": true,
      "name": "from",
      "type": "address"
    },
    {
      "indexed": true,
      "name": "to",
      "type": "address"
    },
    {
      "indexed": false,
      "name": "tokenId",
      "type": "uint256"
    }
  ],
  "name": "Transfer",
  "type": "event"
}

In that case, what do you want to work on first? It would be easiest to start with the stats and get them displayed.

Here it is

{
“anonymous”: false,
“inputs”: [
{
“indexed”: true,
“internalType”: “uint256”,
“name”: “itemId”,
“type”: “uint256”
},
{
“indexed”: true,
“internalType”: “address”,
“name”: “nftContract”,
“type”: “address”
},
{
“indexed”: true,
“internalType”: “uint256”,
“name”: “tokenId”,
“type”: “uint256”
},
{
“indexed”: false,
“internalType”: “address”,
“name”: “seller”,
“type”: “address”
},
{
“indexed”: false,
“internalType”: “address”,
“name”: “owner”,
“type”: “address”
},
{
“indexed”: false,
“internalType”: “uint256”,
“name”: “price”,
“type”: “uint256”
},
{
“indexed”: false,
“internalType”: “bool”,
“name”: “sold”,
“type”: “bool”
}
],
“name”: “MarketItemCreated”,
“type”: “event”
},

Ok no problem, we can start with the stats & get them displayed.

Get rid of the comma at the end and it should work.

1 Like

That worked perfectly, Thank you!

When adding my ABI as a string in MoralisDappProvider.js I’m getting this error message " Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength"…

I’ve done a google search for this issue and change the max Token length to 2000000, but this still doesn’t work.

I’m not familiar with that error, does that break the app?

What you could try is putting your ABI in a separate .json file, and importing/using that.

import ABI from './abi.json';
...
const [contractABI, setContractABI] = useState(JSON.stringify(ABI));
1 Like

It doesn’t break the app but I don’t think it’s being read as a string b/c it’s saying that it’s too long.
I’m going to try the way that you suggested and see how it works for me, thanks.

That worked for the error I was getting, now however when i go to try to sell the NFT Metamask opens and says " We were not able to estimate gas. There might be an error in the contract and this transaction may fail.
Then they give this option to press “I want to proceed anyway”
when I press it I it doesn’t go through just says “Transaction reverted by EVM”

Any idea of what may be happening here?

this is a the full message I get when Metamask rejects my transaction

Is your contract a copy of the provided marketplace contract? What is the chain you’re using?