При вызове функции пишет: reverted with reason string 'ERC721: transfer caller is not owner nor approved'

Функция:

function f(address nftContract, uint256 itemId, uint256 price) public payable nonReentrant 
{
  uint tokenId = idToMarketItem[itemId].tokenId;
  IERC721(nftContract).approve(address(this), tokenId);
  IERC721(nftContract).transferFrom(msg.sender, address(this), tokenId);
}

У меня нет идей, что не так. Токен точно принадлежит msg.sender. После минта я выполняю setApprovalForAll(contractAddress, true);


Ответы (0 шт):