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.
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
WIP: Uniswap Module #4518
WIP: Uniswap Module #4518
Changes from all commits
b6aceac
fe60ff4
d2b7ba5
7609e05
9e56eee
43f29f0
930f5ed
c04b239
91da176
a8437b0
8796822
5e366fd
7cfb8c1
5bb4624
c7fdc1f
9e84bf8
cacbff3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 was going through 'GetInputPrice
and
GetOutputPrice` mentioned in https://github.com/runtimeverification/verified-smart-contracts/blob/uniswap/uniswap/x-y-k.pdfAfter discussing with @AdityaSripal we both feel that you swapped
lesser than
andgreater than
when it comes to buy order and sell order.For instance, for a buy order, the calculated amount should be lesser than the maximum amount the sender is willing to pay. Thus change
if msg.Input.Amount.LT(calculatedAmount)
toif calculatedAmount.LT(msg.input.Amount)
Similarly for a sell order, the calculated amount should be greater than the minimum amount the sender is willing to pay. Thus change
if msg.Output.Amount.GT(outputAmount)
toif calculatedAmount.GT(msg.Output.Amount)
. I would changeoutputAmount
tocalculatedAmount
for uniformity.A better way to write the comment would be to specify calculated amount first followed by the amount the sender is willing to pay.