I am doing transfers from a dApp built with hardhat, ethers and React. it works perfectly using:
async function transfer() {
const [accountUser] = await window.ethereum.request({ method: 'eth_requestAccounts' });
const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();
const contract = new ethers.Contract(nftContract, NFT.abi, signer);
let transaction;
try {
transaction = await contract.transferFrom(accountUser, newOwner, idNFT);
...
But if I use the function safeTransferFrom I get the error ``` safeTransferFrom is not a function``.
Why is that? Evidently the contract has in its ABI this standard function.
async function transfer() {
const [accountUser] = await window.ethereum.request({ method: 'eth_requestAccounts' });
const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();
const contract = new ethers.Contract(nftContract, NFT.abi, signer);
let transaction;
try {
transaction = await contract.safeTransferFrom(accountUser, newOwner, idNFT);