59533 sc low firelightvault sol periodattimestamp will return an incorrect period number due to flawed logic
Description
Brief/Intro
Vulnerability Details
function periodAtTimestamp(uint48 timestamp) public view returns (uint256) {
PeriodConfiguration memory periodConfiguration = periodConfigurationAtTimestamp(timestamp);
// solhint-disable-next-line max-line-length
return periodConfiguration.startingPeriod + _sinceEpoch(periodConfiguration.epoch) / periodConfiguration.duration;
}
function _sinceEpoch(uint48 epoch) private view returns (uint48) {
return Time.timestamp() - epoch;
}Impact Details
References
Proof of Concept
Proof of Concept
Previous#59559 [SC-Low] period calculation does not use provided timestamp in periodattimestampNext#59467 [SC-Low] periodattimestamp ignores input parameter
Was this helpful?