Skip to content
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

Extend coverage on uniswapPair mint() #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

guille-block
Copy link

I just finished part 3 of the echidna streaming series and I noticed that coverage didnt marked * on liquidity mint after the intial scenario were totalSupply was cero. I modified our invariant test to extend this and have full coverage on UniswapPair mint() function.

image

I moved the initial preconditions and action to a public function: mintLiquidty() that can be called previous to our target test testProvideLiquidity(). Additionaly, I modified the amount bounding to only account for the initial liquidity minting which is the only moment where we need to provide at least 1000 tokens.

image

Looking forward to get some feedback and keep learning from the streaming series!

@CLAassistant
Copy link

CLAassistant commented Jan 27, 2023

CLA assistant check
All committers have signed the CLA.

@technovision99
Copy link
Contributor

Hmm, that's a bit odd. The fuzzer should be able to get that line just by calling testProvideLiquidity multiple times. In fact I tested this with testLimit: 20000 and it could hit that line.

@guille-block
Copy link
Author

I see, It makes sense if it calls testProvideLiquidity multiple times. I will try running the fuzzer with testLimit: 20000 looking for this then.
Just a thought, after the first call to testProvideLiquidity there is no need to bound the amount between 1000 and uint(-1), correct?
Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants