52837 sc insight gas heavy repeated binary search increases reward calculation gas costs
Description
Summary
Vulnerability Detail
while (low <= high) {
uint256 mid = low + (high - low) / 2;
if (checkpoints[mid].timestamp <= timestamp) {
ans = mid;
low = mid + 1;
} else {
if (mid == 0) break;
high = mid - 1;
}
}Impact
Recommendation
Proof of Concept
Previous52203 sc medium griefing attack on arctokenpurchase setpurchasetoken function via front runningNext51090 sc high malicious user can steal yields when arctoken distributeyieldwithlimit is used
Was this helpful?