-
Notifications
You must be signed in to change notification settings - Fork 44
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
Adding UniswapV2 properties #38
base: main
Are you sure you want to change the base?
Conversation
Hi, By the way, while working on a fuzzer comparison, I noticed that "Withdrawing liquidity always decreases LP token supply" is not always true: When the |
uint256 actualAmountIn = _between( | ||
amountIn, | ||
1, | ||
inToken.balanceOf(address(user)) | ||
); |
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 may revert with an underflow, as the high
parameter of the _between
function inToken.balanceOf(address(user))
can be 0, while low
is 1.
I believe it is necessary to add a require(inToken.balanceOf(user) >= 1);
before this
Initial draft of UniswapV2 basic properties.
Providing liquidity
Withdrawing liquidity
Swapping
Blockers: Properties fail with
ErrorUnrecognizedOpcode
crytic/echidna#984, so far haven't been able to figure out whyCons: Only tests UniswapV2 pair and router. Next step will be to generalize this so the properties can be easily used in a harness for testing UniV2-based AMMs