_unlocked_shares
function missing safeguards against timestamp underflows.
This could lead to transaction reverts and disrupt critical protocol functions if timestamps are improperly managed.
The _unlocked_shares
function calculates unlocked shares using:
No check ensures ts
(current timestamp) ≥ last_profit_update
.
Risk Scenario:
If last_profit_update
is accidentally/maliciously set to a future timestamp (e.g., due to admin error or governance attack), ts - last_profit_update
underflows.
Vyper/Solidity reverts on underflow (due to checked arithmetic), causing transaction failures in functions relying on _unlocked_shares
.
Example:
last_profit_update =
1773217672 (future timestamp: 2026).
Current ts = 1773217672 - 100
→ subtraction underflows.
Transaction reverts, halting price updates or profit distribution.
Denial-of-Service (DoS): Core functionalities (e.g., price updates) may fail, leading to stale data.
Reputation Damage: Frequent reverts break user trust.
Manual Code Review
Implement a check at the beginning of the _unlocked_shares
function to ensure that ts
is always greater than or equal to last_profit_update
.
Add Timestamp Validation:
Include a check to ensure ts ≥ last_profit_update
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.