Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

820
Views
Interacción de interfaz con el método de contrato inteligente Error: el método no pagable no puede anular el valor

tratando de llamar a un método de menta en un contrato inteligente implementado aquí: https://rinkeby.etherscan.io/address/0x86C31eA7a0D8996db3cB9da52F3386DA6029a387#code

 function mintTo(address recipient) public payable returns (uint256) { uint256 tokenId = currentTokenId.current(); require(tokenId < TOTAL_SUPPLY, "Max supply reached"); require(!_exists(tokenId), "ERC721: token already minted"); // require(count > 0 && count <= 10, "You can mint between 1 and 10 at once"); require(msg.value == MINT_PRICE, "Transaction value did not equal the mint price"); currentTokenId.increment(); uint256 newItemId = currentTokenId.current(); _safeMint(recipient, newItemId); return newItemId; }

Código de interfaz:

 const provider = new ethers.providers.Web3Provider(ethereum) const signer = provider.getSigner() const nftContract = new ethers.Contract( nftContractAddress, NFT.abi, signer ) const options = { value: ethers.utils.parseEther("0.00420") } let nftTx = await nftContract.mintTo(currentAccount, options)

error:

 Error minting character Error: non-payable method cannot override value (operation="overrides.value", value={"type":"BigNumber","hex":"0x0eebe0b40e8000"}, code=UNSUPPORTED_OPERATION, version=contracts/5.6.2)
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

entonces... después de horas de búsqueda, me di cuenta de que estaba haciendo referencia a un contrato diferente. el código anterior funciona, era extraño que el método no fuera pagable a pesar de que la última implementación incluía un método mintTo pagable.

:|

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!