@lukso/lsp-smart-contracts 0.11.0-rc.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/artifacts/LSP0ERC725Account.json +7 -2
- package/artifacts/LSP0ERC725AccountInit.json +7 -2
- package/artifacts/LSP11BasicSocialRecovery.json +2 -2
- package/artifacts/LSP11BasicSocialRecoveryInit.json +2 -2
- package/artifacts/LSP1UniversalReceiverDelegateUP.json +3 -79
- package/artifacts/LSP1UniversalReceiverDelegateVault.json +3 -41
- package/artifacts/LSP23LinkedContractsFactory.json +544 -0
- package/artifacts/LSP6KeyManager.json +24 -19
- package/artifacts/LSP6KeyManagerInit.json +24 -19
- package/artifacts/LSP7CappedSupply.json +88 -0
- package/artifacts/LSP7CappedSupplyInitAbstract.json +88 -0
- package/artifacts/LSP7CompatibleERC20.json +88 -0
- package/artifacts/LSP7CompatibleERC20InitAbstract.json +88 -0
- package/artifacts/LSP7CompatibleERC20Mintable.json +90 -2
- package/artifacts/LSP7CompatibleERC20MintableInit.json +90 -2
- package/artifacts/LSP7DigitalAsset.json +88 -0
- package/artifacts/LSP7DigitalAssetInitAbstract.json +88 -0
- package/artifacts/LSP7Mintable.json +90 -2
- package/artifacts/LSP7MintableInit.json +90 -2
- package/artifacts/LSP8CappedSupply.json +59 -0
- package/artifacts/LSP8CappedSupplyInitAbstract.json +59 -0
- package/artifacts/LSP8CompatibleERC721.json +60 -1
- package/artifacts/LSP8CompatibleERC721InitAbstract.json +60 -1
- package/artifacts/LSP8CompatibleERC721Mintable.json +62 -3
- package/artifacts/LSP8CompatibleERC721MintableInit.json +62 -3
- package/artifacts/LSP8IdentifiableDigitalAsset.json +59 -0
- package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +59 -0
- package/artifacts/LSP8Mintable.json +61 -2
- package/artifacts/LSP8MintableInit.json +61 -2
- package/artifacts/LSP9Vault.json +7 -2
- package/artifacts/LSP9VaultInit.json +7 -2
- package/artifacts/UniversalProfile.json +7 -2
- package/artifacts/UniversalProfileInit.json +7 -2
- package/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +8 -36
- package/contracts/LSP0ERC725Account/LSP0Constants.sol +1 -1
- package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +15 -30
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +122 -206
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +18 -36
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +8 -34
- package/contracts/LSP10ReceivedVaults/LSP10Utils.sol +148 -177
- package/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +21 -20
- package/contracts/LSP14Ownable2Step/LSP14Errors.sol +13 -2
- package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +50 -20
- package/contracts/LSP17ContractExtension/LSP17Errors.sol +10 -0
- package/contracts/LSP17ContractExtension/LSP17Extendable.sol +16 -34
- package/contracts/LSP17ContractExtension/LSP17Utils.sol +1 -1
- package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +16 -11
- package/contracts/LSP1UniversalReceiver/LSP1Errors.sol +5 -10
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +192 -177
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +150 -88
- package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +66 -48
- package/contracts/LSP20CallVerification/LSP20CallVerification.sol +1 -1
- package/contracts/LSP23LinkedContractsDeployment/ILSP23LinkedContractsFactory.sol +192 -0
- package/contracts/LSP23LinkedContractsDeployment/IPostDeploymentModule.sol +18 -0
- package/contracts/LSP23LinkedContractsDeployment/LSP23Errors.sol +24 -0
- package/contracts/LSP23LinkedContractsDeployment/LSP23LinkedContractsFactory.sol +392 -0
- package/contracts/{LSP23MultiChainDeployment → LSP23LinkedContractsDeployment}/modules/UniversalProfileInitPostDeploymentModule.sol +5 -1
- package/contracts/LSP23LinkedContractsDeployment/modules/UniversalProfilePostDeploymentModule.sol +61 -0
- package/contracts/LSP25ExecuteRelayCall/ILSP25ExecuteRelayCall.sol +68 -0
- package/contracts/LSP25ExecuteRelayCall/LSP25Constants.sol +8 -0
- package/contracts/LSP25ExecuteRelayCall/LSP25Errors.sol +17 -0
- package/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol +143 -0
- package/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +256 -61
- package/contracts/{LSP3UniversalProfile → LSP3ProfileMetadata}/LSP3Constants.sol +3 -3
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +9 -8
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +13 -6
- package/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +4 -4
- package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +148 -189
- package/contracts/LSP6KeyManager/ILSP6KeyManager.sol +26 -54
- package/contracts/LSP6KeyManager/LSP6Constants.sol +1 -3
- package/contracts/LSP6KeyManager/LSP6Errors.sol +142 -63
- package/contracts/LSP6KeyManager/LSP6KeyManager.sol +7 -4
- package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +125 -80
- package/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +8 -4
- package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +1 -1
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +52 -84
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +59 -10
- package/contracts/LSP6KeyManager/LSP6Utils.sol +67 -46
- package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +116 -78
- package/contracts/LSP7DigitalAsset/LSP7Constants.sol +4 -1
- package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +128 -6
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +212 -80
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +126 -3
- package/contracts/LSP7DigitalAsset/LSP7Errors.sol +7 -5
- package/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +27 -14
- package/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +2 -4
- package/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +2 -4
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +29 -11
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +30 -9
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +46 -14
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +43 -12
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +14 -0
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +9 -4
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +7 -1
- package/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +8 -8
- package/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +7 -6
- package/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +10 -2
- package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +120 -92
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +4 -1
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +135 -6
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +128 -38
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +134 -5
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +83 -41
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +13 -5
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8BurnableInitAbstract.sol +24 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +30 -12
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +31 -10
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +96 -31
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +98 -23
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +21 -4
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +12 -2
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +21 -0
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +9 -4
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +13 -0
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +15 -6
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +7 -5
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +17 -2
- package/contracts/LSP9Vault/ILSP9Vault.sol +10 -5
- package/contracts/LSP9Vault/LSP9Errors.sol +3 -2
- package/contracts/LSP9Vault/LSP9Vault.sol +12 -4
- package/contracts/LSP9Vault/LSP9VaultCore.sol +245 -182
- package/contracts/LSP9Vault/LSP9VaultInit.sol +10 -3
- package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +11 -6
- package/contracts/UniversalProfile.sol +8 -6
- package/contracts/UniversalProfileInit.sol +6 -6
- package/contracts/UniversalProfileInitAbstract.sol +10 -3
- package/devdocs/LSP0ERC725Account.json +54 -37
- package/devdocs/LSP0ERC725AccountInit.json +56 -38
- package/devdocs/LSP1UniversalReceiverDelegateUP.json +14 -55
- package/devdocs/LSP1UniversalReceiverDelegateVault.json +9 -33
- package/devdocs/LSP23LinkedContractsFactory.json +81 -0
- package/devdocs/LSP4DigitalAssetMetadata.json +5 -5
- package/devdocs/LSP4DigitalAssetMetadataInitAbstract.json +4 -4
- package/devdocs/LSP6KeyManager.json +109 -70
- package/devdocs/LSP6KeyManagerInit.json +109 -70
- package/devdocs/LSP7CappedSupply.json +90 -42
- package/devdocs/LSP7CappedSupplyInitAbstract.json +86 -40
- package/devdocs/LSP7CompatibleERC20.json +79 -43
- package/devdocs/LSP7CompatibleERC20InitAbstract.json +75 -39
- package/devdocs/LSP7CompatibleERC20Mintable.json +87 -40
- package/devdocs/LSP7CompatibleERC20MintableInit.json +82 -42
- package/devdocs/LSP7DigitalAsset.json +76 -40
- package/devdocs/LSP7DigitalAssetInitAbstract.json +73 -37
- package/devdocs/LSP7Mintable.json +79 -51
- package/devdocs/LSP7MintableInit.json +78 -49
- package/devdocs/LSP8CappedSupply.json +72 -43
- package/devdocs/LSP8CappedSupplyInitAbstract.json +68 -41
- package/devdocs/LSP8CompatibleERC721.json +85 -64
- package/devdocs/LSP8CompatibleERC721InitAbstract.json +81 -60
- package/devdocs/LSP8CompatibleERC721Mintable.json +98 -60
- package/devdocs/LSP8CompatibleERC721MintableInit.json +93 -62
- package/devdocs/LSP8IdentifiableDigitalAsset.json +58 -41
- package/devdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +57 -40
- package/devdocs/LSP8Mintable.json +65 -48
- package/devdocs/LSP8MintableInit.json +64 -47
- package/devdocs/LSP9Vault.json +61 -18
- package/devdocs/LSP9VaultInit.json +59 -17
- package/devdocs/UniversalProfile.json +53 -35
- package/devdocs/UniversalProfileInit.json +53 -35
- package/dist/constants.cjs.js +6236 -2587
- package/dist/constants.d.ts +3851 -1129
- package/dist/constants.es.js +6236 -2587
- package/package.json +6 -4
- package/userdocs/LSP0ERC725Account.json +40 -8
- package/userdocs/LSP0ERC725AccountInit.json +40 -8
- package/userdocs/LSP1UniversalReceiverDelegateUP.json +18 -2
- package/userdocs/LSP1UniversalReceiverDelegateVault.json +18 -2
- package/userdocs/LSP23LinkedContractsFactory.json +29 -0
- package/userdocs/LSP4DigitalAssetMetadata.json +1 -1
- package/userdocs/LSP6KeyManager.json +144 -6
- package/userdocs/LSP6KeyManagerInit.json +147 -6
- package/userdocs/LSP7CappedSupply.json +18 -3
- package/userdocs/LSP7CappedSupplyInitAbstract.json +17 -2
- package/userdocs/LSP7CompatibleERC20.json +3 -9
- package/userdocs/LSP7CompatibleERC20InitAbstract.json +2 -8
- package/userdocs/LSP7CompatibleERC20Mintable.json +5 -8
- package/userdocs/LSP7CompatibleERC20MintableInit.json +3 -9
- package/userdocs/LSP7DigitalAsset.json +2 -2
- package/userdocs/LSP7DigitalAssetInitAbstract.json +2 -2
- package/userdocs/LSP7Mintable.json +3 -3
- package/userdocs/LSP7MintableInit.json +3 -3
- package/userdocs/LSP8CappedSupply.json +16 -1
- package/userdocs/LSP8CappedSupplyInitAbstract.json +15 -0
- package/userdocs/LSP8CompatibleERC721.json +24 -3
- package/userdocs/LSP8CompatibleERC721InitAbstract.json +23 -2
- package/userdocs/LSP8CompatibleERC721Mintable.json +29 -2
- package/userdocs/LSP8CompatibleERC721MintableInit.json +27 -3
- package/userdocs/LSP8Mintable.json +4 -1
- package/userdocs/LSP8MintableInit.json +4 -1
- package/userdocs/LSP9Vault.json +50 -4
- package/userdocs/LSP9VaultInit.json +50 -4
- package/userdocs/UniversalProfile.json +40 -8
- package/userdocs/UniversalProfileInit.json +40 -8
- package/contracts/LSP0ERC725Account/LSP0Utils.sol +0 -47
- package/contracts/LSP23MultiChainDeployment/IOwnerControlledContractDeployer.sol +0 -174
- package/contracts/LSP23MultiChainDeployment/IPostDeploymentModule.sol +0 -10
- package/contracts/LSP23MultiChainDeployment/LSP23Errors.sol +0 -24
- package/contracts/LSP23MultiChainDeployment/OwnerControlledContractDeployer.sol +0 -388
|
@@ -15,11 +15,14 @@ bytes4 constant _INTERFACEID_ERC721METADATA = 0x5b5e139f;
|
|
|
15
15
|
*/
|
|
16
16
|
interface ILSP8CompatibleERC721 is ILSP8IdentifiableDigitalAsset {
|
|
17
17
|
/**
|
|
18
|
-
* @notice
|
|
19
|
-
*
|
|
20
|
-
* @
|
|
21
|
-
*
|
|
22
|
-
*
|
|
18
|
+
* @notice ERC721 `Transfer` compatible event emitted. Successfully transferred tokenId `tokenId` from `from` to `to`.
|
|
19
|
+
*
|
|
20
|
+
* @dev ERC721 `Transfer` event emitted when `tokenId` token is transferred from `from` to `to`.
|
|
21
|
+
* To provide compatibility with indexing ERC721 events.
|
|
22
|
+
*
|
|
23
|
+
* @param from The sending address.
|
|
24
|
+
* @param to The receiving address.
|
|
25
|
+
* @param tokenId The tokenId to transfer.
|
|
23
26
|
*/
|
|
24
27
|
event Transfer(
|
|
25
28
|
address indexed from,
|
|
@@ -28,21 +31,30 @@ interface ILSP8CompatibleERC721 is ILSP8IdentifiableDigitalAsset {
|
|
|
28
31
|
);
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
|
-
* @notice
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
34
|
-
*
|
|
35
|
-
*
|
|
34
|
+
* @notice ERC721 `Approval` compatible event emitted. Successfully approved operator `operator` to operate on tokenId `tokenId` on behalf of token owner `owner`.
|
|
35
|
+
*
|
|
36
|
+
* @dev ERC721 `Approval` event emitted when `owner` enables `operator` for `tokenId`.
|
|
37
|
+
* To provide compatibility with indexing ERC721 events.
|
|
38
|
+
*
|
|
39
|
+
* @param owner The address of the owner of the `tokenId`.
|
|
40
|
+
* @param operator The address set as operator.
|
|
41
|
+
* @param tokenId The approved tokenId.
|
|
36
42
|
*/
|
|
37
43
|
event Approval(
|
|
38
44
|
address indexed owner,
|
|
39
|
-
address indexed
|
|
45
|
+
address indexed operator,
|
|
40
46
|
uint256 indexed tokenId
|
|
41
47
|
);
|
|
42
48
|
|
|
43
49
|
/**
|
|
44
|
-
* @
|
|
45
|
-
*
|
|
50
|
+
* @notice ERC721 `ApprovalForAll` compatible event emitted. Successfully set "approved for all" status to `approved` for operator `operator` for token owner `owner`.
|
|
51
|
+
*
|
|
52
|
+
* @dev ERC721 `ApprovalForAll` event emitted when an `operator` is enabled or disabled for an owner
|
|
53
|
+
* to transfer any of its tokenIds. The operator can manage all NFTs of the owner.
|
|
54
|
+
*
|
|
55
|
+
* @param owner The address of the owner of tokenIds.
|
|
56
|
+
* @param operator The address set as operator.
|
|
57
|
+
* @param approved If `operator` is approved for all NFTs or not.
|
|
46
58
|
*/
|
|
47
59
|
event ApprovalForAll(
|
|
48
60
|
address indexed owner,
|
|
@@ -51,18 +63,24 @@ interface ILSP8CompatibleERC721 is ILSP8IdentifiableDigitalAsset {
|
|
|
51
63
|
);
|
|
52
64
|
|
|
53
65
|
/**
|
|
54
|
-
* @
|
|
55
|
-
*
|
|
56
|
-
* @
|
|
57
|
-
*
|
|
66
|
+
* @notice Calling `transferFrom` function on `ILSP8CompatibleERC721` contract. Transferring tokenId `tokenId` from address `from` to address `to`.
|
|
67
|
+
*
|
|
68
|
+
* @dev Transfer functions from the ERC721 standard interface.
|
|
69
|
+
*
|
|
70
|
+
* @param from The sending address.
|
|
71
|
+
* @param to The receiving address.
|
|
72
|
+
* @param tokenId The tokenId to transfer.
|
|
58
73
|
*/
|
|
59
74
|
function transferFrom(address from, address to, uint256 tokenId) external;
|
|
60
75
|
|
|
61
76
|
/**
|
|
62
|
-
* @
|
|
63
|
-
*
|
|
64
|
-
* @
|
|
65
|
-
*
|
|
77
|
+
* @notice Calling `safeTransferFrom` function on `ILSP8CompatibleERC721` contract. Transferring tokenId `tokenId` from address `from` to address `to`.
|
|
78
|
+
*
|
|
79
|
+
* @dev Safe Transfer function without optional data from the ERC721 standard interface.
|
|
80
|
+
*
|
|
81
|
+
* @param from The sending address.
|
|
82
|
+
* @param to The receiving address.
|
|
83
|
+
* @param tokenId The tokenId to transfer.
|
|
66
84
|
*/
|
|
67
85
|
function safeTransferFrom(
|
|
68
86
|
address from,
|
|
@@ -71,11 +89,14 @@ interface ILSP8CompatibleERC721 is ILSP8IdentifiableDigitalAsset {
|
|
|
71
89
|
) external;
|
|
72
90
|
|
|
73
91
|
/**
|
|
74
|
-
* @
|
|
75
|
-
*
|
|
76
|
-
* @
|
|
77
|
-
*
|
|
78
|
-
* @param
|
|
92
|
+
* @notice Calling `safeTransferFrom` function with `data` on `ILSP8CompatibleERC721` contract. Transferring tokenId `tokenId` from address `from` to address `to`.
|
|
93
|
+
*
|
|
94
|
+
* @dev Safe Transfer function with optional data from the ERC721 standard interface.
|
|
95
|
+
*
|
|
96
|
+
* @param from The sending address.
|
|
97
|
+
* @param to The receiving address.
|
|
98
|
+
* @param tokenId The tokenId to transfer.
|
|
99
|
+
* @param data The data to be sent with the transfer.
|
|
79
100
|
*/
|
|
80
101
|
function safeTransferFrom(
|
|
81
102
|
address from,
|
|
@@ -85,38 +106,55 @@ interface ILSP8CompatibleERC721 is ILSP8IdentifiableDigitalAsset {
|
|
|
85
106
|
) external;
|
|
86
107
|
|
|
87
108
|
/**
|
|
109
|
+
* @notice Retrieving the address that own tokenId `tokenId`.
|
|
110
|
+
*
|
|
88
111
|
* @dev Compatible with ERC721 ownerOf.
|
|
89
|
-
*
|
|
90
|
-
* @
|
|
112
|
+
*
|
|
113
|
+
* @param tokenId The tokenId to query.
|
|
114
|
+
* @return The owner of the tokenId.
|
|
91
115
|
*/
|
|
92
116
|
function ownerOf(uint256 tokenId) external view returns (address);
|
|
93
117
|
|
|
94
118
|
/**
|
|
95
|
-
* @
|
|
96
|
-
*
|
|
97
|
-
* @
|
|
119
|
+
* @notice Calling `approve` function on `ILSP8CompatibleERC721` contract. Approving operator at address `operator` to transfer tokenId `tokenId` on behalf of its owner.
|
|
120
|
+
*
|
|
121
|
+
* @dev Approval function compatible with ERC721 `approve(address,uint256)`.
|
|
122
|
+
*
|
|
123
|
+
* @param operator The address to approve for `tokenId`.
|
|
124
|
+
* @param tokenId The tokenId to approve.
|
|
98
125
|
*/
|
|
99
126
|
function approve(address operator, uint256 tokenId) external;
|
|
100
127
|
|
|
101
128
|
/**
|
|
102
|
-
* @notice
|
|
103
|
-
*
|
|
104
|
-
* @
|
|
105
|
-
*
|
|
129
|
+
* @notice Setting the "approval for all" status of operator `_operator` to `_approved` to allow it to transfer any tokenIds on behalf of `msg.sender`.
|
|
130
|
+
*
|
|
131
|
+
* @dev Enable or disable approval for a third party ("operator") to manage all of `msg.sender`'s assets. The contract MUST allow multiple operators per owner.
|
|
132
|
+
*
|
|
133
|
+
* @param _operator Address to add to the set of authorized operators.
|
|
134
|
+
* @param _approved True if the operator is approved, false to revoke approval.
|
|
135
|
+
*
|
|
136
|
+
* @custom:events {ApprovalForAll} event
|
|
106
137
|
*/
|
|
107
138
|
function setApprovalForAll(address _operator, bool _approved) external;
|
|
108
139
|
|
|
109
140
|
/**
|
|
141
|
+
* @notice Retrieving the address other than the token owner that is approved to transfer tokenId `tokenId` on behalf of its owner.
|
|
142
|
+
*
|
|
110
143
|
* @dev Compatible with ERC721 getApproved.
|
|
111
|
-
*
|
|
112
|
-
* @
|
|
144
|
+
*
|
|
145
|
+
* @param tokenId The tokenId to query.
|
|
146
|
+
* @return The address of the operator for `tokenId`.
|
|
113
147
|
*/
|
|
114
148
|
function getApproved(uint256 tokenId) external view returns (address);
|
|
115
149
|
|
|
116
150
|
/*
|
|
151
|
+
* @notice Checking if address `operator` is approved to transfer any tokenId owned by address `owner`.
|
|
152
|
+
*
|
|
117
153
|
* @dev Compatible with ERC721 isApprovedForAll.
|
|
118
|
-
*
|
|
119
|
-
* @param
|
|
154
|
+
*
|
|
155
|
+
* @param owner The tokenOwner address to query.
|
|
156
|
+
* @param operator The operator address to query.
|
|
157
|
+
*
|
|
120
158
|
* @return Returns if the `operator` is allowed to manage all of the assets of `owner`
|
|
121
159
|
*/
|
|
122
160
|
function isApprovedForAll(
|
|
@@ -125,9 +163,13 @@ interface ILSP8CompatibleERC721 is ILSP8IdentifiableDigitalAsset {
|
|
|
125
163
|
) external view returns (bool);
|
|
126
164
|
|
|
127
165
|
/*
|
|
166
|
+
* @notice Retrieving the token URI of tokenId `tokenId`.
|
|
167
|
+
*
|
|
128
168
|
* @dev Compatible with ERC721Metadata tokenURI.
|
|
129
|
-
*
|
|
130
|
-
* @
|
|
169
|
+
*
|
|
170
|
+
* @param tokenId The tokenId to query.
|
|
171
|
+
*
|
|
172
|
+
* @return The token URI.
|
|
131
173
|
*/
|
|
132
174
|
function tokenURI(uint256 tokenId) external returns (string memory);
|
|
133
175
|
}
|
|
@@ -2,18 +2,26 @@
|
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "../
|
|
5
|
+
LSP8IdentifiableDigitalAsset
|
|
6
|
+
} from "../LSP8IdentifiableDigitalAsset.sol";
|
|
7
7
|
|
|
8
8
|
// errors
|
|
9
9
|
import {LSP8NotTokenOperator} from "../LSP8Errors.sol";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* @dev LSP8 extension that allows token holders to destroy both
|
|
12
|
+
* @dev LSP8 token extension that allows token holders to destroy both
|
|
13
13
|
* their own tokens and those that they have an allowance for as an operator.
|
|
14
14
|
*/
|
|
15
|
-
abstract contract LSP8Burnable is
|
|
16
|
-
|
|
15
|
+
abstract contract LSP8Burnable is LSP8IdentifiableDigitalAsset {
|
|
16
|
+
/**
|
|
17
|
+
* @notice Burning tokenId `tokenId`. This tokenId will not be recoverable! (additional data sent: `data`).
|
|
18
|
+
*
|
|
19
|
+
* @dev See internal {_burn} function for details.
|
|
20
|
+
*
|
|
21
|
+
* @param tokenId The tokenId to burn.
|
|
22
|
+
* @param data Any extra data to be sent alongside burning the tokenId.
|
|
23
|
+
*/
|
|
24
|
+
function burn(bytes32 tokenId, bytes memory data) public {
|
|
17
25
|
if (!_isOperatorOrOwner(msg.sender, tokenId)) {
|
|
18
26
|
revert LSP8NotTokenOperator(tokenId, msg.sender);
|
|
19
27
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.4;
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
LSP8IdentifiableDigitalAssetInitAbstract
|
|
6
|
+
} from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
|
|
7
|
+
|
|
8
|
+
// errors
|
|
9
|
+
import {LSP8NotTokenOperator} from "../LSP8Errors.sol";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @dev LSP8 extension (proxy version) that allows token holders to destroy both
|
|
13
|
+
* their own tokens and those that they have an allowance for as an operator.
|
|
14
|
+
*/
|
|
15
|
+
abstract contract LSP8BurnableInitAbstract is
|
|
16
|
+
LSP8IdentifiableDigitalAssetInitAbstract
|
|
17
|
+
{
|
|
18
|
+
function burn(bytes32 tokenId, bytes memory data) public virtual {
|
|
19
|
+
if (!_isOperatorOrOwner(msg.sender, tokenId)) {
|
|
20
|
+
revert LSP8NotTokenOperator(tokenId, msg.sender);
|
|
21
|
+
}
|
|
22
|
+
_burn(tokenId, data);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -8,19 +8,35 @@ import {
|
|
|
8
8
|
} from "../LSP8IdentifiableDigitalAsset.sol";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @dev LSP8 extension
|
|
11
|
+
* @dev LSP8 token extension to add a max token supply cap.
|
|
12
12
|
*/
|
|
13
13
|
abstract contract LSP8CappedSupply is LSP8IdentifiableDigitalAsset {
|
|
14
14
|
// --- Errors
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @notice The `tokenSupplyCap` must be set and cannot be `0`.
|
|
18
|
+
* @dev Reverts when setting `0` for the {tokenSupplyCap}. The max token supply MUST be set to a number greater than 0.
|
|
19
|
+
*/
|
|
15
20
|
error LSP8CappedSupplyRequired();
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @notice Cannot mint anymore as total supply reached the maximum cap.
|
|
24
|
+
* @dev Reverts when trying to mint tokens but the {totalSupply} has reached the maximum {tokenSupplyCap}.
|
|
25
|
+
*/
|
|
16
26
|
error LSP8CappedSupplyCannotMintOverCap();
|
|
17
27
|
|
|
18
28
|
// --- Storage
|
|
19
29
|
uint256 private immutable _tokenSupplyCap;
|
|
20
30
|
|
|
21
31
|
/**
|
|
22
|
-
* @notice
|
|
23
|
-
* @
|
|
32
|
+
* @notice Deploying a `LSP8CappedSupply` token contract with max token supply cap set to `tokenSupplyCap_`.
|
|
33
|
+
* @dev Deploy a `LSP8CappedSupply` token contract and set the maximum token supply token cap up to which
|
|
34
|
+
* it is not possible to mint more tokens.
|
|
35
|
+
*
|
|
36
|
+
* @param tokenSupplyCap_ The maximum token supply.
|
|
37
|
+
*
|
|
38
|
+
* @custom:requirements
|
|
39
|
+
* - `tokenSupplyCap_` MUST NOT be 0.
|
|
24
40
|
*/
|
|
25
41
|
constructor(uint256 tokenSupplyCap_) {
|
|
26
42
|
if (tokenSupplyCap_ == 0) {
|
|
@@ -33,8 +49,12 @@ abstract contract LSP8CappedSupply is LSP8IdentifiableDigitalAsset {
|
|
|
33
49
|
// --- Token queries
|
|
34
50
|
|
|
35
51
|
/**
|
|
36
|
-
* @
|
|
37
|
-
*
|
|
52
|
+
* @notice The maximum supply amount of tokens allowed to exist is `_tokenSupplyCap`.
|
|
53
|
+
*
|
|
54
|
+
* @dev Get the maximum number of tokens that can exist to circulate. Once {totalSupply} reaches
|
|
55
|
+
* reaches {totalSuuplyCap}, it is not possible to mint more tokens.
|
|
56
|
+
*
|
|
57
|
+
* @return The maximum number of tokens that can exist in the contract.
|
|
38
58
|
*/
|
|
39
59
|
function tokenSupplyCap() public view virtual returns (uint256) {
|
|
40
60
|
return _tokenSupplyCap;
|
|
@@ -43,15 +63,13 @@ abstract contract LSP8CappedSupply is LSP8IdentifiableDigitalAsset {
|
|
|
43
63
|
// --- Transfer functionality
|
|
44
64
|
|
|
45
65
|
/**
|
|
46
|
-
* @dev
|
|
47
|
-
*
|
|
48
|
-
*
|
|
66
|
+
* @dev Same as {_mint} but allows to mint only if newly minted `tokenId` does not increase the {totalSupply}
|
|
67
|
+
* over the {tokenSupplyCap}.
|
|
68
|
+
* after a new `tokenId` has of tokens have been minted.
|
|
49
69
|
*
|
|
50
|
-
*
|
|
51
|
-
* -
|
|
70
|
+
* @custom:requirements
|
|
71
|
+
* - {totalSupply} + 1 must not be greater than the {tokenSupplyCap} when calling this function.
|
|
52
72
|
* - `to` cannot be the zero address.
|
|
53
|
-
*
|
|
54
|
-
* Emits a {Transfer} event.
|
|
55
73
|
*/
|
|
56
74
|
function _mint(
|
|
57
75
|
address to,
|
|
@@ -8,18 +8,37 @@ import {
|
|
|
8
8
|
} from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @dev LSP8 extension
|
|
11
|
+
* @dev LSP8 token extension to add a max token supply cap.
|
|
12
12
|
*/
|
|
13
13
|
abstract contract LSP8CappedSupplyInitAbstract is
|
|
14
14
|
LSP8IdentifiableDigitalAssetInitAbstract
|
|
15
15
|
{
|
|
16
16
|
// --- Errors
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @notice The `tokenSupplyCap` must be set and cannot be `0`.
|
|
20
|
+
* @dev Reverts when setting `0` for the {tokenSupplyCap}. The max token supply MUST be set to a number greater than 0.
|
|
21
|
+
*/
|
|
17
22
|
error LSP8CappedSupplyRequired();
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @notice Cannot mint anymore as total supply reached the maximum cap.
|
|
26
|
+
* @dev Reverts when trying to mint tokens but the {totalSupply} has reached the maximum {tokenSupplyCap}.
|
|
27
|
+
*/
|
|
18
28
|
error LSP8CappedSupplyCannotMintOverCap();
|
|
19
29
|
|
|
20
30
|
// --- Storage
|
|
21
31
|
uint256 private _tokenSupplyCap;
|
|
22
32
|
|
|
33
|
+
/**
|
|
34
|
+
* @dev Initialize a `LSP8CappedSupplyInitAbstract` token contract and set the maximum token supply token cap up to which
|
|
35
|
+
* it is not possible to mint more tokens.
|
|
36
|
+
*
|
|
37
|
+
* @param tokenSupplyCap_ The maximum token supply.
|
|
38
|
+
*
|
|
39
|
+
* @custom:requirements
|
|
40
|
+
* - `tokenSupplyCap_` MUST NOT be 0.
|
|
41
|
+
*/
|
|
23
42
|
function _initialize(
|
|
24
43
|
uint256 tokenSupplyCap_
|
|
25
44
|
) internal virtual onlyInitializing {
|
|
@@ -33,8 +52,12 @@ abstract contract LSP8CappedSupplyInitAbstract is
|
|
|
33
52
|
// --- Token queries
|
|
34
53
|
|
|
35
54
|
/**
|
|
36
|
-
* @
|
|
37
|
-
*
|
|
55
|
+
* @notice The maximum supply amount of tokens allowed to exist is `_tokenSupplyCap`.
|
|
56
|
+
*
|
|
57
|
+
* @dev Get the maximum number of tokens that can exist to circulate. Once {totalSupply} reaches
|
|
58
|
+
* reaches {totalSuuplyCap}, it is not possible to mint more tokens.
|
|
59
|
+
*
|
|
60
|
+
* @return The maximum number of tokens that can exist in the contract.
|
|
38
61
|
*/
|
|
39
62
|
function tokenSupplyCap() public view virtual returns (uint256) {
|
|
40
63
|
return _tokenSupplyCap;
|
|
@@ -43,15 +66,13 @@ abstract contract LSP8CappedSupplyInitAbstract is
|
|
|
43
66
|
// --- Transfer functionality
|
|
44
67
|
|
|
45
68
|
/**
|
|
46
|
-
* @dev
|
|
47
|
-
*
|
|
48
|
-
*
|
|
69
|
+
* @dev Same as {_mint} but allows to mint only if newly minted `tokenId` does not increase the {totalSupply}
|
|
70
|
+
* over the {tokenSupplyCap}.
|
|
71
|
+
* after a new `tokenId` has of tokens have been minted.
|
|
49
72
|
*
|
|
50
|
-
*
|
|
51
|
-
* -
|
|
73
|
+
* @custom:requirements
|
|
74
|
+
* - {totalSupply} + 1 must not be greater than the {tokenSupplyCap} when calling this function.
|
|
52
75
|
* - `to` cannot be the zero address.
|
|
53
|
-
*
|
|
54
|
-
* Emits a {Transfer} event.
|
|
55
76
|
*/
|
|
56
77
|
function _mint(
|
|
57
78
|
address to,
|
|
@@ -53,16 +53,17 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
53
53
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* Mapping from owner to operator approvals
|
|
57
|
-
* @dev for backward compatibility with ERC721
|
|
56
|
+
* @dev Mapping from owner to operator approvals for backward compatibility with ERC721
|
|
58
57
|
*/
|
|
59
58
|
mapping(address => mapping(address => bool)) private _operatorApprovals;
|
|
60
59
|
|
|
61
60
|
/**
|
|
62
|
-
* @notice
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* @param
|
|
61
|
+
* @notice Deploying a `LSP8CompatibleERC721` token contract with: token name = `name_`, token symbol = `symbol_`, and
|
|
62
|
+
* address `newOwner_` as the token contract owner.
|
|
63
|
+
*
|
|
64
|
+
* @param name_ The name of the token.
|
|
65
|
+
* @param symbol_ The symbol of the token.
|
|
66
|
+
* @param newOwner_ The owner of the token contract.
|
|
66
67
|
*/
|
|
67
68
|
constructor(
|
|
68
69
|
string memory name_,
|
|
@@ -71,7 +72,7 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
71
72
|
) LSP8IdentifiableDigitalAsset(name_, symbol_, newOwner_) {}
|
|
72
73
|
|
|
73
74
|
/**
|
|
74
|
-
* @
|
|
75
|
+
* @inheritdoc LSP8IdentifiableDigitalAsset
|
|
75
76
|
*/
|
|
76
77
|
function supportsInterface(
|
|
77
78
|
bytes4 interfaceId
|
|
@@ -153,12 +154,11 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
153
154
|
* @inheritdoc ILSP8CompatibleERC721
|
|
154
155
|
*/
|
|
155
156
|
function approve(address operator, uint256 tokenId) public virtual {
|
|
156
|
-
authorizeOperator(operator, bytes32(tokenId));
|
|
157
|
-
emit Approval(tokenOwnerOf(bytes32(tokenId)), operator, tokenId);
|
|
157
|
+
authorizeOperator(operator, bytes32(tokenId), "");
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
/**
|
|
161
|
-
* @dev See _setApprovalForAll
|
|
161
|
+
* @dev See {_setApprovalForAll}
|
|
162
162
|
*/
|
|
163
163
|
function setApprovalForAll(address operator, bool approved) public virtual {
|
|
164
164
|
_setApprovalForAll(msg.sender, operator, approved);
|
|
@@ -166,8 +166,8 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
166
166
|
|
|
167
167
|
/**
|
|
168
168
|
* @inheritdoc ILSP8CompatibleERC721
|
|
169
|
-
*
|
|
170
|
-
*
|
|
169
|
+
*
|
|
170
|
+
* @custom:info This function sets the `allowNonLSP1Recipient` parameter to `true` so that EOAs and any contract can receive the `tokenId`.
|
|
171
171
|
*/
|
|
172
172
|
function transferFrom(
|
|
173
173
|
address from,
|
|
@@ -179,8 +179,8 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
181
|
* @inheritdoc ILSP8CompatibleERC721
|
|
182
|
-
*
|
|
183
|
-
*
|
|
182
|
+
*
|
|
183
|
+
* @custom:info This function sets the `allowNonLSP1Recipient` parameter to `true` so that EOAs and any contract can receive the `tokenId`.
|
|
184
184
|
*/
|
|
185
185
|
function safeTransferFrom(
|
|
186
186
|
address from,
|
|
@@ -190,9 +190,10 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
190
190
|
_safeTransfer(from, to, tokenId, "");
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
|
|
194
|
-
* @
|
|
195
|
-
*
|
|
193
|
+
/**
|
|
194
|
+
* @inheritdoc ILSP8CompatibleERC721
|
|
195
|
+
*
|
|
196
|
+
* @custom:info This function sets the `allowNonLSP1Recipient` parameter to `true` so that EOAs and any contract can receive the `tokenId`.
|
|
196
197
|
*/
|
|
197
198
|
function safeTransferFrom(
|
|
198
199
|
address from,
|
|
@@ -207,10 +208,15 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
207
208
|
|
|
208
209
|
/**
|
|
209
210
|
* @inheritdoc ILSP8IdentifiableDigitalAsset
|
|
211
|
+
*
|
|
212
|
+
* @custom:events
|
|
213
|
+
* - LSP7 {AuthorizedOperator} event.
|
|
214
|
+
* - ERC721 {Approval} event.
|
|
210
215
|
*/
|
|
211
216
|
function authorizeOperator(
|
|
212
217
|
address operator,
|
|
213
|
-
bytes32 tokenId
|
|
218
|
+
bytes32 tokenId,
|
|
219
|
+
bytes memory operatorNotificationData
|
|
214
220
|
)
|
|
215
221
|
public
|
|
216
222
|
virtual
|
|
@@ -219,10 +225,49 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
219
225
|
LSP8IdentifiableDigitalAssetCore
|
|
220
226
|
)
|
|
221
227
|
{
|
|
222
|
-
|
|
228
|
+
address tokenOwner = tokenOwnerOf(tokenId);
|
|
229
|
+
|
|
230
|
+
if (
|
|
231
|
+
tokenOwner != msg.sender &&
|
|
232
|
+
!isApprovedForAll(tokenOwner, msg.sender)
|
|
233
|
+
) {
|
|
234
|
+
revert LSP8NotTokenOwner(tokenOwner, tokenId, msg.sender);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (operator == address(0)) {
|
|
238
|
+
revert LSP8CannotUseAddressZeroAsOperator();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (tokenOwner == operator) {
|
|
242
|
+
revert LSP8TokenOwnerCannotBeOperator();
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
bool isAdded = _operators[tokenId].add(operator);
|
|
246
|
+
if (!isAdded) revert LSP8OperatorAlreadyAuthorized(operator, tokenId);
|
|
247
|
+
|
|
248
|
+
emit AuthorizedOperator(
|
|
249
|
+
operator,
|
|
250
|
+
tokenOwner,
|
|
251
|
+
tokenId,
|
|
252
|
+
operatorNotificationData
|
|
253
|
+
);
|
|
223
254
|
emit Approval(tokenOwnerOf(tokenId), operator, uint256(tokenId));
|
|
255
|
+
|
|
256
|
+
bytes memory lsp1Data = abi.encode(
|
|
257
|
+
msg.sender,
|
|
258
|
+
tokenId,
|
|
259
|
+
operatorNotificationData
|
|
260
|
+
);
|
|
261
|
+
_notifyTokenOperator(operator, lsp1Data);
|
|
224
262
|
}
|
|
225
263
|
|
|
264
|
+
/**
|
|
265
|
+
* @inheritdoc LSP8IdentifiableDigitalAssetCore
|
|
266
|
+
*
|
|
267
|
+
* @custom:events
|
|
268
|
+
* - LSP8 {Transfer} event.
|
|
269
|
+
* - ERC721 {Transfer} event.
|
|
270
|
+
*/
|
|
226
271
|
function _transfer(
|
|
227
272
|
address from,
|
|
228
273
|
address to,
|
|
@@ -230,19 +275,22 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
230
275
|
bool allowNonLSP1Recipient,
|
|
231
276
|
bytes memory data
|
|
232
277
|
) internal virtual override {
|
|
233
|
-
address operator = msg.sender;
|
|
234
|
-
|
|
235
278
|
if (
|
|
236
|
-
!isApprovedForAll(from,
|
|
237
|
-
!_isOperatorOrOwner(
|
|
279
|
+
!isApprovedForAll(from, msg.sender) &&
|
|
280
|
+
!_isOperatorOrOwner(msg.sender, tokenId)
|
|
238
281
|
) {
|
|
239
|
-
revert LSP8NotTokenOperator(tokenId,
|
|
282
|
+
revert LSP8NotTokenOperator(tokenId, msg.sender);
|
|
240
283
|
}
|
|
241
284
|
|
|
242
285
|
emit Transfer(from, to, uint256(tokenId));
|
|
243
286
|
super._transfer(from, to, tokenId, allowNonLSP1Recipient, data);
|
|
244
287
|
}
|
|
245
288
|
|
|
289
|
+
/**
|
|
290
|
+
* @dev Transfer the `tokenId` from `from` to `to` and check if the `to` recipient address is
|
|
291
|
+
* a contract that implements the `IERC721Received` interface and return the right magic value.
|
|
292
|
+
* See {_checkOnERC721Received} for more infos.
|
|
293
|
+
*/
|
|
246
294
|
function _safeTransfer(
|
|
247
295
|
address from,
|
|
248
296
|
address to,
|
|
@@ -256,6 +304,13 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
256
304
|
);
|
|
257
305
|
}
|
|
258
306
|
|
|
307
|
+
/**
|
|
308
|
+
* @inheritdoc LSP8IdentifiableDigitalAssetCore
|
|
309
|
+
*
|
|
310
|
+
* @custom:events
|
|
311
|
+
* - LSP8 {Transfer} event with `address(0)` as `from`.
|
|
312
|
+
* - ERC721 {Transfer} event with `address(0)` as `from`.
|
|
313
|
+
*/
|
|
259
314
|
function _mint(
|
|
260
315
|
address to,
|
|
261
316
|
bytes32 tokenId,
|
|
@@ -266,6 +321,13 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
266
321
|
super._mint(to, tokenId, allowNonLSP1Recipient, data);
|
|
267
322
|
}
|
|
268
323
|
|
|
324
|
+
/**
|
|
325
|
+
* @inheritdoc LSP8IdentifiableDigitalAssetCore
|
|
326
|
+
*
|
|
327
|
+
* @custom:events
|
|
328
|
+
* - LSP8 {Transfer} event with `address(0)` as the `to` address.
|
|
329
|
+
* - ERC721 {Transfer} event with `address(0)` as the `to` address.
|
|
330
|
+
*/
|
|
269
331
|
function _burn(
|
|
270
332
|
bytes32 tokenId,
|
|
271
333
|
bytes memory data
|
|
@@ -279,7 +341,7 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
279
341
|
/**
|
|
280
342
|
* @dev Approve `operator` to operate on all tokens of `tokensOwner`
|
|
281
343
|
*
|
|
282
|
-
*
|
|
344
|
+
* @custom:events {ApprovalForAll} event.
|
|
283
345
|
*/
|
|
284
346
|
function _setApprovalForAll(
|
|
285
347
|
address tokensOwner,
|
|
@@ -295,14 +357,14 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
295
357
|
}
|
|
296
358
|
|
|
297
359
|
/**
|
|
298
|
-
* @dev Internal function to invoke
|
|
360
|
+
* @dev Internal function to invoke `IERC721Receiver.onERC721Received(...)` function on a target address.
|
|
299
361
|
* The call is not executed if the target address is not a contract.
|
|
300
362
|
*
|
|
301
|
-
* @param from address representing the previous owner of the given
|
|
302
|
-
* @param to target address that will receive the token
|
|
303
|
-
* @param tokenId uint256 ID of the token to be transferred
|
|
304
|
-
* @param data bytes optional data to send along with the call
|
|
305
|
-
* @return bool whether the call correctly returned the expected magic value
|
|
363
|
+
* @param from address representing the previous owner of the given `tokenId`.
|
|
364
|
+
* @param to target address that will receive the token.
|
|
365
|
+
* @param tokenId uint256 ID of the token to be transferred.
|
|
366
|
+
* @param data bytes optional data to send along with the call.
|
|
367
|
+
* @return bool whether the call correctly returned the expected magic value.
|
|
306
368
|
*/
|
|
307
369
|
function _checkOnERC721Received(
|
|
308
370
|
address from,
|
|
@@ -338,6 +400,9 @@ abstract contract LSP8CompatibleERC721 is
|
|
|
338
400
|
}
|
|
339
401
|
}
|
|
340
402
|
|
|
403
|
+
/**
|
|
404
|
+
* @inheritdoc LSP4DigitalAssetMetadata
|
|
405
|
+
*/
|
|
341
406
|
function _setData(
|
|
342
407
|
bytes32 key,
|
|
343
408
|
bytes memory value
|