Skip to content
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

Open
wants to merge 4 commits into
base: transient-approval
Choose a base branch
from

Conversation

akroeger-circle
Copy link

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:

  • The PR edits only existing draft PRs.
  • The build passes.
  • Your GitHub username or email address is listed in the 'author' header of all affected PRs, inside .
  • If matching on email address, the email address is the one publicly listed on your GitHub profile.

### 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`.
Copy link
Author

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.

ERCS/erc-7550.md Outdated Show resolved Hide resolved
ERCS/erc-7550.md Outdated Show resolved Hide resolved
ERCS/erc-7550.md Outdated Show resolved Hide resolved
ERCS/erc-7550.md Outdated Show resolved Hide resolved
ERCS/erc-7550.md Outdated Show resolved Hide resolved
ERCS/erc-7550.md Outdated Show resolved Hide resolved
ERCS/erc-7550.md Outdated Show resolved Hide resolved
ERCS/erc-7550.md Outdated Show resolved Hide resolved
ERCS/erc-7550.md Show resolved Hide resolved
ERCS/erc-7550.md Outdated Show resolved Hide resolved

### New Methods

#### transientAllowance

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.

Copy link
Author

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

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.

Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants