returnValues or Transfer undefined

I think that you can put there any other address for the smart contract and it will tell you that everything worked ok on minting.
You could test with an address that has last number/letter different than your address that you are using now for your smart contract.

Here is the contract address : 0x5B5497059B53880f10D6625eb435c1E51605B586
and the testnet : https://testnet.bscscan.com/address/0x5B5497059B53880f10D6625eb435c1E51605B586

Do you think the problem would be because I was on BSC not on ganache?

Can you show me that transaction hash in testnet.bscscan interface?
I have the impression that your deploy is not done on bsc testnet.

0x17ed478c280b093f135e88bac80ac72b2125d0d9da9afb14ae1ed3c8afbf9944

test net.bscscan.com/tx/0x17ed478c280b093f135e88bac80ac72b2125d0d9da9afb14ae1ed3c8afbf9944

Please fix the link, discourse / forum wont allow me to post full link. Thanks

It looks like this is a transaction where you tried to mint an nft with https://ipfs.moralis.io:2053/ipfs/QmT5QPV2TM26a52wht7ViXKX9yQZP52k9zDkmZ9vgj6mM7 url.
I wanted to say what is the transaction that created this smart contract in particular.

yup, do you think the problem is either

1.) I have mainnet server in moralis and uses testnet on localhost metamask?

2.) I have used BSC instead of Ganache from the tutorial?

I think that you didn’t properly configure your deployment part and it didn’t deploy to bsc testnet and maybe it deployed on a local chain.
You should use testnet server in Moralis, but I don’t think that is the main problem.

I did exactly the same on the tutorial, I’m following along. This is just the things I change course about

1.) I have mainnet server in moralis and uses testnet on localhost metamask?

2.) I have used BSC instead of Ganache from the tutorial?

in order to use BSC, you have to do some changes in deployment
Maybe you can deploy the smart contract easier in bsc testnet by using remix interface

maybe this helps also: https://www.youtube.com/watch?v=roHoOZXIxYs&ab_channel=MoralisWeb3

1 Like

Deploying it on remix is still the same if being done locally? And with moralis?

Thanks will take note on this.

Yes, remix deployment is the same. Th only difference, it doesn’t allow many custom configurations.

1 Like

just one question, because in the code it has mint function

mintNft = async (metadataUrl) => {
    const receipt =  await tokenContract.methods.createItem(metadataUrl).send({from: ethereum.selectedAddress});

  return receipt.events.Transfer.returnValues.tokenId;

}

How will I be able to call this if It is deployed in remix? Thank you!

remix is only a tool that can be easier to use in order to deploy a smart contract on blockchain, after the smart contract was deployed on bsc testnet, then it can be used from anywhere
you’ll have to connect remix to MetaMask in order to be able to deploy on BSC testnet, and you’ll also need some BNB in that testnet network in order to do that deploy

1 Like

I have watched the video and did exactly the same with BSC testnet.

what does truffle(develop) mean?
vs truffle(ropsten) in this video: https://youtu.be/roHoOZXIxYs?t=529

I tried to clone the rarible clone and see if the problem is still there. and now I’m stuck still same problem. I don’t know if Transfer.returnValues.tokenId; is just simple not there? or am I missing something.

If you click on events does it show something or is empty?

My guess is that you didn’t deploy the smart contract to bsc testnet yet. You can still make random calls in bsc testnet to a random address even if is no smart contract at that address. It will simply ignore your parameters but not give an error.

1 Like

Hey, I’ve gotten this a few times-- It’s normally fixed doing one of these:

  1. make sure the correct token / marketplace address is referenced correctly, and up to date everywhere in your code

  2. make sure that the Sync and Watch Contract Events are up to date with the newest contract / abi (at the time of the tutorial they were under plugins, but now under the sync tab)

  3. make sure your hooked up to the correct test / main network on your wallet, on the app, and in the moralis configs

1 Like

Thanks! Will take note of these.