function approveBurn(address nft_cont_address,uint256 _tokenId) public {
ERC721 tokenContract = ERC721(nft_cont_address);
// approve the contract to burn the token
tokenContract.approve(address(this), _tokenId);
}
Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Returned error: {"jsonrpc":"2.0","error":"execution reverted: ERC721: approve caller is not token owner or approved for all","id":8066513221942198}
Why am I getting this error and how to solve this?