@lukso/lsp-smart-contracts 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +39 -0
- package/README.md +93 -40
- package/artifacts/Create2Factory.json +2 -2
- package/artifacts/LSP0ERC725Account.json +194 -15
- package/artifacts/LSP0ERC725AccountInit.json +194 -15
- package/artifacts/LSP11BasicSocialRecovery.json +493 -0
- package/artifacts/LSP11BasicSocialRecoveryInit.json +513 -0
- package/artifacts/LSP16UniversalFactory.json +236 -0
- package/artifacts/LSP1UniversalReceiverDelegateUP.json +134 -15
- package/artifacts/LSP1UniversalReceiverDelegateVault.json +80 -15
- package/artifacts/LSP4Compatibility.json +16 -0
- package/artifacts/LSP4DigitalAssetMetadata.json +16 -0
- package/artifacts/LSP4DigitalAssetMetadataInitAbstract.json +16 -0
- package/artifacts/LSP6KeyManager.json +177 -33
- package/artifacts/LSP6KeyManagerInit.json +177 -33
- package/artifacts/LSP7CappedSupply.json +26 -5
- package/artifacts/LSP7CappedSupplyInitAbstract.json +26 -5
- package/artifacts/LSP7CompatibleERC20.json +26 -5
- package/artifacts/LSP7CompatibleERC20InitAbstract.json +28 -7
- package/artifacts/LSP7CompatibleERC20Mintable.json +29 -8
- package/artifacts/LSP7CompatibleERC20MintableInit.json +29 -8
- package/artifacts/LSP7DigitalAsset.json +26 -5
- package/artifacts/LSP7DigitalAssetInitAbstract.json +26 -5
- package/artifacts/LSP7Mintable.json +29 -8
- package/artifacts/LSP7MintableInit.json +29 -8
- package/artifacts/LSP8CappedSupply.json +27 -6
- package/artifacts/LSP8CappedSupplyInitAbstract.json +27 -6
- package/artifacts/LSP8CompatibleERC721.json +28 -7
- package/artifacts/LSP8CompatibleERC721InitAbstract.json +30 -9
- package/artifacts/LSP8CompatibleERC721Mintable.json +31 -10
- package/artifacts/LSP8CompatibleERC721MintableInit.json +31 -10
- package/artifacts/LSP8IdentifiableDigitalAsset.json +27 -6
- package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +27 -6
- package/artifacts/LSP8Mintable.json +30 -9
- package/artifacts/LSP8MintableInit.json +30 -9
- package/artifacts/LSP9Vault.json +202 -17
- package/artifacts/LSP9VaultInit.json +202 -17
- package/artifacts/UniversalProfile.json +194 -15
- package/artifacts/UniversalProfileInit.json +194 -15
- package/artifacts/UniversalReceiverAddressStore.json +3 -3
- package/common/constants.d.ts +738 -0
- package/common/constants.js +785 -0
- package/contracts/Custom/EIP191Signer.sol +12 -0
- package/contracts/Factories/Create2Factory.sol +1 -3
- package/contracts/LSP0ERC725Account/LSP0Constants.sol +13 -2
- package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +2 -1
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +320 -63
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +2 -2
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +2 -1
- package/contracts/LSP0ERC725Account/LSP0Utils.sol +50 -0
- package/contracts/LSP10ReceivedVaults/LSP10Constants.sol +2 -2
- package/contracts/LSP10ReceivedVaults/LSP10Utils.sol +212 -0
- package/contracts/LSP11BasicSocialRecovery/ILSP11BasicSocialRecovery.sol +177 -0
- package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol +23 -0
- package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol +258 -0
- package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.sol +26 -0
- package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInitAbstract.sol +19 -0
- package/contracts/LSP11BasicSocialRecovery/LSP11Constants.sol +6 -0
- package/contracts/LSP11BasicSocialRecovery/LSP11Errors.sol +60 -0
- package/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +53 -0
- package/contracts/LSP14Ownable2Step/LSP14Constants.sol +15 -0
- package/contracts/LSP14Ownable2Step/LSP14Errors.sol +12 -0
- package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +212 -0
- package/contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol +246 -0
- package/contracts/LSP17ContractExtension/LSP17Constants.sol +17 -0
- package/contracts/LSP17ContractExtension/LSP17Errors.sol +7 -0
- package/contracts/LSP17ContractExtension/LSP17Extendable.sol +104 -0
- package/contracts/LSP17ContractExtension/LSP17Extension.sol +45 -0
- package/contracts/LSP17ContractExtension/LSP17Utils.sol +20 -0
- package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +5 -5
- package/contracts/LSP1UniversalReceiver/LSP1Constants.sol +5 -3
- package/contracts/LSP1UniversalReceiver/LSP1Errors.sol +21 -0
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +155 -37
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +64 -31
- package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +53 -40
- package/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +45 -23
- package/contracts/LSP3UniversalProfile/LSP3Constants.sol +1 -1
- package/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +1 -1
- package/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +1 -1
- package/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +1 -1
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +2 -2
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +2 -2
- package/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +3 -3
- package/contracts/LSP5ReceivedAssets/LSP5Constants.sol +2 -2
- package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +102 -114
- package/contracts/LSP6KeyManager/ILSP6KeyManager.sol +25 -7
- package/contracts/LSP6KeyManager/LSP6Constants.sol +43 -38
- package/contracts/LSP6KeyManager/LSP6Errors.sol +90 -21
- package/contracts/LSP6KeyManager/LSP6KeyManager.sol +2 -1
- package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +224 -506
- package/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +1 -1
- package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +3 -2
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +229 -0
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol +25 -0
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +606 -0
- package/contracts/LSP6KeyManager/LSP6Utils.sol +156 -35
- package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +8 -8
- package/contracts/LSP7DigitalAsset/LSP7Constants.sol +6 -6
- package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +1 -1
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +36 -36
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +1 -1
- package/contracts/LSP7DigitalAsset/LSP7Errors.sol +33 -1
- package/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +1 -1
- package/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +24 -0
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +28 -8
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +28 -11
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +87 -20
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +97 -19
- package/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +3 -3
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +3 -4
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +2 -2
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +3 -3
- package/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +3 -5
- package/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +2 -2
- package/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +3 -3
- package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +7 -7
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +7 -7
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +45 -2
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +2 -2
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +57 -60
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +1 -1
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +5 -2
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +20 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +27 -7
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +27 -10
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +234 -30
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +238 -30
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +32 -4
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +35 -8
- package/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +3 -3
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +3 -4
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +3 -3
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +3 -3
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +3 -4
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +2 -2
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +3 -3
- package/contracts/LSP9Vault/LSP9Constants.sol +10 -10
- package/contracts/LSP9Vault/LSP9Errors.sol +8 -0
- package/contracts/LSP9Vault/LSP9Vault.sol +6 -4
- package/contracts/LSP9Vault/LSP9VaultCore.sol +350 -127
- package/contracts/LSP9Vault/LSP9VaultInit.sol +2 -2
- package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +4 -3
- package/contracts/Legacy/Registries/AddressRegistry.sol +1 -1
- package/contracts/Legacy/Registries/AddressRegistryRequiresERC725.sol +1 -1
- package/contracts/Legacy/UniversalReceiverAddressStore.sol +4 -14
- package/contracts/UniversalProfile.sol +2 -2
- package/contracts/UniversalProfileInit.sol +2 -2
- package/contracts/UniversalProfileInitAbstract.sol +1 -1
- package/contracts/Utils/GasLib.sol +1 -1
- package/module/constants.d.ts +738 -0
- package/module/constants.js +782 -0
- package/package.json +42 -12
- package/artifacts/UniversalFactory.json +0 -127
- package/constants.js +0 -594
- package/contracts/Custom/ClaimOwnership.sol +0 -96
- package/contracts/Custom/ERC165Checker.sol +0 -130
- package/contracts/Custom/IClaimOwnership.sol +0 -12
- package/contracts/Factories/UniversalFactory.sol +0 -159
- package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol +0 -24
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/Handling/TokenAndVaultHandling.sol +0 -82
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/Handling/TokenHandling.sol +0 -73
- package/contracts/LSP2ERC725YJSONSchema/LSP2Errors.sol +0 -9
- package/contracts/LSP7DigitalAsset/extensions/ILSP7CappedSupply.sol +0 -17
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyCore.sol +0 -57
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20Core.sol +0 -111
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CappedSupply.sol +0 -17
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8Enumerable.sol +0 -17
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyCore.sol +0 -58
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleConstants.sol +0 -6
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721Core.sol +0 -211
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableCore.sol +0 -50
- package/contracts/Utils/UtilsLib.sol +0 -31
|
@@ -1,21 +1,49 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
|
|
3
|
-
pragma solidity ^0.8.
|
|
3
|
+
pragma solidity ^0.8.4;
|
|
4
4
|
|
|
5
5
|
// modules
|
|
6
6
|
import {LSP8IdentifiableDigitalAsset} from "../LSP8IdentifiableDigitalAsset.sol";
|
|
7
7
|
import {LSP8IdentifiableDigitalAssetCore} from "../LSP8IdentifiableDigitalAssetCore.sol";
|
|
8
|
-
import {LSP8EnumerableCore} from "./LSP8EnumerableCore.sol";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* @dev LSP8 extension.
|
|
12
11
|
*/
|
|
13
|
-
abstract contract LSP8Enumerable is LSP8IdentifiableDigitalAsset
|
|
12
|
+
abstract contract LSP8Enumerable is LSP8IdentifiableDigitalAsset {
|
|
13
|
+
// Mapping from token index to token id
|
|
14
|
+
mapping(uint256 => bytes32) private _indexToken;
|
|
15
|
+
|
|
16
|
+
// Mapping from token id to index
|
|
17
|
+
mapping(bytes32 => uint256) private _tokenIndex;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @dev Returns a token id at index. See totalSupply() to get total number of minted tokens.
|
|
21
|
+
* @return TokenId or 0x00 if no token exist at the index `index`
|
|
22
|
+
*/
|
|
23
|
+
function tokenAt(uint256 index) public view returns (bytes32) {
|
|
24
|
+
return _indexToken[index];
|
|
25
|
+
}
|
|
26
|
+
|
|
14
27
|
function _beforeTokenTransfer(
|
|
15
28
|
address from,
|
|
16
29
|
address to,
|
|
17
30
|
bytes32 tokenId
|
|
18
|
-
) internal virtual override(LSP8IdentifiableDigitalAssetCore
|
|
31
|
+
) internal virtual override(LSP8IdentifiableDigitalAssetCore) {
|
|
32
|
+
if (from == address(0)) {
|
|
33
|
+
uint256 index = _existingTokens;
|
|
34
|
+
_indexToken[index] = tokenId;
|
|
35
|
+
_tokenIndex[tokenId] = index;
|
|
36
|
+
} else if (to == address(0)) {
|
|
37
|
+
uint256 lastIndex = _existingTokens - 1;
|
|
38
|
+
uint256 index = _tokenIndex[tokenId];
|
|
39
|
+
if (index < lastIndex) {
|
|
40
|
+
bytes32 lastTokenId = _indexToken[lastIndex];
|
|
41
|
+
_indexToken[index] = lastTokenId;
|
|
42
|
+
_tokenIndex[lastTokenId] = index;
|
|
43
|
+
}
|
|
44
|
+
delete _indexToken[lastIndex];
|
|
45
|
+
delete _tokenIndex[tokenId];
|
|
46
|
+
}
|
|
19
47
|
super._beforeTokenTransfer(from, to, tokenId);
|
|
20
48
|
}
|
|
21
49
|
}
|
|
@@ -1,24 +1,51 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
|
|
3
|
-
pragma solidity ^0.8.
|
|
3
|
+
pragma solidity ^0.8.4;
|
|
4
4
|
|
|
5
5
|
// modules
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
LSP8IdentifiableDigitalAssetInitAbstract
|
|
8
|
+
} from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
|
|
7
9
|
import {LSP8IdentifiableDigitalAssetCore} from "../LSP8IdentifiableDigitalAssetCore.sol";
|
|
8
|
-
import {LSP8EnumerableCore} from "./LSP8EnumerableCore.sol";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* @dev LSP8 extension.
|
|
12
13
|
*/
|
|
13
|
-
abstract contract LSP8EnumerableInitAbstract is
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
abstract contract LSP8EnumerableInitAbstract is LSP8IdentifiableDigitalAssetInitAbstract {
|
|
15
|
+
// Mapping from token index to token id
|
|
16
|
+
mapping(uint256 => bytes32) private _indexToken;
|
|
17
|
+
|
|
18
|
+
// Mapping from token id to index
|
|
19
|
+
mapping(bytes32 => uint256) private _tokenIndex;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @dev Returns a token id at index. See totalSupply() to get total number of minted tokens.
|
|
23
|
+
* @return TokenId or 0x00 if no token exist at the index `index`
|
|
24
|
+
*/
|
|
25
|
+
function tokenAt(uint256 index) public view returns (bytes32) {
|
|
26
|
+
return _indexToken[index];
|
|
27
|
+
}
|
|
28
|
+
|
|
17
29
|
function _beforeTokenTransfer(
|
|
18
30
|
address from,
|
|
19
31
|
address to,
|
|
20
32
|
bytes32 tokenId
|
|
21
|
-
) internal virtual override(LSP8IdentifiableDigitalAssetCore
|
|
33
|
+
) internal virtual override(LSP8IdentifiableDigitalAssetCore) {
|
|
34
|
+
if (from == address(0)) {
|
|
35
|
+
uint256 index = _existingTokens;
|
|
36
|
+
_indexToken[index] = tokenId;
|
|
37
|
+
_tokenIndex[tokenId] = index;
|
|
38
|
+
} else if (to == address(0)) {
|
|
39
|
+
uint256 lastIndex = _existingTokens - 1;
|
|
40
|
+
uint256 index = _tokenIndex[tokenId];
|
|
41
|
+
if (index < lastIndex) {
|
|
42
|
+
bytes32 lastTokenId = _indexToken[lastIndex];
|
|
43
|
+
_indexToken[index] = lastTokenId;
|
|
44
|
+
_tokenIndex[lastTokenId] = index;
|
|
45
|
+
}
|
|
46
|
+
delete _indexToken[lastIndex];
|
|
47
|
+
delete _tokenIndex[tokenId];
|
|
48
|
+
}
|
|
22
49
|
super._beforeTokenTransfer(from, to, tokenId);
|
|
23
50
|
}
|
|
24
51
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
|
|
3
|
-
pragma solidity ^0.8.
|
|
3
|
+
pragma solidity ^0.8.4;
|
|
4
4
|
|
|
5
5
|
// interfaces
|
|
6
6
|
import {ILSP8IdentifiableDigitalAsset} from "../ILSP8IdentifiableDigitalAsset.sol";
|
|
@@ -12,7 +12,7 @@ interface ILSP8Mintable is ILSP8IdentifiableDigitalAsset {
|
|
|
12
12
|
/**
|
|
13
13
|
* @param to The address to mint tokens
|
|
14
14
|
* @param tokenId The tokenId to mint
|
|
15
|
-
* @param
|
|
15
|
+
* @param allowNonLSP1Recipient When set to TRUE, to may be any address but
|
|
16
16
|
* when set to FALSE to must be a contract that supports LSP1 UniversalReceiver
|
|
17
17
|
* @param data Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses.
|
|
18
18
|
* @dev Mints `amount` tokens and transfers it to `to`.
|
|
@@ -26,7 +26,7 @@ interface ILSP8Mintable is ILSP8IdentifiableDigitalAsset {
|
|
|
26
26
|
function mint(
|
|
27
27
|
address to,
|
|
28
28
|
bytes32 tokenId,
|
|
29
|
-
bool
|
|
29
|
+
bool allowNonLSP1Recipient,
|
|
30
30
|
bytes memory data
|
|
31
31
|
) external;
|
|
32
32
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.
|
|
2
|
+
pragma solidity ^0.8.12;
|
|
3
3
|
|
|
4
4
|
import {LSP8CompatibleERC721} from "../extensions/LSP8CompatibleERC721.sol";
|
|
5
5
|
|
|
6
6
|
contract LSP8CompatibleERC721Mintable is LSP8CompatibleERC721 {
|
|
7
|
-
/* solhint-disable no-empty-blocks */
|
|
8
7
|
constructor(
|
|
9
8
|
string memory name_,
|
|
10
9
|
string memory symbol_,
|
|
@@ -14,9 +13,9 @@ contract LSP8CompatibleERC721Mintable is LSP8CompatibleERC721 {
|
|
|
14
13
|
function mint(
|
|
15
14
|
address to,
|
|
16
15
|
bytes32 tokenId,
|
|
17
|
-
bool
|
|
16
|
+
bool allowNonLSP1Recipient,
|
|
18
17
|
bytes memory data
|
|
19
18
|
) public onlyOwner {
|
|
20
|
-
_mint(to, tokenId,
|
|
19
|
+
_mint(to, tokenId, allowNonLSP1Recipient, data);
|
|
21
20
|
}
|
|
22
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.
|
|
2
|
+
pragma solidity ^0.8.12;
|
|
3
3
|
|
|
4
4
|
// modules
|
|
5
5
|
import {
|
|
@@ -13,7 +13,7 @@ contract LSP8CompatibleERC721MintableInit is LSP8CompatibleERC721MintableInitAbs
|
|
|
13
13
|
constructor() {
|
|
14
14
|
_disableInitializers();
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
/**
|
|
18
18
|
* @notice Sets the name, the symbol and the owner of the token
|
|
19
19
|
* @param name_ The name of the token
|
|
@@ -24,7 +24,7 @@ contract LSP8CompatibleERC721MintableInit is LSP8CompatibleERC721MintableInitAbs
|
|
|
24
24
|
string memory name_,
|
|
25
25
|
string memory symbol_,
|
|
26
26
|
address newOwner_
|
|
27
|
-
)
|
|
27
|
+
) external virtual initializer {
|
|
28
28
|
LSP8CompatibleERC721MintableInitAbstract._initialize(name_, symbol_, newOwner_);
|
|
29
29
|
}
|
|
30
30
|
}
|
package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.
|
|
2
|
+
pragma solidity ^0.8.12;
|
|
3
3
|
|
|
4
4
|
// modules
|
|
5
5
|
import {LSP8CompatibleERC721InitAbstract} from "../extensions/LSP8CompatibleERC721InitAbstract.sol";
|
|
@@ -19,9 +19,9 @@ contract LSP8CompatibleERC721MintableInitAbstract is LSP8CompatibleERC721InitAbs
|
|
|
19
19
|
function mint(
|
|
20
20
|
address to,
|
|
21
21
|
bytes32 tokenId,
|
|
22
|
-
bool
|
|
22
|
+
bool allowNonLSP1Recipient,
|
|
23
23
|
bytes memory data
|
|
24
24
|
) public onlyOwner {
|
|
25
|
-
_mint(to, tokenId,
|
|
25
|
+
_mint(to, tokenId, allowNonLSP1Recipient, data);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
|
|
3
|
-
pragma solidity ^0.8.
|
|
3
|
+
pragma solidity ^0.8.4;
|
|
4
4
|
|
|
5
5
|
// interfaces
|
|
6
6
|
import {ILSP8Mintable} from "./ILSP8Mintable.sol";
|
|
@@ -12,7 +12,6 @@ import {LSP8IdentifiableDigitalAsset} from "../LSP8IdentifiableDigitalAsset.sol"
|
|
|
12
12
|
* @dev LSP8 extension.
|
|
13
13
|
*/
|
|
14
14
|
contract LSP8Mintable is LSP8IdentifiableDigitalAsset, ILSP8Mintable {
|
|
15
|
-
// solhint-disable no-empty-blocks
|
|
16
15
|
/**
|
|
17
16
|
* @notice Sets the token-Metadata and register LSP8InterfaceId
|
|
18
17
|
* @param name_ The name of the token
|
|
@@ -31,9 +30,9 @@ contract LSP8Mintable is LSP8IdentifiableDigitalAsset, ILSP8Mintable {
|
|
|
31
30
|
function mint(
|
|
32
31
|
address to,
|
|
33
32
|
bytes32 tokenId,
|
|
34
|
-
bool
|
|
33
|
+
bool allowNonLSP1Recipient,
|
|
35
34
|
bytes memory data
|
|
36
35
|
) public virtual onlyOwner {
|
|
37
|
-
_mint(to, tokenId,
|
|
36
|
+
_mint(to, tokenId, allowNonLSP1Recipient, data);
|
|
38
37
|
}
|
|
39
38
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
|
|
3
|
-
pragma solidity ^0.8.
|
|
3
|
+
pragma solidity ^0.8.4;
|
|
4
4
|
|
|
5
5
|
// modules
|
|
6
6
|
import {LSP8MintableInitAbstract} from "./LSP8MintableInitAbstract.sol";
|
|
@@ -26,7 +26,7 @@ contract LSP8MintableInit is LSP8MintableInitAbstract {
|
|
|
26
26
|
string memory name_,
|
|
27
27
|
string memory symbol_,
|
|
28
28
|
address newOwner_
|
|
29
|
-
)
|
|
29
|
+
) external virtual initializer {
|
|
30
30
|
LSP8MintableInitAbstract._initialize(name_, symbol_, newOwner_);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
|
|
3
|
-
pragma solidity ^0.8.
|
|
3
|
+
pragma solidity ^0.8.4;
|
|
4
4
|
|
|
5
5
|
// interfaces
|
|
6
6
|
import {ILSP8Mintable} from "./ILSP8Mintable.sol";
|
|
@@ -30,9 +30,9 @@ abstract contract LSP8MintableInitAbstract is
|
|
|
30
30
|
function mint(
|
|
31
31
|
address to,
|
|
32
32
|
bytes32 tokenId,
|
|
33
|
-
bool
|
|
33
|
+
bool allowNonLSP1Recipient,
|
|
34
34
|
bytes memory data
|
|
35
35
|
) public virtual onlyOwner {
|
|
36
|
-
_mint(to, tokenId,
|
|
36
|
+
_mint(to, tokenId, allowNonLSP1Recipient, data);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: CC0-1.0
|
|
2
|
-
pragma solidity ^0.8.
|
|
2
|
+
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
4
|
// --- ERC165 interface ids
|
|
5
|
-
bytes4 constant _INTERFACEID_LSP9 =
|
|
5
|
+
bytes4 constant _INTERFACEID_LSP9 = 0x7050cee9;
|
|
6
6
|
|
|
7
|
-
// --- ERC725Y Keys
|
|
7
|
+
// --- ERC725Y Data Keys
|
|
8
8
|
|
|
9
9
|
// bytes10(keccak256('SupportedStandards')) + bytes2(0) + bytes20(keccak256('LSP9Vault'))
|
|
10
10
|
bytes32 constant _LSP9_SUPPORTED_STANDARDS_KEY = 0xeafec4d89fa9619884b600007c0334a14085fefa8b51ae5a40895018882bdb90;
|
|
@@ -12,13 +12,13 @@ bytes32 constant _LSP9_SUPPORTED_STANDARDS_KEY = 0xeafec4d89fa9619884b600007c033
|
|
|
12
12
|
// bytes4(keccak256('LSP9Vault'))
|
|
13
13
|
bytes constant _LSP9_SUPPORTED_STANDARDS_VALUE = hex"7c0334a1";
|
|
14
14
|
|
|
15
|
-
//
|
|
15
|
+
// Ownerhsip Transfer Type IDs
|
|
16
16
|
|
|
17
|
-
// keccak256(
|
|
18
|
-
bytes32 constant
|
|
17
|
+
// keccak256('LSP9OwnershipTransferStarted')
|
|
18
|
+
bytes32 constant _TYPEID_LSP9_OwnershipTransferStarted = 0xaefd43f45fed1bcd8992f23c803b6f4ec45cf6b62b0d404d565f290a471e763f;
|
|
19
19
|
|
|
20
|
-
// keccak256(
|
|
21
|
-
bytes32 constant
|
|
20
|
+
// keccak256('LSP9OwnershipTransferred_SenderNotification')
|
|
21
|
+
bytes32 constant _TYPEID_LSP9_OwnershipTransferred_SenderNotification = 0x0c622e58e6b7089ae35f1af1c86d997be92fcdd8c9509652022d41aa65169471;
|
|
22
22
|
|
|
23
|
-
// keccak256(
|
|
24
|
-
bytes32 constant
|
|
23
|
+
// keccak256('LSP9OwnershipTransferred_RecipientNotification')
|
|
24
|
+
bytes32 constant _TYPEID_LSP9_OwnershipTransferred_RecipientNotification = 0x79855c97dbc259ce395421d933d7bc0699b0f1561f988f09a9e8633fd542fe5c;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// SPDX-License-Identifier: CC0-1.0
|
|
2
|
+
pragma solidity ^0.8.4;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @dev reverts when the UniversalReceiverDelegates of the Vault sets LSP1/6/17 Data Keys
|
|
6
|
+
* @param dataKey The data key that the UniversalReceiverDelegate is not allowed to set
|
|
7
|
+
*/
|
|
8
|
+
error LSP1DelegateNotAllowedToSetDataKey(bytes32 dataKey);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
pragma solidity ^0.8.
|
|
2
|
+
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
4
|
// interfaces
|
|
5
5
|
import {IERC725Y} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
|
|
@@ -7,7 +7,7 @@ import {IERC725Y} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.so
|
|
|
7
7
|
// modules
|
|
8
8
|
import {OwnableUnset} from "@erc725/smart-contracts/contracts/custom/OwnableUnset.sol";
|
|
9
9
|
import {ERC725} from "@erc725/smart-contracts/contracts/ERC725.sol";
|
|
10
|
-
import {LSP9VaultCore
|
|
10
|
+
import {LSP9VaultCore} from "./LSP9VaultCore.sol";
|
|
11
11
|
|
|
12
12
|
// constants
|
|
13
13
|
import {_INTERFACEID_LSP1} from "../LSP1UniversalReceiver/LSP1Constants.sol";
|
|
@@ -27,12 +27,14 @@ contract LSP9Vault is LSP9VaultCore {
|
|
|
27
27
|
* @notice Sets the owner of the contract and sets the SupportedStandards:LSP9Vault key
|
|
28
28
|
* @param newOwner the owner of the contract
|
|
29
29
|
*/
|
|
30
|
-
constructor(address newOwner) {
|
|
30
|
+
constructor(address newOwner) payable {
|
|
31
|
+
if (msg.value != 0) emit ValueReceived(msg.sender, msg.value);
|
|
32
|
+
|
|
31
33
|
OwnableUnset._setOwner(newOwner);
|
|
32
34
|
|
|
33
35
|
// set key SupportedStandards:LSP9Vault
|
|
34
36
|
_setData(_LSP9_SUPPORTED_STANDARDS_KEY, _LSP9_SUPPORTED_STANDARDS_VALUE);
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
_notifyLSP1RecipientOnOwnershipTransferCompletion(newOwner, "");
|
|
37
39
|
}
|
|
38
40
|
}
|