@lukso/lsp-smart-contracts 0.13.0 → 0.15.0-rc.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 +2 -191
- package/artifacts/LSP0ERC725Account.json +3 -3
- package/artifacts/LSP0ERC725AccountInit.json +3 -3
- package/artifacts/LSP11BasicSocialRecovery.json +2 -2
- package/artifacts/LSP11BasicSocialRecoveryInit.json +2 -2
- package/artifacts/LSP1UniversalReceiverDelegateUP.json +3 -3
- package/artifacts/LSP1UniversalReceiverDelegateVault.json +3 -3
- package/artifacts/LSP23LinkedContractsFactory.json +3 -3
- package/artifacts/LSP4DigitalAssetMetadata.json +1 -1
- package/artifacts/LSP4DigitalAssetMetadataInitAbstract.json +1 -1
- package/artifacts/LSP6KeyManager.json +3 -3
- package/artifacts/LSP6KeyManagerInit.json +3 -3
- package/artifacts/LSP7CappedSupply.json +53 -6
- package/artifacts/LSP7CappedSupplyInitAbstract.json +53 -6
- package/artifacts/LSP7DigitalAsset.json +52 -5
- package/artifacts/LSP7DigitalAssetInitAbstract.json +52 -5
- package/artifacts/LSP7Mintable.json +54 -7
- package/artifacts/LSP7MintableInit.json +54 -7
- package/artifacts/LSP8CappedSupply.json +85 -48
- package/artifacts/LSP8CappedSupplyInitAbstract.json +85 -48
- package/artifacts/LSP8IdentifiableDigitalAsset.json +85 -48
- package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +85 -48
- package/artifacts/LSP8Mintable.json +88 -51
- package/artifacts/LSP8MintableInit.json +88 -51
- package/artifacts/LSP9Vault.json +3 -3
- package/artifacts/LSP9VaultInit.json +3 -3
- package/artifacts/UniversalProfile.json +3 -3
- package/artifacts/UniversalProfileInit.json +3 -3
- package/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +1 -17
- package/contracts/LSP0ERC725Account/LSP0Constants.sol +1 -23
- package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +1 -53
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +1 -873
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +1 -47
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +1 -49
- package/contracts/LSP10ReceivedVaults/LSP10Constants.sol +1 -7
- package/contracts/LSP10ReceivedVaults/LSP10Utils.sol +1 -208
- package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol +4 -2
- package/contracts/LSP12IssuedAssets/LSP12Constants.sol +4 -0
- package/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +1 -75
- package/contracts/LSP14Ownable2Step/LSP14Constants.sol +1 -12
- package/contracts/LSP14Ownable2Step/LSP14Errors.sol +1 -29
- package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +1 -212
- package/contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol +1 -417
- package/contracts/LSP17ContractExtension/LSP17Constants.sol +1 -14
- package/contracts/LSP17ContractExtension/LSP17Errors.sol +1 -14
- package/contracts/LSP17ContractExtension/LSP17Extendable.sol +1 -117
- package/contracts/LSP17ContractExtension/LSP17Extension.sol +1 -55
- package/contracts/LSP17ContractExtension/LSP17Utils.sol +1 -16
- package/contracts/LSP17Extensions/Extension4337.sol +1 -123
- package/contracts/LSP17Extensions/OnERC721ReceivedExtension.sol +1 -13
- package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +1 -37
- package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol +1 -21
- package/contracts/LSP1UniversalReceiver/LSP1Constants.sol +1 -11
- package/contracts/LSP1UniversalReceiver/LSP1Errors.sol +1 -7
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +1 -292
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +1 -217
- package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +1 -84
- package/contracts/LSP20CallVerification/ILSP20CallVerifier.sol +1 -36
- package/contracts/LSP20CallVerification/LSP20CallVerification.sol +1 -117
- package/contracts/LSP20CallVerification/LSP20Constants.sol +1 -14
- package/contracts/LSP20CallVerification/LSP20Errors.sol +1 -18
- package/contracts/LSP23LinkedContractsFactory/ILSP23LinkedContractsFactory.sol +1 -189
- package/contracts/LSP23LinkedContractsFactory/IPostDeploymentModule.sol +1 -15
- package/contracts/LSP23LinkedContractsFactory/LSP23Errors.sol +1 -21
- package/contracts/LSP23LinkedContractsFactory/LSP23LinkedContractsFactory.sol +1 -393
- package/contracts/LSP23LinkedContractsFactory/modules/README.md +23 -0
- package/contracts/LSP23LinkedContractsFactory/modules/UniversalProfileInitPostDeploymentModule.sol +1 -60
- package/contracts/LSP23LinkedContractsFactory/modules/UniversalProfilePostDeploymentModule.sol +1 -58
- package/contracts/LSP25ExecuteRelayCall/ILSP25ExecuteRelayCall.sol +1 -65
- package/contracts/LSP25ExecuteRelayCall/LSP25Constants.sol +1 -5
- package/contracts/LSP25ExecuteRelayCall/LSP25Errors.sol +1 -14
- package/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol +1 -141
- package/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +1 -445
- package/contracts/LSP3ProfileMetadata/LSP3Constants.sol +1 -8
- package/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +1 -31
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +1 -59
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol +1 -44
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +1 -65
- package/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +1 -20
- package/contracts/LSP5ReceivedAssets/LSP5Constants.sol +1 -7
- package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +1 -206
- package/contracts/LSP6KeyManager/ILSP6KeyManager.sol +1 -60
- package/contracts/LSP6KeyManager/LSP6Constants.sol +1 -61
- package/contracts/LSP6KeyManager/LSP6Errors.sol +1 -222
- package/contracts/LSP6KeyManager/LSP6KeyManager.sol +1 -23
- package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +1 -694
- package/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +1 -29
- package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +1 -21
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +1 -411
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteRelayCallModule.sol +1 -24
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol +1 -27
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +1 -848
- package/contracts/LSP6KeyManager/LSP6Utils.sol +1 -293
- package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +1 -302
- package/contracts/LSP7DigitalAsset/LSP7Constants.sol +1 -13
- package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +1 -193
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +1 -728
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +1 -189
- package/contracts/LSP7DigitalAsset/LSP7Errors.sol +1 -87
- package/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +1 -23
- package/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +1 -24
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +1 -80
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +1 -83
- package/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +1 -29
- package/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +1 -50
- package/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +1 -41
- package/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +1 -54
- package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +1 -326
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +1 -38
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +1 -102
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +1 -236
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +1 -787
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +1 -243
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +2 -28
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8BurnableInitAbstract.sol +2 -22
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +2 -84
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +2 -87
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +2 -68
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +2 -63
- package/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +1 -31
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +2 -59
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +2 -42
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +2 -61
- package/contracts/LSP9Vault/ILSP9Vault.sol +1 -16
- package/contracts/LSP9Vault/LSP9Constants.sol +1 -26
- package/contracts/LSP9Vault/LSP9Errors.sol +1 -6
- package/contracts/LSP9Vault/LSP9Vault.sol +1 -63
- package/contracts/LSP9Vault/LSP9VaultCore.sol +1 -684
- package/contracts/LSP9Vault/LSP9VaultInit.sol +1 -33
- package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +1 -65
- package/contracts/UniversalProfile.sol +1 -37
- package/contracts/UniversalProfileInit.sol +1 -39
- package/contracts/UniversalProfileInitAbstract.sol +1 -44
- package/dist/constants.cjs +75 -0
- package/dist/constants.d.cts +121 -0
- package/dist/constants.d.mts +121 -0
- package/dist/constants.d.ts +107 -40105
- package/dist/constants.mjs +70 -0
- package/package.json +58 -116
- package/types/@lukso/lsp0-contracts/contracts/LSP0ERC725Account.ts +694 -0
- package/types/@lukso/lsp0-contracts/contracts/LSP0ERC725AccountInit.ts +740 -0
- package/types/@lukso/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.ts +139 -0
- package/types/@lukso/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.ts +139 -0
- package/types/@lukso/lsp23-contracts/contracts/LSP23LinkedContractsFactory.ts +448 -0
- package/types/@lukso/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.ts +274 -0
- package/types/@lukso/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.ts +309 -0
- package/types/@lukso/lsp6-contracts/contracts/LSP6KeyManager.ts +355 -0
- package/types/@lukso/lsp6-contracts/contracts/LSP6KeyManagerInit.ts +398 -0
- package/types/@lukso/lsp7-contracts/contracts/LSP7DigitalAsset.ts +698 -0
- package/types/@lukso/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.ts +729 -0
- package/types/@lukso/lsp7-contracts/contracts/extensions/LSP7CappedSupply.ts +712 -0
- package/types/@lukso/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.ts +743 -0
- package/types/@lukso/lsp7-contracts/contracts/presets/LSP7Mintable.ts +717 -0
- package/types/@lukso/lsp7-contracts/contracts/presets/LSP7MintableInit.ts +779 -0
- package/types/@lukso/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.ts +778 -0
- package/types/@lukso/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.ts +813 -0
- package/types/@lukso/lsp8-contracts/contracts/extensions/LSP8CappedSupply.ts +792 -0
- package/types/@lukso/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.ts +824 -0
- package/types/@lukso/lsp8-contracts/contracts/presets/LSP8Mintable.ts +797 -0
- package/types/@lukso/lsp8-contracts/contracts/presets/LSP8MintableInit.ts +860 -0
- package/types/@lukso/lsp9-contracts/contracts/LSP9Vault.ts +672 -0
- package/types/@lukso/lsp9-contracts/contracts/LSP9VaultInit.ts +714 -0
- package/types/@lukso/universalprofile-contracts/contracts/UniversalProfile.ts +694 -0
- package/types/@lukso/universalprofile-contracts/contracts/UniversalProfileInit.ts +740 -0
- package/types/LSP0ERC725Account.ts +694 -0
- package/types/LSP0ERC725AccountInit.ts +740 -0
- package/types/LSP11BasicSocialRecovery.ts +596 -0
- package/types/LSP11BasicSocialRecoveryInit.ts +646 -0
- package/types/LSP1UniversalReceiverDelegateUP.ts +139 -0
- package/types/LSP1UniversalReceiverDelegateVault.ts +139 -0
- package/types/LSP23LinkedContractsFactory.ts +448 -0
- package/types/LSP4DigitalAssetMetadata.ts +274 -0
- package/types/LSP4DigitalAssetMetadataInitAbstract.ts +309 -0
- package/types/LSP6KeyManager.ts +355 -0
- package/types/LSP6KeyManagerInit.ts +398 -0
- package/types/LSP7CappedSupply.ts +712 -0
- package/types/LSP7CappedSupplyInitAbstract.ts +743 -0
- package/types/LSP7DigitalAsset.ts +698 -0
- package/types/LSP7DigitalAssetInitAbstract.ts +729 -0
- package/types/LSP7Mintable.ts +717 -0
- package/types/LSP7MintableInit.ts +779 -0
- package/types/LSP8CappedSupply.ts +792 -0
- package/types/LSP8CappedSupplyInitAbstract.ts +824 -0
- package/types/LSP8IdentifiableDigitalAsset.ts +778 -0
- package/types/LSP8IdentifiableDigitalAssetInitAbstract.ts +813 -0
- package/types/LSP8Mintable.ts +797 -0
- package/types/LSP8MintableInit.ts +860 -0
- package/types/LSP9Vault.ts +672 -0
- package/types/LSP9VaultInit.ts +714 -0
- package/types/UniversalProfile.ts +694 -0
- package/types/UniversalProfileInit.ts +740 -0
- package/types/common.ts +131 -0
- package/types/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.ts +596 -0
- package/types/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.ts +646 -0
- package/types/index.ts +58 -0
- package/LICENSE +0 -201
- package/artifacts/Create2Factory.json +0 -107
- package/artifacts/LSP16UniversalFactory.json +0 -271
- package/artifacts/LSP7CompatibleERC20.json +0 -935
- package/artifacts/LSP7CompatibleERC20InitAbstract.json +0 -948
- package/artifacts/LSP7CompatibleERC20Mintable.json +0 -989
- package/artifacts/LSP7CompatibleERC20MintableInit.json +0 -1009
- package/artifacts/LSP8CompatibleERC721.json +0 -1191
- package/artifacts/LSP8CompatibleERC721InitAbstract.json +0 -1204
- package/artifacts/LSP8CompatibleERC721Mintable.json +0 -1261
- package/artifacts/LSP8CompatibleERC721MintableInit.json +0 -1281
- package/artifacts/UniversalReceiverAddressStore.json +0 -209
- package/contracts/Factories/Create2Factory.sol +0 -88
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +0 -260
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +0 -273
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +0 -37
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +0 -44
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +0 -43
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +0 -512
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +0 -514
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +0 -54
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +0 -47
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +0 -52
- package/contracts/Legacy/Registries/AddressRegistry.sol +0 -52
- package/contracts/Legacy/Registries/AddressRegistryRequiresERC725.sol +0 -37
- package/contracts/Legacy/UniversalReceiverAddressStore.sol +0 -64
- package/contracts/Version.sol +0 -17
- package/devdocs/Create2Factory.json +0 -16
- package/devdocs/LSP0ERC725Account.json +0 -260
- package/devdocs/LSP0ERC725AccountInit.json +0 -263
- package/devdocs/LSP11BasicSocialRecovery.json +0 -159
- package/devdocs/LSP11BasicSocialRecoveryInit.json +0 -159
- package/devdocs/LSP16UniversalFactory.json +0 -116
- package/devdocs/LSP1UniversalReceiverDelegateUP.json +0 -34
- package/devdocs/LSP1UniversalReceiverDelegateVault.json +0 -33
- package/devdocs/LSP23LinkedContractsFactory.json +0 -81
- package/devdocs/LSP4DigitalAssetMetadata.json +0 -112
- package/devdocs/LSP4DigitalAssetMetadataInitAbstract.json +0 -104
- package/devdocs/LSP6KeyManager.json +0 -305
- package/devdocs/LSP6KeyManagerInit.json +0 -308
- package/devdocs/LSP7CappedSupply.json +0 -306
- package/devdocs/LSP7CappedSupplyInitAbstract.json +0 -299
- package/devdocs/LSP7CompatibleERC20.json +0 -346
- package/devdocs/LSP7CompatibleERC20InitAbstract.json +0 -338
- package/devdocs/LSP7CompatibleERC20Mintable.json +0 -349
- package/devdocs/LSP7CompatibleERC20MintableInit.json +0 -352
- package/devdocs/LSP7DigitalAsset.json +0 -294
- package/devdocs/LSP7DigitalAssetInitAbstract.json +0 -285
- package/devdocs/LSP7Mintable.json +0 -296
- package/devdocs/LSP7MintableInit.json +0 -298
- package/devdocs/LSP8CappedSupply.json +0 -356
- package/devdocs/LSP8CappedSupplyInitAbstract.json +0 -349
- package/devdocs/LSP8CompatibleERC721.json +0 -437
- package/devdocs/LSP8CompatibleERC721InitAbstract.json +0 -428
- package/devdocs/LSP8CompatibleERC721Mintable.json +0 -446
- package/devdocs/LSP8CompatibleERC721MintableInit.json +0 -449
- package/devdocs/LSP8IdentifiableDigitalAsset.json +0 -346
- package/devdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +0 -335
- package/devdocs/LSP8Mintable.json +0 -356
- package/devdocs/LSP8MintableInit.json +0 -359
- package/devdocs/LSP9Vault.json +0 -236
- package/devdocs/LSP9VaultInit.json +0 -239
- package/devdocs/UniversalProfile.json +0 -260
- package/devdocs/UniversalProfileInit.json +0 -263
- package/devdocs/UniversalReceiverAddressStore.json +0 -9
- package/dist/constants.cjs.js +0 -40758
- package/dist/constants.es.js +0 -40737
- package/userdocs/Create2Factory.json +0 -5
- package/userdocs/LSP0ERC725Account.json +0 -91
- package/userdocs/LSP0ERC725AccountInit.json +0 -94
- package/userdocs/LSP11BasicSocialRecovery.json +0 -29
- package/userdocs/LSP11BasicSocialRecoveryInit.json +0 -29
- package/userdocs/LSP16UniversalFactory.json +0 -30
- package/userdocs/LSP1UniversalReceiverDelegateUP.json +0 -19
- package/userdocs/LSP1UniversalReceiverDelegateVault.json +0 -19
- package/userdocs/LSP23LinkedContractsFactory.json +0 -29
- package/userdocs/LSP4DigitalAssetMetadata.json +0 -26
- package/userdocs/LSP4DigitalAssetMetadataInitAbstract.json +0 -23
- package/userdocs/LSP6KeyManager.json +0 -154
- package/userdocs/LSP6KeyManagerInit.json +0 -157
- package/userdocs/LSP7CappedSupply.json +0 -60
- package/userdocs/LSP7CappedSupplyInitAbstract.json +0 -57
- package/userdocs/LSP7CompatibleERC20.json +0 -47
- package/userdocs/LSP7CompatibleERC20InitAbstract.json +0 -44
- package/userdocs/LSP7CompatibleERC20Mintable.json +0 -47
- package/userdocs/LSP7CompatibleERC20MintableInit.json +0 -47
- package/userdocs/LSP7DigitalAsset.json +0 -47
- package/userdocs/LSP7DigitalAssetInitAbstract.json +0 -44
- package/userdocs/LSP7Mintable.json +0 -47
- package/userdocs/LSP7MintableInit.json +0 -47
- package/userdocs/LSP8CappedSupply.json +0 -66
- package/userdocs/LSP8CappedSupplyInitAbstract.json +0 -63
- package/userdocs/LSP8CompatibleERC721.json +0 -80
- package/userdocs/LSP8CompatibleERC721InitAbstract.json +0 -77
- package/userdocs/LSP8CompatibleERC721Mintable.json +0 -83
- package/userdocs/LSP8CompatibleERC721MintableInit.json +0 -83
- package/userdocs/LSP8IdentifiableDigitalAsset.json +0 -53
- package/userdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +0 -50
- package/userdocs/LSP8Mintable.json +0 -56
- package/userdocs/LSP8MintableInit.json +0 -56
- package/userdocs/LSP9Vault.json +0 -93
- package/userdocs/LSP9VaultInit.json +0 -93
- package/userdocs/UniversalProfile.json +0 -91
- package/userdocs/UniversalProfileInit.json +0 -94
- package/userdocs/UniversalReceiverAddressStore.json +0 -5
|
@@ -1,62 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import {ERC725Y} from "@erc725/smart-contracts/contracts/ERC725Y.sol";
|
|
6
|
-
import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol";
|
|
7
|
-
import {LSP4DigitalAssetMetadataCore} from "./LSP4DigitalAssetMetadataCore.sol";
|
|
8
|
-
|
|
9
|
-
// constants
|
|
10
|
-
import {
|
|
11
|
-
_LSP4_SUPPORTED_STANDARDS_KEY,
|
|
12
|
-
_LSP4_SUPPORTED_STANDARDS_VALUE,
|
|
13
|
-
_LSP4_TOKEN_NAME_KEY,
|
|
14
|
-
_LSP4_TOKEN_SYMBOL_KEY,
|
|
15
|
-
_LSP4_TOKEN_TYPE_KEY
|
|
16
|
-
} from "./LSP4Constants.sol";
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @title Implementation of a LSP4DigitalAssetMetadata contract that stores the **Token-Metadata** (`LSP4TokenName` and `LSP4TokenSymbol`) in its ERC725Y data store.
|
|
20
|
-
* @author Matthew Stevens
|
|
21
|
-
* @dev Standard Implementation of the LSP4 standard.
|
|
22
|
-
*/
|
|
23
|
-
abstract contract LSP4DigitalAssetMetadata is
|
|
24
|
-
ERC725Y,
|
|
25
|
-
LSP4DigitalAssetMetadataCore
|
|
26
|
-
{
|
|
27
|
-
/**
|
|
28
|
-
* @notice Deploying a digital asset `name_` with the `symbol_` symbol.
|
|
29
|
-
*
|
|
30
|
-
* @param name_ The name of the token.
|
|
31
|
-
* @param symbol_ The symbol of the token.
|
|
32
|
-
* @param initialOwner_ The owner of the token contract.
|
|
33
|
-
* @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection).
|
|
34
|
-
*/
|
|
35
|
-
constructor(
|
|
36
|
-
string memory name_,
|
|
37
|
-
string memory symbol_,
|
|
38
|
-
address initialOwner_,
|
|
39
|
-
uint256 lsp4TokenType_
|
|
40
|
-
) ERC725Y(initialOwner_) {
|
|
41
|
-
// set data key SupportedStandards:LSP4DigitalAsset
|
|
42
|
-
ERC725YCore._setData(
|
|
43
|
-
_LSP4_SUPPORTED_STANDARDS_KEY,
|
|
44
|
-
_LSP4_SUPPORTED_STANDARDS_VALUE
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
ERC725YCore._setData(_LSP4_TOKEN_NAME_KEY, bytes(name_));
|
|
48
|
-
ERC725YCore._setData(_LSP4_TOKEN_SYMBOL_KEY, bytes(symbol_));
|
|
49
|
-
ERC725YCore._setData(_LSP4_TOKEN_TYPE_KEY, abi.encode(lsp4TokenType_));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @dev The ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol` cannot be changed
|
|
54
|
-
* via this function once the digital asset contract has been deployed.
|
|
55
|
-
*/
|
|
56
|
-
function _setData(
|
|
57
|
-
bytes32 dataKey,
|
|
58
|
-
bytes memory dataValue
|
|
59
|
-
) internal virtual override(ERC725YCore, LSP4DigitalAssetMetadataCore) {
|
|
60
|
-
LSP4DigitalAssetMetadataCore._setData(dataKey, dataValue);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
4
|
+
import "@lukso/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol";
|
|
@@ -1,47 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol";
|
|
6
|
-
|
|
7
|
-
// constants
|
|
8
|
-
import {
|
|
9
|
-
_LSP4_TOKEN_NAME_KEY,
|
|
10
|
-
_LSP4_TOKEN_SYMBOL_KEY,
|
|
11
|
-
_LSP4_TOKEN_TYPE_KEY
|
|
12
|
-
} from "./LSP4Constants.sol";
|
|
13
|
-
|
|
14
|
-
// errors
|
|
15
|
-
import {
|
|
16
|
-
LSP4TokenNameNotEditable,
|
|
17
|
-
LSP4TokenSymbolNotEditable,
|
|
18
|
-
LSP4TokenTypeNotEditable
|
|
19
|
-
} from "./LSP4Errors.sol";
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @title Implementation of a LSP4DigitalAssetMetadata contract that stores the **Token-Metadata** (`LSP4TokenName` and `LSP4TokenSymbol`) in its ERC725Y data store.
|
|
23
|
-
* @author Matthew Stevens
|
|
24
|
-
* @dev Standard Implementation of the LSP4 standard.
|
|
25
|
-
*/
|
|
26
|
-
abstract contract LSP4DigitalAssetMetadataCore is ERC725YCore {
|
|
27
|
-
/**
|
|
28
|
-
* @dev The ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol` cannot be changed
|
|
29
|
-
* via this function once the digital asset contract has been deployed.
|
|
30
|
-
*/
|
|
31
|
-
function _setData(
|
|
32
|
-
bytes32 dataKey,
|
|
33
|
-
bytes memory dataValue
|
|
34
|
-
) internal virtual override {
|
|
35
|
-
if (dataKey == _LSP4_TOKEN_NAME_KEY) {
|
|
36
|
-
revert LSP4TokenNameNotEditable();
|
|
37
|
-
} else if (dataKey == _LSP4_TOKEN_SYMBOL_KEY) {
|
|
38
|
-
revert LSP4TokenSymbolNotEditable();
|
|
39
|
-
} else if (dataKey == _LSP4_TOKEN_TYPE_KEY) {
|
|
40
|
-
revert LSP4TokenTypeNotEditable();
|
|
41
|
-
} else {
|
|
42
|
-
_store[dataKey] = dataValue;
|
|
43
|
-
|
|
44
|
-
emit DataChanged(dataKey, dataValue);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
4
|
+
import "@lukso/lsp4-contracts/contracts/LSP4DigitalAssetMetadataCore.sol";
|
|
@@ -1,68 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
ERC725YInitAbstract
|
|
7
|
-
} from "@erc725/smart-contracts/contracts/ERC725YInitAbstract.sol";
|
|
8
|
-
|
|
9
|
-
import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol";
|
|
10
|
-
|
|
11
|
-
import {LSP4DigitalAssetMetadataCore} from "./LSP4DigitalAssetMetadataCore.sol";
|
|
12
|
-
|
|
13
|
-
// constants
|
|
14
|
-
import {
|
|
15
|
-
_LSP4_SUPPORTED_STANDARDS_KEY,
|
|
16
|
-
_LSP4_SUPPORTED_STANDARDS_VALUE,
|
|
17
|
-
_LSP4_TOKEN_NAME_KEY,
|
|
18
|
-
_LSP4_TOKEN_SYMBOL_KEY,
|
|
19
|
-
_LSP4_TOKEN_TYPE_KEY
|
|
20
|
-
} from "./LSP4Constants.sol";
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @title Implementation of a LSP4DigitalAssetMetadata contract that stores the **Token-Metadata** (`LSP4TokenName` and `LSP4TokenSymbol`) in its ERC725Y data store.
|
|
24
|
-
* @author Matthew Stevens
|
|
25
|
-
* @dev Inheritable Proxy Implementation of the LSP4 standard.
|
|
26
|
-
*/
|
|
27
|
-
abstract contract LSP4DigitalAssetMetadataInitAbstract is
|
|
28
|
-
LSP4DigitalAssetMetadataCore,
|
|
29
|
-
ERC725YInitAbstract
|
|
30
|
-
{
|
|
31
|
-
/**
|
|
32
|
-
* @notice Initializing a digital asset `name_` with the `symbol_` symbol.
|
|
33
|
-
*
|
|
34
|
-
* @param name_ The name of the token
|
|
35
|
-
* @param symbol_ The symbol of the token
|
|
36
|
-
* @param initialOwner_ The owner of the token contract
|
|
37
|
-
* @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection)
|
|
38
|
-
*/
|
|
39
|
-
function _initialize(
|
|
40
|
-
string memory name_,
|
|
41
|
-
string memory symbol_,
|
|
42
|
-
address initialOwner_,
|
|
43
|
-
uint256 lsp4TokenType_
|
|
44
|
-
) internal virtual onlyInitializing {
|
|
45
|
-
ERC725YInitAbstract._initialize(initialOwner_);
|
|
46
|
-
|
|
47
|
-
// set data key SupportedStandards:LSP4DigitalAsset
|
|
48
|
-
ERC725YCore._setData(
|
|
49
|
-
_LSP4_SUPPORTED_STANDARDS_KEY,
|
|
50
|
-
_LSP4_SUPPORTED_STANDARDS_VALUE
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
ERC725YCore._setData(_LSP4_TOKEN_NAME_KEY, bytes(name_));
|
|
54
|
-
ERC725YCore._setData(_LSP4_TOKEN_SYMBOL_KEY, bytes(symbol_));
|
|
55
|
-
ERC725YCore._setData(_LSP4_TOKEN_TYPE_KEY, abi.encode(lsp4TokenType_));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @dev The ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol` cannot be changed
|
|
60
|
-
* via this function once the digital asset contract has been deployed.
|
|
61
|
-
*/
|
|
62
|
-
function _setData(
|
|
63
|
-
bytes32 dataKey,
|
|
64
|
-
bytes memory dataValue
|
|
65
|
-
) internal virtual override(ERC725YCore, LSP4DigitalAssetMetadataCore) {
|
|
66
|
-
LSP4DigitalAssetMetadataCore._setData(dataKey, dataValue);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
4
|
+
import "@lukso/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol";
|
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
* @dev Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized.
|
|
6
|
-
* The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract.
|
|
7
|
-
* It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
|
|
8
|
-
*/
|
|
9
|
-
error LSP4TokenNameNotEditable();
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @dev Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized.
|
|
13
|
-
* The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract.
|
|
14
|
-
* It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
|
|
15
|
-
*/
|
|
16
|
-
error LSP4TokenSymbolNotEditable();
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @dev Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized.
|
|
20
|
-
* The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract.
|
|
21
|
-
* It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
|
|
22
|
-
*/
|
|
23
|
-
error LSP4TokenTypeNotEditable();
|
|
4
|
+
import "@lukso/lsp4-contracts/contracts/LSP4Errors.sol";
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// keccak256('LSP5ReceivedAssets[]')
|
|
7
|
-
bytes32 constant _LSP5_RECEIVED_ASSETS_ARRAY_KEY = 0x6460ee3c0aac563ccbf76d6e1d07bada78e3a9514e6382b736ed3f478ab7b90b;
|
|
8
|
-
|
|
9
|
-
// bytes10(keccak256('LSP5ReceivedAssetsMap'))
|
|
10
|
-
bytes10 constant _LSP5_RECEIVED_ASSETS_MAP_KEY_PREFIX = 0x812c4334633eb816c80d;
|
|
4
|
+
import "@lukso/lsp5-contracts/contracts/LSP5Constants.sol";
|
|
@@ -1,209 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
IERC725Y
|
|
7
|
-
} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
|
|
8
|
-
|
|
9
|
-
// libraries
|
|
10
|
-
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
|
|
11
|
-
|
|
12
|
-
// constants
|
|
13
|
-
import {
|
|
14
|
-
_LSP5_RECEIVED_ASSETS_MAP_KEY_PREFIX,
|
|
15
|
-
_LSP5_RECEIVED_ASSETS_ARRAY_KEY
|
|
16
|
-
} from "../LSP5ReceivedAssets/LSP5Constants.sol";
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @title LSP5 Utility library.
|
|
20
|
-
* @author Yamen Merhi <YamenMerhi>, Jean Cavallera <CJ42>
|
|
21
|
-
* @dev LSP5Utils is a library of functions that can be used to register and manage assets under an ERC725Y smart contract.
|
|
22
|
-
* Based on the LSP5 Received Assets standard.
|
|
23
|
-
*/
|
|
24
|
-
library LSP5Utils {
|
|
25
|
-
/**
|
|
26
|
-
* @dev Generate an array of data key/value pairs to be set on the receiver address after receiving assets.
|
|
27
|
-
*
|
|
28
|
-
* @custom:warning Returns empty arrays when encountering errors. Otherwise the arrays must have 3 data keys and 3 data values.
|
|
29
|
-
*
|
|
30
|
-
* @param receiver The address receiving the asset and where the LSP5 data keys should be added.
|
|
31
|
-
* @param assetAddress The address of the asset being received (_e.g: an LSP7 or LSP8 token_).
|
|
32
|
-
* @param assetInterfaceId The interfaceID of the asset being received.
|
|
33
|
-
*
|
|
34
|
-
* @return lsp5DataKeys An array Data Keys used to update the [LSP-5-ReceivedAssets] data.
|
|
35
|
-
* @return lsp5DataValues An array Data Values used to update the [LSP-5-ReceivedAssets] data.
|
|
36
|
-
*/
|
|
37
|
-
function generateReceivedAssetKeys(
|
|
38
|
-
address receiver,
|
|
39
|
-
address assetAddress,
|
|
40
|
-
bytes4 assetInterfaceId
|
|
41
|
-
)
|
|
42
|
-
internal
|
|
43
|
-
view
|
|
44
|
-
returns (bytes32[] memory lsp5DataKeys, bytes[] memory lsp5DataValues)
|
|
45
|
-
{
|
|
46
|
-
IERC725Y erc725YContract = IERC725Y(receiver);
|
|
47
|
-
|
|
48
|
-
// --- `LSP5ReceivedAssets[]` Array ---
|
|
49
|
-
|
|
50
|
-
bytes memory currentArrayLengthBytes = getLSP5ArrayLengthBytes(
|
|
51
|
-
erc725YContract
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
// CHECK that the value of `LSP5ReceivedAssets[]` Array length is a valid `uint128` (16 bytes long)
|
|
55
|
-
if (!LSP2Utils.isValidLSP2ArrayLengthValue(currentArrayLengthBytes)) {
|
|
56
|
-
if (currentArrayLengthBytes.length == 0) {
|
|
57
|
-
// if it's the first asset received and nothing is set (= 0x)
|
|
58
|
-
// we need to convert it to: `0x00000000000000000000000000000000`
|
|
59
|
-
// to safely cast to a uint128 of length 0
|
|
60
|
-
currentArrayLengthBytes = abi.encodePacked(bytes16(0));
|
|
61
|
-
} else {
|
|
62
|
-
// otherwise the array length is invalid
|
|
63
|
-
return (lsp5DataKeys, lsp5DataValues);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
uint128 currentArrayLength = uint128(bytes16(currentArrayLengthBytes));
|
|
68
|
-
|
|
69
|
-
// CHECK for potential overflow
|
|
70
|
-
if (currentArrayLength == type(uint128).max) {
|
|
71
|
-
return (lsp5DataKeys, lsp5DataValues);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// --- `LSP5ReceivedAssetsMap:<assetAddress>` ---
|
|
75
|
-
|
|
76
|
-
bytes32 mapDataKey = LSP2Utils.generateMappingKey(
|
|
77
|
-
_LSP5_RECEIVED_ASSETS_MAP_KEY_PREFIX,
|
|
78
|
-
bytes20(assetAddress)
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
// CHECK that the map value is not already set in the storage for the newly received asset
|
|
82
|
-
// If that's the case, the asset is already registered. Do not try to update.
|
|
83
|
-
if (erc725YContract.getData(mapDataKey).length != 0) {
|
|
84
|
-
return (lsp5DataKeys, lsp5DataValues);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// --- LSP5 Data Keys & Values ---
|
|
88
|
-
|
|
89
|
-
lsp5DataKeys = new bytes32[](3);
|
|
90
|
-
lsp5DataValues = new bytes[](3);
|
|
91
|
-
|
|
92
|
-
// Increment `LSP5ReceivedAssets[]` Array length
|
|
93
|
-
lsp5DataKeys[0] = _LSP5_RECEIVED_ASSETS_ARRAY_KEY;
|
|
94
|
-
lsp5DataValues[0] = abi.encodePacked(currentArrayLength + 1);
|
|
95
|
-
|
|
96
|
-
// Add asset address to `LSP5ReceivedAssets[index]`, where index == previous array length
|
|
97
|
-
lsp5DataKeys[1] = LSP2Utils.generateArrayElementKeyAtIndex(
|
|
98
|
-
_LSP5_RECEIVED_ASSETS_ARRAY_KEY,
|
|
99
|
-
currentArrayLength
|
|
100
|
-
);
|
|
101
|
-
lsp5DataValues[1] = abi.encodePacked(assetAddress);
|
|
102
|
-
|
|
103
|
-
// Add interfaceId + index as value under `LSP5ReceivedAssetsMap:<assetAddress>`
|
|
104
|
-
lsp5DataKeys[2] = mapDataKey;
|
|
105
|
-
lsp5DataValues[2] = bytes.concat(
|
|
106
|
-
assetInterfaceId,
|
|
107
|
-
currentArrayLengthBytes
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* @dev Generate an array of Data Key/Value pairs to be set on the sender address after sending assets.
|
|
113
|
-
*
|
|
114
|
-
* @custom:warning Returns empty arrays when encountering errors. Otherwise the arrays must have at least 3 data keys and 3 data values.
|
|
115
|
-
*
|
|
116
|
-
* @param sender The address sending the asset and where the LSP5 data keys should be updated.
|
|
117
|
-
* @param assetAddress The address of the asset that is being sent.
|
|
118
|
-
*
|
|
119
|
-
* @return lsp5DataKeys An array Data Keys used to update the [LSP-5-ReceivedAssets] data.
|
|
120
|
-
* @return lsp5DataValues An array Data Values used to update the [LSP-5-ReceivedAssets] data.
|
|
121
|
-
*/
|
|
122
|
-
function generateSentAssetKeys(
|
|
123
|
-
address sender,
|
|
124
|
-
address assetAddress
|
|
125
|
-
)
|
|
126
|
-
internal
|
|
127
|
-
view
|
|
128
|
-
returns (bytes32[] memory lsp5DataKeys, bytes[] memory lsp5DataValues)
|
|
129
|
-
{
|
|
130
|
-
IERC725Y erc725YContract = IERC725Y(sender);
|
|
131
|
-
|
|
132
|
-
// --- `LSP5ReceivedAssets[]` Array ---
|
|
133
|
-
|
|
134
|
-
bytes memory newArrayLengthBytes = getLSP5ArrayLengthBytes(
|
|
135
|
-
erc725YContract
|
|
136
|
-
);
|
|
137
|
-
|
|
138
|
-
// CHECK that the value of `LSP5ReceivedAssets[]` Array length is a valid `uint128` (16 bytes long)
|
|
139
|
-
if (!LSP2Utils.isValidLSP2ArrayLengthValue(newArrayLengthBytes)) {
|
|
140
|
-
return (lsp5DataKeys, lsp5DataValues);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// CHECK for potential underflow
|
|
144
|
-
if (bytes16(newArrayLengthBytes) == bytes16(0)) {
|
|
145
|
-
return (lsp5DataKeys, lsp5DataValues);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
uint128 newArrayLength = uint128(bytes16(newArrayLengthBytes)) - 1;
|
|
149
|
-
|
|
150
|
-
// --- `LSP5ReceivedAssetsMap:<assetAddress>` ---
|
|
151
|
-
|
|
152
|
-
bytes32 removedElementMapKey = LSP2Utils.generateMappingKey(
|
|
153
|
-
_LSP5_RECEIVED_ASSETS_MAP_KEY_PREFIX,
|
|
154
|
-
bytes20(assetAddress)
|
|
155
|
-
);
|
|
156
|
-
|
|
157
|
-
// Query the ERC725Y storage of the LSP0-ERC725Account
|
|
158
|
-
bytes memory mapValue = erc725YContract.getData(removedElementMapKey);
|
|
159
|
-
|
|
160
|
-
// CHECK if no map value was set for the asset to remove.
|
|
161
|
-
// If that's the case, there is nothing to remove. Do not try to update.
|
|
162
|
-
if (mapValue.length != 20) {
|
|
163
|
-
return (lsp5DataKeys, lsp5DataValues);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// Extract index of asset to remove from the map value
|
|
167
|
-
uint128 removedElementIndex = uint128(bytes16(bytes20(mapValue) << 32));
|
|
168
|
-
|
|
169
|
-
bytes32 removedElementIndexKey = LSP2Utils
|
|
170
|
-
.generateArrayElementKeyAtIndex(
|
|
171
|
-
_LSP5_RECEIVED_ASSETS_ARRAY_KEY,
|
|
172
|
-
removedElementIndex
|
|
173
|
-
);
|
|
174
|
-
|
|
175
|
-
if (removedElementIndex == newArrayLength) {
|
|
176
|
-
return
|
|
177
|
-
LSP2Utils.removeLastElementFromArrayAndMap(
|
|
178
|
-
_LSP5_RECEIVED_ASSETS_ARRAY_KEY,
|
|
179
|
-
newArrayLength,
|
|
180
|
-
removedElementIndexKey,
|
|
181
|
-
removedElementMapKey
|
|
182
|
-
);
|
|
183
|
-
} else if (removedElementIndex < newArrayLength) {
|
|
184
|
-
return
|
|
185
|
-
LSP2Utils.removeElementFromArrayAndMap(
|
|
186
|
-
erc725YContract,
|
|
187
|
-
_LSP5_RECEIVED_ASSETS_ARRAY_KEY,
|
|
188
|
-
newArrayLength,
|
|
189
|
-
removedElementIndexKey,
|
|
190
|
-
removedElementIndex,
|
|
191
|
-
removedElementMapKey
|
|
192
|
-
);
|
|
193
|
-
} else {
|
|
194
|
-
// If index is bigger than the array length, out of bounds
|
|
195
|
-
return (lsp5DataKeys, lsp5DataValues);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* @dev Get the raw bytes value stored under the `_LSP5_RECEIVED_ASSETS_ARRAY_KEY`.
|
|
201
|
-
* @param erc725YContract The contract to query the ERC725Y storage from.
|
|
202
|
-
* @return The raw bytes value stored under this data key.
|
|
203
|
-
*/
|
|
204
|
-
function getLSP5ArrayLengthBytes(
|
|
205
|
-
IERC725Y erc725YContract
|
|
206
|
-
) internal view returns (bytes memory) {
|
|
207
|
-
return erc725YContract.getData(_LSP5_RECEIVED_ASSETS_ARRAY_KEY);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
4
|
+
import "@lukso/lsp5-contracts/contracts/LSP5Utils.sol";
|
|
@@ -1,63 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @title Interface of the LSP6 - Key Manager standard, a contract acting as a controller of an ERC725 Account using predfined permissions.
|
|
9
|
-
*/
|
|
10
|
-
interface ILSP6KeyManager is
|
|
11
|
-
IERC1271
|
|
12
|
-
/* is ERC165 */
|
|
13
|
-
{
|
|
14
|
-
/**
|
|
15
|
-
* @dev Emitted when the LSP6KeyManager contract verified the permissions of the `signer` successfully.
|
|
16
|
-
* @notice Verified the permissions of `signer` for calling function `selector` on the linked account and sending `value` of native token.
|
|
17
|
-
* @param signer The address of the controller that executed the calldata payload (either directly via {execute} or via meta transaction using {executeRelayCall}).
|
|
18
|
-
* @param value The amount of native token to be transferred in the calldata payload.
|
|
19
|
-
* @param selector The bytes4 function of the function that was executed on the linked {target}
|
|
20
|
-
*/
|
|
21
|
-
event PermissionsVerified(
|
|
22
|
-
address indexed signer,
|
|
23
|
-
uint256 indexed value,
|
|
24
|
-
bytes4 indexed selector
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @dev Get The address of the contract linked to this Key Manager.
|
|
29
|
-
* @return The address of the linked contract
|
|
30
|
-
*/
|
|
31
|
-
function target() external view returns (address);
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @notice Executing the following payload on the linked contract: `payload`
|
|
35
|
-
*
|
|
36
|
-
* @dev Execute A `payload` on the linked {target} contract after having verified the permissions associated with the function being run.
|
|
37
|
-
* The `payload` MUST be a valid abi-encoded function call of one of the functions present in the linked {target}, otherwise the call will fail.
|
|
38
|
-
* The linked {target} will return some data on successful execution, or revert on failure.
|
|
39
|
-
*
|
|
40
|
-
* @param payload The abi-encoded function call to execute on the linked {target}.
|
|
41
|
-
* @return The abi-decoded data returned by the function called on the linked {target}.
|
|
42
|
-
*/
|
|
43
|
-
function execute(
|
|
44
|
-
bytes calldata payload
|
|
45
|
-
) external payable returns (bytes memory);
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @notice Executing the following batch of payloads and sensind on the linked contract.
|
|
49
|
-
* - payloads: `payloads`
|
|
50
|
-
* - values transferred for each payload: `values`
|
|
51
|
-
*
|
|
52
|
-
* @dev Same as {execute} but execute a batch of payloads (abi-encoded function calls) in a single transaction.
|
|
53
|
-
*
|
|
54
|
-
* @param values An array of amount of native tokens to be transferred for each `payload`.
|
|
55
|
-
* @param payloads An array of abi-encoded function calls to execute successively on the linked {target}.
|
|
56
|
-
*
|
|
57
|
-
* @return An array of abi-decoded data returned by the functions called on the linked {target}.
|
|
58
|
-
*/
|
|
59
|
-
function executeBatch(
|
|
60
|
-
uint256[] calldata values,
|
|
61
|
-
bytes[] calldata payloads
|
|
62
|
-
) external payable returns (bytes[] memory);
|
|
63
|
-
}
|
|
4
|
+
import "@lukso/lsp6-contracts/contracts/ILSP6KeyManager.sol";
|
|
@@ -1,64 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
bytes4 constant _INTERFACEID_LSP6 = 0x23f34c62;
|
|
6
|
-
|
|
7
|
-
// --- ERC725Y Data Keys
|
|
8
|
-
|
|
9
|
-
// PERMISSIONS KEYS
|
|
10
|
-
|
|
11
|
-
// keccak256('AddressPermissions[]')
|
|
12
|
-
bytes32 constant _LSP6KEY_ADDRESSPERMISSIONS_ARRAY = 0xdf30dba06db6a30e65354d9a64c609861f089545ca58c6b4dbe31a5f338cb0e3;
|
|
13
|
-
|
|
14
|
-
// AddressPermissions[index]
|
|
15
|
-
bytes16 constant _LSP6KEY_ADDRESSPERMISSIONS_ARRAY_PREFIX = 0xdf30dba06db6a30e65354d9a64c60986;
|
|
16
|
-
|
|
17
|
-
// AddressPermissions:...
|
|
18
|
-
bytes6 constant _LSP6KEY_ADDRESSPERMISSIONS_PREFIX = 0x4b80742de2bf;
|
|
19
|
-
|
|
20
|
-
// bytes6(keccak256('AddressPermissions')) + bytes4(keccak256('Permissions'))
|
|
21
|
-
bytes10 constant _LSP6KEY_ADDRESSPERMISSIONS_PERMISSIONS_PREFIX = 0x4b80742de2bf82acb363; // AddressPermissions:Permissions:<address> --> bytes32
|
|
22
|
-
|
|
23
|
-
// bytes6(keccak256('AddressPermissions')) + bytes4(keccak256('AllowedERC725YDataKeys'))
|
|
24
|
-
bytes10 constant _LSP6KEY_ADDRESSPERMISSIONS_AllowedERC725YDataKeys_PREFIX = 0x4b80742de2bf866c2911; // AddressPermissions:AllowedERC725YDataKeys:<address> --> bytes[CompactBytesArray]
|
|
25
|
-
|
|
26
|
-
// bytes6(keccak256('AddressPermissions')) + bytes4(keccak256('AllowedCalls'))
|
|
27
|
-
bytes10 constant _LSP6KEY_ADDRESSPERMISSIONS_ALLOWEDCALLS_PREFIX = 0x4b80742de2bf393a64c7; // AddressPermissions:AllowedCalls:<address>
|
|
28
|
-
|
|
29
|
-
// DEFAULT PERMISSIONS VALUES
|
|
30
|
-
// NB: the SUPER PERMISSIONS allow to not check for:
|
|
31
|
-
// - AddressPermissions:AllowedERC725YDataKeys:...
|
|
32
|
-
// - AddressPermissions:AllowedCalls
|
|
33
|
-
bytes32 constant _PERMISSION_CHANGEOWNER = 0x0000000000000000000000000000000000000000000000000000000000000001;
|
|
34
|
-
bytes32 constant _PERMISSION_ADDCONTROLLER = 0x0000000000000000000000000000000000000000000000000000000000000002;
|
|
35
|
-
bytes32 constant _PERMISSION_EDITPERMISSIONS = 0x0000000000000000000000000000000000000000000000000000000000000004;
|
|
36
|
-
bytes32 constant _PERMISSION_ADDEXTENSIONS = 0x0000000000000000000000000000000000000000000000000000000000000008;
|
|
37
|
-
bytes32 constant _PERMISSION_CHANGEEXTENSIONS = 0x0000000000000000000000000000000000000000000000000000000000000010;
|
|
38
|
-
bytes32 constant _PERMISSION_ADDUNIVERSALRECEIVERDELEGATE = 0x0000000000000000000000000000000000000000000000000000000000000020;
|
|
39
|
-
bytes32 constant _PERMISSION_CHANGEUNIVERSALRECEIVERDELEGATE = 0x0000000000000000000000000000000000000000000000000000000000000040;
|
|
40
|
-
bytes32 constant _PERMISSION_REENTRANCY = 0x0000000000000000000000000000000000000000000000000000000000000080;
|
|
41
|
-
bytes32 constant _PERMISSION_SUPER_TRANSFERVALUE = 0x0000000000000000000000000000000000000000000000000000000000000100;
|
|
42
|
-
bytes32 constant _PERMISSION_TRANSFERVALUE = 0x0000000000000000000000000000000000000000000000000000000000000200;
|
|
43
|
-
bytes32 constant _PERMISSION_SUPER_CALL = 0x0000000000000000000000000000000000000000000000000000000000000400;
|
|
44
|
-
bytes32 constant _PERMISSION_CALL = 0x0000000000000000000000000000000000000000000000000000000000000800;
|
|
45
|
-
bytes32 constant _PERMISSION_SUPER_STATICCALL = 0x0000000000000000000000000000000000000000000000000000000000001000;
|
|
46
|
-
bytes32 constant _PERMISSION_STATICCALL = 0x0000000000000000000000000000000000000000000000000000000000002000;
|
|
47
|
-
bytes32 constant _PERMISSION_SUPER_DELEGATECALL = 0x0000000000000000000000000000000000000000000000000000000000004000;
|
|
48
|
-
bytes32 constant _PERMISSION_DELEGATECALL = 0x0000000000000000000000000000000000000000000000000000000000008000;
|
|
49
|
-
bytes32 constant _PERMISSION_DEPLOY = 0x0000000000000000000000000000000000000000000000000000000000010000;
|
|
50
|
-
bytes32 constant _PERMISSION_SUPER_SETDATA = 0x0000000000000000000000000000000000000000000000000000000000020000;
|
|
51
|
-
bytes32 constant _PERMISSION_SETDATA = 0x0000000000000000000000000000000000000000000000000000000000040000;
|
|
52
|
-
bytes32 constant _PERMISSION_ENCRYPT = 0x0000000000000000000000000000000000000000000000000000000000080000;
|
|
53
|
-
bytes32 constant _PERMISSION_DECRYPT = 0x0000000000000000000000000000000000000000000000000000000000100000;
|
|
54
|
-
bytes32 constant _PERMISSION_SIGN = 0x0000000000000000000000000000000000000000000000000000000000200000;
|
|
55
|
-
bytes32 constant _PERMISSION_EXECUTE_RELAY_CALL = 0x0000000000000000000000000000000000000000000000000000000000400000;
|
|
56
|
-
|
|
57
|
-
// All Permissions currently exclude REENTRANCY, DELEGATECALL and SUPER_DELEGATECALL for security
|
|
58
|
-
bytes32 constant ALL_REGULAR_PERMISSIONS = 0x00000000000000000000000000000000000000000000000000000000007f3f7f;
|
|
59
|
-
|
|
60
|
-
// AllowedCalls types
|
|
61
|
-
bytes4 constant _ALLOWEDCALLS_TRANSFERVALUE = 0x00000001; // 0000 0001
|
|
62
|
-
bytes4 constant _ALLOWEDCALLS_CALL = 0x00000002; // 0000 0010
|
|
63
|
-
bytes4 constant _ALLOWEDCALLS_STATICCALL = 0x00000004; // 0000 0100
|
|
64
|
-
bytes4 constant _ALLOWEDCALLS_DELEGATECALL = 0x00000008; // 0000 1000
|
|
4
|
+
import "@lukso/lsp6-contracts/contracts/LSP6Constants.sol";
|