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