@lukso/lsp-smart-contracts 0.7.0 → 0.8.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/CONTRIBUTING.md +31 -0
- package/README.md +73 -20
- 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 +21 -5
- package/artifacts/LSP7CappedSupplyInitAbstract.json +21 -5
- package/artifacts/LSP7CompatibleERC20.json +21 -5
- package/artifacts/LSP7CompatibleERC20InitAbstract.json +23 -7
- package/artifacts/LSP7CompatibleERC20Mintable.json +24 -8
- package/artifacts/LSP7CompatibleERC20MintableInit.json +24 -8
- package/artifacts/LSP7DigitalAsset.json +21 -5
- package/artifacts/LSP7DigitalAssetInitAbstract.json +21 -5
- package/artifacts/LSP7Mintable.json +24 -8
- package/artifacts/LSP7MintableInit.json +24 -8
- package/artifacts/LSP8CappedSupply.json +22 -6
- package/artifacts/LSP8CappedSupplyInitAbstract.json +22 -6
- package/artifacts/LSP8CompatibleERC721.json +23 -7
- package/artifacts/LSP8CompatibleERC721InitAbstract.json +25 -9
- package/artifacts/LSP8CompatibleERC721Mintable.json +26 -10
- package/artifacts/LSP8CompatibleERC721MintableInit.json +26 -10
- package/artifacts/LSP8IdentifiableDigitalAsset.json +22 -6
- package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +22 -6
- package/artifacts/LSP8Mintable.json +25 -9
- package/artifacts/LSP8MintableInit.json +25 -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/constants.js +377 -115
- 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 +261 -63
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +2 -2
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +2 -1
- package/contracts/LSP10ReceivedVaults/LSP10Constants.sol +2 -2
- package/contracts/LSP10ReceivedVaults/LSP10Utils.sol +214 -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 +157 -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 +772 -364
- package/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +1 -1
- package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +3 -2
- package/contracts/LSP6KeyManager/LSP6Utils.sol +125 -34
- 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 +38 -34
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +1 -1
- package/contracts/LSP7DigitalAsset/LSP7Errors.sol +28 -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 +40 -2
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +2 -2
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +53 -50
- 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 +236 -30
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +240 -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 +289 -126
- 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/package.json +17 -9
- package/artifacts/UniversalFactory.json +0 -127
- 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,16 +1,22 @@
|
|
|
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 {LSP7DigitalAsset} from "../LSP7DigitalAsset.sol";
|
|
7
7
|
import {LSP7DigitalAssetCore} from "../LSP7DigitalAssetCore.sol";
|
|
8
|
-
import {LSP7CappedSupplyCore} from "./LSP7CappedSupplyCore.sol";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* @dev LSP7 extension, adds token supply cap.
|
|
12
11
|
*/
|
|
13
|
-
abstract contract LSP7CappedSupply is LSP7DigitalAsset
|
|
12
|
+
abstract contract LSP7CappedSupply is LSP7DigitalAsset {
|
|
13
|
+
// --- Errors
|
|
14
|
+
error LSP7CappedSupplyRequired();
|
|
15
|
+
error LSP7CappedSupplyCannotMintOverCap();
|
|
16
|
+
|
|
17
|
+
// --- Storage
|
|
18
|
+
uint256 internal _tokenSupplyCap;
|
|
19
|
+
|
|
14
20
|
/**
|
|
15
21
|
* @notice Sets the token max supply
|
|
16
22
|
* @param tokenSupplyCap_ The Token max supply
|
|
@@ -23,10 +29,20 @@ abstract contract LSP7CappedSupply is LSP7DigitalAsset, LSP7CappedSupplyCore {
|
|
|
23
29
|
_tokenSupplyCap = tokenSupplyCap_;
|
|
24
30
|
}
|
|
25
31
|
|
|
26
|
-
// ---
|
|
32
|
+
// --- Token queries
|
|
27
33
|
|
|
28
34
|
/**
|
|
29
|
-
* @dev
|
|
35
|
+
* @dev Returns the number of tokens that can be minted
|
|
36
|
+
* @return The number of tokens that can be minted
|
|
37
|
+
*/
|
|
38
|
+
function tokenSupplyCap() public view virtual returns (uint256) {
|
|
39
|
+
return _tokenSupplyCap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// --- Transfer functionality
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @dev Mints `amount` and transfers it to `to`.
|
|
30
46
|
*
|
|
31
47
|
* Requirements:
|
|
32
48
|
*
|
|
@@ -38,9 +54,13 @@ abstract contract LSP7CappedSupply is LSP7DigitalAsset, LSP7CappedSupplyCore {
|
|
|
38
54
|
function _mint(
|
|
39
55
|
address to,
|
|
40
56
|
uint256 amount,
|
|
41
|
-
bool
|
|
57
|
+
bool allowNonLSP1Recipient,
|
|
42
58
|
bytes memory data
|
|
43
|
-
) internal virtual override
|
|
44
|
-
|
|
59
|
+
) internal virtual override {
|
|
60
|
+
if (totalSupply() + amount > tokenSupplyCap()) {
|
|
61
|
+
revert LSP7CappedSupplyCannotMintOverCap();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
super._mint(to, amount, allowNonLSP1Recipient, data);
|
|
45
65
|
}
|
|
46
66
|
}
|
|
@@ -1,19 +1,22 @@
|
|
|
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 {LSP7DigitalAssetInitAbstract} from "../LSP7DigitalAssetInitAbstract.sol";
|
|
7
7
|
import {LSP7DigitalAssetCore} from "../LSP7DigitalAssetCore.sol";
|
|
8
|
-
import {LSP7CappedSupplyCore} from "./LSP7CappedSupplyCore.sol";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* @dev LSP7 extension, adds token supply cap.
|
|
12
11
|
*/
|
|
13
|
-
abstract contract LSP7CappedSupplyInitAbstract is
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
abstract contract LSP7CappedSupplyInitAbstract is LSP7DigitalAssetInitAbstract {
|
|
13
|
+
// --- Errors
|
|
14
|
+
error LSP7CappedSupplyRequired();
|
|
15
|
+
error LSP7CappedSupplyCannotMintOverCap();
|
|
16
|
+
|
|
17
|
+
// --- Storage
|
|
18
|
+
uint256 internal _tokenSupplyCap;
|
|
19
|
+
|
|
17
20
|
function _initialize(uint256 tokenSupplyCap_) internal virtual onlyInitializing {
|
|
18
21
|
if (tokenSupplyCap_ == 0) {
|
|
19
22
|
revert LSP7CappedSupplyRequired();
|
|
@@ -22,10 +25,20 @@ abstract contract LSP7CappedSupplyInitAbstract is
|
|
|
22
25
|
_tokenSupplyCap = tokenSupplyCap_;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
// ---
|
|
28
|
+
// --- Token queries
|
|
26
29
|
|
|
27
30
|
/**
|
|
28
|
-
* @dev
|
|
31
|
+
* @dev Returns the number of tokens that can be minted
|
|
32
|
+
* @return The number of tokens that can be minted
|
|
33
|
+
*/
|
|
34
|
+
function tokenSupplyCap() public view virtual returns (uint256) {
|
|
35
|
+
return _tokenSupplyCap;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// --- Transfer functionality
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @dev Mints `amount` and transfers it to `to`.
|
|
29
42
|
*
|
|
30
43
|
* Requirements:
|
|
31
44
|
*
|
|
@@ -37,9 +50,13 @@ abstract contract LSP7CappedSupplyInitAbstract is
|
|
|
37
50
|
function _mint(
|
|
38
51
|
address to,
|
|
39
52
|
uint256 amount,
|
|
40
|
-
bool
|
|
53
|
+
bool allowNonLSP1Recipient,
|
|
41
54
|
bytes memory data
|
|
42
|
-
) internal virtual override
|
|
43
|
-
|
|
55
|
+
) internal virtual override {
|
|
56
|
+
if (totalSupply() + amount > tokenSupplyCap()) {
|
|
57
|
+
revert LSP7CappedSupplyCannotMintOverCap();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
super._mint(to, amount, allowNonLSP1Recipient, data);
|
|
44
61
|
}
|
|
45
62
|
}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.
|
|
2
|
+
pragma solidity ^0.8.12;
|
|
3
|
+
|
|
4
|
+
// interfaces
|
|
5
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
6
|
+
import {ILSP7CompatibleERC20} from "./ILSP7CompatibleERC20.sol";
|
|
7
|
+
import {ILSP7DigitalAsset} from "../ILSP7DigitalAsset.sol";
|
|
3
8
|
|
|
4
9
|
// modules
|
|
10
|
+
import {LSP4Compatibility} from "../../LSP4DigitalAssetMetadata/LSP4Compatibility.sol";
|
|
5
11
|
import {LSP7DigitalAsset, LSP4DigitalAssetMetadata, ERC725YCore} from "../LSP7DigitalAsset.sol";
|
|
6
12
|
import {LSP7DigitalAssetCore} from "../LSP7DigitalAssetCore.sol";
|
|
7
|
-
import {LSP7CompatibleERC20Core} from "./LSP7CompatibleERC20Core.sol";
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @dev LSP7 extension, for compatibility for clients / tools that expect ERC20.
|
|
16
|
+
*/
|
|
17
|
+
abstract contract LSP7CompatibleERC20 is ILSP7CompatibleERC20, LSP4Compatibility, LSP7DigitalAsset {
|
|
11
18
|
/**
|
|
12
19
|
* @notice Sets the name, the symbol and the owner of the token
|
|
13
20
|
* @param name_ The name of the token
|
|
@@ -20,41 +27,101 @@ abstract contract LSP7CompatibleERC20 is LSP7DigitalAsset, LSP7CompatibleERC20Co
|
|
|
20
27
|
address newOwner_
|
|
21
28
|
) LSP7DigitalAsset(name_, symbol_, newOwner_, false) {}
|
|
22
29
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
/**
|
|
31
|
+
* @dev See {IERC165-supportsInterface}.
|
|
32
|
+
*/
|
|
33
|
+
function supportsInterface(bytes4 interfaceId)
|
|
26
34
|
public
|
|
35
|
+
view
|
|
27
36
|
virtual
|
|
28
|
-
override(
|
|
37
|
+
override(IERC165, ERC725YCore, LSP7DigitalAsset)
|
|
38
|
+
returns (bool)
|
|
29
39
|
{
|
|
30
|
-
super.
|
|
40
|
+
return super.supportsInterface(interfaceId);
|
|
31
41
|
}
|
|
32
42
|
|
|
33
|
-
|
|
43
|
+
/**
|
|
44
|
+
* @inheritdoc ILSP7CompatibleERC20
|
|
45
|
+
*/
|
|
46
|
+
function allowance(address tokenOwner, address operator) public view virtual returns (uint256) {
|
|
47
|
+
return authorizedAmountFor(operator, tokenOwner);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @inheritdoc ILSP7CompatibleERC20
|
|
52
|
+
*/
|
|
53
|
+
function approve(address operator, uint256 amount) public virtual returns (bool) {
|
|
54
|
+
authorizeOperator(operator, amount);
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @inheritdoc ILSP7CompatibleERC20
|
|
60
|
+
* @dev Compatible with ERC20 transferFrom.
|
|
61
|
+
* Using allowNonLSP1Recipient=true so that EOA and any contract may receive the tokens.
|
|
62
|
+
*/
|
|
63
|
+
function transferFrom(
|
|
34
64
|
address from,
|
|
65
|
+
address to,
|
|
66
|
+
uint256 amount
|
|
67
|
+
) public virtual returns (bool) {
|
|
68
|
+
transfer(from, to, amount, true, "");
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// --- Overrides
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @inheritdoc ILSP7CompatibleERC20
|
|
76
|
+
* @dev Compatible with ERC20 transfer.
|
|
77
|
+
* Using allowNonLSP1Recipient=true so that EOA and any contract may receive the tokens.
|
|
78
|
+
*/
|
|
79
|
+
function transfer(address to, uint256 amount) public virtual override returns (bool) {
|
|
80
|
+
transfer(msg.sender, to, amount, true, "");
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @dev same behaviour as LSP7DigitalAssetCore
|
|
86
|
+
* with the addition of emitting ERC20 Approval event.
|
|
87
|
+
*/
|
|
88
|
+
function _updateOperator(
|
|
89
|
+
address tokenOwner,
|
|
90
|
+
address operator,
|
|
91
|
+
uint256 amount
|
|
92
|
+
) internal virtual override {
|
|
93
|
+
super._updateOperator(tokenOwner, operator, amount);
|
|
94
|
+
emit Approval(tokenOwner, operator, amount);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function _transfer(
|
|
98
|
+
address from,
|
|
99
|
+
address to,
|
|
35
100
|
uint256 amount,
|
|
101
|
+
bool allowNonLSP1Recipient,
|
|
36
102
|
bytes memory data
|
|
37
|
-
) internal virtual override
|
|
38
|
-
super.
|
|
103
|
+
) internal virtual override {
|
|
104
|
+
super._transfer(from, to, amount, allowNonLSP1Recipient, data);
|
|
105
|
+
emit Transfer(from, to, amount);
|
|
39
106
|
}
|
|
40
107
|
|
|
41
108
|
function _mint(
|
|
42
109
|
address to,
|
|
43
110
|
uint256 amount,
|
|
44
|
-
bool
|
|
111
|
+
bool allowNonLSP1Recipient,
|
|
45
112
|
bytes memory data
|
|
46
|
-
) internal virtual override
|
|
47
|
-
super._mint(to, amount,
|
|
113
|
+
) internal virtual override {
|
|
114
|
+
super._mint(to, amount, allowNonLSP1Recipient, data);
|
|
115
|
+
emit Transfer(address(0), to, amount);
|
|
48
116
|
}
|
|
49
117
|
|
|
50
|
-
function
|
|
118
|
+
function _burn(
|
|
51
119
|
address from,
|
|
52
|
-
address to,
|
|
53
120
|
uint256 amount,
|
|
54
|
-
bool force,
|
|
55
121
|
bytes memory data
|
|
56
|
-
) internal virtual override
|
|
57
|
-
super.
|
|
122
|
+
) internal virtual override {
|
|
123
|
+
super._burn(from, amount, data);
|
|
124
|
+
emit Transfer(from, address(0), amount);
|
|
58
125
|
}
|
|
59
126
|
|
|
60
127
|
function _setData(bytes32 key, bytes memory value)
|
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.12;
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
// interfaces
|
|
5
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
6
|
+
import {ILSP7CompatibleERC20} from "./ILSP7CompatibleERC20.sol";
|
|
7
|
+
import {ILSP7DigitalAsset} from "../ILSP7DigitalAsset.sol";
|
|
4
8
|
|
|
5
9
|
// modules
|
|
10
|
+
import {LSP4Compatibility} from "../../LSP4DigitalAssetMetadata/LSP4Compatibility.sol";
|
|
6
11
|
import {
|
|
7
12
|
LSP7DigitalAssetInitAbstract,
|
|
8
13
|
LSP4DigitalAssetMetadataInitAbstract,
|
|
9
14
|
ERC725YCore
|
|
10
15
|
} from "../LSP7DigitalAssetInitAbstract.sol";
|
|
11
16
|
import {LSP7DigitalAssetCore} from "../LSP7DigitalAssetCore.sol";
|
|
12
|
-
import {LSP7CompatibleERC20Core} from "./LSP7CompatibleERC20Core.sol";
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @dev LSP7 extension, for compatibility for clients / tools that expect ERC20.
|
|
20
|
+
*/
|
|
21
|
+
abstract contract LSP7CompatibleERC20InitAbstract is
|
|
22
|
+
ILSP7CompatibleERC20,
|
|
23
|
+
LSP4Compatibility,
|
|
24
|
+
LSP7DigitalAssetInitAbstract
|
|
25
|
+
{
|
|
26
|
+
/**
|
|
27
|
+
* @notice Sets the name, the symbol and the owner of the token
|
|
28
|
+
* @param name_ The name of the token
|
|
29
|
+
* @param symbol_ The symbol of the token
|
|
30
|
+
* @param newOwner_ The owner of the token
|
|
31
|
+
*/
|
|
32
|
+
|
|
15
33
|
function _initialize(
|
|
16
34
|
string memory name_,
|
|
17
35
|
string memory symbol_,
|
|
@@ -20,41 +38,101 @@ contract LSP7CompatibleERC20InitAbstract is LSP7DigitalAssetInitAbstract, LSP7Co
|
|
|
20
38
|
LSP7DigitalAssetInitAbstract._initialize(name_, symbol_, newOwner_, false);
|
|
21
39
|
}
|
|
22
40
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @dev See {IERC165-supportsInterface}.
|
|
43
|
+
*/
|
|
44
|
+
function supportsInterface(bytes4 interfaceId)
|
|
26
45
|
public
|
|
46
|
+
view
|
|
27
47
|
virtual
|
|
28
|
-
override(
|
|
48
|
+
override(IERC165, ERC725YCore, LSP7DigitalAssetInitAbstract)
|
|
49
|
+
returns (bool)
|
|
29
50
|
{
|
|
30
|
-
super.
|
|
51
|
+
return super.supportsInterface(interfaceId);
|
|
31
52
|
}
|
|
32
53
|
|
|
33
|
-
|
|
54
|
+
/**
|
|
55
|
+
* @inheritdoc ILSP7CompatibleERC20
|
|
56
|
+
*/
|
|
57
|
+
function allowance(address tokenOwner, address operator) public view virtual returns (uint256) {
|
|
58
|
+
return authorizedAmountFor(operator, tokenOwner);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @inheritdoc ILSP7CompatibleERC20
|
|
63
|
+
*/
|
|
64
|
+
function approve(address operator, uint256 amount) public virtual returns (bool) {
|
|
65
|
+
authorizeOperator(operator, amount);
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @inheritdoc ILSP7CompatibleERC20
|
|
71
|
+
* @dev Compatible with ERC20 transferFrom.
|
|
72
|
+
* Using allowNonLSP1Recipient=true so that EOA and any contract may receive the tokens.
|
|
73
|
+
*/
|
|
74
|
+
function transferFrom(
|
|
34
75
|
address from,
|
|
76
|
+
address to,
|
|
77
|
+
uint256 amount
|
|
78
|
+
) public virtual returns (bool) {
|
|
79
|
+
transfer(from, to, amount, true, "");
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// --- Overrides
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @inheritdoc ILSP7CompatibleERC20
|
|
87
|
+
* @dev Compatible with ERC20 transfer.
|
|
88
|
+
* Using allowNonLSP1Recipient=true so that EOA and any contract may receive the tokens.
|
|
89
|
+
*/
|
|
90
|
+
function transfer(address to, uint256 amount) public virtual override returns (bool) {
|
|
91
|
+
transfer(msg.sender, to, amount, true, "");
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @dev same behaviour as LSP7DigitalAssetCore
|
|
97
|
+
* with the addition of emitting ERC20 Approval event.
|
|
98
|
+
*/
|
|
99
|
+
function _updateOperator(
|
|
100
|
+
address tokenOwner,
|
|
101
|
+
address operator,
|
|
102
|
+
uint256 amount
|
|
103
|
+
) internal virtual override {
|
|
104
|
+
super._updateOperator(tokenOwner, operator, amount);
|
|
105
|
+
emit Approval(tokenOwner, operator, amount);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function _transfer(
|
|
109
|
+
address from,
|
|
110
|
+
address to,
|
|
35
111
|
uint256 amount,
|
|
112
|
+
bool allowNonLSP1Recipient,
|
|
36
113
|
bytes memory data
|
|
37
|
-
) internal virtual override
|
|
38
|
-
super.
|
|
114
|
+
) internal virtual override {
|
|
115
|
+
super._transfer(from, to, amount, allowNonLSP1Recipient, data);
|
|
116
|
+
emit Transfer(from, to, amount);
|
|
39
117
|
}
|
|
40
118
|
|
|
41
119
|
function _mint(
|
|
42
120
|
address to,
|
|
43
121
|
uint256 amount,
|
|
44
|
-
bool
|
|
122
|
+
bool allowNonLSP1Recipient,
|
|
45
123
|
bytes memory data
|
|
46
|
-
) internal virtual override
|
|
47
|
-
super._mint(to, amount,
|
|
124
|
+
) internal virtual override {
|
|
125
|
+
super._mint(to, amount, allowNonLSP1Recipient, data);
|
|
126
|
+
emit Transfer(address(0), to, amount);
|
|
48
127
|
}
|
|
49
128
|
|
|
50
|
-
function
|
|
129
|
+
function _burn(
|
|
51
130
|
address from,
|
|
52
|
-
address to,
|
|
53
131
|
uint256 amount,
|
|
54
|
-
bool force,
|
|
55
132
|
bytes memory data
|
|
56
|
-
) internal virtual override
|
|
57
|
-
super.
|
|
133
|
+
) internal virtual override {
|
|
134
|
+
super._burn(from, amount, data);
|
|
135
|
+
emit Transfer(from, address(0), amount);
|
|
58
136
|
}
|
|
59
137
|
|
|
60
138
|
function _setData(bytes32 key, bytes memory value)
|
|
@@ -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 {ILSP7DigitalAsset} from "../ILSP7DigitalAsset.sol";
|
|
@@ -12,7 +12,7 @@ interface ILSP7Mintable is ILSP7DigitalAsset {
|
|
|
12
12
|
/**
|
|
13
13
|
* @param to The address to mint tokens
|
|
14
14
|
* @param amount The amount 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 ILSP7Mintable is ILSP7DigitalAsset {
|
|
|
26
26
|
function mint(
|
|
27
27
|
address to,
|
|
28
28
|
uint256 amount,
|
|
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 {LSP7CompatibleERC20} from "../extensions/LSP7CompatibleERC20.sol";
|
|
5
5
|
|
|
6
6
|
contract LSP7CompatibleERC20Mintable is LSP7CompatibleERC20 {
|
|
7
|
-
/* solhint-disable no-empty-blocks */
|
|
8
7
|
constructor(
|
|
9
8
|
string memory name_,
|
|
10
9
|
string memory symbol_,
|
|
@@ -14,9 +13,9 @@ contract LSP7CompatibleERC20Mintable is LSP7CompatibleERC20 {
|
|
|
14
13
|
function mint(
|
|
15
14
|
address to,
|
|
16
15
|
uint256 amount,
|
|
17
|
-
bool
|
|
16
|
+
bool allowNonLSP1Recipient,
|
|
18
17
|
bytes memory data
|
|
19
18
|
) public onlyOwner {
|
|
20
|
-
_mint(to, amount,
|
|
19
|
+
_mint(to, amount, 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 {
|
|
@@ -24,7 +24,7 @@ contract LSP7CompatibleERC20MintableInit is LSP7CompatibleERC20MintableInitAbstr
|
|
|
24
24
|
string memory name_,
|
|
25
25
|
string memory symbol_,
|
|
26
26
|
address newOwner_
|
|
27
|
-
)
|
|
27
|
+
) external virtual initializer {
|
|
28
28
|
LSP7CompatibleERC20MintableInitAbstract._initialize(name_, symbol_, newOwner_);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -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 {LSP7CompatibleERC20InitAbstract} from "../extensions/LSP7CompatibleERC20InitAbstract.sol";
|
|
@@ -19,9 +19,9 @@ contract LSP7CompatibleERC20MintableInitAbstract is LSP7CompatibleERC20InitAbstr
|
|
|
19
19
|
function mint(
|
|
20
20
|
address to,
|
|
21
21
|
uint256 amount,
|
|
22
|
-
bool
|
|
22
|
+
bool allowNonLSP1Recipient,
|
|
23
23
|
bytes memory data
|
|
24
24
|
) public onlyOwner {
|
|
25
|
-
_mint(to, amount,
|
|
25
|
+
_mint(to, amount, 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 {ILSP7Mintable} from "./ILSP7Mintable.sol";
|
|
@@ -14,8 +14,6 @@ import {LSP7DigitalAsset} from "../LSP7DigitalAsset.sol";
|
|
|
14
14
|
* @dev LSP7 extension, mintable.
|
|
15
15
|
*/
|
|
16
16
|
contract LSP7Mintable is LSP7DigitalAsset, ILSP7Mintable {
|
|
17
|
-
// solhint-disable no-empty-blocks
|
|
18
|
-
|
|
19
17
|
/**
|
|
20
18
|
* @notice Sets the token-Metadata and register LSP7InterfaceId
|
|
21
19
|
* @param name_ The name of the token
|
|
@@ -36,9 +34,9 @@ contract LSP7Mintable is LSP7DigitalAsset, ILSP7Mintable {
|
|
|
36
34
|
function mint(
|
|
37
35
|
address to,
|
|
38
36
|
uint256 amount,
|
|
39
|
-
bool
|
|
37
|
+
bool allowNonLSP1Recipient,
|
|
40
38
|
bytes memory data
|
|
41
39
|
) public virtual onlyOwner {
|
|
42
|
-
_mint(to, amount,
|
|
40
|
+
_mint(to, amount, allowNonLSP1Recipient, data);
|
|
43
41
|
}
|
|
44
42
|
}
|
|
@@ -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 {LSP7MintableInitAbstract} from "./LSP7MintableInitAbstract.sol";
|
|
@@ -28,7 +28,7 @@ contract LSP7MintableInit is LSP7MintableInitAbstract {
|
|
|
28
28
|
string memory symbol_,
|
|
29
29
|
address newOwner_,
|
|
30
30
|
bool isNonDivisible_
|
|
31
|
-
)
|
|
31
|
+
) external virtual initializer {
|
|
32
32
|
LSP7MintableInitAbstract._initialize(name_, symbol_, newOwner_, isNonDivisible_);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -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 {ILSP7Mintable} from "./ILSP7Mintable.sol";
|
|
@@ -27,9 +27,9 @@ abstract contract LSP7MintableInitAbstract is LSP7DigitalAssetInitAbstract, ILSP
|
|
|
27
27
|
function mint(
|
|
28
28
|
address to,
|
|
29
29
|
uint256 amount,
|
|
30
|
-
bool
|
|
30
|
+
bool allowNonLSP1Recipient,
|
|
31
31
|
bytes memory data
|
|
32
32
|
) public virtual onlyOwner {
|
|
33
|
-
_mint(to, amount,
|
|
33
|
+
_mint(to, amount, allowNonLSP1Recipient, data);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -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 {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
@@ -18,7 +18,7 @@ interface ILSP8IdentifiableDigitalAsset is IERC165, IERC725Y {
|
|
|
18
18
|
* @param from The address which tokens are sent
|
|
19
19
|
* @param to The receiving address
|
|
20
20
|
* @param tokenId The tokenId transferred
|
|
21
|
-
* @param
|
|
21
|
+
* @param allowNonLSP1Recipient When set to TRUE, `to` may be any address but
|
|
22
22
|
* when set to FALSE `to` must be a contract that supports LSP1 UniversalReceiver
|
|
23
23
|
* @param data Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses
|
|
24
24
|
*/
|
|
@@ -27,7 +27,7 @@ interface ILSP8IdentifiableDigitalAsset is IERC165, IERC725Y {
|
|
|
27
27
|
address indexed from,
|
|
28
28
|
address indexed to,
|
|
29
29
|
bytes32 indexed tokenId,
|
|
30
|
-
bool
|
|
30
|
+
bool allowNonLSP1Recipient,
|
|
31
31
|
bytes data
|
|
32
32
|
);
|
|
33
33
|
|
|
@@ -159,7 +159,7 @@ interface ILSP8IdentifiableDigitalAsset is IERC165, IERC725Y {
|
|
|
159
159
|
* @param from The sending address.
|
|
160
160
|
* @param to The receiving address.
|
|
161
161
|
* @param tokenId The tokenId to transfer.
|
|
162
|
-
* @param
|
|
162
|
+
* @param allowNonLSP1Recipient When set to TRUE, to may be any address but
|
|
163
163
|
* when set to FALSE to must be a contract that supports LSP1 UniversalReceiver
|
|
164
164
|
* @param data Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses.
|
|
165
165
|
* @dev Transfers `tokenId` token from `from` to `to`.
|
|
@@ -178,7 +178,7 @@ interface ILSP8IdentifiableDigitalAsset is IERC165, IERC725Y {
|
|
|
178
178
|
address from,
|
|
179
179
|
address to,
|
|
180
180
|
bytes32 tokenId,
|
|
181
|
-
bool
|
|
181
|
+
bool allowNonLSP1Recipient,
|
|
182
182
|
bytes memory data
|
|
183
183
|
) external;
|
|
184
184
|
|
|
@@ -186,7 +186,7 @@ interface ILSP8IdentifiableDigitalAsset is IERC165, IERC725Y {
|
|
|
186
186
|
* @param from The list of sending addresses.
|
|
187
187
|
* @param to The list of receiving addresses.
|
|
188
188
|
* @param tokenId The list of tokenId to transfer.
|
|
189
|
-
* @param
|
|
189
|
+
* @param allowNonLSP1Recipient When set to TRUE, to may be any address but
|
|
190
190
|
* when set to FALSE to must be a contract that supports LSP1 UniversalReceiver
|
|
191
191
|
* @param data Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses.
|
|
192
192
|
*
|
|
@@ -208,7 +208,7 @@ interface ILSP8IdentifiableDigitalAsset is IERC165, IERC725Y {
|
|
|
208
208
|
address[] memory from,
|
|
209
209
|
address[] memory to,
|
|
210
210
|
bytes32[] memory tokenId,
|
|
211
|
-
bool
|
|
211
|
+
bool[] memory allowNonLSP1Recipient,
|
|
212
212
|
bytes[] memory data
|
|
213
213
|
) external;
|
|
214
214
|
}
|
|
@@ -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_LSP8 =
|
|
5
|
+
bytes4 constant _INTERFACEID_LSP8 = 0x622e7a01;
|
|
6
6
|
|
|
7
|
-
// --- ERC725Y Keys
|
|
7
|
+
// --- ERC725Y Data Keys
|
|
8
8
|
|
|
9
9
|
// bytes10(keccak256('LSP8MetadataAddress')) + bytes2(0)
|
|
10
10
|
bytes12 constant _LSP8_METADATA_ADDRESS_KEY_PREFIX = 0x73dcc7c3c4096cdc7f8a0000;
|
|
@@ -14,8 +14,8 @@ bytes12 constant _LSP8_METADATA_JSON_KEY_PREFIX = 0x9a26b4060ae7f7d5e3cd0000;
|
|
|
14
14
|
|
|
15
15
|
// --- Token Hooks
|
|
16
16
|
|
|
17
|
-
// keccak256('
|
|
18
|
-
bytes32 constant _TYPEID_LSP8_TOKENSSENDER =
|
|
17
|
+
// keccak256('LSP8Tokens_SenderNotification')
|
|
18
|
+
bytes32 constant _TYPEID_LSP8_TOKENSSENDER = 0xb23eae7e6d1564b295b4c3e3be402d9a2f0776c57bdf365903496f6fa481ab00;
|
|
19
19
|
|
|
20
|
-
// keccak256('
|
|
21
|
-
bytes32 constant _TYPEID_LSP8_TOKENSRECIPIENT =
|
|
20
|
+
// keccak256('LSP8Tokens_RecipientNotification')
|
|
21
|
+
bytes32 constant _TYPEID_LSP8_TOKENSRECIPIENT = 0x0b084a55ebf70fd3c06fd755269dac2212c4d3f0f4d09079780bfa50c1b2984d;
|