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

Sneaky Zinc Narwhal - _amountOutMin should be override #571

Open
sherlock-admin3 opened this issue Feb 17, 2025 · 0 comments
Open

Sneaky Zinc Narwhal - _amountOutMin should be override #571

sherlock-admin3 opened this issue Feb 17, 2025 · 0 comments

Comments

@sherlock-admin3
Copy link
Contributor

Sneaky Zinc Narwhal

Medium

_amountOutMin should be override

Summary

in the contract AutoCompoundingPodLp function _swapV2 if there is more than one swap the _twoHops bollean will be turned to true the problem is that _amountOutMin in line 374 shouldnt be calculated with (_amountOutMin * maxSwap[_path[0]]) / _amountIn; if there is another swa (_amountOutMin * maxSwap[_path[0]]) / _amountIn; instead should be calculated with the second maxSwap[_path[`]]

https://github.com/sherlock-audit/2025-01-peapods-finance/blob/main/contracts/contracts/AutoCompoundingPodLp.sol#L374

Root Cause

in AutoCompoundingPodLp line 274 _amountOutMin will also be calculated even if there is another trade

Internal Pre-conditions

nothing

External Pre-conditions

nothing

Attack Path

nothing

Impact

might lead to revert

PoC

No response

Mitigation

No response

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

No branches or pull requests

1 participant