DeFiLayer 1Layer 2
14,723 OP
View results
Submission Details
Severity: medium
Invalid

Potential Division by Zero in Profit Unlocking Rate Calculation

Description:

The _obtain_price_params function has a potential division by zero vulnerability.

Root Cause:

When calculating params.profit_unlocking_rate, the function performs division by (params.full_profit_unlock_date - params.last_profit_update). If these values are equal, this would cause a division by zero:

params.profit_unlocking_rate = params.balance_of_self * MAX_BPS_EXTENDED // (
params.full_profit_unlock_date - params.last_profit_update
)

Impact:

If this condition occurs, the function would revert, preventing price updates and potentially freezing the oracle entirely, making price updates impossible.

recommendation

Add validation to ensure denominator is never zero when calculating profit unlocking rate.

Updates

Lead Judging Commences

0xnevi Lead Judge
6 months ago
0xnevi Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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