Skip to content

Commit 78e0e26

Browse files
committed
fix: step not slope
1 parent b4596d7 commit 78e0e26

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/StreamWeightActor.sol

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {IsASafe} from "./lib/IsASafe.sol";
1313

1414
uint64 constant SERVICE_ID = 2;
1515

16-
int256 constant INITIAL = 5e16; // 5%
1716
int256 constant STEP = 5e16; // 5%
1817

1918
/// @notice Owner-governed actor with sudo control over every f02 stream's weight schedule
@@ -142,21 +141,21 @@ contract StreamWeightActor is UnanimousGovernance {
142141
FixedU18 fpv = SRA.aggregatedFPV(quarter);
143142

144143
if (fpv >= loaded.nextThreshold()) {
145-
int256 start = (int256(uint256(loaded.steps)) + 2) * STEP;
144+
int256 next = (int256(uint256(loaded.steps)) + 3) * STEP;
146145

147146
WeightRecordUpdate[] memory updates = new WeightRecordUpdate[](1);
148147
updates[0].id = SERVICE_ID;
149-
updates[0].record.floor = INITIAL;
148+
updates[0].record.floor = next;
150149
updates[0].record.tStart = SRA.qEnd(quarter);
151-
updates[0].record.vStart = start;
152-
updates[0].record.cap = start + STEP;
153-
updates[0].record.slope =
154-
(updates[0].record.cap - updates[0].record.vStart) / int256(uint256(Epoch.unwrap(QUARTER)));
150+
updates[0].record.vStart = next;
151+
updates[0].record.cap = next;
152+
updates[0].record.slope = 0;
153+
154+
FVMRewards.stepWeightRecords(updates);
155155

156156
loaded.steps++;
157157
loaded.lastCheckedQuarter = quarter;
158158
gateParamsInfo.params = loaded;
159-
FVMRewards.stepWeightRecords(updates);
160159
} else {
161160
gateParamsInfo.params.lastCheckedQuarter = quarter;
162161
}

0 commit comments

Comments
 (0)