Skip to content

Commit

Permalink
[OZ][L-01] Fix inaccurate uptime calculation due to remainder (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-CZ authored Jan 31, 2025
1 parent 05eba01 commit e9dc8d2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions contracts/sfc/SFC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,7 @@ contract SFC is OwnableUpgradeable, UUPSUpgradeable, Version {

if (cur.averageUptime > Decimal.unit()) {
cur.averageUptime = uint64(Decimal.unit());
cur.remainder = 0; // reset the remainder when capping the averageUptime
}
if (prev.epochs < c.averageUptimeEpochWindow()) {
cur.epochs = prev.epochs + 1;
Expand Down

0 comments on commit e9dc8d2

Please sign in to comment.