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

DenTonylifer - Hardcoded slippage params #332

Open
sherlock-admin4 opened this issue Oct 29, 2024 · 0 comments
Open

DenTonylifer - Hardcoded slippage params #332

sherlock-admin4 opened this issue Oct 29, 2024 · 0 comments

Comments

@sherlock-admin4
Copy link
Contributor

sherlock-admin4 commented Oct 29, 2024

DenTonylifer

Medium

Hardcoded slippage params

Summary

_unfarmBuyBurn() uses hardcoded slippage params (1) instead of user-defined, and it will lead to loss of funds for user.

Root Cause

This function defines min amounts as 1, meaning slippage protection is disabled.
https://github.com/sherlock-audit/2024-10-axion/blob/c65e662999d0c79439703fc6713814b4ad023e01/liquidity-amo/contracts/SolidlyV3AMO.sol#L328-L334

 _unfarmBuyBurn(
            liquidity,
            1, // minBoostRemove
            1, // minUsdRemove
            1, // minBoostAmountOut
            block.timestamp + 1 // deadline
        );

Then this params is passed in this functions:

ISolidlyV3Pool(pool).burnAndCollect(
                address(this),
                tickLower,
                tickUpper,
                uint128(liquidity),
                amount0Min,
                amount1Min,
                type(uint128).max,
                type(uint128).max,
                deadline
            );
(int256 amount0, int256 amount1) = ISolidlyV3Pool(pool).swap(
            address(this),
            boost > usd, 
            int256(usdRemoved),
            targetSqrtPriceX96,
            minBoostAmountOut,
            deadline
        );

Internal pre-conditions

None

External pre-conditions

None

Attack Path

None, issue may arise in natural conditions.

Impact

User will suffer loses due to disabled slippage protection.

PoC

No response

Mitigation

Allow users to define minimum amouns when they minting/burning Boost.

@sherlock-admin2 sherlock-admin2 changed the title Damaged Macaroon Finch - Hardcoded slippage params DenTonylifer - Hardcoded slippage params Oct 30, 2024
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