Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update App.js #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update App.js #23

wants to merge 1 commit into from

Conversation

xbaldr
Copy link

@xbaldr xbaldr commented Nov 13, 2021

blockchain.smartContract.methods.mint(mintAmount) was missing the parameter telling the dapp which address to mint to

blockchain.smartContract.methods.mint(mintAmount) was missing the parameter telling the app which address to mint to
@Deveshb15
Copy link

Please someone merge this pull request, this issue is breaking the app from minting!

@Mtihc
Copy link

Mtihc commented Dec 13, 2021

It's related to this

Error: Invalid number of parameters for "mint". Got 1 expected 2!

Most people use HashLips/hashlips_nft_contract to create their contracts.
As you can see here, the mint function actually has one 1 parameter. And here, it's being called with 1 parameter. But here, the abi.json says that it has 2 parameters! So the abi.json seems to be wrong.

It depends on your contract The most important thing is that your abi.json is correct. It needs to match with your actual contract. And then, change your code accordingly if needed.

You are probably using a contract where the mint function has 2 parameters. So your fix is good. But I believe most people have a contract where the mint function has 1 parameter. And they just update the abi.json (like they should!) and they don't notice any problems.

abi.json

   {
     "inputs": [
-      {
-        "internalType": "address",
-        "name": "_to",
-        "type": "address"
-      },
       {
         "internalType": "uint256",
         "name": "_mintAmount",
         "type": "uint256"
       }
     ],
     "name": "mint",
     "outputs": [],
     "stateMutability": "payable",
     "type": "function"
   },

I would suggest to CLOSE this pull request.

@clipartinc clipartinc mentioned this pull request Jan 28, 2022
@sultan-710
Copy link

my man god bless you :> i just removed that part from my abi and mint function worked for me:> good job keep goin :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants