Skip to content

Commit

Permalink
Don't pay a validator for current month
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaStebaev committed Dec 11, 2023
1 parent dd35ab7 commit dbda93d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/Paymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,19 @@ contract Paymaster is AccessManagedUpgradeable, IPaymaster {

function _claimFor(ValidatorId validatorId, address to) private {
Validator storage validator = _getValidator(validatorId);
Timestamp currentTime = _getTimestamp();
_totalRewards.process(currentTime);
Timestamp claimUntil = DateTimeUtils.firstDayOfMonth(_getTimestamp());
_totalRewards.process(claimUntil);

SKL rewards = _calculateRewards(
validator,
Payment({
from: validator.claimedUntil,
to: currentTime,
to: claimUntil,
amount: SKL.wrap(0) // ignored by _loadFromTimeline
}),
_loadFromTimeline
);
validator.claimedUntil = currentTime;
validator.claimedUntil = claimUntil;

DebtId end = debtsEnd;
for (DebtId debtId = validator.firstUnpaidDebt; _before(debtId, end); debtId = _next(debtId)) {
Expand Down

0 comments on commit dbda93d

Please sign in to comment.