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

275
Views
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
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!