-
Notifications
You must be signed in to change notification settings - Fork 25
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 LBPool #1001
base: main
Are you sure you want to change the base?
Add LBPool #1001
Conversation
…ptimize weight validation for 2 weights
…x time to avoid time overflow attack; add misc events and errors; change paused vars to be swapEnabled; add setters and getters for swap enabled/swap fee/gradual update params; add 3 hooks for dynamic swap fee percentage, paused blocking swaps, and only owner can join; build out GradualValueChange library
…henever it's developed
…BP's add liquidity hook; change terminology back to what it originally was in the interface
…outer provider exists
…enable swap fee changes by the assigned admin rather than assuming that power has been delegated to governance
…R rather than the placeholder trusted router provider; leave references in comments for future addition
@EndymionJkb I'm not sure if this is a bug in For Other than that, I think I'm at 100% coverage now -- just a bit puzzled by that result |
We're aware of issues with coverage. It behaves differently / has holes on both hardhat and forge. Modifiers aren't handled very well, for instance (though that's not what's going on here), which is why they can be run either independently or merged. It's good to run coverage to make sure you aren't missing anything, but some anomalies are expected, so don't worry about it if it flags something you know actually does run. |
# Conflicts: # pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - ERC4626 - BatchRouter] swapExactIn - with buffer liquidity - warm slots # pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - ERC4626 - BatchRouter] swapExactOut - no buffer liquidity - warm slots
# Conflicts: # pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] swap single token exact in with fees - cold slots # pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] swap single token exact in with fees - warm slots
# Conflicts: # pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - ERC4626 - BatchRouter] swapExactIn - with buffer liquidity - warm slots
# Conflicts: # pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - WithNestedPool - BatchRouter] swap exact in - tokenA-tokenD
# Conflicts: # pkg/vault/test/foundry/utils/BasePoolTest.sol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I have a couple of minor comments
LiquidityManagement calldata | ||
) public view override onlyVault returns (bool) { | ||
// Since in this case the pool is the hook, we don't need to check anything else. | ||
// We *could* check that it's two tokens, but better to let that be caught later, as it will fail with a more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the code does not have this check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What specifically are you asking for here? The check here verifies that this contract is both the pool and the hook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean checking that the pool contains only 2 tokens
Description
tl;dr: Create a weight shifting LBPool for V3.
Note
This PR replaces and obsoletes #971 by turning it into a PR from the add-lbpool branch from w/in this repo rather than my fork.
What
Create a WeightValidation library for improved portability (could use this in standard WP if desired)FP.ONE
BasePoolTest.sol
) to be more generalizable/override-ableWhy
Modernize a highly popular feature from v2
Type of change
Checklist:
main
, or there's a description of how to mergeIssue Resolution
n/a