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

Add function to revoke permit on BPT #1009

Merged
merged 14 commits into from
Oct 4, 2024
Merged

Add function to revoke permit on BPT #1009

merged 14 commits into from
Oct 4, 2024

Conversation

EndymionJkb
Copy link
Collaborator

Description

Per ToB issue:
"The BalancerPoolToken contract implements the permit function, allowing users to sign a payload in order to allow another user or contract to spend their tokens. However, once a user signs a payload and sends it to another user, they have no way of revoking this signature. Since only one nonce is valid until it is consumed, this would prevent the original user from submitting permit signatures with a different nonce."

This adds a revokePermit function that increments the nonce.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Dependency changes
  • Code refactor / cleanup
  • Optimization: [ ] gas / [ ] bytecode
  • Documentation or wording changes
  • Other

Checklist:

  • The diff is legible and has no extraneous changes
  • Complex code has been commented, including external interfaces
  • Tests have 100% code coverage
  • The base branch is either main, or there's a description of how to merge

Issue Resolution

Resolves #1007

Copy link
Contributor

@jubeira jubeira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The fix is correct; I'd be a bit more specific with the comments, otherwise it gives the impression that it can revoke permits that were executed already which is not the case.

Thanks @EndymionJkb !

pkg/vault/contracts/BalancerPoolToken.sol Outdated Show resolved Hide resolved
pkg/vault/test/foundry/BalancerPoolTokenTest.t.sol Outdated Show resolved Hide resolved
@EndymionJkb EndymionJkb merged commit e23231b into main Oct 4, 2024
12 checks passed
@EndymionJkb EndymionJkb deleted the revoke-permit branch October 4, 2024 17:51
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.

Add ability to revoke BPT permit
2 participants