The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

`runLiquidation` will revert when holders array has large length.

Summary

runLiquidation will revert when holders array has large length.

Vulnerability Details

The root cause of the issue is located within the consolidatePendingStakes function:

function distributeAssets(ILiquidationPoolManager.Asset[] memory _assets, uint256 _collateralRate, uint256 _hundredPC) external payable {
...
for (uint256 j = 0; j < holders.length; j++) {
...
}
if (burnEuros > 0) IEUROs(EUROs).burn(address(this), burnEuros);
returnUnpurchasedNative(_assets, nativePurchased);
}```
The function iterates over the `holders` array. However, as `holders` grows, the iteration becomes increasingly gas-intensive, potentially leading to an 'out of gas' error.
Since `distributeAssets` is used in `runLiquidation`, if a revert occurs, the liquidation will not be possible.
## Impact
`runLiquidation` will revert and make bad debt.
## Tools Used
VS Code
## Recommendations
Due to the structure, it's hard to prevent the problem from happening at all.
The best solution is to limit the length of holder.
Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

pengun Submitter
over 1 year ago
hrishibhat Lead Judge
over 1 year ago
hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.