Skip to content

Commit 13fd25e

Browse files
Rename the monthly subscriptions amount to rename the monthly part
1 parent c18a988 commit 13fd25e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

contracts/src/core/AggregationModePaymentService.sol

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ contract AggregationModePaymentService is Initializable, UUPSUpgradeable, Access
2727
/// @notice The limit of subscriptions for different addresses
2828
uint256 public subscriptionLimit;
2929

30-
/// @notice Number of subscriptions in the current month
31-
uint256 public monthlySubscriptionsAmount;
30+
/// @notice Number of current subscriptions
31+
uint256 public subscriptionsAmount;
3232

3333
/// @notice Maximum amount of time (in seconds) an address can be subscribed ahead of the current block timestamp.
3434
/// Prevents stacking multiple short subscriptions and paying them over an extended period.
@@ -60,8 +60,8 @@ contract AggregationModePaymentService is Initializable, UUPSUpgradeable, Access
6060
event SubscriptionLimitUpdated(uint256 indexed newSubscriptionLimit);
6161

6262
/// @notice Event emitted when the subscription amount is updated
63-
/// @param newSubscriptionsAmount the new monthly subscription amount.
64-
event MonthlySubscriptionsAmountUpdated(uint256 indexed newSubscriptionsAmount);
63+
/// @param newSubscriptionsAmount the new subscriptions amount.
64+
event SubscriptionsAmountUpdated(uint256 indexed newSubscriptionsAmount);
6565

6666
/// @notice Event emitted when the max subscription time ahead is updated
6767
/// @param newMaxSubscriptionTimeAhead the max time allowed to subscribe ahead the current timestamp.
@@ -170,13 +170,13 @@ contract AggregationModePaymentService is Initializable, UUPSUpgradeable, Access
170170
}
171171

172172
/**
173-
* @notice Sets the monthly subscriptions counter to the value received by parameter. Only callable by the owner
174-
* @param newSubscriptionsAmount The new monthly subscription amount.
173+
* @notice Sets the subscriptions counter to the value received by parameter. Only callable by the owner
174+
* @param newSubscriptionsAmount The new subscriptions amount.
175175
*/
176-
function setMonthlySubscriptionsAmount(uint256 newSubscriptionsAmount) public onlyRole(ADMIN_ROLE) {
177-
monthlySubscriptionsAmount = newSubscriptionsAmount;
176+
function setSubscriptionsAmount(uint256 newSubscriptionsAmount) public onlyRole(ADMIN_ROLE) {
177+
subscriptionsAmount = newSubscriptionsAmount;
178178

179-
emit MonthlySubscriptionsAmountUpdated(newSubscriptionsAmount);
179+
emit SubscriptionsAmountUpdated(newSubscriptionsAmount);
180180
}
181181

182182
/**
@@ -202,7 +202,7 @@ contract AggregationModePaymentService is Initializable, UUPSUpgradeable, Access
202202

203203
subscribedAddresses[addressToAdd] = expirationTimestamp;
204204

205-
++monthlySubscriptionsAmount;
205+
++subscriptionsAmount;
206206

207207
emit UserPayment(addressToAdd, amountToPayInWei, block.timestamp, expirationTimestamp);
208208
}
@@ -218,7 +218,7 @@ contract AggregationModePaymentService is Initializable, UUPSUpgradeable, Access
218218
revert InvalidDepositAmount(amount, amountToPayInWei);
219219
}
220220

221-
if (monthlySubscriptionsAmount >= subscriptionLimit) {
221+
if (subscriptionsAmount >= subscriptionLimit) {
222222
revert SubscriptionLimitReached(subscriptionLimit);
223223
}
224224

@@ -236,7 +236,7 @@ contract AggregationModePaymentService is Initializable, UUPSUpgradeable, Access
236236
revert SubscriptionTimeExceedsLimit(newExpiration, maxSubscriptionTimeAhead);
237237
}
238238

239-
++monthlySubscriptionsAmount;
239+
++subscriptionsAmount;
240240

241241
emit UserPayment(msg.sender, amount, block.timestamp, block.timestamp + paymentExpirationTimeSeconds);
242242
}

0 commit comments

Comments
 (0)