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

Restrict addLiquidityToBuffer to proportional #982

Merged
merged 15 commits into from
Sep 18, 2024

Conversation

joaobrunoah
Copy link
Contributor

Description

Per issue #977, the current implementation of addLiquidityToBuffer does not implement the buffer minimum check. This check is not necessary if we only support proportional add liquidity.

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

Closes #977

@joaobrunoah joaobrunoah self-assigned this Sep 17, 2024
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.

First pass looks good, with a few minor suggestions. Haven't gone through the tests in detail yet

pkg/vault/contracts/Router.sol Outdated Show resolved Hide resolved
pkg/interfaces/contracts/vault/IRouter.sol Show resolved Hide resolved
pkg/interfaces/contracts/vault/IVaultAdmin.sol Outdated Show resolved Hide resolved
pkg/vault/contracts/Router.sol Show resolved Hide resolved
pkg/vault/contracts/Router.sol Outdated 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.

LGTM! Thanks for pushing this @joaobrunoah.

I do have one relatively important comment regarding the math. I'll do one final pass once that's addressed :)

pkg/vault/contracts/VaultAdmin.sol Outdated Show resolved Hide resolved
pkg/vault/contracts/test/VaultAdminMock.sol Outdated 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.

LGTM! Great job.

pkg/interfaces/contracts/vault/IRouter.sol Outdated Show resolved Hide resolved
pkg/vault/contracts/test/VaultAdminMock.sol Show resolved Hide resolved
@joaobrunoah joaobrunoah merged commit a78d872 into main Sep 18, 2024
12 checks passed
@joaobrunoah joaobrunoah deleted the add-liquidity-to-buffer-proportional branch September 18, 2024 22: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.

Consider restricting buffer addLiquidity to proportional
3 participants