returnValues or Transfer undefined

I’m watching tutorial and already in this part:

and when I inspected the element these happened.
the problem is " return; "
I’m wondering why Transfer is undefined when I console.log and returnValues is not showing.

here is my code:

mintNft = async (metadataUrl) => {
const receipt = await tokenContract.methods.createNft(metadataUrl).send({from: ethereum.selectedAddress});
console.log(“receipt only”,receipt);



Hey @suntay44

In the original code there is a method createItem and you have createNft.

The original code from the tutorial:

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

Please check if your method is executing :man_mechanic:

yup, the tutorial is createItem and I created createNft

here is my createNft:

 function createNft(string memory uri) public returns (uint256){
        uint256 newItemId = _tokenIds.current();
        _safeMint(msg.sender, newItemId);

        Items[newItemId] = Item(newItemId, msg.sender, uri);

        return newItemId;

Could you send a console.log(“receipt only”,receipt) message?

Here, Thanks!

I’m using BSC instead of ganache, will that changes the structure of what is needed to return?

Can you paste the address that you are using so that we can look on bsc chain? Also the contract address.

the wallet address: “0xd1378f17051e34cf24d92227ea753346d4b3d72e”

TOKEN_CONTRACT_ADDRESS = “0x28b26a366e608D7e1d4e6FCeb88577029baA435F”;

For me it looks like there is no smart contract deployed at address “0x28b26a366e608D7e1d4e6FCeb88577029baA435F”

When I run truffle migrate it says migrated successfully just like in the video and copied the contract address. Let me check. Thanks man!

0x5B5497059B53880f10D6625eb435c1E51605B586 here is the updated contract address.

2 items is being minted:

how do you know that those 2 items are being minted, what is the transaction that made that smart contract deploy in bsc testnet?

because when I hit create NFT in localhost and after a few mins it is reflected on that testnet address.

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 :

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.



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 url.
I wanted to say what is the transaction that created this smart contract in particular.