I was trying to do a simple NFT locking mechanism when I came across this error (It transfers over the NFT from owner to a locking address): TypeError: Contract "locker" should be marked as abstract.
Here is the code.
contract locker is IERC721
{
function lockThisToken(address nftAddress, uint tokenID) public
{
IERC721(nftAddress).safeTransferFrom(msg.sender, address(this), tokenID);
}
}
What I understand is I must implement every method in the interface, this is quite fascinating - why would this be a strict rule from a program design perspective?
Also, when this user writes a similar code but for ERC20s, it does not return an error - any reasons why?