-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: fuzz testing for GQMF Polygon #158
base: main
Are you sure you want to change the base?
Conversation
…racts into 138-gqmf-gumf-improper-ratio
…bilitydao/stability-contracts into 138-gqmf-gumf-improper-ratio
function handleStableAmounts( | ||
uint[] memory amountsMax, | ||
GammaUniswapV3FarmStrategyStorage storage $, | ||
address underlying_, | ||
address[] memory _assets, | ||
uint amount1Start, | ||
uint amount1End, | ||
uint[] memory amountsConsumed | ||
) internal view { | ||
(, uint amount0End) = $.uniProxy.getDepositAmount(underlying_, _assets[1], amountsMax[1]); | ||
|
||
if (amountsMax[1] > amount1End) { | ||
amountsConsumed[1] = amount1End; | ||
amountsConsumed[0] = amountsMax[0]; | ||
} else if (amountsMax[1] <= amount1Start) { | ||
(, amountsConsumed[0]) = $.uniProxy.getDepositAmount(underlying_, _assets[1], amountsMax[1]); | ||
amountsConsumed[1] = amountsMax[1]; | ||
} | ||
|
||
if (amountsMax[0] > amount0End) { | ||
amountsConsumed[0] = amount0End; | ||
} | ||
} |
Check warning
Code scanning / Slither
Unused return Medium
function handleStableAmounts( | ||
uint[] memory amountsMax, | ||
GammaQuickSwapFarmStrategyStorage storage $, | ||
address underlying_, | ||
address[] memory _assets, | ||
uint amount1Start, | ||
uint amount1End, | ||
uint[] memory amountsConsumed | ||
) internal view { | ||
(, uint amount0End) = $.uniProxy.getDepositAmount(underlying_, _assets[1], amountsMax[1]); | ||
|
||
if (amountsMax[1] > amount1End) { | ||
amountsConsumed[1] = amount1End; | ||
amountsConsumed[0] = amountsMax[0]; | ||
} else if (amountsMax[1] <= amount1Start) { | ||
(, amountsConsumed[0]) = $.uniProxy.getDepositAmount(underlying_, _assets[1], amountsMax[1]); | ||
amountsConsumed[1] = amountsMax[1]; | ||
} | ||
|
||
if (amountsMax[0] > amount0End) { | ||
amountsConsumed[0] = amount0End; | ||
} | ||
} |
Check warning
Code scanning / Slither
Unused return Medium
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #158 +/- ##
==========================================
+ Coverage 94.76% 94.78% +0.02%
==========================================
Files 60 60
Lines 4428 4450 +22
Branches 477 478 +1
==========================================
+ Hits 4196 4218 +22
Misses 77 77
Partials 155 155 ☔ View full report in Codecov by Sentry. |
fetched the improper ratio revert using fuzz testing.