-
Notifications
You must be signed in to change notification settings - Fork 2
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
performed modifications after adding sqrt computation #26
Conversation
- construction of Router and Pair contracts are done outside `UniswapV2Swap` for testing purposes - interfaces for `UniswapV2Router02` and `UniswapV2Pair` are added - construction of pairs are moved from the UniswapV2Swap's constructor to the test setup - `UniswapV2Router02.addLiquidity()` and `UniswapV2Pair.mint()` functions are added (together with functions they use such as `math_sqrt()`) - `testRouterAddLiquidity()` test added that checks for newly added functionality - some additional formatting changes (done by forge formatter)
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 believe that this is failing due to compound assignment no longer being supported.
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.
Please also make sure you are applying the same modifications to the version of the contract in test/regression/swaps.sol
. The two files differ slightly, but we want to keep them enough in sync that they are running the same computations. Also, that version is the only version that is currently being regression tested.
I will happily investigate the failures in the semantics if there are any, but now that we have a working version of the semantics on one version of the contract, changes to the contract need to only go through if they don't break the semantics. |
Also, just fyi, auto formatting a file in the same PR that you make other modifications to that file is a bad idea; it makes it vastly more difficult to review the code. |
I tried this version of Uniswap locally, and it does not run. It fails in
UniswapV2Swap using two different constructors.
and
Only the one with 3 parameters exists though. |
@mariaKt I have addressed the issue below; Uniswap is compiling now.
|
@dwightguth last commit performs this synchronization.
|
@dwightguth @mariaKt as far as I can see current state of semantics don't work well with the |
Can you show me what the change to the contract and the resulting stuck configuration were? |
@dwightguth if you meant me: I made no changes to the contract, and simply added the transaction
after the others (so it is similar to the UniswapTest.txn file in this PR). Here is the stuck configuration. |
@dwightguth @mariaKt I went over the error and performed necessary modifications. krun progressed when I replaced integer literals in the I have also updated the reference output accordingly, I wasn't able to see any problems with the output reference please check if you can see anything odd. |
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'm approving so as to make you not stuck, but please address my comment prior to merging.
test/regression/swaps.txn
Outdated
@@ -1,2 +1,3 @@ | |||
create(1, 0, 1724300000, UniswapV2SwapTest, ), | |||
txn(1, 2, 0, 1724300000, testSwapLoop, ) | |||
txn(1, 2, 0, 1724300000, testSwapLoop, ), | |||
txn(1, 2, 0, 1724300000, testRouterAddLiquidity, ) |
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 should not be here. This program tests just the swap function.
Changes include:
UniswapV2Router02.addLiquidity()
andUniswapV2Pair.mint()
functions are added (together with functions they use such asmath_sqrt()
)testRouterAddLiquidity()
test added that checks for newly added functionality