Skip to content

Commit 454f144

Browse files
Add a onlyOwner method to add a list of addresses with a custom expiracy
1 parent ca81965 commit 454f144

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

contracts/src/core/AggregationModePaymentService.sol

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,22 @@ contract AggregationModePaymentService is Initializable, OwnableUpgradeable, UUP
156156
monthlySubscriptionsAmount = 0;
157157
}
158158

159+
/**
160+
* @notice Adds an array of addresses to the payment map and emits the Payment event.
161+
* @param addressesToAdd the addresses to be subscribed
162+
* @param expiracy the expiracy date for that subscriptions
163+
*/
164+
function addArbitraryExpirationSubscriptions(address[] memory addressesToAdd, uint256 expiracy) public onlyOwner() {
165+
for (uint256 i=0; i < addressesToAdd.length; ++i) {
166+
address addressToAdd = addressesToAdd[i];
167+
168+
subscribedAddresses[addressToAdd] = expiracy;
169+
170+
// TODO: Analyze if we should emit N events or just one
171+
emit UserPayment(msg.sender, amountToPayInWei, block.timestamp, expiracy);
172+
}
173+
}
174+
159175
/**
160176
* @notice Accepts payments and validates they meet the minimum requirement.
161177
*/

0 commit comments

Comments
 (0)