@@ -17,6 +17,7 @@ import { Errors } from "./lib/Errors.sol";
17
17
import { BaseWorkflow } from "./BaseWorkflow.sol " ;
18
18
import { ISPGNFT } from "./interfaces/ISPGNFT.sol " ;
19
19
import { MetadataHelper } from "./lib/MetadataHelper.sol " ;
20
+ import { LicensingHelper } from "./lib/LicensingHelper.sol " ;
20
21
import { PermissionHelper } from "./lib/PermissionHelper.sol " ;
21
22
import { IGroupingWorkflows } from "./interfaces/IGroupingWorkflows.sol " ;
22
23
import { IStoryProtocolGateway as ISPG } from "./interfaces/IStoryProtocolGateway.sol " ;
@@ -132,7 +133,14 @@ contract GroupingWorkflows is
132
133
ipId = IP_ASSET_REGISTRY.register (block .chainid , spgNftContract, tokenId);
133
134
MetadataHelper.setMetadata (ipId, address (CORE_METADATA_MODULE), ipMetadata);
134
135
135
- LICENSING_MODULE.attachLicenseTerms (ipId, licenseTemplate, licenseTermsId);
136
+ // attach license terms to the IP, do nothing if already attached
137
+ LicensingHelper.attachLicenseTerms (
138
+ ipId,
139
+ address (LICENSING_MODULE),
140
+ address (LICENSE_REGISTRY),
141
+ licenseTemplate,
142
+ licenseTermsId
143
+ );
136
144
137
145
PermissionHelper.setPermissionForModule (
138
146
groupId,
@@ -190,7 +198,14 @@ contract GroupingWorkflows is
190
198
191
199
MetadataHelper.setMetadata (ipId, address (CORE_METADATA_MODULE), ipMetadata);
192
200
193
- LICENSING_MODULE.attachLicenseTerms (ipId, licenseTemplate, licenseTermsId);
201
+ // attach license terms to the IP, do nothing if already attached
202
+ LicensingHelper.attachLicenseTerms (
203
+ ipId,
204
+ address (LICENSING_MODULE),
205
+ address (LICENSE_REGISTRY),
206
+ licenseTemplate,
207
+ licenseTermsId
208
+ );
194
209
195
210
PermissionHelper.setPermissionForModule (
196
211
groupId,
@@ -221,7 +236,14 @@ contract GroupingWorkflows is
221
236
) external returns (address groupId ) {
222
237
groupId = GROUPING_MODULE.registerGroup (groupPool);
223
238
224
- LICENSING_MODULE.attachLicenseTerms (groupId, licenseTemplate, licenseTermsId);
239
+ // attach license terms to the group IP, do nothing if already attached
240
+ LicensingHelper.attachLicenseTerms (
241
+ groupId,
242
+ address (LICENSING_MODULE),
243
+ address (LICENSE_REGISTRY),
244
+ licenseTemplate,
245
+ licenseTermsId
246
+ );
225
247
226
248
GROUPING_MODULE.addIp (groupId, ipIds);
227
249
0 commit comments