@lukso/lsp-smart-contracts 0.5.0 → 0.6.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 +29 -9
- package/artifacts/LSP0ERC725Account.json +392 -0
- package/artifacts/LSP0ERC725AccountInit.json +433 -0
- package/artifacts/LSP1UniversalReceiverDelegateUP.json +2 -7
- package/artifacts/LSP1UniversalReceiverDelegateVault.json +2 -7
- package/artifacts/LSP4Compatibility.json +195 -0
- package/artifacts/LSP4DigitalAssetMetadata.json +169 -0
- package/artifacts/LSP4DigitalAssetMetadataInit.json +231 -0
- package/artifacts/LSP6KeyManager.json +34 -28
- package/artifacts/LSP6KeyManagerInit.json +42 -23
- package/artifacts/LSP7CappedSupply.json +133 -8
- package/artifacts/LSP7CappedSupplyInit.json +160 -32
- package/artifacts/LSP7CompatibilityForERC20.json +125 -10
- package/artifacts/LSP7CompatibilityForERC20Init.json +727 -0
- package/artifacts/LSP7DigitalAsset.json +125 -10
- package/artifacts/LSP7DigitalAssetInit.json +149 -31
- package/artifacts/LSP7Mintable.json +126 -11
- package/artifacts/LSP7MintableInit.json +150 -32
- package/artifacts/LSP8CappedSupply.json +134 -8
- package/artifacts/LSP8CappedSupplyInit.json +169 -17
- package/artifacts/LSP8CompatibilityForERC721.json +126 -10
- package/artifacts/LSP8CompatibilityForERC721Init.json +873 -0
- package/artifacts/LSP8IdentifiableDigitalAsset.json +126 -10
- package/artifacts/LSP8IdentifiableDigitalAssetInit.json +158 -16
- package/artifacts/LSP8Mintable.json +138 -11
- package/artifacts/LSP8MintableInit.json +170 -17
- package/artifacts/LSP9Vault.json +368 -0
- package/artifacts/LSP9VaultInit.json +409 -0
- package/artifacts/UniversalFactory.json +127 -0
- package/artifacts/UniversalProfile.json +65 -14
- package/artifacts/UniversalProfileInit.json +104 -14
- package/artifacts/UniversalReceiverAddressStore.json +204 -0
- package/constants.js +352 -0
- package/contracts/Custom/ClaimOwnership.sol +31 -0
- package/contracts/Custom/ERC165Checker.sol +130 -0
- package/contracts/Custom/IClaimOwnership.sol +10 -0
- package/contracts/Factories/UniversalFactory.sol +155 -0
- package/contracts/LSP0ERC725Account/LSP0Constants.sol +5 -9
- package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +6 -8
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +89 -46
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +5 -5
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +6 -21
- package/contracts/LSP10ReceivedVaults/LSP10Constants.sol +10 -0
- package/contracts/LSP1UniversalReceiver/LSP1Constants.sol +2 -8
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/Handling/TokenAndVaultHandling.sol +59 -185
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +48 -6
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/Handling/TokenHandling.sol +45 -92
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +39 -6
- package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +47 -0
- package/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +205 -0
- package/contracts/LSP3UniversalProfile/LSP3Constants.sol +11 -0
- package/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +1 -1
- package/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +5 -14
- package/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +10 -4
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +11 -8
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInit.sol +9 -13
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +14 -20
- package/contracts/LSP5ReceivedAssets/LSP5Constants.sol +10 -0
- package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +157 -0
- package/contracts/LSP6KeyManager/ILSP6KeyManager.sol +21 -18
- package/contracts/LSP6KeyManager/LSP6Constants.sol +61 -25
- package/contracts/LSP6KeyManager/LSP6Errors.sol +37 -0
- package/contracts/LSP6KeyManager/LSP6KeyManager.sol +3 -4
- package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +429 -332
- package/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +6 -5
- package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +7 -15
- package/contracts/LSP6KeyManager/LSP6Utils.sol +111 -0
- package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +3 -8
- package/contracts/LSP7DigitalAsset/LSP7Constants.sol +5 -4
- package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +23 -9
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +70 -94
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInit.sol +8 -9
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +25 -23
- package/contracts/LSP7DigitalAsset/LSP7Errors.sol +23 -0
- package/contracts/LSP7DigitalAsset/extensions/ILSP7CappedSupply.sol +1 -1
- package/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibilityForERC20.sol +2 -4
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +8 -7
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyCore.sol +14 -12
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInit.sol +3 -8
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +9 -17
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibilityForERC20.sol +33 -21
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibilityForERC20Core.sol +20 -39
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibilityForERC20Init.sol +3 -3
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibilityForERC20InitAbstract.sol +39 -28
- package/contracts/LSP7DigitalAsset/{extensions → presets}/ILSP7Mintable.sol +1 -1
- package/contracts/LSP7DigitalAsset/{extensions → presets}/LSP7Mintable.sol +4 -3
- package/contracts/LSP7DigitalAsset/{extensions → presets}/LSP7MintableCore.sol +5 -5
- package/contracts/LSP7DigitalAsset/{extensions → presets}/LSP7MintableInit.sol +3 -2
- package/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +34 -0
- package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +5 -16
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +6 -3
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +22 -0
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +23 -10
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +102 -135
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInit.sol +8 -11
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +24 -21
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CappedSupply.sol +1 -1
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibilityForERC721.sol +3 -11
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +9 -15
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyCore.sol +14 -12
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInit.sol +3 -8
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +11 -20
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibilityForERC721.sol +41 -33
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibilityForERC721Core.sol +27 -84
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibilityForERC721Init.sol +4 -6
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibilityForERC721InitAbstract.sol +40 -41
- package/contracts/LSP8IdentifiableDigitalAsset/{extensions → presets}/ILSP8Mintable.sol +1 -1
- package/contracts/LSP8IdentifiableDigitalAsset/{extensions → presets}/LSP8Mintable.sol +4 -3
- package/contracts/LSP8IdentifiableDigitalAsset/{extensions → presets}/LSP8MintableCore.sol +5 -8
- package/contracts/LSP8IdentifiableDigitalAsset/{extensions → presets}/LSP8MintableInit.sol +4 -3
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +35 -0
- package/contracts/LSP9Vault/LSP9Constants.sol +13 -4
- package/contracts/LSP9Vault/LSP9Vault.sol +15 -37
- package/contracts/LSP9Vault/LSP9VaultCore.sol +101 -82
- package/contracts/LSP9Vault/LSP9VaultInit.sol +5 -4
- package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +15 -45
- package/contracts/Legacy/Registries/AddressRegistry.sol +43 -0
- package/contracts/Legacy/Registries/AddressRegistryRequiresERC725.sol +33 -0
- package/contracts/Legacy/UniversalReceiverAddressStore.sol +59 -0
- package/contracts/UniversalProfile.sol +10 -5
- package/contracts/UniversalProfileInit.sol +5 -4
- package/contracts/UniversalProfileInitAbstract.sol +14 -20
- package/contracts/Utils/UtilsLib.sol +47 -11
- package/package.json +23 -9
- package/artifacts/LSP1UniversalReceiverDelegateUPInit.json +0 -66
- package/artifacts/LSP1UniversalReceiverDelegateVaultInit.json +0 -66
- package/constants.ts +0 -356
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUPCore.sol +0 -52
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUPInit.sol +0 -26
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUPInitAbstract.sol +0 -28
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVaultCore.sol +0 -41
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVaultInit.sol +0 -23
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVaultInitAbstract.sol +0 -25
- package/contracts/LSP7DigitalAsset/extensions/LSP7MintableInitAbstract.sol +0 -47
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8MintableInitAbstract.sol +0 -44
- package/contracts/Utils/ERC725Utils.sol +0 -169
- package/contracts/Utils/LSP2Utils.sol +0 -127
- package/contracts/Utils/LSP6Utils.sol +0 -63
|
@@ -1,114 +1,67 @@
|
|
|
1
1
|
// SPDX-License-Identifier: CC0-1.0
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
// modules
|
|
5
|
-
import "@erc725/smart-contracts/contracts/ERC725Y.sol";
|
|
6
|
-
|
|
7
4
|
// interfaces
|
|
8
|
-
import "
|
|
5
|
+
import {IERC725Y} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
|
|
6
|
+
import {ILSP7DigitalAsset} from "../../../LSP7DigitalAsset/ILSP7DigitalAsset.sol";
|
|
9
7
|
|
|
10
8
|
// libraries
|
|
11
|
-
import "../../../
|
|
9
|
+
import {ERC165Checker} from "../../../Custom/ERC165Checker.sol";
|
|
10
|
+
import {LSP1Utils} from "../../LSP1Utils.sol";
|
|
11
|
+
import {LSP2Utils} from "../../../LSP2ERC725YJSONSchema/LSP2Utils.sol";
|
|
12
|
+
import {LSP5Utils} from "../../../LSP5ReceivedAssets/LSP5Utils.sol";
|
|
13
|
+
|
|
14
|
+
// modules
|
|
15
|
+
import {ERC725Y} from "@erc725/smart-contracts/contracts/ERC725Y.sol";
|
|
16
|
+
import {LSP6KeyManager} from "../../../LSP6KeyManager/LSP6KeyManager.sol";
|
|
12
17
|
|
|
13
18
|
// constants
|
|
14
19
|
import "../../LSP1Constants.sol";
|
|
15
|
-
import "../../../LSP7DigitalAsset/LSP7Constants.sol";
|
|
16
|
-
import "../../../LSP8IdentifiableDigitalAsset/LSP8Constants.sol";
|
|
17
20
|
import "../../../LSP9Vault/LSP9Constants.sol";
|
|
18
21
|
|
|
19
22
|
/**
|
|
20
|
-
* @dev Function logic to add and remove the MapAndArrayKey of incoming assets
|
|
23
|
+
* @dev Function logic to add and remove the MapAndArrayKey of incoming assets and vaults
|
|
21
24
|
*/
|
|
22
|
-
abstract contract
|
|
23
|
-
|
|
25
|
+
abstract contract TokenHandling {
|
|
26
|
+
// internal functions
|
|
27
|
+
function _tokenHandling(address sender, bytes32 typeId) internal returns (bytes memory result) {
|
|
28
|
+
if (sender.code.length == 0) return "";
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
address sender,
|
|
27
|
-
bytes32 typeId,
|
|
28
|
-
bytes memory data
|
|
29
|
-
) internal returns (bytes memory) {
|
|
30
|
-
(
|
|
31
|
-
bytes32 arrayKey,
|
|
32
|
-
bytes32 mapHash,
|
|
33
|
-
bytes4 interfaceId
|
|
34
|
-
) = _getTransferData(typeId);
|
|
35
|
-
bytes32 mapKey = ERC725Utils.generateMapKey(
|
|
36
|
-
mapHash,
|
|
37
|
-
abi.encodePacked(sender)
|
|
38
|
-
);
|
|
39
|
-
IERC725Y vault = IERC725Y(msg.sender);
|
|
40
|
-
bytes memory mapValue = vault.getDataSingle(mapKey);
|
|
30
|
+
if (!ERC165Checker.supportsERC165Interface(msg.sender, _INTERFACEID_LSP9)) return "";
|
|
41
31
|
|
|
42
|
-
|
|
43
|
-
typeId
|
|
44
|
-
typeId == _TYPEID_LSP8_TOKENSRECIPIENT
|
|
45
|
-
) {
|
|
46
|
-
if (bytes12(mapValue) == bytes12(0)) {
|
|
47
|
-
(bytes32[] memory keys, bytes[] memory values) = ERC725Utils
|
|
48
|
-
.addMapAndArrayKey(
|
|
49
|
-
vault,
|
|
50
|
-
arrayKey,
|
|
51
|
-
mapKey,
|
|
52
|
-
sender,
|
|
53
|
-
interfaceId
|
|
54
|
-
);
|
|
32
|
+
(bool senderHook, bytes32 arrayKey, bytes12 mapPrefix, bytes4 interfaceID) = LSP1Utils
|
|
33
|
+
.getTransferDetails(typeId);
|
|
55
34
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
} else if (
|
|
59
|
-
typeId == _TYPEID_LSP7_TOKENSSENDER ||
|
|
60
|
-
typeId == _TYPEID_LSP8_TOKENSSENDER
|
|
61
|
-
) {
|
|
62
|
-
if (bytes12(mapValue) != bytes12(0)) {
|
|
63
|
-
uint256 balance = ILSP7DigitalAsset(sender).balanceOf(
|
|
64
|
-
msg.sender
|
|
65
|
-
);
|
|
66
|
-
if ((balance - _tokenAmount(typeId, data)) == 0) {
|
|
67
|
-
(bytes32[] memory keys, bytes[] memory values) = ERC725Utils
|
|
68
|
-
.removeMapAndArrayKey(vault, arrayKey, mapHash, mapKey);
|
|
35
|
+
bytes32 mapKey = LSP2Utils.generateMappingKey(mapPrefix, bytes20(sender));
|
|
36
|
+
bytes memory mapValue = IERC725Y(msg.sender).getData(mapKey);
|
|
69
37
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// helper functions
|
|
38
|
+
if (!senderHook) {
|
|
39
|
+
// if the map is already set, then do nothing
|
|
40
|
+
if (bytes12(mapValue) != bytes12(0)) return "";
|
|
77
41
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
) {
|
|
93
|
-
interfaceID = _INTERFACEID_LSP7;
|
|
94
|
-
} else {
|
|
95
|
-
interfaceID = _INTERFACEID_LSP8;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
42
|
+
(bytes32[] memory keys, bytes[] memory values) = LSP5Utils.addMapAndArrayKey(
|
|
43
|
+
IERC725Y(msg.sender),
|
|
44
|
+
arrayKey,
|
|
45
|
+
mapKey,
|
|
46
|
+
sender,
|
|
47
|
+
interfaceID
|
|
48
|
+
);
|
|
49
|
+
IERC725Y(msg.sender).setData(keys, values);
|
|
50
|
+
} else if (senderHook) {
|
|
51
|
+
// if there is no map for the asset to remove, then do nothing
|
|
52
|
+
if (bytes12(mapValue) == bytes12(0)) return "";
|
|
53
|
+
uint256 balance = ILSP7DigitalAsset(sender).balanceOf(msg.sender);
|
|
54
|
+
// if the amount sent is not the full balance, then do nothing
|
|
55
|
+
if (balance != 0) return "";
|
|
98
56
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
amount := mload(add(add(_data, 0x20), 0x28))
|
|
108
|
-
}
|
|
109
|
-
/* solhint-enable */
|
|
110
|
-
} else {
|
|
111
|
-
amount = 1;
|
|
57
|
+
(bytes32[] memory keys, bytes[] memory values) = LSP5Utils.removeMapAndArrayKey(
|
|
58
|
+
IERC725Y(msg.sender),
|
|
59
|
+
arrayKey,
|
|
60
|
+
mapPrefix,
|
|
61
|
+
mapKey,
|
|
62
|
+
mapValue
|
|
63
|
+
);
|
|
64
|
+
IERC725Y(msg.sender).setData(keys, values);
|
|
112
65
|
}
|
|
113
66
|
}
|
|
114
67
|
}
|
|
@@ -1,23 +1,56 @@
|
|
|
1
1
|
// SPDX-License-Identifier: CC0-1.0
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
+
// interfaces
|
|
5
|
+
import {ILSP1UniversalReceiverDelegate} from "../ILSP1UniversalReceiverDelegate.sol";
|
|
6
|
+
|
|
4
7
|
// modules
|
|
5
|
-
import "
|
|
8
|
+
import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
9
|
+
import {TokenHandling} from "./Handling/TokenHandling.sol";
|
|
10
|
+
|
|
11
|
+
// constants
|
|
12
|
+
import {_INTERFACEID_LSP1_DELEGATE} from "../LSP1Constants.sol";
|
|
13
|
+
import {_TYPEID_LSP7_TOKENSSENDER, _TYPEID_LSP7_TOKENSRECIPIENT} from "../../LSP7DigitalAsset/LSP7Constants.sol";
|
|
14
|
+
import {_TYPEID_LSP8_TOKENSSENDER, _TYPEID_LSP8_TOKENSRECIPIENT} from "../../LSP8IdentifiableDigitalAsset/LSP8Constants.sol";
|
|
6
15
|
|
|
7
16
|
/**
|
|
8
|
-
* @title Implementation of contract writing the received LSP7 and LSP8 assets into your Vault using
|
|
17
|
+
* @title Core Implementation of contract writing the received LSP7 and LSP8 assets into your Vault using
|
|
9
18
|
* the LSP5-ReceivedAsset standard and removing the sent assets.
|
|
10
19
|
*
|
|
11
20
|
* @author Fabian Vogelsteller, Yamen Merhi, Jean Cavallera
|
|
12
21
|
* @dev Delegate contract of the initial universal receiver
|
|
13
22
|
*/
|
|
14
23
|
contract LSP1UniversalReceiverDelegateVault is
|
|
15
|
-
|
|
24
|
+
ERC165,
|
|
25
|
+
ILSP1UniversalReceiverDelegate,
|
|
26
|
+
TokenHandling
|
|
16
27
|
{
|
|
17
28
|
/**
|
|
18
|
-
* @
|
|
29
|
+
* @inheritdoc ILSP1UniversalReceiverDelegate
|
|
30
|
+
* @dev allows to register arrayKeys and Map of incoming assets and remove after being sent
|
|
31
|
+
* @return result The return value
|
|
32
|
+
*/
|
|
33
|
+
function universalReceiverDelegate(
|
|
34
|
+
address sender,
|
|
35
|
+
bytes32 typeId,
|
|
36
|
+
bytes memory data // solhint-disable no-unused-vars
|
|
37
|
+
) public virtual override returns (bytes memory result) {
|
|
38
|
+
if (
|
|
39
|
+
typeId == _TYPEID_LSP7_TOKENSSENDER ||
|
|
40
|
+
typeId == _TYPEID_LSP7_TOKENSRECIPIENT ||
|
|
41
|
+
typeId == _TYPEID_LSP8_TOKENSSENDER ||
|
|
42
|
+
typeId == _TYPEID_LSP8_TOKENSRECIPIENT
|
|
43
|
+
) {
|
|
44
|
+
result = _tokenHandling(sender, typeId);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// --- Overrides
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @inheritdoc ERC165
|
|
19
52
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
53
|
+
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
|
|
54
|
+
return interfaceId == _INTERFACEID_LSP1_DELEGATE || super.supportsInterface(interfaceId);
|
|
22
55
|
}
|
|
23
56
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
// constants
|
|
5
|
+
import {_LSP5_RECEIVED_ASSETS_ARRAY_KEY, _LSP5_RECEIVED_ASSETS_MAP_KEY_PREFIX} from "../LSP5ReceivedAssets/LSP5Constants.sol";
|
|
6
|
+
import {_INTERFACEID_LSP7, _TYPEID_LSP7_TOKENSSENDER, _TYPEID_LSP7_TOKENSRECIPIENT} from "../LSP7DigitalAsset/LSP7Constants.sol";
|
|
7
|
+
import {_INTERFACEID_LSP8, _TYPEID_LSP8_TOKENSRECIPIENT, _TYPEID_LSP8_TOKENSSENDER} from "../LSP8IdentifiableDigitalAsset/LSP8Constants.sol";
|
|
8
|
+
import {_INTERFACEID_LSP9, _TYPEID_LSP9_VAULTSENDER} from "../LSP9Vault/LSP9Constants.sol";
|
|
9
|
+
import {_LSP10_VAULTS_ARRAY_KEY, _LSP10_VAULTS_MAP_KEY_PREFIX} from "../LSP10ReceivedVaults/LSP10Constants.sol";
|
|
10
|
+
|
|
11
|
+
library LSP1Utils {
|
|
12
|
+
/**
|
|
13
|
+
* @dev Gets all the transfer details depending on the `typeId`
|
|
14
|
+
*/
|
|
15
|
+
function getTransferDetails(bytes32 typeId)
|
|
16
|
+
internal
|
|
17
|
+
pure
|
|
18
|
+
returns (
|
|
19
|
+
bool senderHook,
|
|
20
|
+
bytes32 arrayKey,
|
|
21
|
+
bytes12 mapPrefix,
|
|
22
|
+
bytes4 interfaceId
|
|
23
|
+
)
|
|
24
|
+
{
|
|
25
|
+
if (
|
|
26
|
+
typeId == _TYPEID_LSP7_TOKENSSENDER ||
|
|
27
|
+
typeId == _TYPEID_LSP7_TOKENSRECIPIENT ||
|
|
28
|
+
typeId == _TYPEID_LSP8_TOKENSRECIPIENT ||
|
|
29
|
+
typeId == _TYPEID_LSP8_TOKENSSENDER
|
|
30
|
+
) {
|
|
31
|
+
arrayKey = _LSP5_RECEIVED_ASSETS_ARRAY_KEY;
|
|
32
|
+
mapPrefix = _LSP5_RECEIVED_ASSETS_MAP_KEY_PREFIX;
|
|
33
|
+
interfaceId = typeId == _TYPEID_LSP7_TOKENSSENDER ||
|
|
34
|
+
typeId == _TYPEID_LSP7_TOKENSRECIPIENT
|
|
35
|
+
? _INTERFACEID_LSP7
|
|
36
|
+
: _INTERFACEID_LSP8;
|
|
37
|
+
senderHook = typeId == _TYPEID_LSP7_TOKENSSENDER || typeId == _TYPEID_LSP8_TOKENSSENDER
|
|
38
|
+
? true
|
|
39
|
+
: false;
|
|
40
|
+
} else {
|
|
41
|
+
arrayKey = _LSP10_VAULTS_ARRAY_KEY;
|
|
42
|
+
mapPrefix = _LSP10_VAULTS_MAP_KEY_PREFIX;
|
|
43
|
+
interfaceId = _INTERFACEID_LSP9;
|
|
44
|
+
senderHook = typeId == _TYPEID_LSP9_VAULTSENDER ? true : false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
// libraries
|
|
5
|
+
import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";
|
|
6
|
+
import {UtilsLib} from "../Utils/UtilsLib.sol";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @title ERC725 Utility library to encode key types
|
|
10
|
+
* @author Jean Cavallera (CJ-42)
|
|
11
|
+
* @dev based on LSP2 - ERC725Y JSON Schema
|
|
12
|
+
* https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md
|
|
13
|
+
*/
|
|
14
|
+
library LSP2Utils {
|
|
15
|
+
using BytesLib for bytes;
|
|
16
|
+
|
|
17
|
+
/* solhint-disable no-inline-assembly */
|
|
18
|
+
|
|
19
|
+
function generateBytes32Key(bytes memory _rawKey) internal pure returns (bytes32 key) {
|
|
20
|
+
// solhint-disable-next-line
|
|
21
|
+
assembly {
|
|
22
|
+
key := mload(add(_rawKey, 32))
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function generateSingletonKey(string memory _keyName) internal pure returns (bytes32) {
|
|
27
|
+
return keccak256(bytes(_keyName));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function generateArrayKey(string memory _keyName) internal pure returns (bytes32) {
|
|
31
|
+
bytes memory keyName = bytes(_keyName);
|
|
32
|
+
|
|
33
|
+
// prettier-ignore
|
|
34
|
+
require(
|
|
35
|
+
keyName[keyName.length - 2] == 0x5b && // "[" in utf8 encoded
|
|
36
|
+
keyName[keyName.length - 1] == 0x5d, // "]" in utf8
|
|
37
|
+
"Missing empty square brackets \"[]\" at the end of the key name"
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
return keccak256(keyName);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function generateArrayKeyAtIndex(bytes32 _arrayKey, uint256 _index)
|
|
44
|
+
internal
|
|
45
|
+
pure
|
|
46
|
+
returns (bytes32)
|
|
47
|
+
{
|
|
48
|
+
bytes memory elementInArray = UtilsLib.concatTwoBytes16(
|
|
49
|
+
bytes16(_arrayKey),
|
|
50
|
+
bytes16(uint128(_index))
|
|
51
|
+
);
|
|
52
|
+
return generateBytes32Key(elementInArray);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function generateMappingKey(string memory _firstWord, string memory _lastWord)
|
|
56
|
+
internal
|
|
57
|
+
pure
|
|
58
|
+
returns (bytes32)
|
|
59
|
+
{
|
|
60
|
+
bytes32 firstWordHash = keccak256(bytes(_firstWord));
|
|
61
|
+
bytes32 lastWordHash = keccak256(bytes(_lastWord));
|
|
62
|
+
|
|
63
|
+
bytes memory temporaryBytes = abi.encodePacked(
|
|
64
|
+
bytes10(firstWordHash),
|
|
65
|
+
bytes2(0),
|
|
66
|
+
bytes20(lastWordHash)
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
return generateBytes32Key(temporaryBytes);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function generateMappingKey(string memory _firstWord, address _address)
|
|
73
|
+
internal
|
|
74
|
+
pure
|
|
75
|
+
returns (bytes32)
|
|
76
|
+
{
|
|
77
|
+
bytes32 firstWordHash = keccak256(bytes(_firstWord));
|
|
78
|
+
|
|
79
|
+
bytes memory temporaryBytes = abi.encodePacked(bytes10(firstWordHash), bytes2(0), _address);
|
|
80
|
+
|
|
81
|
+
return generateBytes32Key(temporaryBytes);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function generateMappingKey(bytes12 _keyPrefix, bytes20 _bytes20)
|
|
85
|
+
internal
|
|
86
|
+
pure
|
|
87
|
+
returns (bytes32)
|
|
88
|
+
{
|
|
89
|
+
bytes memory generatedKey = bytes.concat(_keyPrefix, _bytes20);
|
|
90
|
+
return generateBytes32Key(generatedKey);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function generateMappingWithGroupingKey(
|
|
94
|
+
string memory _firstWord,
|
|
95
|
+
string memory _secondWord,
|
|
96
|
+
address _address
|
|
97
|
+
) internal pure returns (bytes32) {
|
|
98
|
+
bytes32 firstWordHash = keccak256(bytes(_firstWord));
|
|
99
|
+
bytes32 secondWordHash = keccak256(bytes(_secondWord));
|
|
100
|
+
|
|
101
|
+
bytes memory temporaryBytes = abi.encodePacked(
|
|
102
|
+
bytes6(firstWordHash),
|
|
103
|
+
bytes4(secondWordHash),
|
|
104
|
+
bytes2(0),
|
|
105
|
+
_address
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
return generateBytes32Key(temporaryBytes);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function generateMappingWithGroupingKey(bytes12 _keyPrefix, bytes20 _bytes20)
|
|
112
|
+
internal
|
|
113
|
+
pure
|
|
114
|
+
returns (bytes32)
|
|
115
|
+
{
|
|
116
|
+
bytes memory generatedKey = bytes.concat(_keyPrefix, _bytes20);
|
|
117
|
+
return generateBytes32Key(generatedKey);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function generateJSONURLValue(
|
|
121
|
+
string memory _hashFunction,
|
|
122
|
+
string memory _json,
|
|
123
|
+
string memory _url
|
|
124
|
+
) internal pure returns (bytes memory key_) {
|
|
125
|
+
bytes32 hashFunctionDigest = keccak256(bytes(_hashFunction));
|
|
126
|
+
bytes32 jsonDigest = keccak256(bytes(_json));
|
|
127
|
+
|
|
128
|
+
key_ = abi.encodePacked(bytes4(hashFunctionDigest), jsonDigest, _url);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function generateASSETURLValue(
|
|
132
|
+
string memory _hashFunction,
|
|
133
|
+
string memory _assetBytes,
|
|
134
|
+
string memory _url
|
|
135
|
+
) internal pure returns (bytes memory key_) {
|
|
136
|
+
bytes32 hashFunctionDigest = keccak256(bytes(_hashFunction));
|
|
137
|
+
bytes32 jsonDigest = keccak256(bytes(_assetBytes));
|
|
138
|
+
|
|
139
|
+
key_ = abi.encodePacked(bytes4(hashFunctionDigest), jsonDigest, _url);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function isEncodedArray(bytes memory _data) internal pure returns (bool) {
|
|
143
|
+
uint256 nbOfBytes = _data.length;
|
|
144
|
+
|
|
145
|
+
// 1) there must be at least 32 bytes to store the offset
|
|
146
|
+
if (nbOfBytes < 32) return false;
|
|
147
|
+
|
|
148
|
+
// 2) there must be at least the same number of bytes specified by
|
|
149
|
+
// the offset value (otherwise, the offset points to nowhere)
|
|
150
|
+
uint256 offset = uint256(bytes32(_data));
|
|
151
|
+
if (nbOfBytes < offset) return false;
|
|
152
|
+
|
|
153
|
+
// 3) there must be at least 32 x length bytes after offset
|
|
154
|
+
uint256 arrayLength = _data.toUint256(offset);
|
|
155
|
+
|
|
156
|
+
// 32 bytes word (= offset)
|
|
157
|
+
// + 32 bytes word (= array length)
|
|
158
|
+
// + remaining bytes that make each element of the array
|
|
159
|
+
if (nbOfBytes < (offset + 32 + (arrayLength * 32))) return false;
|
|
160
|
+
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function isEncodedArrayOfAddresses(bytes memory _data) internal pure returns (bool) {
|
|
165
|
+
if (!isEncodedArray(_data)) return false;
|
|
166
|
+
|
|
167
|
+
uint256 offset = uint256(bytes32(_data));
|
|
168
|
+
uint256 arrayLength = _data.toUint256(offset);
|
|
169
|
+
|
|
170
|
+
uint256 pointer = offset + 32;
|
|
171
|
+
|
|
172
|
+
for (uint256 ii = 0; ii < arrayLength; ii++) {
|
|
173
|
+
bytes32 key = _data.toBytes32(pointer);
|
|
174
|
+
|
|
175
|
+
// check that the leading bytes are zero bytes "00"
|
|
176
|
+
// NB: address type is padded on the left (unlike bytes20 type that is padded on the right)
|
|
177
|
+
if (bytes12(key) != bytes12(0)) return false;
|
|
178
|
+
|
|
179
|
+
// increment the pointer
|
|
180
|
+
pointer += 32;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function isBytes4EncodedArray(bytes memory _data) internal pure returns (bool) {
|
|
187
|
+
if (!isEncodedArray(_data)) return false;
|
|
188
|
+
|
|
189
|
+
uint256 offset = uint256(bytes32(_data));
|
|
190
|
+
uint256 arrayLength = _data.toUint256(offset);
|
|
191
|
+
uint256 pointer = offset + 32;
|
|
192
|
+
|
|
193
|
+
for (uint256 ii = 0; ii < arrayLength; ii++) {
|
|
194
|
+
bytes32 key = _data.toBytes32(pointer);
|
|
195
|
+
|
|
196
|
+
// check that the trailing bytes are zero bytes "00"
|
|
197
|
+
if (uint224(uint256(key)) != 0) return false;
|
|
198
|
+
|
|
199
|
+
// increment the pointer
|
|
200
|
+
pointer += 32;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// SPDX-License-Identifier: CC0-1.0
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
// bytes10(keccak256('SupportedStandard')) + bytes2(0) + bytes20(keccak256('LSP3UniversalProfile'))
|
|
5
|
+
bytes32 constant _LSP3_SUPPORTED_STANDARDS_KEY = 0xeafec4d89fa9619884b60000abe425d64acd861a49b8ddf5c0b6962110481f38;
|
|
6
|
+
|
|
7
|
+
// bytes4(keccak256('LSP3UniversalProfile'))
|
|
8
|
+
bytes constant _LSP3_SUPPORTED_STANDARDS_VALUE = hex"abe425d6";
|
|
9
|
+
|
|
10
|
+
// bytes32(keccak256("LSP3Profile"))
|
|
11
|
+
bytes32 constant _LSP3_PROFILE_KEY = 0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
pragma solidity ^0.8.0;
|
|
4
4
|
|
|
5
5
|
// interfaces
|
|
6
|
-
import "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
|
|
6
|
+
import {IERC725Y} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @dev LSP4 extension, for compatibility with clients & tools that expect ERC20/721.
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
// modules
|
|
5
|
-
import "@erc725/smart-contracts/contracts/ERC725YCore.sol";
|
|
6
|
-
|
|
7
4
|
// interfaces
|
|
8
|
-
import "./ILSP4Compatibility.sol";
|
|
5
|
+
import {ILSP4Compatibility} from "./ILSP4Compatibility.sol";
|
|
9
6
|
|
|
10
|
-
//
|
|
11
|
-
import "
|
|
7
|
+
// modules
|
|
8
|
+
import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol";
|
|
12
9
|
|
|
13
10
|
// constants
|
|
14
11
|
import "./LSP4Constants.sol";
|
|
@@ -26,10 +23,7 @@ abstract contract LSP4Compatibility is ILSP4Compatibility, ERC725YCore {
|
|
|
26
23
|
* @return The name of the token
|
|
27
24
|
*/
|
|
28
25
|
function name() public view virtual override returns (string memory) {
|
|
29
|
-
bytes memory data =
|
|
30
|
-
this,
|
|
31
|
-
_LSP4_METADATA_TOKEN_NAME_KEY
|
|
32
|
-
);
|
|
26
|
+
bytes memory data = _getData(_LSP4_TOKEN_NAME_KEY);
|
|
33
27
|
return string(data);
|
|
34
28
|
}
|
|
35
29
|
|
|
@@ -38,10 +32,7 @@ abstract contract LSP4Compatibility is ILSP4Compatibility, ERC725YCore {
|
|
|
38
32
|
* @return The symbol of the token
|
|
39
33
|
*/
|
|
40
34
|
function symbol() public view virtual override returns (string memory) {
|
|
41
|
-
bytes memory data =
|
|
42
|
-
this,
|
|
43
|
-
_LSP4_METADATA_TOKEN_SYMBOL_KEY
|
|
44
|
-
);
|
|
35
|
+
bytes memory data = _getData(_LSP4_TOKEN_SYMBOL_KEY);
|
|
45
36
|
return string(data);
|
|
46
37
|
}
|
|
47
38
|
}
|
|
@@ -3,17 +3,23 @@ pragma solidity ^0.8.0;
|
|
|
3
3
|
|
|
4
4
|
// --- ERC725Y entries
|
|
5
5
|
|
|
6
|
-
//
|
|
7
|
-
bytes32 constant _LSP4_SUPPORTED_STANDARDS_KEY =
|
|
6
|
+
// bytes10(keccak256('SupportedStandard')) + bytes2(0) + bytes20(keccak256('LSP4DigitalAsset'))
|
|
7
|
+
bytes32 constant _LSP4_SUPPORTED_STANDARDS_KEY = 0xeafec4d89fa9619884b60000a4d96624a38f7ac2d8d9a604ecf07c12c77e480c;
|
|
8
8
|
|
|
9
9
|
// bytes4(keccak256('LSP4DigitalAsset'))
|
|
10
10
|
bytes constant _LSP4_SUPPORTED_STANDARDS_VALUE = hex"a4d96624";
|
|
11
11
|
|
|
12
12
|
// keccak256('LSP4TokenName')
|
|
13
|
-
bytes32 constant
|
|
13
|
+
bytes32 constant _LSP4_TOKEN_NAME_KEY = 0xdeba1e292f8ba88238e10ab3c7f88bd4be4fac56cad5194b6ecceaf653468af1;
|
|
14
14
|
|
|
15
15
|
// keccak256('LSP4TokenSymbol')
|
|
16
|
-
bytes32 constant
|
|
16
|
+
bytes32 constant _LSP4_TOKEN_SYMBOL_KEY = 0x2f0a68ab07768e01943a599e73362a0e17a63a72e94dd2e384d2c1d4db932756;
|
|
17
|
+
|
|
18
|
+
// keccak256('LSP4Creators[]')
|
|
19
|
+
bytes32 constant _LSP4_CREATORS_ARRAY_KEY = 0x114bd03b3a46d48759680d81ebb2b414fda7d030a7105a851867accf1c2352e7;
|
|
20
|
+
|
|
21
|
+
// bytes10(keccak256('LSP4CreatorsMap')) + bytes2(0)
|
|
22
|
+
bytes12 constant _LSP4_CREATORS_MAP_KEY_PREFIX = 0x6de85eaf5d982b4e5da00000;
|
|
17
23
|
|
|
18
24
|
// keccak256('LSP4Metadata')
|
|
19
25
|
bytes32 constant _LSP4_METADATA_KEY = 0x9afb95cacc9f95858ec44aa8c3b685511002e30ae54415823f406128b85b238e;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
4
|
// modules
|
|
5
|
-
import "@erc725/smart-contracts/contracts/ERC725Y.sol";
|
|
5
|
+
import {ERC725Y} from "@erc725/smart-contracts/contracts/ERC725Y.sol";
|
|
6
6
|
|
|
7
7
|
// constants
|
|
8
8
|
import "./LSP4Constants.sol";
|
|
@@ -24,13 +24,16 @@ abstract contract LSP4DigitalAssetMetadata is ERC725Y {
|
|
|
24
24
|
string memory symbol_,
|
|
25
25
|
address newOwner_
|
|
26
26
|
) ERC725Y(newOwner_) {
|
|
27
|
-
// SupportedStandards:LSP4DigitalAsset
|
|
28
|
-
_setData(
|
|
29
|
-
_LSP4_SUPPORTED_STANDARDS_KEY,
|
|
30
|
-
_LSP4_SUPPORTED_STANDARDS_VALUE
|
|
31
|
-
);
|
|
27
|
+
// set key SupportedStandards:LSP4DigitalAsset
|
|
28
|
+
super._setData(_LSP4_SUPPORTED_STANDARDS_KEY, _LSP4_SUPPORTED_STANDARDS_VALUE);
|
|
32
29
|
|
|
33
|
-
_setData(
|
|
34
|
-
_setData(
|
|
30
|
+
super._setData(_LSP4_TOKEN_NAME_KEY, bytes(name_));
|
|
31
|
+
super._setData(_LSP4_TOKEN_SYMBOL_KEY, bytes(symbol_));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function _setData(bytes32 key, bytes memory value) internal virtual override {
|
|
35
|
+
require(key != _LSP4_TOKEN_NAME_KEY, "LSP4: cannot edit Token Name after deployment");
|
|
36
|
+
require(key != _LSP4_TOKEN_SYMBOL_KEY, "LSP4: cannot edit Token Symbol after deployment");
|
|
37
|
+
super._setData(key, value);
|
|
35
38
|
}
|
|
36
39
|
}
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
//
|
|
5
|
-
import "./
|
|
6
|
-
import "./LSP4DigitalAssetMetadataInitAbstract.sol";
|
|
4
|
+
// modules
|
|
5
|
+
import {LSP4DigitalAssetMetadataInitAbstract} from "./LSP4DigitalAssetMetadataInitAbstract.sol";
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* @title LSP4DigitalAssetMetadata
|
|
10
9
|
* @author Matthew Stevens
|
|
11
10
|
* @dev Deployable Proxy Implementation of a LSP8 compliant contract.
|
|
12
11
|
*/
|
|
13
|
-
abstract contract LSP4DigitalAssetMetadataInit is
|
|
14
|
-
LSP4DigitalAssetMetadataInitAbstract
|
|
15
|
-
{
|
|
12
|
+
abstract contract LSP4DigitalAssetMetadataInit is LSP4DigitalAssetMetadataInitAbstract {
|
|
16
13
|
/**
|
|
17
|
-
* @
|
|
14
|
+
* @notice Sets the name, symbol of the token and the owner, and sets the SupportedStandards:LSP4DigitalAsset key
|
|
15
|
+
* @param name_ The name of the token
|
|
16
|
+
* @param symbol_ The symbol of the token
|
|
17
|
+
* @param newOwner_ The owner of the token contract
|
|
18
18
|
*/
|
|
19
19
|
function initialize(
|
|
20
20
|
string memory name_,
|
|
21
21
|
string memory symbol_,
|
|
22
22
|
address newOwner_
|
|
23
|
-
) public virtual
|
|
24
|
-
LSP4DigitalAssetMetadataInitAbstract.
|
|
25
|
-
name_,
|
|
26
|
-
symbol_,
|
|
27
|
-
newOwner_
|
|
28
|
-
);
|
|
23
|
+
) public virtual initializer {
|
|
24
|
+
LSP4DigitalAssetMetadataInitAbstract._initialize(name_, symbol_, newOwner_);
|
|
29
25
|
}
|
|
30
26
|
}
|