Fast Khaki Raccoon
Medium
DoS of operations in AutoCompoundingPodLp
due to not considering the deposit limit
Upon operations such as depositing and withdrawing in AutoCompoundingPodLp
, we have the following code:
if (IS_PAIRED_LENDING_PAIR) {
_amountOut = _depositIntoLendingPair(_pairedLpToken, _swapOutputTkn, _amountOut);
}
Which calls this:
function _depositIntoLendingPair(address _lendingPair, address _pairAsset, uint256 _depositAmt) internal returns (uint256 _shares) {
IERC20(_pairAsset).safeIncreaseAllowance(address(_lendingPair), _depositAmt);
_shares = IFraxlendPair(_lendingPair).deposit(_depositAmt, address(this));
}
However, the code fails to consider the deposit limit in FraxlendPair
:
if (depositLimit < _totalAsset.totalAmount(address(0)) + _amount) revert ExceedsDepositLimit();
As the function is called upon all important operations, this will cause a DoS of depositing and withdrawing if the deposit limit is reached and if IS_PAIRED_LENDING_PAIR
is true.
No response
No response
- Rewards are processed for
AutoCompoundingPodLp
andIS_LENDING_PAIR
is true - Upon depositing, we revert as the deposit limit has been reached
- Users who try to withdraw will be DoSed for an indefinite amount of time
DoS of functionalities such as deposits and withdraws
No response
Check for the deposit limit and if it has been reached, do not deposit