@@ -118,9 +118,7 @@ contract GroupingWorkflows is
118
118
/// @param spgNftContract The address of the SPGNFT collection.
119
119
/// @param groupId The ID of the group IP to add the newly registered IP.
120
120
/// @param recipient The address of the recipient of the minted NFT.
121
- /// @param licenseTemplates The addresses of the license templates to be attached to the new IP.
122
- /// @param licenseTermsIds The IDs of the registered license terms that will be attached to the new IP.
123
- /// The i th license terms ID must be a valid license terms that was registered in the i th license template.
121
+ /// @param licenseTermsInfo The information of the license terms that will be attached to the new IP.
124
122
/// @param ipMetadata OPTIONAL. The desired metadata for the newly minted NFT and registered IP.
125
123
/// @param sigAddToGroup Signature data for addIp to the group IP via the Grouping Module.
126
124
/// @param allowDuplicates Set to true to allow minting an NFT with a duplicate metadata hash.
@@ -130,8 +128,7 @@ contract GroupingWorkflows is
130
128
address spgNftContract ,
131
129
address groupId ,
132
130
address recipient ,
133
- address [] calldata licenseTemplates ,
134
- uint256 [] calldata licenseTermsIds ,
131
+ WorkflowStructs.LicenseTermsInfo[] calldata licenseTermsInfo ,
135
132
WorkflowStructs.IPMetadata calldata ipMetadata ,
136
133
WorkflowStructs.SignatureData calldata sigAddToGroup ,
137
134
bool allowDuplicates
@@ -148,12 +145,12 @@ contract GroupingWorkflows is
148
145
MetadataHelper.setMetadata (ipId, address (CORE_METADATA_MODULE), ipMetadata);
149
146
150
147
// attach license terms to the IP, do nothing if already attached
151
- for (uint256 i = 0 ; i < licenseTermsIds .length ; i++ ) {
148
+ for (uint256 i = 0 ; i < licenseTermsInfo .length ; i++ ) {
152
149
LicensingHelper.attachLicenseTerms (
153
150
ipId,
154
151
address (LICENSING_MODULE),
155
- licenseTemplates [i],
156
- licenseTermsIds [i]
152
+ licenseTermsInfo [i].licenseTemplate ,
153
+ licenseTermsInfo [i].licenseTermsId
157
154
);
158
155
}
159
156
@@ -189,9 +186,7 @@ contract GroupingWorkflows is
189
186
/// @param nftContract The address of the NFT collection.
190
187
/// @param tokenId The ID of the NFT.
191
188
/// @param groupId The ID of the group IP to add the newly registered IP.
192
- /// @param licenseTemplates The addresses of the license templates to be attached to the new IP.
193
- /// @param licenseTermsIds The IDs of the registered license terms that will be attached to the new IP.
194
- /// The i th license terms ID must be a valid license terms that was registered in the i th license template.
189
+ /// @param licenseTermsInfo The information of the license terms that will be attached to the new IP.
195
190
/// @param ipMetadata OPTIONAL. The desired metadata for the newly registered IP.
196
191
/// @param sigMetadata OPTIONAL. Signature data for setAll (metadata) for the IP via the Core Metadata Module.
197
192
/// @param sigsAttach Signature data for attachLicenseTerms to the IP via the Licensing Module.
@@ -203,31 +198,22 @@ contract GroupingWorkflows is
203
198
address nftContract ,
204
199
uint256 tokenId ,
205
200
address groupId ,
206
- address [] calldata licenseTemplates ,
207
- uint256 [] calldata licenseTermsIds ,
201
+ WorkflowStructs.LicenseTermsInfo[] calldata licenseTermsInfo ,
208
202
WorkflowStructs.IPMetadata calldata ipMetadata ,
209
203
WorkflowStructs.SignatureData calldata sigMetadata ,
210
204
WorkflowStructs.SignatureData[] calldata sigsAttach ,
211
205
WorkflowStructs.SignatureData calldata sigAddToGroup
212
206
) external returns (address ipId ) {
213
207
ipId = IP_ASSET_REGISTRY.register (block .chainid , nftContract, tokenId);
214
-
215
- address [] memory modules = new address [](2 );
216
- bytes4 [] memory selectors = new bytes4 [](2 );
217
- modules[0 ] = address (CORE_METADATA_MODULE);
218
- modules[1 ] = address (LICENSING_MODULE);
219
- selectors[0 ] = ICoreMetadataModule.setAll.selector ;
220
- selectors[1 ] = ILicensingModule.attachLicenseTerms.selector ;
221
-
222
208
MetadataHelper.setMetadataWithSig (ipId, address (CORE_METADATA_MODULE), ipMetadata, sigMetadata);
223
209
224
210
// attach license terms to the IP, do nothing if already attached
225
- for (uint256 i = 0 ; i < licenseTermsIds .length ; i++ ) {
211
+ for (uint256 i = 0 ; i < licenseTermsInfo .length ; i++ ) {
226
212
LicensingHelper.attachLicenseTermsWithSig (
227
213
ipId,
228
214
address (LICENSING_MODULE),
229
- licenseTemplates [i],
230
- licenseTermsIds [i],
215
+ licenseTermsInfo [i].licenseTemplate ,
216
+ licenseTermsInfo [i].licenseTermsId ,
231
217
sigsAttach[i]
232
218
);
233
219
}
@@ -249,18 +235,21 @@ contract GroupingWorkflows is
249
235
250
236
/// @notice Register a group IP with a group reward pool and attach license terms to the group IP
251
237
/// @param groupPool The address of the group reward pool.
252
- /// @param licenseTemplate The address of the license template to be attached to the new group IP.
253
- /// @param licenseTermsId The ID of the registered license terms that will be attached to the new group IP.
238
+ /// @param licenseTermsInfo The information of the license terms that will be attached to the new group IP.
254
239
/// @return groupId The ID of the newly registered group IP.
255
240
function registerGroupAndAttachLicense (
256
241
address groupPool ,
257
- address licenseTemplate ,
258
- uint256 licenseTermsId
242
+ WorkflowStructs.LicenseTermsInfo calldata licenseTermsInfo
259
243
) external returns (address groupId ) {
260
244
groupId = GROUPING_MODULE.registerGroup (groupPool);
261
245
262
246
// attach license terms to the group IP, do nothing if already attached
263
- LicensingHelper.attachLicenseTerms (groupId, address (LICENSING_MODULE), licenseTemplate, licenseTermsId);
247
+ LicensingHelper.attachLicenseTerms (
248
+ groupId,
249
+ address (LICENSING_MODULE),
250
+ licenseTermsInfo.licenseTemplate,
251
+ licenseTermsInfo.licenseTermsId
252
+ );
264
253
265
254
GROUP_NFT.safeTransferFrom (address (this ), msg .sender , GROUP_NFT.totalSupply () - 1 );
266
255
}
@@ -270,19 +259,22 @@ contract GroupingWorkflows is
270
259
/// @dev ipIds must have the same PIL terms as the group IP.
271
260
/// @param groupPool The address of the group reward pool.
272
261
/// @param ipIds The IDs of the IPs to add to the newly registered group IP.
273
- /// @param licenseTemplate The address of the license template to be attached to the new group IP.
274
- /// @param licenseTermsId The ID of the registered license terms that will be attached to the new group IP.
262
+ /// @param licenseTermsInfo The information of the license terms that will be attached to the new group IP.
275
263
/// @return groupId The ID of the newly registered group IP.
276
264
function registerGroupAndAttachLicenseAndAddIps (
277
265
address groupPool ,
278
266
address [] calldata ipIds ,
279
- address licenseTemplate ,
280
- uint256 licenseTermsId
267
+ WorkflowStructs.LicenseTermsInfo calldata licenseTermsInfo
281
268
) external returns (address groupId ) {
282
269
groupId = GROUPING_MODULE.registerGroup (groupPool);
283
270
284
271
// attach license terms to the group IP, do nothing if already attached
285
- LicensingHelper.attachLicenseTerms (groupId, address (LICENSING_MODULE), licenseTemplate, licenseTermsId);
272
+ LicensingHelper.attachLicenseTerms (
273
+ groupId,
274
+ address (LICENSING_MODULE),
275
+ licenseTermsInfo.licenseTemplate,
276
+ licenseTermsInfo.licenseTermsId
277
+ );
286
278
287
279
GROUPING_MODULE.addIp (groupId, ipIds);
288
280
0 commit comments