Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

821
Vistas
Frontend interaction with smart contract method Error: non-payable method cannot override value

trying to call a mint method in a smart contract deployed here: 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;
  }

Frontend code:

    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 Respuestas
Responde la pregunta

0

so ... after hours of searching, I realised that I was referencing a different contract. the above code works, it was just weird that the method was non-payable even though the last deploy included a payable mintTo method.

:|

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda