[SOLVED] Cloning openSea how do I specify I want to operate on Goerli testnet

I am cloning opensea and trying to put my smart contract info that I have on Goerli, where can I specify that ?

You can follow the instructions here for setting up the boilerplate with your marketplace contract.

thank you for your reply, I am wondering where I can specify which testnet my contract is in? I have a contract already deployed on goerli and want to use that

Not sure what you mean, what sort of contract are you talking about? If you’ve deployed your contract on Goerli, then you don’t need to specify it’s on Goerli.

If you have an NFT contract on Goerli that you want to display, then you set it in your helpers\collections.js file with the correct chainId (‘0x5’) and then when the user is connected to Goerli with their wallet, it will be active in the app.

I thought I had to specify contract info in MoralisDappProvider.js ?

I also see Chains.jsx is where the input is given?

I thought I had to specify contract info in MoralisDappProvider.js ?

Yes you do for the marketplace contract. That is different from an NFT contract. When the user’s wallet is on Goerli, then they can interact with your marketplace contract.

when I insert my contract info, the marketplace shows empty page in the browser, this is my code in MoralisDappProvider.js:

const [contractABI, setContractABI] = useState(my_contract_abi); //Smart Contract ABI here
const [marketAddress, setMarketAddress] = useState(my_contract_address); //Smart Contract Address Here

Is your wallet on the right chain where some of the NFT collections defined in helpers\collections.js (sorry incorrectly specified networks.js previously)? You don’t see the marketplace contract, it’s what you interact with behind the scenes when you go to list an NFT for example from one of these collections.

the browser is completely empty I cannot even see my wallet connected

this is what I have before connecting my contract

Check your browser console for any errors.

my abi is not in JSON format apparently, but I just copied and pasted it

[
{
inputs: [ [Object] ],
stateMutability: ‘nonpayable’,
type: ‘constructor’
},
{
anonymous: false,
inputs: [ [Object], [Object] ],
name: ‘BalanceWithdrawn’,
type: ‘event’
},
{
anonymous: false,
inputs: [ [Object], [Object] ],
name: ‘OfferingClosed’,
type: ‘event’
},
{
anonymous: false,
inputs: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
name: ‘OfferingPlaced’,
type: ‘event’
},
{
anonymous: false,
inputs: [ [Object], [Object] ],
name: ‘OperatorChanged’,
type: ‘event’
},
{
inputs: [ [Object], [Object], [Object], [Object] ],
name: ‘placeOffering’,
outputs: [],
stateMutability: ‘nonpayable’,
type: ‘function’
},
{
inputs: [ [Object] ],
name: ‘closeOffering’,
outputs: [],
stateMutability: ‘payable’,
type: ‘function’,
payable: true
},
{
inputs: [],
name: ‘withdrawBalance’,
outputs: [],
stateMutability: ‘nonpayable’,
type: ‘function’
},
{
inputs: [ [Object] ],
name: ‘changeOperator’,
outputs: [],
stateMutability: ‘nonpayable’,
type: ‘function’
},
{
inputs: [ [Object] ],
name: ‘viewOfferingNFT’,
outputs: [ [Object], [Object], [Object], [Object] ],
stateMutability: ‘view’,
type: ‘function’,
constant: true
},
{
inputs: [ [Object] ],
name: ‘viewBalances’,
outputs: [ [Object] ],
stateMutability: ‘view’,
type: ‘function’,
constant: true
}
]

Where did you copy this ABI from? There shouldn’t be any [Object]s like that. Also it doesn’t look like the ABI for the default marketplace contract.

This is an example of the marketplace ABI, and it needs to be in a string:

const [contractABI, setContractABI] = useState(
    '[{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"createMarketItem","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"itemId","type":"uint256"}],"name":"createMarketSale","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"itemId","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"MarketItemSold","type":"event"},{"inputs":[],"name":"fetchMarketItems","outputs":[{"components":[{"internalType":"uint256","name":"itemId","type":"uint256"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address payable","name":"seller","type":"address"},{"internalType":"address payable","name":"owner","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"bool","name":"sold","type":"bool"}],"internalType":"struct BETTASea.MarketItem[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]'
  );

Have you been following the tutorial?

I was just reading documentation. let me check that tutorial and will get back to you! thanks

I checked the video really helpful. Do you know where is the nft contract (marketplace) used in this video? I can’t find it on github

The marketplace contract can be found here.

thank you glad for your help. I have successfully loaded the contract and NFE collection but am getting the error “Unable to fetch all NFT metadata… We are searching for a solution, please try again later!”
I understand it is coming from NFTBalance.jsx but can’t seem to figure out why.
I also changed to heroku server to stop CORS error.
the picture for the collection loads fine

image

image

this is what the browser gives me

You can click into that 400 error link (or check your browser’s network tab) to see what the error response is.

That “Unable to fetch all NFT metadata” message means the useNFTBalance hook (getNFTs) failed where it couldn’t get the metadata from one or more of your owned NFTs. What is that NFE contract address you’re using?

this is what the console link says : {“code”:141,“error”:“address is not a valid hex address”}

and this is my NFT address on goerli 0xA43C59BDb984DBF72A2ca6D938B5cfc745817AcA