-
Notifications
You must be signed in to change notification settings - Fork 187
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
Uniswap demo #179
Uniswap demo #179
Conversation
Codecov Report
@@ Coverage Diff @@
## master #179 +/- ##
==========================================
+ Coverage 77.93% 77.96% +0.03%
==========================================
Files 45 45
Lines 3300 3300
==========================================
+ Hits 2572 2573 +1
+ Misses 728 727 -1
Continue to review full report at Codecov.
|
04051cd
to
9bc1ae0
Compare
Still a few small things I want to clean up and features that need to be documented, but I thought it would be nice to get some feedback before the weekend. |
pairs: map<address, map<address, address>> | ||
|
||
# todo: discuss unbounded storage arrays | ||
all_pairs: address[0] |
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.
Good point. I've been thinking about this every now and then
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.
Nice! Looks like we aren't too far off from getting it compiled. Also 👍 on moving these things into /demo/
.
|
||
# update reserves and, on the first call per block, price accumulators | ||
def _update(balance0: u256, balance1: u256, reserve0: u112, reserve1: u112): | ||
assert balance0 <= u112(-1) and balance1 <= u112(-1), "UniswapV2: OVERFLOW" |
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 dont think we want to get max values using u112(-1)
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.
Yeah, that's a good point. It feels hacky to me that some languages even allow this. We already have a check in place that something like u8(-1)
doesn't compile (nothing of type uxxx
allows passing -1
). I think we want something like u8.max()
, u8.min()
to expose these.
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.
Yeah I like the idea of having uxxx.max()
& uxxx.min()
.
204b072
to
1d2d476
Compare
@cburgdorf , core functionality seems to work. There are a few more things that we should try to get done before April, tho. These things are documented in TODO comments that link to issues. |
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.
Really really cool! I left a few comments regarding things that I consider worth to create issues for and link to them in the example. I also think we should put the testing code into a separate file because our all-tests-in-one-file approach is starting to look unsustainable 😅
Other than that, looks amazing 👍
1d2d476
to
8882959
Compare
8882959
to
9155926
Compare
What was wrong?
We need some contracts for the Uniswap demo.
How was it fixed?
To-Do
OPTIONAL: Update Spec if applicable
Add entry to the release notes (may forgo for trivial changes)
Clean up commit history