@@ -36,11 +36,6 @@ abstract contract BaseSubscriptionManager is
3636 EnumerableSet.AddressSet subscriptionCreators;
3737 }
3838
39- error SubscriptionCreatorAlreadyAdded (address subscriptionCreator );
40-
41- event SubscriptionCreatorAdded (address indexed subscriptionCreator );
42- event SubscriptionCreatorRemoved (address indexed subscriptionCreator );
43-
4439 modifier onlySubscriptionCreator () {
4540 _onlySubscriptionCreator (msg .sender );
4641 _;
@@ -76,14 +71,21 @@ abstract contract BaseSubscriptionManager is
7671 __SignatureSubscriptionModule_init (sigSubscriptionInitData_);
7772 }
7873
74+ /// @inheritdoc ISubscriptionManager
7975 function pause () public virtual onlyOwner {
8076 _pause ();
8177 }
8278
79+ /// @inheritdoc ISubscriptionManager
8380 function unpause () public virtual onlyOwner {
8481 _unpause ();
8582 }
8683
84+ /**
85+ * @notice A function to update payment token configurations.
86+ * @param paymentTokenEntries_ An array of payment token configurations
87+ containing token addresses and their base costs.
88+ */
8789 function updatePaymentTokens (
8890 PaymentTokenUpdateEntry[] calldata paymentTokenEntries_
8991 ) public virtual onlyOwner {
@@ -95,16 +97,31 @@ abstract contract BaseSubscriptionManager is
9597 }
9698 }
9799
100+ /**
101+ * @notice A function to remove supported payment tokens.
102+ * @param tokensToRemove_ An array of token addresses to remove.
103+ */
98104 function removePaymentTokens (address [] calldata tokensToRemove_ ) public virtual onlyOwner {
99105 for (uint256 i = 0 ; i < tokensToRemove_.length ; ++ i) {
100106 _removePaymentToken (tokensToRemove_[i]);
101107 }
102108 }
103109
110+ /**
111+ * @notice A function to update the duration-based factor for adjusting subscription costs.
112+ * @param duration_ Subscription duration to update the factor for.
113+ * @param factor_ Updated multiplicative factor applied to the base cost.
114+ */
104115 function updateDurationFactor (uint64 duration_ , uint256 factor_ ) public virtual onlyOwner {
105116 _updateDurationFactor (duration_, factor_);
106117 }
107118
119+ /**
120+ * @notice A function to withdraw tokens from the subscription manager.
121+ * @param tokenAddr_ Payment token address to withdraw.
122+ * @param to_ Withdrawal recipient address.
123+ * @param amount_ Amount of tokens to withdraw.
124+ */
108125 function withdrawTokens (
109126 address tokenAddr_ ,
110127 address to_ ,
@@ -113,26 +130,41 @@ abstract contract BaseSubscriptionManager is
113130 _withdrawTokens (tokenAddr_, to_, amount_);
114131 }
115132
133+ /**
134+ * @notice A function to update supported SBTs used for subscription purchases.
135+ * @param sbtEntries_ An array of SBT configurations containing
136+ token addresses and their subscription durations.
137+ */
116138 function updateSBTs (SBTUpdateEntry[] calldata sbtEntries_ ) public virtual onlyOwner {
117139 for (uint256 i = 0 ; i < sbtEntries_.length ; ++ i) {
118140 _updateSBT (sbtEntries_[i].sbt, sbtEntries_[i].subscriptionDurationPerToken);
119141 }
120142 }
121143
144+ /**
145+ * @notice A function to remove supported SBTs.
146+ * @param sbtsToRemove_ An array of SBT addresses to remove.
147+ */
122148 function removeSBTs (address [] calldata sbtsToRemove_ ) public virtual onlyOwner {
123149 for (uint256 i = 0 ; i < sbtsToRemove_.length ; ++ i) {
124150 _removeSBT (sbtsToRemove_[i]);
125151 }
126152 }
127153
154+ /**
155+ * @notice A function to set a new subscription signer used for signature-based subscriptions.
156+ * @param newSigner_ Address of the new subscription signer.
157+ */
128158 function setSubscriptionSigner (address newSigner_ ) public virtual onlyOwner {
129159 _setSubscriptionSigner (newSigner_);
130160 }
131161
162+ /// @inheritdoc ISubscriptionManager
132163 function createSubscription (address account_ ) public virtual onlySubscriptionCreator {
133164 _createSubscription (account_);
134165 }
135166
167+ /// @inheritdoc ITokensPaymentModule
136168 function buySubscription (
137169 address account_ ,
138170 address token_ ,
@@ -148,6 +180,7 @@ abstract contract BaseSubscriptionManager is
148180 super .buySubscription (account_, token_, duration_);
149181 }
150182
183+ /// @inheritdoc ISBTPaymentModule
151184 function buySubscriptionWithSBT (
152185 address vault_ ,
153186 address sbt_ ,
@@ -156,6 +189,7 @@ abstract contract BaseSubscriptionManager is
156189 super .buySubscriptionWithSBT (vault_, sbt_, tokenId_);
157190 }
158191
192+ /// @inheritdoc ISignatureSubscriptionModule
159193 function buySubscriptionWithSignature (
160194 address vault_ ,
161195 uint64 duration_ ,
@@ -170,14 +204,17 @@ abstract contract BaseSubscriptionManager is
170204 super .buySubscriptionWithSignature (vault_, duration_, signature_);
171205 }
172206
207+ /// @inheritdoc ISubscriptionManager
173208 function implementation () external view returns (address ) {
174209 return ERC1967Utils .getImplementation ();
175210 }
176211
212+ /// @inheritdoc ISubscriptionManager
177213 function getSubscriptionCreators () public view virtual returns (address [] memory ) {
178214 return _getBaseSubscriptionManagerStorage ().subscriptionCreators.values ();
179215 }
180216
217+ /// @inheritdoc ISubscriptionManager
181218 function isSubscriptionCreator (address account_ ) public view virtual returns (bool ) {
182219 return _getBaseSubscriptionManagerStorage ().subscriptionCreators.contains (account_);
183220 }
0 commit comments