The Standard

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

Absence of a 'require' keyword

Summary

Missing a 'require' keyword in the function

Vulnerability Details

It would be a better solution if a 'require' keyword is added just before the 'for' loop in the 'holderPendingStakes' function. Otherwise, it could lead to entering an infinite loop and could be an attack vulnerability.

Tools Used

Manual review

Recommendations

Delete the 'if (_pendingStake.holder == _holder)' statement inside the 'for' loop and replace it just before the loop with 'require(_pendingStake.holder == _holder, "err-invalid-holder");'
The new function should look like this:

function holderPendingStakes(address _holder) private view returns (uint256 _pendingTST, uint256 _pendingEUROs) {
require(_pendingStake.holder == _holder, "err-invalid-holder");
for (uint256 i = 0; i < pendingStakes.length; i++) {
PendingStake memory _pendingStake = pendingStakes[i];
_pendingTST += _pendingStake.TST;
_pendingEUROs += _pendingStake.EUROs;
}
}
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.