_beforeTokenTransfer for ERC20 transfer logic

@abcoathup Hey Andrew, as ERC20 and ERC721 are combined in a single DApp more and more. I’m wondering if _beforeTokenTransfer has an aim for ERC20 transfer logics.

1 Like

Hi @maxareo,

Can you give more detail on what you mean?

I recommend separation of concerns, so if a solution requires a fungible token and a non-fungible token then these should be separate contracts, unless you use ERC1155 multi token standard.

Projects like Enjin and the one we are working on involve using ERC20 tokens to interact with ERC721 tokens to provide more utilities, like BID/ASK mechanisms I mentioned in another post.

The hook function _beforeTokenTransfer seems to be a natural place for ERC20 token transfers before (ERC721) Token Transfer. That said, I do not have a very clear view on this.

1 Like