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

Account Abstraction - Spending Limits #277

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

julio4
Copy link
Contributor

@julio4 julio4 commented Dec 12, 2024

Issue(s): Close #230

Description

Account Contract with Spending Limits for any ERC20 token.

@julio4
Copy link
Contributor Author

julio4 commented Dec 17, 2024

We need to figure out the best way to correctly track allowance and spending:

When counting spending against a limit, there are two operations to track:

  • approve: Allows another address to spend tokens
  • transfer/transferFrom: Actually moves the tokens

Issues:

  • An approval might never be spent (user approves 100 tokens but spender never uses them), but because of transferFrom we want to count it towards the spending limit (as we have no way to add our custom blocking logic when another contract call transferFrom with allowance).
  • The same tokens should not be counted twice (user approves 100 then transfers 100 - shouldn't count as 200 towards the limit)

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

Successfully merging this pull request may close these issues.

2 participants