-
Notifications
You must be signed in to change notification settings - Fork 15
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
…ap function (onSwap) to reduce multiple balance reads from storage
Copying over summary comment from old PRI've now incorporated all the changes that @EndymionJkb made in #974 and included them in this PR. I believe we can now close that one; I'll summarize the notes/comments from that review here for convenience to note anything known outstanding. TODOs from PR #974
Other TODOs
Misc comments/down-the-line TODOs
|
|
…paused on start test
…eight) and LBPoolFactory test for getPoolVersion
@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. |
if (!_getPoolSwapEnabled()) { | ||
revert SwapsDisabled(); | ||
} |
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.
Why not just pause the pool instead?
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.
Pausing would also prevent the owner from adding liquidity. Often these are deployed with swaps disabled, funded at a later point (to set initial prices), the update is scheduled, and then swaps are enabled to start the sale
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