Cloning OpenSea NFT Boilerplate Questions

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?

Yes I didn’t change anything, and I’ve deployed to BSC Testnet


This is the reason it fails on BSC Testnet. I’m not certain how to go about fixing it b/c this didn’t come up in the tutorial.

Are you using the right wallet e.g. owner of the tokens? Check the wallet address that is attempting the transaction. You can look at the tutorial for any missed steps.

Yes i’m using some test NFTs that i’ve deployed and the owner of so I’m not sure what it means

It means the sender of that transaction is either not the owner or doesn’t have permission (via contract approval) to successfully run transfer/transferFrom.

Im going to be moving on to a new template, but thank you to everyone who gave me advice & shared their knowledge. Appreciate all of you

Best of luck. The principles discussed can still apply any other template/boilerplate.

1 Like

Hi. I managed to get the OpenSea clone to work using Moralis server on Ethereum mainnet. I hope someone can please help me with any of these questions:

  1. How do I create a Moralis server on PulseChain Testnet V2b if I know all the RPC details etc.? (I have already deployed marketplaceBoilerplate.sol on PulseChain Testnet V2b).

  2. How do I enable my Moralis server so anyone can access my cloned marketplace via a url rather just me accessing via my localhost?

  3. How come all the NFT’s in the collections in my cloned marketplace dApp are not for sale? How do I only show the ones that are for sale?

Thanks very much. Any help would be much appreciated :slight_smile:

  1. How do I create a Moralis server on PulseChain Testnet V2b if I know all the RPC details etc.? (I have already deployed marketplaceBoilerplate.sol on PulseChain Testnet V2b).

PulseChain is not currently supported by Moralis. Your collection and marketplace contracts will need to be on a supported chain.

  1. How do I enable my Moralis server so anyone can access my cloned marketplace via a url rather just me accessing via my localhost?

You will need to deploy your marketplace app and then users can access it. E.g. this is the base Ethereum boilerplate live. You can use providers like Netlify or Vercel.

  1. How come all the NFT’s in the collections in my cloned marketplace dApp are not for sale? How do I only show the ones that are for sale?

On the Explore page, by default the boilerplate also shows NFTs not for sale. You would need to filter these out based on MarketItem events.

Thanks so much! :slight_smile:

In regard to your answers, any more info on the following would be greatly appreciated:

  1. Can I lobby Moralis to support PulseChain Testnet V2b or mainnet in the future? If not, are there any servers that do support them? Or since it is just an Ethereum fork and I know all the ChainID and RPC server address details, is there any way to use this info create my own PulseChain Testnet server?

  2. Thanks for this! I am deploying using Netlify and so far so good :slight_smile:

  3. How do I filter out the NFTs not for sale as you suggested?

Thanks very much! :slight_smile:

  1. Can I lobby Moralis to support PulseChain Testnet V2b or mainnet in the future? If not, are there any servers that do support them? Or since it is just an Ethereum fork and I know all the ChainID and RPC server address details, is there any way to use this info create my own PulseChain Testnet server?

You can suggest they add PulseChain at https://roadmap.moralis.io. It is an Ethereum fork yes but Moralis doesn’t support it so you won’t be able to use Moralis to sync or get on-chain data (via Moralis servers or the API).

  1. How do I filter out the NFTs not for sale as you suggested?

This is an example you can look at, at step 3. You query the market items Class to get the list of NFTs for sale and then filter the displayed results using this list.

Thanks again! :slight_smile:

  1. I have added a feature request as you suggested. I really hope they consider it.

  2. I tried deploying using Netlify but unfortunately it came back with the following error: “Failed during stage ‘building site’: Build script returned non-zero exit code: 2”. I have opened topic on the Support Forum. I tried it using Vercil and it worked but only shows the basic boilerplate template? Not the final code version I have in my GitHub repository? https://openclone-yngwiewylde.vercel.app/NFTMarketPlace

  3. Thanks for this. I will try.

Did you get other errors in your deploy log?

I tried it using Vercil and it worked but only shows the basic boilerplate template? Not the final code version I have in my GitHub repository

Make sure you deployed from the right repository and branch.

Thanks again for your help :slight_smile:

I gave up on Netlify but got it working using Vercel! It was just a wallet connecting issue at my end.

In terms of getting it to work on PulseChain Testnet V2b I think I need to replace the Moralis API calls with standard RPC Node API calls… any idea how to do this?

Also, the collections only seem to show 10 items. Is there a way to view all the items in each collection?

Thanks very much :slight_smile:

I think I need to replace the Moralis API calls with standard RPC Node API calls… any idea how to do this?

Not sure exactly. It won’t be an easy process querying nodes otherwise there wouldn’t be a need for Moralis’s API. For getting a contract’s NFTs for example you would have to pick up all Transfer events and store/normalize this data - this would require an archive node.

You could also look at the PulseChain API.

Also, the collections only seem to show 10 items. Is there a way to view all the items in each collection?

Does your collection only have 10 NFTs? By default the boilerplate has a limit of 20 which you can remove.