The Calculation For nextEraTime Drifts, Causing Eras To Occur Further And Further Into The Future.
In Vader.sol, eras are intended to occur every 24 hours.
This means that a correct implementation would add 24 hours to the end-time of the previous era to find the end-time of the next era.
However, the current method for calculating the next era's end-time uses block.timestamp, rather than the previous era's end-time.
Proof of Concept
This line of code will cause a perpetual drift of era times, causing each era to actually be 24 hours plus the time between when the last era ended and when Vader._transfer() is next called.
Handle
jvaqa
Vulnerability details
Impact
The Calculation For nextEraTime Drifts, Causing Eras To Occur Further And Further Into The Future.
In Vader.sol, eras are intended to occur every 24 hours. This means that a correct implementation would add 24 hours to the end-time of the previous era to find the end-time of the next era. However, the current method for calculating the next era's end-time uses block.timestamp, rather than the previous era's end-time.
Proof of Concept
This line of code will cause a perpetual drift of era times, causing each era to actually be 24 hours plus the time between when the last era ended and when Vader._transfer() is next called.
Recommended Mitigation Steps
In Vader.sol, change this:
nextEraTime = block.timestamp + secondsPerEra;
to this:
nextEraTime = nextEraTime + secondsPerEra;