Skip to content

Latest commit

 

History

History
48 lines (31 loc) · 1.9 KB

073.md

File metadata and controls

48 lines (31 loc) · 1.9 KB

Thankful Plum Pheasant

Medium

Previous liquidity cannot be used in _unfarmBuyBurn after we update tick bounds

Summary

When we update tick bounds in SolidlyV3AMO, we don't adjust the previous position's liquidity to the new position. This will cause the previous liquidity cannot be used in _unfarmBuyBurn.

Root Cause

In SolidlyV3AMO.sol::86, the SETTER ROLE can update tick bounds to one new position according to current condition. The problem is that we don't adjust the previous liquidity from the previous position to the new position when the SETTER role update the tick bounds. This will cause that the new position holds zero liquidity after we update tick bounds. If the amo bot wants to adjust the BOOST price via unfarmBuyBurn, the operation will be reverted because there is no any liquidity in the new position.

    function setTickBounds(int24 tickLower_, int24 tickUpper_) public override onlyRole(SETTER_ROLE) {
        tickLower = tickLower_;
        tickUpper = tickUpper_;
        emit TickBoundsSet(tickLower, tickUpper);
    }

Internal pre-conditions

  • SolidlyV3AMO runs for a while and we have some liquidity in the previous position.
  • The Setter role updates the tick bounds to one new position.

External pre-conditions

N/A

Attack Path

  • SolidlyV3AMO runs for a while and we have some liquidity in AMO contract.
  • Setter role updates the tick bound to one new position.
  • Boost token becomes below-pegged.
  • AMO bot wants to trigger unfarmBuyBurn to adjust BOOST price, this will be reverted because the existing liquidity cannot be burned.

Impact

The existing liquidity cannot be burned to adjust BOOST price.

PoC

N/A

Mitigation

When we update tick bound, remove liquidity from the previous position and add liquidity to the new position.