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

ProtocolFeeSweeper: use fee recipient as admin #1315

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

Conversation

jubeira
Copy link
Contributor

@jubeira jubeira commented Feb 21, 2025

Description

This PR:

  • allows fee recipient to call permissioned functions on fee sweeper (not exclusive, everything can still be called via governance)
  • refactors auth contracts that depend on the vault (from solidity utils to vault package)
  • adds tests for everything, including expected behavior for the common auth layer

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

N/A

Juan Ignacio Ubeira added 2 commits February 21, 2025 10:32
- Add tests
- Refactor common auth to vault
@jubeira jubeira requested review from EndymionJkb, elshan-eth and joaobrunoah and removed request for EndymionJkb February 21, 2025 13:35
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.

Tests failed (lint) but LGTM

Copy link
Collaborator

@EndymionJkb EndymionJkb left a comment

Choose a reason for hiding this comment

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

Ideally would have separated into authentication infra vs. fee-sweeper PRs, but looks good (have some mostly rename-related comments).

@@ -114,4 +107,28 @@ contract PoolMock is IBasePool, IPoolLiquidity, BalancerPoolToken, BasePoolAuthe
function getRate() public view override returns (uint256) {
return _mockRate == 0 ? super.getRate() : _mockRate;
}

function getTokenInfo()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not keep the PoolInfo base contract, which already defines getTokenInfo and getAggregateFeePercentages the same way?

Not sure why it had BasePoolAuthentication; seems fine to remove that, as there are no permissioned functions at this level.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because it makes the vault package implicitly depend on pool-utils, whereas actually it's the other way around.
It didn't cause issues here, but BasePoolAuthentication was throwing a very confusing one; this should prevent that from happening.

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!

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.

4 participants