@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
|
@@ -3,25 +3,23 @@
|
|
|
3
3
|
pragma solidity ^0.8.0;
|
|
4
4
|
|
|
5
5
|
// modules
|
|
6
|
-
import "
|
|
7
|
-
import "../
|
|
6
|
+
import {LSP8IdentifiableDigitalAsset} from "../LSP8IdentifiableDigitalAsset.sol";
|
|
7
|
+
import {LSP8IdentifiableDigitalAssetCore} from "../LSP8IdentifiableDigitalAssetCore.sol";
|
|
8
|
+
import {LSP8CappedSupplyCore} from "./LSP8CappedSupplyCore.sol";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* @dev LSP8 extension, adds token supply cap.
|
|
11
12
|
*/
|
|
12
|
-
abstract contract LSP8CappedSupply is
|
|
13
|
-
LSP8CappedSupplyCore,
|
|
14
|
-
LSP8IdentifiableDigitalAsset
|
|
15
|
-
{
|
|
13
|
+
abstract contract LSP8CappedSupply is LSP8IdentifiableDigitalAsset, LSP8CappedSupplyCore {
|
|
16
14
|
/**
|
|
17
15
|
* @notice Sets the token max supply
|
|
18
16
|
* @param tokenSupplyCap_ The Token max supply
|
|
19
17
|
*/
|
|
20
18
|
constructor(uint256 tokenSupplyCap_) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
if (tokenSupplyCap_ == 0) {
|
|
20
|
+
revert LSP8CappedSupplyRequired();
|
|
21
|
+
}
|
|
22
|
+
|
|
25
23
|
_tokenSupplyCap = tokenSupplyCap_;
|
|
26
24
|
}
|
|
27
25
|
|
|
@@ -43,11 +41,7 @@ abstract contract LSP8CappedSupply is
|
|
|
43
41
|
bytes32 tokenId,
|
|
44
42
|
bool force,
|
|
45
43
|
bytes memory data
|
|
46
|
-
)
|
|
47
|
-
internal
|
|
48
|
-
virtual
|
|
49
|
-
override(LSP8IdentifiableDigitalAssetCore, LSP8CappedSupplyCore)
|
|
50
|
-
{
|
|
44
|
+
) internal virtual override(LSP8IdentifiableDigitalAssetCore, LSP8CappedSupplyCore) {
|
|
51
45
|
super._mint(to, tokenId, force, data);
|
|
52
46
|
}
|
|
53
47
|
}
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
pragma solidity ^0.8.0;
|
|
4
4
|
|
|
5
|
-
// modules
|
|
6
|
-
import "../LSP8IdentifiableDigitalAssetCore.sol";
|
|
7
|
-
|
|
8
5
|
// interfaces
|
|
9
|
-
import "./ILSP8CappedSupply.sol";
|
|
6
|
+
import {ILSP8CappedSupply} from "./ILSP8CappedSupply.sol";
|
|
7
|
+
|
|
8
|
+
// modules
|
|
9
|
+
import {LSP8IdentifiableDigitalAssetCore} from "../LSP8IdentifiableDigitalAssetCore.sol";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @dev LSP8 extension, adds token supply cap.
|
|
13
13
|
*/
|
|
14
|
-
abstract contract LSP8CappedSupplyCore is
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
abstract contract LSP8CappedSupplyCore is LSP8IdentifiableDigitalAssetCore, ILSP8CappedSupply {
|
|
15
|
+
// --- Errors
|
|
16
|
+
|
|
17
|
+
error LSP8CappedSupplyRequired();
|
|
18
|
+
error LSP8CappedSupplyCannotMintOverCap();
|
|
19
|
+
|
|
18
20
|
// --- Storage
|
|
19
21
|
|
|
20
22
|
uint256 internal _tokenSupplyCap;
|
|
@@ -47,10 +49,10 @@ abstract contract LSP8CappedSupplyCore is
|
|
|
47
49
|
bool force,
|
|
48
50
|
bytes memory data
|
|
49
51
|
) internal virtual override {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
if (totalSupply() + 1 > tokenSupplyCap()) {
|
|
53
|
+
revert LSP8CappedSupplyCannotMintOverCap();
|
|
54
|
+
}
|
|
55
|
+
|
|
54
56
|
super._mint(to, tokenId, force, data);
|
|
55
57
|
}
|
|
56
58
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
pragma solidity ^0.8.0;
|
|
4
4
|
|
|
5
5
|
// modules
|
|
6
|
-
import "./LSP8CappedSupplyInitAbstract.sol";
|
|
6
|
+
import {LSP8CappedSupplyInitAbstract} from "./LSP8CappedSupplyInitAbstract.sol";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @dev LSP8 extension, adds token supply cap.
|
|
@@ -13,12 +13,7 @@ abstract contract LSP8CappedSupplyInit is LSP8CappedSupplyInitAbstract {
|
|
|
13
13
|
* @notice Sets the token max supply
|
|
14
14
|
* @param tokenSupplyCap_ The Token max supply
|
|
15
15
|
*/
|
|
16
|
-
function initialize(uint256 tokenSupplyCap_)
|
|
17
|
-
|
|
18
|
-
virtual
|
|
19
|
-
override
|
|
20
|
-
initializer
|
|
21
|
-
{
|
|
22
|
-
LSP8CappedSupplyInitAbstract.initialize(tokenSupplyCap_);
|
|
16
|
+
function initialize(uint256 tokenSupplyCap_) public virtual initializer {
|
|
17
|
+
LSP8CappedSupplyInitAbstract._initialize(tokenSupplyCap_);
|
|
23
18
|
}
|
|
24
19
|
}
|
|
@@ -3,27 +3,22 @@
|
|
|
3
3
|
pragma solidity ^0.8.0;
|
|
4
4
|
|
|
5
5
|
// modules
|
|
6
|
-
import "
|
|
7
|
-
import "../LSP8IdentifiableDigitalAssetInit.sol";
|
|
6
|
+
import {LSP8IdentifiableDigitalAssetCore} from "../LSP8IdentifiableDigitalAssetCore.sol";
|
|
7
|
+
import {LSP8IdentifiableDigitalAssetInit} from "../LSP8IdentifiableDigitalAssetInit.sol";
|
|
8
|
+
import {LSP8CappedSupplyCore} from "./LSP8CappedSupplyCore.sol";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* @dev LSP8 extension, adds token supply cap.
|
|
11
12
|
*/
|
|
12
13
|
abstract contract LSP8CappedSupplyInitAbstract is
|
|
13
|
-
|
|
14
|
-
LSP8CappedSupplyCore
|
|
15
|
-
LSP8IdentifiableDigitalAssetInit
|
|
14
|
+
LSP8IdentifiableDigitalAssetInit,
|
|
15
|
+
LSP8CappedSupplyCore
|
|
16
16
|
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
public
|
|
23
|
-
virtual
|
|
24
|
-
onlyInitializing
|
|
25
|
-
{
|
|
26
|
-
require(tokenSupplyCap_ > 0, "LSP8Capped: tokenSupplyCap is zero");
|
|
17
|
+
function _initialize(uint256 tokenSupplyCap_) internal virtual onlyInitializing {
|
|
18
|
+
if (tokenSupplyCap_ == 0) {
|
|
19
|
+
revert LSP8CappedSupplyRequired();
|
|
20
|
+
}
|
|
21
|
+
|
|
27
22
|
_tokenSupplyCap = tokenSupplyCap_;
|
|
28
23
|
}
|
|
29
24
|
|
|
@@ -45,11 +40,7 @@ abstract contract LSP8CappedSupplyInitAbstract is
|
|
|
45
40
|
bytes32 tokenId,
|
|
46
41
|
bool force,
|
|
47
42
|
bytes memory data
|
|
48
|
-
)
|
|
49
|
-
internal
|
|
50
|
-
virtual
|
|
51
|
-
override(LSP8IdentifiableDigitalAssetCore, LSP8CappedSupplyCore)
|
|
52
|
-
{
|
|
43
|
+
) internal virtual override(LSP8IdentifiableDigitalAssetCore, LSP8CappedSupplyCore) {
|
|
53
44
|
super._mint(to, tokenId, force, data);
|
|
54
45
|
}
|
|
55
46
|
}
|
|
@@ -2,19 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
pragma solidity ^0.8.0;
|
|
4
4
|
|
|
5
|
+
// interfaces
|
|
6
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
7
|
+
|
|
8
|
+
// libraries
|
|
9
|
+
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
|
10
|
+
|
|
5
11
|
// modules
|
|
6
|
-
import "../LSP8IdentifiableDigitalAsset.sol";
|
|
7
|
-
import "
|
|
12
|
+
import {LSP8IdentifiableDigitalAsset, LSP4DigitalAssetMetadata, ERC725YCore} from "../LSP8IdentifiableDigitalAsset.sol";
|
|
13
|
+
import {LSP8IdentifiableDigitalAssetCore} from "../LSP8IdentifiableDigitalAssetCore.sol";
|
|
14
|
+
import {LSP8CompatibilityForERC721Core} from "./LSP8CompatibilityForERC721Core.sol";
|
|
8
15
|
|
|
9
16
|
// constants
|
|
10
|
-
import "./LSP8CompatibilityConstants.sol";
|
|
17
|
+
import {_INTERFACEID_ERC721, _INTERFACEID_ERC721METADATA} from "./LSP8CompatibilityConstants.sol";
|
|
11
18
|
|
|
12
19
|
/**
|
|
13
20
|
* @dev LSP8 extension, for compatibility for clients / tools that expect ERC721.
|
|
14
21
|
*/
|
|
15
22
|
contract LSP8CompatibilityForERC721 is
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
LSP8IdentifiableDigitalAsset,
|
|
24
|
+
LSP8CompatibilityForERC721Core
|
|
18
25
|
{
|
|
19
26
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
20
27
|
|
|
@@ -28,20 +35,14 @@ contract LSP8CompatibilityForERC721 is
|
|
|
28
35
|
string memory name_,
|
|
29
36
|
string memory symbol_,
|
|
30
37
|
address newOwner_
|
|
31
|
-
) LSP8IdentifiableDigitalAsset(name_, symbol_, newOwner_) {
|
|
32
|
-
_registerInterface(_INTERFACEID_ERC721);
|
|
33
|
-
_registerInterface(_INTERFACEID_ERC721METADATA);
|
|
34
|
-
}
|
|
38
|
+
) LSP8IdentifiableDigitalAsset(name_, symbol_, newOwner_) {} // solhint-disable no-empty-blocks
|
|
35
39
|
|
|
36
40
|
// --- Overrides
|
|
37
41
|
|
|
38
42
|
function authorizeOperator(address operator, bytes32 tokenId)
|
|
39
43
|
public
|
|
40
44
|
virtual
|
|
41
|
-
override(
|
|
42
|
-
LSP8IdentifiableDigitalAssetCore,
|
|
43
|
-
LSP8CompatibilityForERC721Core
|
|
44
|
-
)
|
|
45
|
+
override(LSP8IdentifiableDigitalAssetCore, LSP8CompatibilityForERC721Core)
|
|
45
46
|
{
|
|
46
47
|
super.authorizeOperator(operator, tokenId);
|
|
47
48
|
}
|
|
@@ -52,14 +53,7 @@ contract LSP8CompatibilityForERC721 is
|
|
|
52
53
|
bytes32 tokenId,
|
|
53
54
|
bool force,
|
|
54
55
|
bytes memory data
|
|
55
|
-
)
|
|
56
|
-
internal
|
|
57
|
-
virtual
|
|
58
|
-
override(
|
|
59
|
-
LSP8IdentifiableDigitalAssetCore,
|
|
60
|
-
LSP8CompatibilityForERC721Core
|
|
61
|
-
)
|
|
62
|
-
{
|
|
56
|
+
) internal virtual override(LSP8IdentifiableDigitalAssetCore, LSP8CompatibilityForERC721Core) {
|
|
63
57
|
super._transfer(from, to, tokenId, force, data);
|
|
64
58
|
}
|
|
65
59
|
|
|
@@ -68,25 +62,39 @@ contract LSP8CompatibilityForERC721 is
|
|
|
68
62
|
bytes32 tokenId,
|
|
69
63
|
bool force,
|
|
70
64
|
bytes memory data
|
|
71
|
-
)
|
|
72
|
-
internal
|
|
73
|
-
virtual
|
|
74
|
-
override(
|
|
75
|
-
LSP8IdentifiableDigitalAssetCore,
|
|
76
|
-
LSP8CompatibilityForERC721Core
|
|
77
|
-
)
|
|
78
|
-
{
|
|
65
|
+
) internal virtual override(LSP8IdentifiableDigitalAssetCore, LSP8CompatibilityForERC721Core) {
|
|
79
66
|
super._mint(to, tokenId, force, data);
|
|
80
67
|
}
|
|
81
68
|
|
|
82
69
|
function _burn(bytes32 tokenId, bytes memory data)
|
|
83
70
|
internal
|
|
84
71
|
virtual
|
|
85
|
-
override(
|
|
86
|
-
LSP8IdentifiableDigitalAssetCore,
|
|
87
|
-
LSP8CompatibilityForERC721Core
|
|
88
|
-
)
|
|
72
|
+
override(LSP8IdentifiableDigitalAssetCore, LSP8CompatibilityForERC721Core)
|
|
89
73
|
{
|
|
90
74
|
super._burn(tokenId, data);
|
|
91
75
|
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @dev See {IERC165-supportsInterface}.
|
|
79
|
+
*/
|
|
80
|
+
function supportsInterface(bytes4 interfaceId)
|
|
81
|
+
public
|
|
82
|
+
view
|
|
83
|
+
virtual
|
|
84
|
+
override(IERC165, LSP8IdentifiableDigitalAsset)
|
|
85
|
+
returns (bool)
|
|
86
|
+
{
|
|
87
|
+
return
|
|
88
|
+
interfaceId == _INTERFACEID_ERC721 ||
|
|
89
|
+
interfaceId == _INTERFACEID_ERC721METADATA ||
|
|
90
|
+
super.supportsInterface(interfaceId);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function _setData(bytes32 key, bytes memory value)
|
|
94
|
+
internal
|
|
95
|
+
virtual
|
|
96
|
+
override(LSP4DigitalAssetMetadata, ERC725YCore)
|
|
97
|
+
{
|
|
98
|
+
super._setData(key, value);
|
|
99
|
+
}
|
|
92
100
|
}
|
package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibilityForERC721Core.sol
CHANGED
|
@@ -2,78 +2,58 @@
|
|
|
2
2
|
|
|
3
3
|
pragma solidity ^0.8.0;
|
|
4
4
|
|
|
5
|
-
//
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import "../../LSP4DigitalAssetMetadata/LSP4Compatibility.sol";
|
|
5
|
+
// interfaces
|
|
6
|
+
import {ILSP8IdentifiableDigitalAsset} from "../ILSP8IdentifiableDigitalAsset.sol";
|
|
7
|
+
import {ILSP8CompatibilityForERC721} from "./ILSP8CompatibilityForERC721.sol";
|
|
9
8
|
|
|
10
9
|
// libraries
|
|
11
|
-
import "
|
|
10
|
+
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
|
11
|
+
import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";
|
|
12
12
|
|
|
13
|
-
//
|
|
14
|
-
import "
|
|
13
|
+
// modules
|
|
14
|
+
import {LSP4Compatibility} from "../../LSP4DigitalAssetMetadata/LSP4Compatibility.sol";
|
|
15
|
+
import {LSP8IdentifiableDigitalAssetCore} from "../LSP8IdentifiableDigitalAssetCore.sol";
|
|
15
16
|
|
|
16
17
|
// constants
|
|
17
|
-
import "
|
|
18
|
+
import {_LSP4_METADATA_KEY} from "../../LSP4DigitalAssetMetadata/LSP4Constants.sol";
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* @dev LSP8 extension, for compatibility for clients / tools that expect ERC721.
|
|
21
22
|
*/
|
|
22
23
|
abstract contract LSP8CompatibilityForERC721Core is
|
|
23
|
-
|
|
24
|
+
LSP4Compatibility,
|
|
24
25
|
LSP8IdentifiableDigitalAssetCore,
|
|
25
|
-
|
|
26
|
+
ILSP8CompatibilityForERC721
|
|
26
27
|
{
|
|
27
|
-
using ERC725Utils for IERC725Y;
|
|
28
28
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
29
29
|
|
|
30
30
|
/*
|
|
31
31
|
* @inheritdoc ILSP8CompatibilityForERC721
|
|
32
32
|
*/
|
|
33
|
-
function tokenURI(uint256 tokenId)
|
|
34
|
-
public
|
|
35
|
-
view
|
|
36
|
-
virtual
|
|
37
|
-
override
|
|
38
|
-
returns (string memory)
|
|
39
|
-
{
|
|
33
|
+
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
|
|
40
34
|
// silence compiler warning about unused variable
|
|
41
35
|
tokenId;
|
|
42
36
|
|
|
43
|
-
bytes memory data =
|
|
37
|
+
bytes memory data = _getData(_LSP4_METADATA_KEY);
|
|
44
38
|
|
|
45
39
|
// offset = bytes4(hashSig) + bytes32(contentHash) -> 4 + 32 = 36
|
|
46
40
|
uint256 offset = 36;
|
|
47
41
|
|
|
48
|
-
bytes memory uriBytes = BytesLib.slice(
|
|
49
|
-
data,
|
|
50
|
-
offset,
|
|
51
|
-
data.length - offset
|
|
52
|
-
);
|
|
42
|
+
bytes memory uriBytes = BytesLib.slice(data, offset, data.length - offset);
|
|
53
43
|
return string(uriBytes);
|
|
54
44
|
}
|
|
55
45
|
|
|
56
46
|
/**
|
|
57
47
|
* @inheritdoc ILSP8CompatibilityForERC721
|
|
58
48
|
*/
|
|
59
|
-
function ownerOf(uint256 tokenId)
|
|
60
|
-
external
|
|
61
|
-
view
|
|
62
|
-
virtual
|
|
63
|
-
override
|
|
64
|
-
returns (address)
|
|
65
|
-
{
|
|
49
|
+
function ownerOf(uint256 tokenId) external view virtual override returns (address) {
|
|
66
50
|
return tokenOwnerOf(bytes32(tokenId));
|
|
67
51
|
}
|
|
68
52
|
|
|
69
53
|
/**
|
|
70
54
|
* @inheritdoc ILSP8CompatibilityForERC721
|
|
71
55
|
*/
|
|
72
|
-
function approve(address operator, uint256 tokenId)
|
|
73
|
-
external
|
|
74
|
-
virtual
|
|
75
|
-
override
|
|
76
|
-
{
|
|
56
|
+
function approve(address operator, uint256 tokenId) external virtual override {
|
|
77
57
|
authorizeOperator(operator, bytes32(tokenId));
|
|
78
58
|
|
|
79
59
|
emit Approval(tokenOwnerOf(bytes32(tokenId)), operator, tokenId);
|
|
@@ -82,21 +62,11 @@ abstract contract LSP8CompatibilityForERC721Core is
|
|
|
82
62
|
/**
|
|
83
63
|
* @inheritdoc ILSP8CompatibilityForERC721
|
|
84
64
|
*/
|
|
85
|
-
function getApproved(uint256 tokenId)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
virtual
|
|
89
|
-
override
|
|
90
|
-
returns (address)
|
|
91
|
-
{
|
|
92
|
-
require(
|
|
93
|
-
_exists(bytes32(tokenId)),
|
|
94
|
-
"LSP8: can not query operator for non existent token"
|
|
95
|
-
);
|
|
65
|
+
function getApproved(uint256 tokenId) external view virtual override returns (address) {
|
|
66
|
+
bytes32 tokenIdAsBytes32 = bytes32(tokenId);
|
|
67
|
+
_existsOrError(tokenIdAsBytes32);
|
|
96
68
|
|
|
97
|
-
EnumerableSet.AddressSet storage operatorsForTokenId = _operators[
|
|
98
|
-
bytes32(tokenId)
|
|
99
|
-
];
|
|
69
|
+
EnumerableSet.AddressSet storage operatorsForTokenId = _operators[tokenIdAsBytes32];
|
|
100
70
|
uint256 operatorListLength = operatorsForTokenId.length();
|
|
101
71
|
|
|
102
72
|
if (operatorListLength == 0) {
|
|
@@ -139,8 +109,7 @@ abstract contract LSP8CompatibilityForERC721Core is
|
|
|
139
109
|
address to,
|
|
140
110
|
uint256 tokenId
|
|
141
111
|
) external virtual override {
|
|
142
|
-
return
|
|
143
|
-
transfer(from, to, bytes32(tokenId), true, "compat-transferFrom");
|
|
112
|
+
return transfer(from, to, bytes32(tokenId), true, "");
|
|
144
113
|
}
|
|
145
114
|
|
|
146
115
|
/**
|
|
@@ -153,14 +122,7 @@ abstract contract LSP8CompatibilityForERC721Core is
|
|
|
153
122
|
address to,
|
|
154
123
|
uint256 tokenId
|
|
155
124
|
) external virtual override {
|
|
156
|
-
return
|
|
157
|
-
transfer(
|
|
158
|
-
from,
|
|
159
|
-
to,
|
|
160
|
-
bytes32(tokenId),
|
|
161
|
-
false,
|
|
162
|
-
"compat-safeTransferFrom"
|
|
163
|
-
);
|
|
125
|
+
return transfer(from, to, bytes32(tokenId), false, "");
|
|
164
126
|
}
|
|
165
127
|
|
|
166
128
|
/*
|
|
@@ -181,10 +143,7 @@ abstract contract LSP8CompatibilityForERC721Core is
|
|
|
181
143
|
function authorizeOperator(address operator, bytes32 tokenId)
|
|
182
144
|
public
|
|
183
145
|
virtual
|
|
184
|
-
override(
|
|
185
|
-
ILSP8IdentifiableDigitalAsset,
|
|
186
|
-
LSP8IdentifiableDigitalAssetCore
|
|
187
|
-
)
|
|
146
|
+
override(ILSP8IdentifiableDigitalAsset, LSP8IdentifiableDigitalAssetCore)
|
|
188
147
|
{
|
|
189
148
|
super.authorizeOperator(operator, tokenId);
|
|
190
149
|
|
|
@@ -204,11 +163,7 @@ abstract contract LSP8CompatibilityForERC721Core is
|
|
|
204
163
|
) internal virtual override {
|
|
205
164
|
super._transfer(from, to, tokenId, force, data);
|
|
206
165
|
|
|
207
|
-
emit Transfer(
|
|
208
|
-
from,
|
|
209
|
-
to,
|
|
210
|
-
abi.decode(abi.encodePacked(tokenId), (uint256))
|
|
211
|
-
);
|
|
166
|
+
emit Transfer(from, to, abi.decode(abi.encodePacked(tokenId), (uint256)));
|
|
212
167
|
}
|
|
213
168
|
|
|
214
169
|
function _mint(
|
|
@@ -219,26 +174,14 @@ abstract contract LSP8CompatibilityForERC721Core is
|
|
|
219
174
|
) internal virtual override {
|
|
220
175
|
super._mint(to, tokenId, force, data);
|
|
221
176
|
|
|
222
|
-
emit Transfer(
|
|
223
|
-
address(0),
|
|
224
|
-
to,
|
|
225
|
-
abi.decode(abi.encodePacked(tokenId), (uint256))
|
|
226
|
-
);
|
|
177
|
+
emit Transfer(address(0), to, abi.decode(abi.encodePacked(tokenId), (uint256)));
|
|
227
178
|
}
|
|
228
179
|
|
|
229
|
-
function _burn(bytes32 tokenId, bytes memory data)
|
|
230
|
-
internal
|
|
231
|
-
virtual
|
|
232
|
-
override
|
|
233
|
-
{
|
|
180
|
+
function _burn(bytes32 tokenId, bytes memory data) internal virtual override {
|
|
234
181
|
address tokenOwner = tokenOwnerOf(tokenId);
|
|
235
182
|
|
|
236
183
|
super._burn(tokenId, data);
|
|
237
184
|
|
|
238
|
-
emit Transfer(
|
|
239
|
-
tokenOwner,
|
|
240
|
-
address(0),
|
|
241
|
-
abi.decode(abi.encodePacked(tokenId), (uint256))
|
|
242
|
-
);
|
|
185
|
+
emit Transfer(tokenOwner, address(0), abi.decode(abi.encodePacked(tokenId), (uint256)));
|
|
243
186
|
}
|
|
244
187
|
}
|
package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibilityForERC721Init.sol
CHANGED
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
pragma solidity ^0.8.0;
|
|
4
4
|
|
|
5
5
|
// modules
|
|
6
|
-
import "./LSP8CompatibilityForERC721InitAbstract.sol";
|
|
6
|
+
import {LSP8CompatibilityForERC721InitAbstract} from "./LSP8CompatibilityForERC721InitAbstract.sol";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @dev LSP8 extension, for compatibility for clients / tools that expect ERC721.
|
|
10
10
|
*/
|
|
11
|
-
contract LSP8CompatibilityForERC721Init is
|
|
12
|
-
LSP8CompatibilityForERC721InitAbstract
|
|
13
|
-
{
|
|
11
|
+
contract LSP8CompatibilityForERC721Init is LSP8CompatibilityForERC721InitAbstract {
|
|
14
12
|
/**
|
|
15
13
|
* @notice Sets the name, the symbol and the owner of the token
|
|
16
14
|
* @param name_ The name of the token
|
|
@@ -21,7 +19,7 @@ contract LSP8CompatibilityForERC721Init is
|
|
|
21
19
|
string memory name_,
|
|
22
20
|
string memory symbol_,
|
|
23
21
|
address newOwner_
|
|
24
|
-
) public virtual
|
|
25
|
-
LSP8CompatibilityForERC721InitAbstract.
|
|
22
|
+
) public virtual initializer {
|
|
23
|
+
LSP8CompatibilityForERC721InitAbstract._initialize(name_, symbol_, newOwner_);
|
|
26
24
|
}
|
|
27
25
|
}
|
package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibilityForERC721InitAbstract.sol
CHANGED
|
@@ -2,44 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
pragma solidity ^0.8.0;
|
|
4
4
|
|
|
5
|
+
// interfaces
|
|
6
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
7
|
+
|
|
5
8
|
// modules
|
|
6
|
-
import "
|
|
7
|
-
import "../
|
|
9
|
+
import {LSP8IdentifiableDigitalAssetInitAbstract, LSP4DigitalAssetMetadataInitAbstract, ERC725YCore} from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
|
|
10
|
+
import {LSP8IdentifiableDigitalAssetCore} from "../LSP8IdentifiableDigitalAssetCore.sol";
|
|
11
|
+
import {LSP8CompatibilityForERC721Core} from "./LSP8CompatibilityForERC721Core.sol";
|
|
8
12
|
|
|
9
13
|
// constants
|
|
10
|
-
import "./LSP8CompatibilityConstants.sol";
|
|
14
|
+
import {_INTERFACEID_ERC721, _INTERFACEID_ERC721METADATA} from "./LSP8CompatibilityConstants.sol";
|
|
11
15
|
|
|
12
16
|
/**
|
|
13
17
|
* @dev LSP8 extension, for compatibility for clients / tools that expect ERC721.
|
|
14
18
|
*/
|
|
15
19
|
contract LSP8CompatibilityForERC721InitAbstract is
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
LSP8IdentifiableDigitalAssetInitAbstract,
|
|
21
|
+
LSP8CompatibilityForERC721Core
|
|
18
22
|
{
|
|
19
|
-
|
|
20
|
-
* @notice Sets the name, the symbol and the owner of the token
|
|
21
|
-
* @param name_ The name of the token
|
|
22
|
-
* @param symbol_ The symbol of the token
|
|
23
|
-
* @param newOwner_ The owner of the token
|
|
24
|
-
*/
|
|
25
|
-
function initialize(
|
|
23
|
+
function _initialize(
|
|
26
24
|
string memory name_,
|
|
27
25
|
string memory symbol_,
|
|
28
26
|
address newOwner_
|
|
29
|
-
)
|
|
30
|
-
LSP8IdentifiableDigitalAssetInitAbstract.
|
|
31
|
-
|
|
32
|
-
_registerInterface(_INTERFACEID_ERC721);
|
|
33
|
-
_registerInterface(_INTERFACEID_ERC721METADATA);
|
|
27
|
+
) internal virtual override onlyInitializing {
|
|
28
|
+
LSP8IdentifiableDigitalAssetInitAbstract._initialize(name_, symbol_, newOwner_);
|
|
34
29
|
}
|
|
35
30
|
|
|
36
31
|
function authorizeOperator(address operator, bytes32 tokenId)
|
|
37
32
|
public
|
|
38
33
|
virtual
|
|
39
|
-
override(
|
|
40
|
-
LSP8IdentifiableDigitalAssetCore,
|
|
41
|
-
LSP8CompatibilityForERC721Core
|
|
42
|
-
)
|
|
34
|
+
override(LSP8IdentifiableDigitalAssetCore, LSP8CompatibilityForERC721Core)
|
|
43
35
|
{
|
|
44
36
|
super.authorizeOperator(operator, tokenId);
|
|
45
37
|
}
|
|
@@ -50,14 +42,7 @@ contract LSP8CompatibilityForERC721InitAbstract is
|
|
|
50
42
|
bytes32 tokenId,
|
|
51
43
|
bool force,
|
|
52
44
|
bytes memory data
|
|
53
|
-
)
|
|
54
|
-
internal
|
|
55
|
-
virtual
|
|
56
|
-
override(
|
|
57
|
-
LSP8IdentifiableDigitalAssetCore,
|
|
58
|
-
LSP8CompatibilityForERC721Core
|
|
59
|
-
)
|
|
60
|
-
{
|
|
45
|
+
) internal virtual override(LSP8IdentifiableDigitalAssetCore, LSP8CompatibilityForERC721Core) {
|
|
61
46
|
super._transfer(from, to, tokenId, force, data);
|
|
62
47
|
}
|
|
63
48
|
|
|
@@ -66,25 +51,39 @@ contract LSP8CompatibilityForERC721InitAbstract is
|
|
|
66
51
|
bytes32 tokenId,
|
|
67
52
|
bool force,
|
|
68
53
|
bytes memory data
|
|
69
|
-
)
|
|
70
|
-
internal
|
|
71
|
-
virtual
|
|
72
|
-
override(
|
|
73
|
-
LSP8IdentifiableDigitalAssetCore,
|
|
74
|
-
LSP8CompatibilityForERC721Core
|
|
75
|
-
)
|
|
76
|
-
{
|
|
54
|
+
) internal virtual override(LSP8IdentifiableDigitalAssetCore, LSP8CompatibilityForERC721Core) {
|
|
77
55
|
super._mint(to, tokenId, force, data);
|
|
78
56
|
}
|
|
79
57
|
|
|
80
58
|
function _burn(bytes32 tokenId, bytes memory data)
|
|
81
59
|
internal
|
|
82
60
|
virtual
|
|
83
|
-
override(
|
|
84
|
-
LSP8IdentifiableDigitalAssetCore,
|
|
85
|
-
LSP8CompatibilityForERC721Core
|
|
86
|
-
)
|
|
61
|
+
override(LSP8IdentifiableDigitalAssetCore, LSP8CompatibilityForERC721Core)
|
|
87
62
|
{
|
|
88
63
|
super._burn(tokenId, data);
|
|
89
64
|
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @dev See {IERC165-supportsInterface}.
|
|
68
|
+
*/
|
|
69
|
+
function supportsInterface(bytes4 interfaceId)
|
|
70
|
+
public
|
|
71
|
+
view
|
|
72
|
+
virtual
|
|
73
|
+
override(IERC165, LSP8IdentifiableDigitalAssetInitAbstract)
|
|
74
|
+
returns (bool)
|
|
75
|
+
{
|
|
76
|
+
return
|
|
77
|
+
interfaceId == _INTERFACEID_ERC721 ||
|
|
78
|
+
interfaceId == _INTERFACEID_ERC721METADATA ||
|
|
79
|
+
super.supportsInterface(interfaceId);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function _setData(bytes32 key, bytes memory value)
|
|
83
|
+
internal
|
|
84
|
+
virtual
|
|
85
|
+
override(LSP4DigitalAssetMetadataInitAbstract, ERC725YCore)
|
|
86
|
+
{
|
|
87
|
+
super._setData(key, value);
|
|
88
|
+
}
|
|
90
89
|
}
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
pragma solidity ^0.8.0;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import "../LSP8IdentifiableDigitalAsset.sol";
|
|
5
|
+
// modules
|
|
6
|
+
import {LSP8IdentifiableDigitalAsset} from "../LSP8IdentifiableDigitalAsset.sol";
|
|
7
|
+
import {LSP8MintableCore} from "./LSP8MintableCore.sol";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @dev LSP8 extension.
|
|
10
11
|
*/
|
|
11
|
-
contract LSP8Mintable is
|
|
12
|
+
contract LSP8Mintable is LSP8IdentifiableDigitalAsset, LSP8MintableCore {
|
|
12
13
|
// solhint-disable no-empty-blocks
|
|
13
14
|
/**
|
|
14
15
|
* @notice Sets the token-Metadata and register LSP8InterfaceId
|