The Standard

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

LiquidationPool::consolidatePending() should include transactions upto the deadline

Summary

The consolidatePending is including pending positions before the deadline only. It should consider until the deadline, meaning inclusive of the deadline.

Vulnerability Details

Some pending positions will have to wait for another cycle due to this logic.

Impact

Will impact the rewards for the users as they are accounted based on positions.

Tools Used

Manual Review

Recommendations

Revise the logic as below.

function consolidatePendingStakes() private {
uint256 deadline = block.timestamp - 1 days;
for (int256 i = 0; uint256(i) < pendingStakes.length; i++) {
PendingStake memory _stake = pendingStakes[uint256(i)];
==> @audit revised the condition as below
if (_stake.createdAt <= deadline) {
positions[_stake.holder].holder = _stake.holder;
positions[_stake.holder].TST += _stake.TST;
positions[_stake.holder].EUROs += _stake.EUROs;
deletePendingStake(uint256(i));
// pause iterating on loop because there has been a deletion. "next" item has same index
i--;
}
}
}
Updates

Lead Judging Commences

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.