0

I have maybe a weird question.

But let's say there is contract of T (token ERC721) and contract of M (marketplace). The marketplace has a method .buy which does a transfer of a token to the buyer, pays the seller and takes a fee.

In a made up situation my friend wants to transfer me a token, but not pay any fees. Can't he just call the contract of T.safeTransferFrom directly and not the M.buy which deducts money?

1 Answer 1

1

Not necessarily. The EIP 721 specification only defines an interface. It is up to the tokens how they implement each function.

2
  • Yes, you're right. But f.e the method safeTransferFrom is external payable, in this case if I want to allow only to do transfers for M contract, I can have a require for the msg.sender which is M.address? And nobody will be able to do these calls? May 5, 2021 at 17:54
  • 1
    @TomasEglinskas If safeTransferFrom have require(msg.sender == MarketAddress) then only MarketAddress will be able to call the transfer function. Or you can define an access list that will allowed to operate.
    – Ismael
    May 6, 2021 at 2:34

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .