Emerging standards and recommendations for approveAndCall, transferAndCall EIP-777 and so on

Is there already emerging standard or personal recommendations for approveAndCall so that DeFi interaction with tokens can be done with a single tx? What is Zeppelin guidance and recommendations on these?

Currently most legacy tokens need separate approve() and perform() transactions. This is a UX burden for users and great cause of confusion. I wish this could be combined to a single tx.

And then, my natural next question is that are there any well known examples of OpenZeppelin based deployments of these contracts?

Thanks and keep up the good work! :100:

1 Like

Hi @miohtama,

The user experience of two transactions is definitely problematic.
There have been discussions in the past on various developing standards for approve and call mechanisms.


I would suggest looking at the OpenZeppelin Contracts implementation of ERC777 (https://docs.openzeppelin.com/contracts/2.x/erc777).

PoolTogether uses ERC777 and you could look at the audit report and PoolTogether’s audit disclosures:


An alternate option could be looking at something like Dai’s permit function.

Hi,

I decided to go with ERC-777 after all the bad rap it received over the last weekend.

My arguments why ERC-777 and not permit() can be read here:

It is a good Twitter thread.

Of course ERC-20 is safer as it is simpler. But if we sticked with safer and simpler we would be still in Bitcoin. permit() is nice, but it is not semantically that clean and would require wallet changes.

1 Like

Hi @miohtama,

Thanks for sharing your thoughts on using ERC777. :pray:

Reentrancy is something that you need to handle:

Your token would need appropriate testing and auditing.


I think there is potential for a ERC standardized permit: