@lukso/lsp-smart-contracts 0.11.1 → 0.12.0
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 +10 -2
- package/artifacts/Create2Factory.json +2 -2
- package/artifacts/LSP0ERC725Account.json +68 -47
- package/artifacts/LSP0ERC725AccountInit.json +68 -47
- package/artifacts/LSP11BasicSocialRecovery.json +18 -2
- package/artifacts/LSP11BasicSocialRecoveryInit.json +18 -2
- package/artifacts/LSP16UniversalFactory.json +3 -3
- package/artifacts/LSP1UniversalReceiverDelegateUP.json +27 -46
- package/artifacts/LSP1UniversalReceiverDelegateVault.json +27 -46
- package/artifacts/LSP23LinkedContractsFactory.json +3 -3
- package/artifacts/LSP4DigitalAssetMetadata.json +16 -0
- package/artifacts/LSP4DigitalAssetMetadataInitAbstract.json +16 -0
- package/artifacts/LSP6KeyManager.json +34 -6
- package/artifacts/LSP6KeyManagerInit.json +34 -6
- package/artifacts/LSP7CappedSupply.json +64 -4
- package/artifacts/LSP7CappedSupplyInitAbstract.json +64 -4
- package/artifacts/LSP7CompatibleERC20.json +83 -23
- package/artifacts/LSP7CompatibleERC20InitAbstract.json +83 -23
- package/artifacts/LSP7CompatibleERC20Mintable.json +86 -26
- package/artifacts/LSP7CompatibleERC20MintableInit.json +86 -26
- package/artifacts/LSP7DigitalAsset.json +64 -4
- package/artifacts/LSP7DigitalAssetInitAbstract.json +64 -4
- package/artifacts/LSP7Mintable.json +67 -7
- package/artifacts/LSP7MintableInit.json +67 -7
- package/artifacts/LSP8CappedSupply.json +57 -3
- package/artifacts/LSP8CappedSupplyInitAbstract.json +57 -3
- package/artifacts/LSP8CompatibleERC721.json +79 -25
- package/artifacts/LSP8CompatibleERC721InitAbstract.json +79 -25
- package/artifacts/LSP8CompatibleERC721Mintable.json +87 -28
- package/artifacts/LSP8CompatibleERC721MintableInit.json +87 -28
- package/artifacts/LSP8IdentifiableDigitalAsset.json +57 -3
- package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +57 -3
- package/artifacts/LSP8Mintable.json +65 -6
- package/artifacts/LSP8MintableInit.json +65 -6
- package/artifacts/LSP9Vault.json +51 -35
- package/artifacts/LSP9VaultInit.json +51 -35
- package/artifacts/UniversalProfile.json +68 -47
- package/artifacts/UniversalProfileInit.json +68 -47
- package/contracts/Factories/Create2Factory.sol +1 -1
- package/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +0 -22
- package/contracts/LSP0ERC725Account/LSP0Constants.sol +6 -1
- package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +12 -2
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +196 -123
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +1 -1
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +11 -2
- package/contracts/LSP10ReceivedVaults/LSP10Utils.sol +5 -3
- package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol +54 -14
- package/contracts/LSP11BasicSocialRecovery/LSP11Constants.sol +1 -1
- package/contracts/LSP11BasicSocialRecovery/LSP11Errors.sol +1 -1
- package/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +2 -2
- package/contracts/LSP14Ownable2Step/LSP14Constants.sol +1 -1
- package/contracts/LSP14Ownable2Step/LSP14Errors.sol +9 -3
- package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +16 -12
- package/contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol +65 -96
- package/contracts/LSP17ContractExtension/LSP17Errors.sol +1 -1
- package/contracts/LSP17ContractExtension/LSP17Extendable.sol +22 -15
- package/contracts/LSP17ContractExtension/LSP17Extension.sol +6 -5
- package/contracts/LSP17Extensions/Extension4337.sol +101 -0
- package/contracts/LSP17Extensions/OnERC721ReceivedExtension.sol +15 -0
- package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +1 -2
- package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol +24 -0
- package/contracts/LSP1UniversalReceiver/LSP1Constants.sol +1 -0
- package/contracts/LSP1UniversalReceiver/LSP1Errors.sol +0 -6
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +49 -33
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +33 -27
- package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +5 -48
- package/contracts/LSP20CallVerification/ILSP20CallVerifier.sol +13 -9
- package/contracts/LSP20CallVerification/LSP20CallVerification.sol +64 -45
- package/contracts/LSP20CallVerification/LSP20Constants.sol +6 -6
- package/contracts/LSP20CallVerification/LSP20Errors.sol +10 -4
- package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/ILSP23LinkedContractsFactory.sol +1 -1
- package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/IPostDeploymentModule.sol +1 -1
- package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/LSP23Errors.sol +1 -1
- package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/LSP23LinkedContractsFactory.sol +5 -1
- package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/modules/UniversalProfileInitPostDeploymentModule.sol +1 -1
- package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/modules/UniversalProfilePostDeploymentModule.sol +1 -1
- package/contracts/LSP25ExecuteRelayCall/LSP25Constants.sol +1 -1
- package/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol +8 -3
- package/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +1 -97
- package/contracts/LSP3ProfileMetadata/LSP3Constants.sol +1 -1
- package/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +1 -1
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +8 -3
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +8 -3
- package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +4 -3
- package/contracts/LSP6KeyManager/LSP6Constants.sol +4 -3
- package/contracts/LSP6KeyManager/LSP6Errors.sol +2 -23
- package/contracts/LSP6KeyManager/LSP6KeyManager.sol +0 -1
- package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +176 -101
- package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +0 -1
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +1 -2
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteRelayCallModule.sol +27 -0
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +34 -28
- package/contracts/LSP6KeyManager/LSP6Utils.sol +29 -2
- package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +70 -10
- package/contracts/LSP7DigitalAsset/LSP7Constants.sol +2 -2
- package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +29 -13
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +273 -265
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +28 -12
- package/contracts/LSP7DigitalAsset/LSP7Errors.sol +17 -3
- package/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +5 -1
- package/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +4 -1
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +7 -7
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +3 -3
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +128 -54
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +129 -54
- package/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +3 -3
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +4 -4
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +2 -2
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +4 -4
- package/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +4 -4
- package/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +1 -1
- package/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +4 -4
- package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +16 -11
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +20 -6
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +32 -16
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +67 -16
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +143 -137
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +69 -15
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +1 -1
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8BurnableInitAbstract.sol +1 -1
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +7 -7
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +3 -3
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +172 -80
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +178 -91
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +7 -7
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +7 -7
- package/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +3 -3
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +8 -7
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +5 -3
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +13 -7
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +9 -8
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +9 -3
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +10 -8
- package/contracts/LSP9Vault/ILSP9Vault.sol +0 -21
- package/contracts/LSP9Vault/LSP9Constants.sol +6 -1
- package/contracts/LSP9Vault/LSP9Errors.sol +1 -1
- package/contracts/LSP9Vault/LSP9Vault.sol +11 -2
- package/contracts/LSP9Vault/LSP9VaultCore.sol +119 -66
- package/contracts/LSP9Vault/LSP9VaultInit.sol +1 -1
- package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +11 -2
- package/contracts/UniversalProfile.sol +1 -1
- package/contracts/UniversalProfileInit.sol +1 -1
- package/contracts/UniversalProfileInitAbstract.sol +1 -1
- package/contracts/Version.sol +16 -0
- package/devdocs/LSP0ERC725Account.json +86 -52
- package/devdocs/LSP0ERC725AccountInit.json +86 -52
- package/devdocs/LSP11BasicSocialRecovery.json +13 -0
- package/devdocs/LSP11BasicSocialRecoveryInit.json +13 -0
- package/devdocs/LSP16UniversalFactory.json +9 -9
- package/devdocs/LSP1UniversalReceiverDelegateUP.json +7 -6
- package/devdocs/LSP1UniversalReceiverDelegateVault.json +7 -6
- package/devdocs/LSP4DigitalAssetMetadata.json +32 -10
- package/devdocs/LSP4DigitalAssetMetadataInitAbstract.json +32 -10
- package/devdocs/LSP6KeyManager.json +27 -13
- package/devdocs/LSP6KeyManagerInit.json +27 -13
- package/devdocs/LSP7CappedSupply.json +61 -28
- package/devdocs/LSP7CappedSupplyInitAbstract.json +61 -28
- package/devdocs/LSP7CompatibleERC20.json +102 -32
- package/devdocs/LSP7CompatibleERC20InitAbstract.json +102 -32
- package/devdocs/LSP7CompatibleERC20Mintable.json +102 -32
- package/devdocs/LSP7CompatibleERC20MintableInit.json +102 -32
- package/devdocs/LSP7DigitalAsset.json +61 -28
- package/devdocs/LSP7DigitalAssetInitAbstract.json +61 -28
- package/devdocs/LSP7Mintable.json +61 -28
- package/devdocs/LSP7MintableInit.json +61 -28
- package/devdocs/LSP8CappedSupply.json +66 -27
- package/devdocs/LSP8CappedSupplyInitAbstract.json +66 -27
- package/devdocs/LSP8CompatibleERC721.json +93 -33
- package/devdocs/LSP8CompatibleERC721InitAbstract.json +93 -33
- package/devdocs/LSP8CompatibleERC721Mintable.json +95 -35
- package/devdocs/LSP8CompatibleERC721MintableInit.json +96 -36
- package/devdocs/LSP8IdentifiableDigitalAsset.json +70 -28
- package/devdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +66 -27
- package/devdocs/LSP8Mintable.json +68 -29
- package/devdocs/LSP8MintableInit.json +69 -30
- package/devdocs/LSP9Vault.json +69 -41
- package/devdocs/LSP9VaultInit.json +69 -41
- package/devdocs/UniversalProfile.json +86 -52
- package/devdocs/UniversalProfileInit.json +86 -52
- package/dist/constants.cjs.js +5565 -2846
- package/dist/constants.d.ts +3996 -1182
- package/dist/constants.es.js +5564 -2846
- package/package.json +8 -8
- package/userdocs/LSP0ERC725Account.json +20 -11
- package/userdocs/LSP0ERC725AccountInit.json +20 -11
- package/userdocs/LSP16UniversalFactory.json +26 -1
- package/userdocs/LSP1UniversalReceiverDelegateUP.json +4 -11
- package/userdocs/LSP1UniversalReceiverDelegateVault.json +4 -11
- package/userdocs/LSP4DigitalAssetMetadata.json +7 -4
- package/userdocs/LSP4DigitalAssetMetadataInitAbstract.json +7 -4
- package/userdocs/LSP6KeyManager.json +3 -5
- package/userdocs/LSP6KeyManagerInit.json +3 -5
- package/userdocs/LSP7CappedSupply.json +17 -6
- package/userdocs/LSP7CappedSupplyInitAbstract.json +16 -5
- package/userdocs/LSP7CompatibleERC20.json +18 -5
- package/userdocs/LSP7CompatibleERC20InitAbstract.json +18 -5
- package/userdocs/LSP7CompatibleERC20Mintable.json +18 -5
- package/userdocs/LSP7CompatibleERC20MintableInit.json +18 -5
- package/userdocs/LSP7DigitalAsset.json +18 -5
- package/userdocs/LSP7DigitalAssetInitAbstract.json +18 -5
- package/userdocs/LSP7Mintable.json +18 -5
- package/userdocs/LSP7MintableInit.json +18 -5
- package/userdocs/LSP8CappedSupply.json +16 -5
- package/userdocs/LSP8CappedSupplyInitAbstract.json +15 -4
- package/userdocs/LSP8CompatibleERC721.json +30 -17
- package/userdocs/LSP8CompatibleERC721InitAbstract.json +30 -17
- package/userdocs/LSP8CompatibleERC721Mintable.json +31 -18
- package/userdocs/LSP8CompatibleERC721MintableInit.json +32 -19
- package/userdocs/LSP8IdentifiableDigitalAsset.json +18 -5
- package/userdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +17 -4
- package/userdocs/LSP8Mintable.json +18 -5
- package/userdocs/LSP8MintableInit.json +19 -6
- package/userdocs/LSP9Vault.json +23 -14
- package/userdocs/LSP9VaultInit.json +23 -14
- package/userdocs/UniversalProfile.json +20 -11
- package/userdocs/UniversalProfileInit.json +20 -11
- package/CONTRIBUTING.md +0 -184
- package/artifacts/LSP4Compatibility.json +0 -216
- package/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +0 -25
- package/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +0 -38
- package/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +0 -83
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +0 -175
- package/devdocs/LSP4Compatibility.json +0 -79
- package/userdocs/LSP4Compatibility.json +0 -20
package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.12;
|
|
3
3
|
|
|
4
4
|
// interfaces
|
|
5
|
-
import {IERC165} from "@openzeppelin/contracts/
|
|
5
|
+
import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol";
|
|
6
6
|
import {
|
|
7
7
|
IERC721Receiver
|
|
8
|
-
} from "@openzeppelin/contracts/
|
|
9
|
-
import {ILSP8CompatibleERC721} from "./ILSP8CompatibleERC721.sol";
|
|
8
|
+
} from "@openzeppelin/contracts/interfaces/IERC721Receiver.sol";
|
|
10
9
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
IERC721Metadata,
|
|
11
|
+
IERC721
|
|
12
|
+
} from "@openzeppelin/contracts/interfaces/IERC721Metadata.sol";
|
|
13
13
|
|
|
14
14
|
// libraries
|
|
15
|
+
import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";
|
|
15
16
|
import {
|
|
16
17
|
EnumerableSet
|
|
17
18
|
} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
|
18
|
-
import {
|
|
19
|
+
import {LSP1Utils} from "../../LSP1UniversalReceiver/LSP1Utils.sol";
|
|
19
20
|
|
|
20
21
|
// modules
|
|
21
22
|
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
import {
|
|
25
|
-
LSP8IdentifiableDigitalAssetInitAbstract,
|
|
26
|
-
LSP4DigitalAssetMetadataInitAbstract,
|
|
27
|
-
ERC725YCore
|
|
23
|
+
LSP8IdentifiableDigitalAssetCore,
|
|
24
|
+
LSP8IdentifiableDigitalAssetInitAbstract
|
|
28
25
|
} from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
|
|
29
|
-
import {
|
|
30
|
-
LSP8IdentifiableDigitalAssetCore
|
|
31
|
-
} from "../LSP8IdentifiableDigitalAssetCore.sol";
|
|
32
26
|
|
|
33
27
|
// errors
|
|
34
|
-
import
|
|
28
|
+
import {
|
|
29
|
+
LSP8NotTokenOwner,
|
|
30
|
+
LSP8CannotUseAddressZeroAsOperator,
|
|
31
|
+
LSP8TokenOwnerCannotBeOperator,
|
|
32
|
+
LSP8OperatorAlreadyAuthorized,
|
|
33
|
+
LSP8NotTokenOperator
|
|
34
|
+
} from "../LSP8Errors.sol";
|
|
35
35
|
|
|
36
36
|
// constants
|
|
37
37
|
import {
|
|
38
|
-
_LSP4_METADATA_KEY
|
|
38
|
+
_LSP4_METADATA_KEY,
|
|
39
|
+
_LSP4_TOKEN_NAME_KEY,
|
|
40
|
+
_LSP4_TOKEN_SYMBOL_KEY
|
|
39
41
|
} from "../../LSP4DigitalAssetMetadata/LSP4Constants.sol";
|
|
40
|
-
import {
|
|
41
|
-
_INTERFACEID_ERC721,
|
|
42
|
-
_INTERFACEID_ERC721METADATA
|
|
43
|
-
} from "./ILSP8CompatibleERC721.sol";
|
|
42
|
+
import {_TYPEID_LSP8_TOKENOPERATOR} from "../LSP8Constants.sol";
|
|
44
43
|
|
|
45
44
|
/**
|
|
46
45
|
* @dev LSP8 extension, for compatibility for clients / tools that expect ERC721.
|
|
47
46
|
*/
|
|
48
47
|
abstract contract LSP8CompatibleERC721InitAbstract is
|
|
49
|
-
|
|
50
|
-
LSP8IdentifiableDigitalAssetInitAbstract
|
|
51
|
-
LSP4Compatibility
|
|
48
|
+
IERC721Metadata,
|
|
49
|
+
LSP8IdentifiableDigitalAssetInitAbstract
|
|
52
50
|
{
|
|
51
|
+
using BytesLib for bytes;
|
|
53
52
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
53
|
+
using LSP1Utils for address;
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* @dev Mapping from owner to operator approvals for backward compatibility with ERC721
|
|
@@ -69,15 +69,56 @@ abstract contract LSP8CompatibleERC721InitAbstract is
|
|
|
69
69
|
function _initialize(
|
|
70
70
|
string memory name_,
|
|
71
71
|
string memory symbol_,
|
|
72
|
-
address newOwner_
|
|
72
|
+
address newOwner_,
|
|
73
|
+
uint256 tokenIdType_
|
|
73
74
|
) internal virtual override onlyInitializing {
|
|
74
75
|
LSP8IdentifiableDigitalAssetInitAbstract._initialize(
|
|
75
76
|
name_,
|
|
76
77
|
symbol_,
|
|
77
|
-
newOwner_
|
|
78
|
+
newOwner_,
|
|
79
|
+
tokenIdType_
|
|
78
80
|
);
|
|
79
81
|
}
|
|
80
82
|
|
|
83
|
+
/**
|
|
84
|
+
* @inheritdoc IERC721Metadata
|
|
85
|
+
* @dev Returns the name of the token.
|
|
86
|
+
* For compatibility with clients & tools that expect ERC721.
|
|
87
|
+
*
|
|
88
|
+
* @return The name of the token
|
|
89
|
+
*/
|
|
90
|
+
function name() public view virtual override returns (string memory) {
|
|
91
|
+
bytes memory data = _getData(_LSP4_TOKEN_NAME_KEY);
|
|
92
|
+
return string(data);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @inheritdoc IERC721Metadata
|
|
97
|
+
* @dev Returns the symbol of the token, usually a shorter version of the name.
|
|
98
|
+
* For compatibility with clients & tools that expect ERC721.
|
|
99
|
+
*
|
|
100
|
+
* @return The symbol of the token
|
|
101
|
+
*/
|
|
102
|
+
function symbol() public view virtual override returns (string memory) {
|
|
103
|
+
bytes memory data = _getData(_LSP4_TOKEN_SYMBOL_KEY);
|
|
104
|
+
return string(data);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @inheritdoc LSP8IdentifiableDigitalAssetCore
|
|
109
|
+
*/
|
|
110
|
+
function balanceOf(
|
|
111
|
+
address tokenOwner
|
|
112
|
+
)
|
|
113
|
+
public
|
|
114
|
+
view
|
|
115
|
+
virtual
|
|
116
|
+
override(IERC721, LSP8IdentifiableDigitalAssetCore)
|
|
117
|
+
returns (uint256)
|
|
118
|
+
{
|
|
119
|
+
return super.balanceOf(tokenOwner);
|
|
120
|
+
}
|
|
121
|
+
|
|
81
122
|
/**
|
|
82
123
|
* @inheritdoc LSP8IdentifiableDigitalAssetInitAbstract
|
|
83
124
|
*/
|
|
@@ -87,47 +128,62 @@ abstract contract LSP8CompatibleERC721InitAbstract is
|
|
|
87
128
|
public
|
|
88
129
|
view
|
|
89
130
|
virtual
|
|
90
|
-
override(IERC165,
|
|
131
|
+
override(IERC165, LSP8IdentifiableDigitalAssetInitAbstract)
|
|
91
132
|
returns (bool)
|
|
92
133
|
{
|
|
93
134
|
return
|
|
94
|
-
interfaceId ==
|
|
95
|
-
interfaceId ==
|
|
135
|
+
interfaceId == type(IERC721).interfaceId ||
|
|
136
|
+
interfaceId == type(IERC721Metadata).interfaceId ||
|
|
96
137
|
super.supportsInterface(interfaceId);
|
|
97
138
|
}
|
|
98
139
|
|
|
99
140
|
/**
|
|
100
|
-
* @inheritdoc
|
|
141
|
+
* @inheritdoc IERC721Metadata
|
|
142
|
+
* @notice Retrieving the token URI of tokenId `tokenId`.
|
|
143
|
+
*
|
|
144
|
+
* @dev Compatible with ERC721Metadata tokenURI. Retrieve the tokenURI for a specific `tokenId`.
|
|
145
|
+
*
|
|
146
|
+
* @return The token URI.
|
|
101
147
|
*/
|
|
102
148
|
function tokenURI(
|
|
103
149
|
uint256 /* tokenId */
|
|
104
|
-
) public view virtual returns (string memory) {
|
|
150
|
+
) public view virtual override returns (string memory) {
|
|
105
151
|
bytes memory data = _getData(_LSP4_METADATA_KEY);
|
|
106
152
|
|
|
107
153
|
// offset = bytes4(hashSig) + bytes32(contentHash) -> 4 + 32 = 36
|
|
108
154
|
uint256 offset = 36;
|
|
109
155
|
|
|
110
|
-
bytes memory uriBytes =
|
|
111
|
-
data,
|
|
112
|
-
offset,
|
|
113
|
-
data.length - offset
|
|
114
|
-
);
|
|
156
|
+
bytes memory uriBytes = data.slice(offset, data.length - offset);
|
|
115
157
|
return string(uriBytes);
|
|
116
158
|
}
|
|
117
159
|
|
|
118
160
|
/**
|
|
119
|
-
* @inheritdoc
|
|
161
|
+
* @inheritdoc IERC721
|
|
162
|
+
* @notice Retrieving the address that own tokenId `tokenId`.
|
|
163
|
+
*
|
|
164
|
+
* @dev Compatible with ERC721 ownerOf.
|
|
165
|
+
*
|
|
166
|
+
* @param tokenId The tokenId to query.
|
|
167
|
+
* @return The owner of the tokenId.
|
|
120
168
|
*/
|
|
121
|
-
function ownerOf(
|
|
169
|
+
function ownerOf(
|
|
170
|
+
uint256 tokenId
|
|
171
|
+
) public view virtual override returns (address) {
|
|
122
172
|
return tokenOwnerOf(bytes32(tokenId));
|
|
123
173
|
}
|
|
124
174
|
|
|
125
175
|
/**
|
|
126
|
-
* @inheritdoc
|
|
176
|
+
* @inheritdoc IERC721
|
|
177
|
+
* @notice Retrieving the address other than the token owner that is approved to transfer tokenId `tokenId` on behalf of its owner.
|
|
178
|
+
*
|
|
179
|
+
* @dev Compatible with ERC721 getApproved.
|
|
180
|
+
*
|
|
181
|
+
* @param tokenId The tokenId to query.
|
|
182
|
+
* @return The address of the operator for `tokenId`.
|
|
127
183
|
*/
|
|
128
184
|
function getApproved(
|
|
129
185
|
uint256 tokenId
|
|
130
|
-
) public view virtual returns (address) {
|
|
186
|
+
) public view virtual override returns (address) {
|
|
131
187
|
bytes32 tokenIdAsBytes32 = bytes32(tokenId);
|
|
132
188
|
_existsOrError(tokenIdAsBytes32);
|
|
133
189
|
|
|
@@ -147,75 +203,126 @@ abstract contract LSP8CompatibleERC721InitAbstract is
|
|
|
147
203
|
}
|
|
148
204
|
}
|
|
149
205
|
|
|
150
|
-
|
|
151
|
-
* @inheritdoc
|
|
206
|
+
/**
|
|
207
|
+
* @inheritdoc IERC721
|
|
208
|
+
* @notice Checking if address `operator` is approved to transfer any tokenId owned by address `owner`.
|
|
209
|
+
*
|
|
210
|
+
* @dev Compatible with ERC721 isApprovedForAll.
|
|
211
|
+
*
|
|
212
|
+
* @param tokenOwner The tokenOwner address to query.
|
|
213
|
+
* @param operator The operator address to query.
|
|
214
|
+
*
|
|
215
|
+
* @return Returns if the `operator` is allowed to manage all of the assets of `owner`
|
|
152
216
|
*/
|
|
153
217
|
function isApprovedForAll(
|
|
154
218
|
address tokenOwner,
|
|
155
219
|
address operator
|
|
156
|
-
) public view virtual returns (bool) {
|
|
220
|
+
) public view virtual override returns (bool) {
|
|
157
221
|
return _operatorApprovals[tokenOwner][operator];
|
|
158
222
|
}
|
|
159
223
|
|
|
160
224
|
/**
|
|
161
|
-
* @inheritdoc
|
|
225
|
+
* @inheritdoc IERC721
|
|
226
|
+
* @notice Calling `approve` function to approve operator at address `operator` to transfer tokenId `tokenId` on behalf of its owner.
|
|
227
|
+
*
|
|
228
|
+
* @dev Approval function compatible with ERC721 `approve(address,uint256)`.
|
|
229
|
+
*
|
|
230
|
+
* @param operator The address to approve for `tokenId`.
|
|
231
|
+
* @param tokenId The tokenId to approve.
|
|
162
232
|
*/
|
|
163
|
-
function approve(
|
|
233
|
+
function approve(
|
|
234
|
+
address operator,
|
|
235
|
+
uint256 tokenId
|
|
236
|
+
) public virtual override {
|
|
164
237
|
authorizeOperator(operator, bytes32(tokenId), "");
|
|
165
238
|
emit Approval(tokenOwnerOf(bytes32(tokenId)), operator, tokenId);
|
|
166
239
|
}
|
|
167
240
|
|
|
168
241
|
/**
|
|
169
|
-
* @
|
|
242
|
+
* @inheritdoc IERC721
|
|
243
|
+
* @notice Setting the "approval for all" status of operator `_operator` to `_approved` to allow it to transfer any tokenIds on behalf of `msg.sender`.
|
|
244
|
+
*
|
|
245
|
+
* @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.
|
|
246
|
+
* See {_setApprovalForAll}
|
|
247
|
+
*
|
|
248
|
+
* @param operator Address to add to the set of authorized operators.
|
|
249
|
+
* @param approved True if the operator is approved, false to revoke approval.
|
|
250
|
+
*
|
|
251
|
+
* @custom:events {ApprovalForAll} event
|
|
170
252
|
*/
|
|
171
|
-
function setApprovalForAll(
|
|
253
|
+
function setApprovalForAll(
|
|
254
|
+
address operator,
|
|
255
|
+
bool approved
|
|
256
|
+
) public virtual override {
|
|
172
257
|
_setApprovalForAll(msg.sender, operator, approved);
|
|
173
258
|
}
|
|
174
259
|
|
|
175
260
|
/**
|
|
176
|
-
* @inheritdoc
|
|
261
|
+
* @inheritdoc IERC721
|
|
262
|
+
* @notice Calling `transferFrom` function to transfer tokenId `tokenId` from address `from` to address `to`.
|
|
177
263
|
*
|
|
178
|
-
* @
|
|
264
|
+
* @dev Transfer functions from the ERC721 standard interface.
|
|
265
|
+
*
|
|
266
|
+
* @param from The sending address.
|
|
267
|
+
* @param to The receiving address.
|
|
268
|
+
* @param tokenId The tokenId to transfer.
|
|
269
|
+
*
|
|
270
|
+
* @custom:info This function sets the `force` parameter to `true` so that EOAs and any contract can receive the `tokenId`.
|
|
179
271
|
*/
|
|
180
272
|
function transferFrom(
|
|
181
273
|
address from,
|
|
182
274
|
address to,
|
|
183
275
|
uint256 tokenId
|
|
184
|
-
) public virtual {
|
|
276
|
+
) public virtual override {
|
|
185
277
|
_transfer(from, to, bytes32(tokenId), true, "");
|
|
186
278
|
}
|
|
187
279
|
|
|
188
280
|
/**
|
|
189
|
-
* @inheritdoc
|
|
281
|
+
* @inheritdoc IERC721
|
|
282
|
+
* @notice Calling `safeTransferFrom` function to transfer tokenId `tokenId` from address `from` to address `to`.
|
|
283
|
+
*
|
|
284
|
+
* @dev Safe Transfer function without optional data from the ERC721 standard interface.
|
|
285
|
+
*
|
|
286
|
+
* @param from The sending address.
|
|
287
|
+
* @param to The receiving address.
|
|
288
|
+
* @param tokenId The tokenId to transfer.
|
|
190
289
|
*
|
|
191
|
-
* @custom:info This function sets the `
|
|
290
|
+
* @custom:info This function sets the `force` parameter to `true` so that EOAs and any contract can receive the `tokenId`.
|
|
192
291
|
*/
|
|
193
292
|
function safeTransferFrom(
|
|
194
293
|
address from,
|
|
195
294
|
address to,
|
|
196
295
|
uint256 tokenId
|
|
197
|
-
) public virtual {
|
|
296
|
+
) public virtual override {
|
|
198
297
|
_safeTransfer(from, to, tokenId, "");
|
|
199
298
|
}
|
|
200
299
|
|
|
201
300
|
/**
|
|
202
|
-
* @inheritdoc
|
|
301
|
+
* @inheritdoc IERC721
|
|
302
|
+
* @notice Calling `safeTransferFrom` function with `data` to transfer tokenId `tokenId` from address `from` to address `to`.
|
|
203
303
|
*
|
|
204
|
-
* @
|
|
304
|
+
* @dev Safe Transfer function with optional data from the ERC721 standard interface.
|
|
305
|
+
*
|
|
306
|
+
* @param from The sending address.
|
|
307
|
+
* @param to The receiving address.
|
|
308
|
+
* @param tokenId The tokenId to transfer.
|
|
309
|
+
* @param data The data to be sent with the transfer.
|
|
310
|
+
*
|
|
311
|
+
* @custom:info This function sets the `force` parameter to `true` so that EOAs and any contract can receive the `tokenId`.
|
|
205
312
|
*/
|
|
206
313
|
function safeTransferFrom(
|
|
207
314
|
address from,
|
|
208
315
|
address to,
|
|
209
316
|
uint256 tokenId,
|
|
210
317
|
bytes memory data
|
|
211
|
-
) public virtual {
|
|
318
|
+
) public virtual override {
|
|
212
319
|
_safeTransfer(from, to, tokenId, data);
|
|
213
320
|
}
|
|
214
321
|
|
|
215
322
|
// --- Overrides
|
|
216
323
|
|
|
217
324
|
/**
|
|
218
|
-
* @inheritdoc
|
|
325
|
+
* @inheritdoc LSP8IdentifiableDigitalAssetCore
|
|
219
326
|
*
|
|
220
327
|
* @custom:events
|
|
221
328
|
* - LSP7 {AuthorizedOperator} event.
|
|
@@ -225,14 +332,7 @@ abstract contract LSP8CompatibleERC721InitAbstract is
|
|
|
225
332
|
address operator,
|
|
226
333
|
bytes32 tokenId,
|
|
227
334
|
bytes memory operatorNotificationData
|
|
228
|
-
)
|
|
229
|
-
public
|
|
230
|
-
virtual
|
|
231
|
-
override(
|
|
232
|
-
ILSP8IdentifiableDigitalAsset,
|
|
233
|
-
LSP8IdentifiableDigitalAssetCore
|
|
234
|
-
)
|
|
235
|
-
{
|
|
335
|
+
) public virtual override {
|
|
236
336
|
address tokenOwner = tokenOwnerOf(tokenId);
|
|
237
337
|
|
|
238
338
|
if (
|
|
@@ -266,7 +366,10 @@ abstract contract LSP8CompatibleERC721InitAbstract is
|
|
|
266
366
|
tokenId,
|
|
267
367
|
operatorNotificationData
|
|
268
368
|
);
|
|
269
|
-
|
|
369
|
+
operator.tryNotifyUniversalReceiver(
|
|
370
|
+
_TYPEID_LSP8_TOKENOPERATOR,
|
|
371
|
+
lsp1Data
|
|
372
|
+
);
|
|
270
373
|
}
|
|
271
374
|
|
|
272
375
|
/**
|
|
@@ -280,20 +383,18 @@ abstract contract LSP8CompatibleERC721InitAbstract is
|
|
|
280
383
|
address from,
|
|
281
384
|
address to,
|
|
282
385
|
bytes32 tokenId,
|
|
283
|
-
bool
|
|
386
|
+
bool force,
|
|
284
387
|
bytes memory data
|
|
285
388
|
) internal virtual override {
|
|
286
|
-
address operator = msg.sender;
|
|
287
|
-
|
|
288
389
|
if (
|
|
289
|
-
!isApprovedForAll(from,
|
|
290
|
-
!_isOperatorOrOwner(
|
|
390
|
+
!isApprovedForAll(from, msg.sender) &&
|
|
391
|
+
!_isOperatorOrOwner(msg.sender, tokenId)
|
|
291
392
|
) {
|
|
292
|
-
revert LSP8NotTokenOperator(tokenId,
|
|
393
|
+
revert LSP8NotTokenOperator(tokenId, msg.sender);
|
|
293
394
|
}
|
|
294
395
|
|
|
295
396
|
emit Transfer(from, to, uint256(tokenId));
|
|
296
|
-
super._transfer(from, to, tokenId,
|
|
397
|
+
super._transfer(from, to, tokenId, force, data);
|
|
297
398
|
}
|
|
298
399
|
|
|
299
400
|
/**
|
|
@@ -324,11 +425,11 @@ abstract contract LSP8CompatibleERC721InitAbstract is
|
|
|
324
425
|
function _mint(
|
|
325
426
|
address to,
|
|
326
427
|
bytes32 tokenId,
|
|
327
|
-
bool
|
|
428
|
+
bool force,
|
|
328
429
|
bytes memory data
|
|
329
430
|
) internal virtual override {
|
|
330
431
|
emit Transfer(address(0), to, uint256(tokenId));
|
|
331
|
-
super._mint(to, tokenId,
|
|
432
|
+
super._mint(to, tokenId, force, data);
|
|
332
433
|
}
|
|
333
434
|
|
|
334
435
|
/**
|
|
@@ -349,7 +450,7 @@ abstract contract LSP8CompatibleERC721InitAbstract is
|
|
|
349
450
|
}
|
|
350
451
|
|
|
351
452
|
/**
|
|
352
|
-
* @dev Approve `operator` to operate on all tokens of `tokensOwner
|
|
453
|
+
* @dev Approve `operator` to operate on all tokens of `tokensOwner`.
|
|
353
454
|
*
|
|
354
455
|
* @custom:events {ApprovalForAll} event.
|
|
355
456
|
*/
|
|
@@ -409,18 +510,4 @@ abstract contract LSP8CompatibleERC721InitAbstract is
|
|
|
409
510
|
}
|
|
410
511
|
}
|
|
411
512
|
}
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* @inheritdoc LSP4DigitalAssetMetadataInitAbstract
|
|
415
|
-
*/
|
|
416
|
-
function _setData(
|
|
417
|
-
bytes32 key,
|
|
418
|
-
bytes memory value
|
|
419
|
-
)
|
|
420
|
-
internal
|
|
421
|
-
virtual
|
|
422
|
-
override(LSP4DigitalAssetMetadataInitAbstract, ERC725YCore)
|
|
423
|
-
{
|
|
424
|
-
super._setData(key, value);
|
|
425
|
-
}
|
|
426
513
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
|
|
3
3
|
pragma solidity ^0.8.4;
|
|
4
4
|
|
|
5
5
|
// modules
|
|
6
6
|
import {
|
|
7
|
-
LSP8IdentifiableDigitalAsset
|
|
8
|
-
} from "../LSP8IdentifiableDigitalAsset.sol";
|
|
9
|
-
import {
|
|
7
|
+
LSP8IdentifiableDigitalAsset,
|
|
10
8
|
LSP8IdentifiableDigitalAssetCore
|
|
11
|
-
} from "../
|
|
9
|
+
} from "../LSP8IdentifiableDigitalAsset.sol";
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
12
|
* @dev LSP8 extension that enables to enumerate over all the `tokenIds` ever minted.
|
|
@@ -39,11 +37,13 @@ abstract contract LSP8Enumerable is LSP8IdentifiableDigitalAsset {
|
|
|
39
37
|
* @param from The address sending the `tokenId` (`address(0)` when `tokenId` is being minted).
|
|
40
38
|
* @param to The address receiving the `tokenId` (`address(0)` when `tokenId` is being burnt).
|
|
41
39
|
* @param tokenId The bytes32 identifier of the token being transferred.
|
|
40
|
+
* @param data The data sent alongside the the token transfer.
|
|
42
41
|
*/
|
|
43
42
|
function _beforeTokenTransfer(
|
|
44
43
|
address from,
|
|
45
44
|
address to,
|
|
46
|
-
bytes32 tokenId
|
|
45
|
+
bytes32 tokenId,
|
|
46
|
+
bytes memory data
|
|
47
47
|
) internal virtual override(LSP8IdentifiableDigitalAssetCore) {
|
|
48
48
|
// `tokenId` being minted
|
|
49
49
|
if (from == address(0)) {
|
|
@@ -65,6 +65,6 @@ abstract contract LSP8Enumerable is LSP8IdentifiableDigitalAsset {
|
|
|
65
65
|
delete _tokenIndex[tokenId];
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
super._beforeTokenTransfer(from, to, tokenId);
|
|
68
|
+
super._beforeTokenTransfer(from, to, tokenId, data);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
|
|
3
3
|
pragma solidity ^0.8.4;
|
|
4
4
|
|
|
5
5
|
// modules
|
|
6
6
|
import {
|
|
7
|
-
LSP8IdentifiableDigitalAssetInitAbstract
|
|
8
|
-
} from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
|
|
9
|
-
import {
|
|
7
|
+
LSP8IdentifiableDigitalAssetInitAbstract,
|
|
10
8
|
LSP8IdentifiableDigitalAssetCore
|
|
11
|
-
} from "../
|
|
9
|
+
} from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
12
|
* @dev LSP8 extension.
|
|
@@ -39,11 +37,13 @@ abstract contract LSP8EnumerableInitAbstract is
|
|
|
39
37
|
* @param from The address sending the `tokenId` (`address(0)` when `tokenId` is being minted).
|
|
40
38
|
* @param to The address receiving the `tokenId` (`address(0)` when `tokenId` is being burnt).
|
|
41
39
|
* @param tokenId The bytes32 identifier of the token being transferred.
|
|
40
|
+
* @param data The data sent alongside the the token transfer.
|
|
42
41
|
*/
|
|
43
42
|
function _beforeTokenTransfer(
|
|
44
43
|
address from,
|
|
45
44
|
address to,
|
|
46
|
-
bytes32 tokenId
|
|
45
|
+
bytes32 tokenId,
|
|
46
|
+
bytes memory data
|
|
47
47
|
) internal virtual override(LSP8IdentifiableDigitalAssetCore) {
|
|
48
48
|
if (from == address(0)) {
|
|
49
49
|
uint256 index = totalSupply();
|
|
@@ -60,6 +60,6 @@ abstract contract LSP8EnumerableInitAbstract is
|
|
|
60
60
|
delete _indexToken[lastIndex];
|
|
61
61
|
delete _tokenIndex[tokenId];
|
|
62
62
|
}
|
|
63
|
-
super._beforeTokenTransfer(from, to, tokenId);
|
|
63
|
+
super._beforeTokenTransfer(from, to, tokenId, data);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
|
|
3
3
|
pragma solidity ^0.8.4;
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ interface ILSP8Mintable is ILSP8IdentifiableDigitalAsset {
|
|
|
14
14
|
/**
|
|
15
15
|
* @param to The address to mint tokens
|
|
16
16
|
* @param tokenId The tokenId to mint
|
|
17
|
-
* @param
|
|
17
|
+
* @param force When set to TRUE, to may be any address but
|
|
18
18
|
* when set to FALSE to must be a contract that supports LSP1 UniversalReceiver
|
|
19
19
|
* @param data Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses.
|
|
20
20
|
* @dev Mints `amount` tokens and transfers it to `to`.
|
|
@@ -28,7 +28,7 @@ interface ILSP8Mintable is ILSP8IdentifiableDigitalAsset {
|
|
|
28
28
|
function mint(
|
|
29
29
|
address to,
|
|
30
30
|
bytes32 tokenId,
|
|
31
|
-
bool
|
|
31
|
+
bool force,
|
|
32
32
|
bytes memory data
|
|
33
33
|
) external;
|
|
34
34
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.12;
|
|
3
3
|
|
|
4
4
|
import {LSP8CompatibleERC721} from "../extensions/LSP8CompatibleERC721.sol";
|
|
@@ -18,25 +18,26 @@ contract LSP8CompatibleERC721Mintable is LSP8CompatibleERC721 {
|
|
|
18
18
|
constructor(
|
|
19
19
|
string memory name_,
|
|
20
20
|
string memory symbol_,
|
|
21
|
-
address newOwner_
|
|
22
|
-
|
|
21
|
+
address newOwner_,
|
|
22
|
+
uint256 tokenIdType_
|
|
23
|
+
) LSP8CompatibleERC721(name_, symbol_, newOwner_, tokenIdType_) {}
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
|
-
* @notice Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `
|
|
26
|
+
* @notice Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `force`).
|
|
26
27
|
*
|
|
27
28
|
* @dev Public {_mint} function only callable by the {owner}.
|
|
28
29
|
*
|
|
29
30
|
* @param to The address that will receive the minted `tokenId`.
|
|
30
31
|
* @param tokenId The tokenId to mint.
|
|
31
|
-
* @param
|
|
32
|
+
* @param force Set to `false` to ensure that you are minting for a recipient that implements LSP1, `false` otherwise for forcing the minting.
|
|
32
33
|
* @param data Any addition data to be sent alongside the minting.
|
|
33
34
|
*/
|
|
34
35
|
function mint(
|
|
35
36
|
address to,
|
|
36
37
|
bytes32 tokenId,
|
|
37
|
-
bool
|
|
38
|
+
bool force,
|
|
38
39
|
bytes memory data
|
|
39
40
|
) public virtual onlyOwner {
|
|
40
|
-
_mint(to, tokenId,
|
|
41
|
+
_mint(to, tokenId, force, data);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.12;
|
|
3
3
|
|
|
4
4
|
// modules
|
|
@@ -30,12 +30,14 @@ contract LSP8CompatibleERC721MintableInit is
|
|
|
30
30
|
function initialize(
|
|
31
31
|
string memory name_,
|
|
32
32
|
string memory symbol_,
|
|
33
|
-
address newOwner_
|
|
33
|
+
address newOwner_,
|
|
34
|
+
uint256 tokenIdType_
|
|
34
35
|
) external virtual initializer {
|
|
35
36
|
LSP8CompatibleERC721MintableInitAbstract._initialize(
|
|
36
37
|
name_,
|
|
37
38
|
symbol_,
|
|
38
|
-
newOwner_
|
|
39
|
+
newOwner_,
|
|
40
|
+
tokenIdType_
|
|
39
41
|
);
|
|
40
42
|
}
|
|
41
43
|
}
|
package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.12;
|
|
3
3
|
|
|
4
4
|
// modules
|
|
@@ -18,27 +18,33 @@ contract LSP8CompatibleERC721MintableInitAbstract is
|
|
|
18
18
|
function _initialize(
|
|
19
19
|
string memory name_,
|
|
20
20
|
string memory symbol_,
|
|
21
|
-
address newOwner_
|
|
21
|
+
address newOwner_,
|
|
22
|
+
uint256 tokenIdType_
|
|
22
23
|
) internal virtual override onlyInitializing {
|
|
23
|
-
LSP8CompatibleERC721InitAbstract._initialize(
|
|
24
|
+
LSP8CompatibleERC721InitAbstract._initialize(
|
|
25
|
+
name_,
|
|
26
|
+
symbol_,
|
|
27
|
+
newOwner_,
|
|
28
|
+
tokenIdType_
|
|
29
|
+
);
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
/**
|
|
27
|
-
* @notice Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `
|
|
33
|
+
* @notice Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `force`).
|
|
28
34
|
*
|
|
29
35
|
* @dev Public {_mint} function only callable by the {owner}.
|
|
30
36
|
*
|
|
31
37
|
* @param to The address that will receive the minted `tokenId`.
|
|
32
38
|
* @param tokenId The tokenId to mint.
|
|
33
|
-
* @param
|
|
39
|
+
* @param force Set to `false` to ensure that you are minting for a recipient that implements LSP1, `false` otherwise for forcing the minting.
|
|
34
40
|
* @param data Any addition data to be sent alongside the minting.
|
|
35
41
|
*/
|
|
36
42
|
function mint(
|
|
37
43
|
address to,
|
|
38
44
|
bytes32 tokenId,
|
|
39
|
-
bool
|
|
45
|
+
bool force,
|
|
40
46
|
bytes memory data
|
|
41
47
|
) public virtual onlyOwner {
|
|
42
|
-
_mint(to, tokenId,
|
|
48
|
+
_mint(to, tokenId, force, data);
|
|
43
49
|
}
|
|
44
50
|
}
|