Hi,
I have a couple of questions, to understand better this issue.
I found a smart contract in which I saw the following line of code:
IERC721(nftContract).transferFrom(msg.sender, address(this), tokenId);
- IERC721 is an interface, and all the functions are not implemented...
- The contract inheritance is ReentrancyGuard.sol, which is an abstract contract and do not inherit either ERC721 or IERC721.
Could some one explain how this works?
Thanks,
M
Code to reproduce
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/utils/Counters.sol';
import 'hardhat/console.sol';
contract MyMkt is ReentrancyGuard {
[...]
function mktPlace (address nftContract, uint256 tokenId) public payable nonReentrant{
[...]
IERC721(nftContract).transferFrom(msg.sender, address(this), tokenId);
{
}