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

272
Vistas
How can we convert an Ethereum address (string) to Solidity's address type in Javascript in order to pass it to a contract function as an argument?

I have a function in a Solidity smart contract like this:

function mint (address _recipient, string _name) public onlyOwner {

 uint256 newItemId = _tokenIds.current();
_safemint(_recipient, newItemId);

// etc

}

I try to pass from the front-end

 import { ethers } from "ethers";
  let tmpdata = ethers.utils.getAddress("0x6f...etc"); //
    
    let nftTxn = await connectedContract.mintNFT(tmpdata, "some string");
    await nftTxn.wait();

I copy paste the addresses to make sure they are correct, but this throws an error everytime. And I think it doesn't work because we'd need an address type as first argument right? I can't find out how to achieve that, anyone can help and point me in the right direction here?

console gives me

data: "0x08c379a00000000000000......etc" message: "execution reverted: ERC721: mint to to zero address

about 4 years ago · Juan Pablo Isaza
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