-
Notifications
You must be signed in to change notification settings - Fork 9
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
Exit Pool #93
Exit Pool #93
Conversation
return { | ||
minAmountsOut: Array(tokens.length).fill(0n), | ||
tokenOutIndex: tokens.findIndex( | ||
(t) => t.address === input.tokenOut.toLowerCase(), |
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.
Would try to move sanitizing of input outside of the individual implementations. This isn't something we want to remember to do at this level, imo.
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.
Thanks for the pointer, added isSameAddress
to Token implementation.
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.
This is fine, but it'd be nicer if sanitize happened before it ever got to weightedExit
, so we don't even need to worry about this.
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.
Overall looks really good. Clean and easy to read.
Did a small refactor to show how we can create an intermediate layer to move some of the duplicate logic that will be in all exit types to a higher level. #96 |
No description provided.