question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Hi team,

I am redirected to the following error when trying perform the Buy step after connecting. Any thoughts to the reason? It obviously states that it is expecting 2 arguments in the mint but I didn’t change the code. Was it stored incorrectly in the repository or did the mint function change?

Thanks! Joe

× Error: Invalid number of parameters for “mint”. Got 1 expected 2! ▼ 2 stack frames were expanded. InvalidNumberOfParams node_modules/web3-core-helpers/lib/errors.js:33 _createTxObject node_modules/web3-eth-contract/lib/index.js:669 ▲ 2 stack frames were expanded. claimNFTs src/App.js:132 129 | console.log("Gas limit: ", totalGasLimit); 130 | setFeedback(Minting your ${CONFIG.NFT_NAME}...); 131 | setClaimingNft(true);

132 | blockchain.smartContract.methods | ^ 133 | .mint(mintAmount) 134 | .send({ 135 | gasLimit: String(totalGasLimit), View compiled onClick src/App.js:359 356 | disabled={claimingNft ? 1 : 0} 357 | onClick={(e) => { 358 | e.preventDefault(); 359 | claimNFTs(); | ^ 360 | getData(); 361 | }} 362 | >

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
franko-ccommented, Feb 18, 2022

Have you tried updating the ABI? I had this same issue and doing that resolved it.

You can see how Daniel does this at around 1h43m in the Ultimate Guide video.

0reactions
yograjmeenacommented, Mar 16, 2022

Screenshot (104) I am getting this error when i try to mint some nfts TypeError: blockchain.smartcontract.methods.mint is not a fuction

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Invalid number of parameters for "mint". Got 1 expected ...
The smart contract which is explained int the Hashlips video takes 2 parameters (Blockchain account and mint amount). If you have copy/paste his ......
Read more >
Invalid number of parameters for "mint". Got 1 expected 2!
I've tried _mint and mint. JS const mintResult = await learnContract.methods.mint({account: address, amount: 100}).send();. ABI { ...
Read more >
Invalid number of parameters for "undefined". Got 0 expected 1!
I'm trying to create an ERC20 token. I get this error when I try to deploy it "CorepassToken" -- Invalid number of parameters...
Read more >
ConsenSys/truffle - Gitter
Error : Invalid number of parameters for "registerAirline". Got 2 expected 4! ... registeredAirlines + 1; emit AirlineRegistered(airline); }. thojest.
Read more >
Building our ERC1155 Token Discussion
I went ahead and started over in new build using 0.8.0 compilier, ... Promise { <rejected> Error: Invalid number of parameters for "mint"....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found