-
Notifications
You must be signed in to change notification settings - Fork 551
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
AMM: Swap and add liquidity scripts #312
Conversation
@Braqzen you can take a look at the test-utils :) |
Any extra thoughts here @Braqzen or can we click the big green button? |
Sorry, I was planning on reviewing this tomorrow. Will get around to this soon |
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 have not carefully reviewed the tests to see if the logic covers all cases or if they make sense - via this review.
@@ -54,22 +49,18 @@ pub fn minimum_output_given_exact_input( | |||
result_wrapped.unwrap() | |||
} | |||
|
|||
pub fn multiply_div(a: u64, b: u64, c: u64) -> u64 { | |||
pub fn multiply_divide(a: u64, b: u64, c: u64) -> u64 { |
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.
The name of this function doesn't really convey much as to what it is trying to accomplish. I would rename and potentially add some documentation to outline what is the multiplication and division achieving.
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.
Cannot come up with a better name now, will rename by the time this is merged to master.
Type of change
Changes
Notes
Before merging to master:
#[should_panic(expected = "Revert(18446744073709486080)")]
once feat: support logs from external contracts is mergedfuels
dependencies should be changed to version instead of master branch once new version is outexchange-contract/utils/multiply_divide
function should be renamed to something along the lines of "proportions"Related Issues
Closes #229
Closes #287