-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove permit functionality and general clean up #33
base: transient-approval
Are you sure you want to change the base?
remove permit functionality and general clean up #33
Conversation
### Modified Methods | ||
|
||
#### transferFrom | ||
The implementation of `transferFrom` MUST recognize allowances set via `transientApprove`. `transferFrom` SHOULD exclusively exhaust the allowance set by `transientApprove` prior to checking or using the allowance set by `approve`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered specifying the behavior here in greater detail, but decided against it. The behavior is quite vague in ERC20, so I left intentionally open. The only thing that's really required here is for transient approvals to be recognized.
|
||
### New Methods | ||
|
||
#### transientAllowance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given that transient approval is treated effectively fungibly with normal approvals, I suggest modifying the existing allowance() method behavior to return the sum "transient + normal" because many DeFi protocols also use the allowance function to determine if approval is required before transfer.
This also removes the transientAllowance method reducing code size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an interesting idea--how would we treat situations where the sum of the approvals overflows MAX_UINT? You could have MAX_UINT both for transient and normal approvals.
We could just return MAX_UINT in that case I suppose, but feels a bit dicey.
|
||
### New Events | ||
|
||
#### TransientApproval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo transient approval event is not super useful because there is no cumulative indexing taking place, as the state is wiped after each block. If people want to see when transient approvals happened they could look at calls to this method or infer it based on the difference between normal approval state and transferFrom amount.
We intentionally did not include in the first draft for this reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The event is in the draft that I modified 😛
I'm somewhat indifferent, thinking about it a bit more. I agree that it's less important since the state does not persist, but events are also useful for analytics.
When opening a pull request to submit a new EIP, please use the suggested template: https://github.com/ethereum/EIPs/blob/master/eip-template.md
We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met: