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

Record swap fee amount in Recovery Mode #1096

Merged
merged 8 commits into from
Nov 13, 2024
Merged

Record swap fee amount in Recovery Mode #1096

merged 8 commits into from
Nov 13, 2024

Conversation

EndymionJkb
Copy link
Collaborator

@EndymionJkb EndymionJkb commented Nov 6, 2024

Description

The raw swap fee amount should be emitted in the Swap event, even in Recovery Mode. This is a true edge case, since normally pools in Recovery Mode would also be paused, but in case Recovery Mode was enabled separately - and swaps still worked - the Swap event will now report it. (Even though protocol and pool creator fees aren't charged in recovery mode, swap fees still apply.)

Credits to @dmitriia for the finding.

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 #1092

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.

Great job, LGTM!

Thanks again @dmitriia! 🙌

pkg/vault/contracts/Vault.sol Show resolved Hide resolved
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.

One more late comment.

pkg/vault/test/foundry/VaultSwap.t.sol Show resolved Hide resolved
Copy link
Contributor

@elshan-eth elshan-eth left a comment

Choose a reason for hiding this comment

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

Cool! LGTM!

Copy link
Contributor

@joaobrunoah joaobrunoah left a comment

Choose a reason for hiding this comment

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

LGTM!

@EndymionJkb EndymionJkb merged commit b572e15 into main Nov 13, 2024
13 checks passed
@EndymionJkb EndymionJkb deleted the swap-fee-event branch November 13, 2024 05:30
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.

Review total swap fees when in recovery mode
4 participants