single-pool v6 final fixes#730
Open
2501babe wants to merge 2 commits into
Open
Conversation
e22f101 to
22748c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
couple cosmetic/qol things came up in the neodyme audit:
nav == 0 || supply == 0is unreachable. i left it that way for unit tests, but make this clear. also i took the opportunity to flip deposit and withdraw branches since we were taking the second branch 100% and ~100% of the time respectivelyWithdrawalTooLargeerror was unreachable because any withdrawal greater than total stake in the main account would trigger the error for violating the main account minimum delegation. this was still safe but the intent of both errors was violated. now, we only returnWithdrawalViolatesPoolRequirements.intoif "value" (lamports minus rent) in the main account is lte minimum delegation already. then we returnWithdrawalTooLargeif the withdrawal would bring the pool account below the minimum. because withdrawal amount is a function of actually existing tokens, rather than an arbitrary user input, this should only happen if too much NAV is in the onramp