0

Let's suppose there is a contract address A of an erc721 token B. If I want to monitor all of its transfers from A to another address say C then should I only filter the Transfer function or should I also monitor safeTransferFrom and transferFrom here. If yes then is there any other event apart from these three that I should be monitoring? And if no then why?

If the same scenario is considered for an erc20 contract then which functions should be monitored just Transfer or transferFrom as well?

1 Answer 1

0

On ERC20, all these functions emit the exact same event:

event Transfer(address indexed _from, address indexed _to, uint256 _value);

On ERC721, all these functions emit the exact same event:

event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
4
  • So you mean just monitoring the transfer event is enough?
    – mzaidi
    Commented Jul 8, 2020 at 12:18
  • @mahamzaidi: Yes. You wrote things like "which events should be monitored just Transfer or transferFrom as well?", while there is no such event transferFrom. It's a function. Commented Jul 8, 2020 at 12:19
  • Sorry, I just edited the description.
    – mzaidi
    Commented Jul 8, 2020 at 12:24
  • @mahamzaidi: There is no function Transfer. There is function transfer and event Transfer. And in either case, you don't "monitor functions", you monitor events. Commented Jul 8, 2020 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.