summa-tx / enhanced-tokens

Advanced functionality for ERC20 tokens, as abstract inheritable contracts
Other
20 stars 2 forks source link

Add permit function (meta-transaction approve) #1

Open haydenadams opened 4 years ago

haydenadams commented 4 years ago

Two options:

1) Uniswap style (with amount) https://github.com/Uniswap/uniswap-v2-core/blob/10be569bd35c827c3935413b32a40fa5f2b0d8b7/contracts/UniswapV2ERC20.sol#L81

2) DAI style (binary on/off) https://github.com/makerdao/dss/blob/master/src/dai.sol#L118

kern commented 4 years ago

Here’s an example PR of me adding this functionality to the @ourzora ERC20 tokens: https://github.com/ourzora/zora-contracts/pull/5/files

Happy to submit a PR with this extracted + tests. Do you have a preference on the signature (uniswap vs dai)?

haydenadams commented 4 years ago

@kern I prefer the Uniswap way personally (imo worth considering changing in @ourzora)

kern commented 4 years ago

@haydenadams Noted, the uniswap approach is a superset of functionality. Will update the @ourzora implementation this weekend sometime.