Skip to content

Commit 17c66a5

Browse files
Convert the resetSubscriptions method in a setter for monthlySubscriptionsAmount
1 parent 3ac2414 commit 17c66a5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

contracts/src/core/AggregationModePaymentService.sol

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ contract AggregationModePaymentService is Initializable, OwnableUpgradeable, UUP
5151
/// @param newSubscriptionLimit the new monthly subscription limit.
5252
event SubscriptionLimitUpdated(uint256 indexed newSubscriptionLimit);
5353

54+
/// @notice Event emitted when the subscription amount is updated
55+
/// @param newSubscriptionsAmount the new monthly subscription amount.
56+
event MonthlySubscriptionsAmountUpdated(uint256 indexed newSubscriptionsAmount);
57+
5458
/// @notice Event emitted when the funds recipient is updated
5559
/// @param newFundsRecipient the new address for receiving the funds on withdrawal.
5660
event FundsRecipientUpdated(address indexed newFundsRecipient);
@@ -150,10 +154,13 @@ contract AggregationModePaymentService is Initializable, OwnableUpgradeable, UUP
150154
}
151155

152156
/**
153-
* @notice Resets the monthly subscriptions mapping counter to zero.
157+
* @notice Sets the monthly subscriptions counter to the value received by parameter. Only callable by the owner
158+
* @param newSubscriptionsAmount The new monthly subscription amount.
154159
*/
155-
function resetSubscriptions() public onlyOwner() {
156-
monthlySubscriptionsAmount = 0;
160+
function setMonthlySubscriptionsAmount(uint256 newSubscriptionsAmount) public onlyOwner() {
161+
monthlySubscriptionsAmount = newSubscriptionsAmount;
162+
163+
emit MonthlySubscriptionsAmountUpdated(newSubscriptionsAmount);
157164
}
158165

159166
/**

0 commit comments

Comments
 (0)