forked from storyprotocol/protocol-periphery
-
Notifications
You must be signed in to change notification settings - Fork 25
/
ILicenseAttachmentWorkflows.sol
121 lines (110 loc) · 6.58 KB
/
ILicenseAttachmentWorkflows.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
import { PILTerms } from "@storyprotocol/core/interfaces/modules/licensing/IPILicenseTemplate.sol";
import { WorkflowStructs } from "../../lib/WorkflowStructs.sol";
/// @title License Attachment Workflows Interface
/// @notice Interface for IP license attachment workflows.
interface ILicenseAttachmentWorkflows {
/// @notice Register Programmable IP License Terms (if unregistered) and attach it to IP.
/// @param ipId The ID of the IP.
/// @param licenseTermsData The PIL terms and licensing configuration data to be attached to the IP.
/// @param sigAttachAndConfig Signature data for attachLicenseTerms and setLicensingConfig to the IP via the Licensing Module.
/// @return licenseTermsIds The IDs of the newly registered PIL terms.
function registerPILTermsAndAttach(
address ipId,
WorkflowStructs.LicenseTermsData[] calldata licenseTermsData,
WorkflowStructs.SignatureData calldata sigAttachAndConfig
) external returns (uint256[] memory licenseTermsIds);
/// @notice Mint an NFT from a SPGNFT collection, register it with metadata as an IP,
/// register Programmable IPLicense
/// Terms (if unregistered), and attach it to the registered IP.
/// @dev Requires caller to have the minter role or the SPG NFT to allow public minting.
/// @param spgNftContract The address of the SPGNFT collection.
/// @param recipient The address of the recipient of the minted NFT.
/// @param ipMetadata OPTIONAL. The desired metadata for the newly minted NFT and registered IP.
/// @param licenseTermsData The PIL terms and licensing configuration data to be attached to the IP.
/// @param allowDuplicates Set to true to allow minting an NFT with a duplicate metadata hash.
/// @return ipId The ID of the newly registered IP.
/// @return tokenId The ID of the newly minted NFT.
/// @return licenseTermsIds The IDs of the newly registered PIL terms.
function mintAndRegisterIpAndAttachPILTerms(
address spgNftContract,
address recipient,
WorkflowStructs.IPMetadata calldata ipMetadata,
WorkflowStructs.LicenseTermsData[] calldata licenseTermsData,
bool allowDuplicates
) external returns (address ipId, uint256 tokenId, uint256[] memory licenseTermsIds);
/// @notice Register a given NFT as an IP and attach Programmable IP License Terms.
/// @dev Because IP Account is created in this function, we need to set the permission via signature to allow this
/// contract to attach PIL Terms to the newly created IP Account in the same function.
/// @param nftContract The address of the NFT collection.
/// @param tokenId The ID of the NFT.
/// @param ipMetadata OPTIONAL. The desired metadata for the newly registered IP.
/// @param licenseTermsData The PIL terms and licensing configuration data to be attached to the IP.
/// @param sigMetadataAndAttachAndConfig Signature data for setAll (metadata), attachLicenseTerms, and
/// setLicensingConfig to the IP via the Core Metadata Module and Licensing Module.
/// @return ipId The ID of the newly registered IP.
/// @return licenseTermsIds The IDs of the newly registered PIL terms.
function registerIpAndAttachPILTerms(
address nftContract,
uint256 tokenId,
WorkflowStructs.IPMetadata calldata ipMetadata,
WorkflowStructs.LicenseTermsData[] calldata licenseTermsData,
WorkflowStructs.SignatureData calldata sigMetadataAndAttachAndConfig
) external returns (address ipId, uint256[] memory licenseTermsIds);
////////////////////////////////////////////////////////////////////////////
// DEPRECATED //
////////////////////////////////////////////////////////////////////////////
/// @notice Register Programmable IP License Terms (if unregistered) and attach it to IP.
/// @notice THIS VERSION OF THE FUNCTION IS DEPRECATED, WILL BE REMOVED IN V1.4
function registerPILTermsAndAttach(
address ipId,
PILTerms[] calldata terms,
WorkflowStructs.SignatureData calldata sigAttach
) external returns (uint256[] memory licenseTermsIds);
/// @notice Mint an NFT from a SPGNFT collection, register it with metadata as an IP,
/// register Programmable IPLicense
/// @notice THIS VERSION OF THE FUNCTION IS DEPRECATED, WILL BE REMOVED IN V1.4
function mintAndRegisterIpAndAttachPILTerms(
address spgNftContract,
address recipient,
WorkflowStructs.IPMetadata calldata ipMetadata,
PILTerms[] calldata terms
) external returns (address ipId, uint256 tokenId, uint256[] memory licenseTermsIds);
/// @notice Register a given NFT as an IP and attach Programmable IP License Terms.
/// @notice THIS VERSION OF THE FUNCTION IS DEPRECATED, WILL BE REMOVED IN V1.4
function registerIpAndAttachPILTerms(
address nftContract,
uint256 tokenId,
WorkflowStructs.IPMetadata calldata ipMetadata,
PILTerms[] calldata terms,
WorkflowStructs.SignatureData calldata sigMetadata,
WorkflowStructs.SignatureData calldata sigAttach
) external returns (address ipId, uint256[] memory licenseTermsIds);
/// @notice Register Programmable IP License Terms (if unregistered) and attach it to IP.
/// @notice THIS VERSION OF THE FUNCTION IS DEPRECATED, WILL BE REMOVED IN V1.4
function registerPILTermsAndAttach(
address ipId,
PILTerms calldata terms,
WorkflowStructs.SignatureData calldata sigAttach
) external returns (uint256 licenseTermsId);
/// Mint an NFT from a SPGNFT collection, register it with metadata as an IP,
/// register Programmable IPLicense
/// @notice THIS VERSION OF THE FUNCTION IS DEPRECATED, WILL BE REMOVED IN V1.4
function mintAndRegisterIpAndAttachPILTerms(
address spgNftContract,
address recipient,
WorkflowStructs.IPMetadata calldata ipMetadata,
PILTerms calldata terms
) external returns (address ipId, uint256 tokenId, uint256 licenseTermsId);
/// @notice Register a given NFT as an IP and attach Programmable IP License Terms.
/// @notice THIS VERSION OF THE FUNCTION IS DEPRECATED, WILL BE REMOVED IN V1.4
function registerIpAndAttachPILTerms(
address nftContract,
uint256 tokenId,
WorkflowStructs.IPMetadata calldata ipMetadata,
PILTerms calldata terms,
WorkflowStructs.SignatureData calldata sigMetadata,
WorkflowStructs.SignatureData calldata sigAttach
) external returns (address ipId, uint256 licenseTermsId);
}