Cloning OpenSea NFT Boilerplate Questions

Figured it out, had to approve the marketplace contract to use the token beforehand. Is there a simple way to execute that during the market creation? or would that need to be a separate thing altogether

After cloning the final code repo, I ran npm install and installed the dependencies, changed the .env.example to .env and assigned my AppID and ServerURL values from my Moralis account. Now, when I run npm start I get this React error on my browser: “Error: A cross-origin error was thrown. React doesn’t have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.”.

I tried Cleaning my local storage in Dev Tools from Chrome but nothing. What am I doing wrong? Here I leave the github repo which I cloned

1 Like

I cloned the final code of this tutorial. NFTs not working on testnet (rinkeby). When I try to show a collection of a testnet in Rinkeby it doesnt load anything or it gives me “Unhandled Rejection (TypeError): Failed to fetch”. Ethereum mainnet collections work just fine. Also, my NFTs in rinkeby dont show here, but they do on OpenSea testnet. My Moralis server is set in the project and I set it up as Rinkeby when I created it. Why is this happening? Thanks

1 Like

Having the same issue here. I think that is an issue that needs to be investigated by the team.
my problem:

is your problem due to Rinkeby network not working but working on Mainnet? that seems to be my issue but im not sure if your problem is related to this. maybe i missed something tho

Hmmm not sure - I thought they may be linked

1 Like

Hi all,

The team knows about some cases where they may be occasional issues with fetching NFT images and are working on fixing these, but you can also expect some error handling updates to be pushed to the boilerplate soon to make it a bit more user-friendly :slight_smile:

can you give examples NFTs that are on OpenSea and you don’t see? Did you try with web3api to see if there is data for those NFTs?

For example, the crypto dino collection on the testnet (contract: “0xcC14dd8E6673fEE203366115D3f9240b079a4930”) is not showing. Also, OpenSea testnet shows my NFTs that I minted from the smart contract I am working on. None of these are showing on my NFT Balances section of the clone Dapp. In fact, I never got to see anything there.

I havent tried web3api for checking data in those NFTs since I dont know exactly how to do that but there is data on those NFTs, I can see that on OpenSea (testnet)

Thank you

it looks like this works:

x = await Moralis.Web3API.token.getTokenIdMetadata({address:"0xcc14dd8e6673fee203366115d3f9240b079a4930", token_id: "620", chain: "rinkeby"})

=>

{
    "token_address": "0xcc14dd8e6673fee203366115d3f9240b079a4930",
    "token_id": "620",
    "block_number_minted": "9771525",
    "owner_of": "0x22b076afa91747d945cffbf7be3fd58ead57a02c",
    "block_number": "9772281",
    "amount": "1",
    "contract_type": "ERC721",
    "name": "Crypto_Dino",
    "symbol": "CDNO",
    "token_uri": "https://ipfs.moralis.io:2053/ipfs/QmNe2Jxm3aqVmByTMdud3z2pDiAYARBfLTEFg1Z7iiK3rj/620.json",
    "metadata": null,
    "synced_at": null,
    "is_valid": 0,
    "syncing": 1,
    "frozen": 0
}

this means that it may not be an issue related to web3api not returning that data

I followed to do everything with Youtube, but when i tried to sell nft with transaction fee , nothing happened on CreatedMarketItems on moralis, ( of course i made smart contract with the code in repo https://github.com/ethereum-boilerplate/ethereum-nft-marketplace-boilerplate/blob/main/src/contracts/marketplaceBoilerplate.sol)

please help me !!! i have struggled with the issue since a week ago

1 Like

Hi @lion33,

The CreatedMarketItems table should update any time you make a transaction with the smart contract with the createMarketSale function. So I would first try putting an NFT for sale through e.g. Remix if you deployed the smart contract there. If this still doesn’t update your CreatedMarketItems table, there is most likely something to fix with your Sync event on the Moralis server where you watch for createMarketSale events to occur.

Hope this helps!

Is possible to set the NFT to purchase with different tokens, ETH, USDC, on ETH, or on polygon Matic, DAI, and custom token.

Hey @joop,

Yeah you can do this, you’ll just need some solidity knowledge for this to be able to set the desired token as the required token for purchasing the NFT put up for sale :slight_smile:

1 Like

is there any method to add NFT Details page or Popup?

For sure @Crypto! This is a boilerplate meant to spark your imagination and you can build anything like that on top of this boilerplate :+1:

Please anyone help me to know where smart contract address do i get?


and Can i test it like that above you did in Youtube?

Hi, firstly really appreciate what you have done for the community. I’m studying to become a blockchain developer and your video is really helpful to me. I have a question when setting up the project on local: How can I have some NFT on my address on testnet like you in the video? Currently I don’t have any so I cannot list anything, I cannot buy anything as well since all items are not for sale. Thank you in advance.

Hey @lion33, you can deploy the smart contract yourself. It is provided in the repository, so simply just deploy with Remix or Hardhat what ever you feel comfortable with. Then you can get the smart contract address and ABI :slight_smile:

As long as you have some NFTs in the network you deploy the smart contract to, you should the also be able to test out the sell and buy functionality.

1 Like

Glad you are enjoying Moralis @vantueyeude!

You can have a look at how to deploy a very simple ERC721 NFT collection yourself, just generate some metadata and images, store it on IPFS and then mint the collection to your own address. Then the NFTs should be available in the “Your Collection” tab in the dApp!

This video on the Moralis Youtube channel could be a nice starting point: