@lukso/lsp-smart-contracts 0.14.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 -192
- 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 +43 -6
- package/artifacts/LSP8CappedSupplyInitAbstract.json +43 -6
- package/artifacts/LSP8IdentifiableDigitalAsset.json +43 -6
- package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +43 -6
- package/artifacts/LSP8Mintable.json +45 -8
- package/artifacts/LSP8MintableInit.json +45 -8
- 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 -30
- 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 -325
- 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 +1 -27
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8BurnableInitAbstract.sol +1 -21
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +1 -82
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +1 -85
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +1 -66
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +1 -61
- package/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +1 -30
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +1 -57
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +1 -40
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +1 -59
- 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,396 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
|
|
6
|
-
import {IPostDeploymentModule} from "./IPostDeploymentModule.sol";
|
|
7
|
-
import {ILSP23LinkedContractsFactory} from "./ILSP23LinkedContractsFactory.sol";
|
|
8
|
-
import {
|
|
9
|
-
InvalidValueSum,
|
|
10
|
-
PrimaryContractProxyInitFailureError,
|
|
11
|
-
SecondaryContractProxyInitFailureError
|
|
12
|
-
} from "./LSP23Errors.sol";
|
|
13
|
-
|
|
14
|
-
contract LSP23LinkedContractsFactory is ILSP23LinkedContractsFactory {
|
|
15
|
-
/**
|
|
16
|
-
* @inheritdoc ILSP23LinkedContractsFactory
|
|
17
|
-
*/
|
|
18
|
-
function deployContracts(
|
|
19
|
-
PrimaryContractDeployment calldata primaryContractDeployment,
|
|
20
|
-
SecondaryContractDeployment calldata secondaryContractDeployment,
|
|
21
|
-
address postDeploymentModule,
|
|
22
|
-
bytes calldata postDeploymentModuleCalldata
|
|
23
|
-
)
|
|
24
|
-
public
|
|
25
|
-
payable
|
|
26
|
-
override
|
|
27
|
-
returns (
|
|
28
|
-
address primaryContractAddress,
|
|
29
|
-
address secondaryContractAddress
|
|
30
|
-
)
|
|
31
|
-
{
|
|
32
|
-
/* check that the msg.value is equal to the sum of the values of the primary and secondary contracts */
|
|
33
|
-
if (
|
|
34
|
-
msg.value !=
|
|
35
|
-
primaryContractDeployment.fundingAmount +
|
|
36
|
-
secondaryContractDeployment.fundingAmount
|
|
37
|
-
) {
|
|
38
|
-
revert InvalidValueSum();
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
primaryContractAddress = _deployPrimaryContract(
|
|
42
|
-
primaryContractDeployment,
|
|
43
|
-
secondaryContractDeployment,
|
|
44
|
-
postDeploymentModule,
|
|
45
|
-
postDeploymentModuleCalldata
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
secondaryContractAddress = _deploySecondaryContract(
|
|
49
|
-
secondaryContractDeployment,
|
|
50
|
-
primaryContractAddress
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
emit DeployedContracts(
|
|
54
|
-
primaryContractAddress,
|
|
55
|
-
secondaryContractAddress,
|
|
56
|
-
primaryContractDeployment,
|
|
57
|
-
secondaryContractDeployment,
|
|
58
|
-
postDeploymentModule,
|
|
59
|
-
postDeploymentModuleCalldata
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
/* execute the post deployment logic in the postDeploymentModule if postDeploymentModule is not address(0) */
|
|
63
|
-
if (postDeploymentModule != address(0)) {
|
|
64
|
-
/* execute the post deployment module logic in the postDeploymentModule */
|
|
65
|
-
IPostDeploymentModule(postDeploymentModule).executePostDeployment(
|
|
66
|
-
primaryContractAddress,
|
|
67
|
-
secondaryContractAddress,
|
|
68
|
-
postDeploymentModuleCalldata
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* @inheritdoc ILSP23LinkedContractsFactory
|
|
75
|
-
*/
|
|
76
|
-
function deployERC1167Proxies(
|
|
77
|
-
PrimaryContractDeploymentInit calldata primaryContractDeploymentInit,
|
|
78
|
-
SecondaryContractDeploymentInit
|
|
79
|
-
calldata secondaryContractDeploymentInit,
|
|
80
|
-
address postDeploymentModule,
|
|
81
|
-
bytes calldata postDeploymentModuleCalldata
|
|
82
|
-
)
|
|
83
|
-
public
|
|
84
|
-
payable
|
|
85
|
-
override
|
|
86
|
-
returns (
|
|
87
|
-
address primaryContractAddress,
|
|
88
|
-
address secondaryContractAddress
|
|
89
|
-
)
|
|
90
|
-
{
|
|
91
|
-
/* check that the msg.value is equal to the sum of the values of the primary and secondary contracts */
|
|
92
|
-
if (
|
|
93
|
-
msg.value !=
|
|
94
|
-
primaryContractDeploymentInit.fundingAmount +
|
|
95
|
-
secondaryContractDeploymentInit.fundingAmount
|
|
96
|
-
) {
|
|
97
|
-
revert InvalidValueSum();
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/* deploy the primary contract proxy with the primaryContractGeneratedSalt */
|
|
101
|
-
primaryContractAddress = _deployAndInitializePrimaryContractProxy(
|
|
102
|
-
primaryContractDeploymentInit,
|
|
103
|
-
secondaryContractDeploymentInit,
|
|
104
|
-
postDeploymentModule,
|
|
105
|
-
postDeploymentModuleCalldata
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
/* deploy the secondary contract proxy */
|
|
109
|
-
secondaryContractAddress = _deployAndInitializeSecondaryContractProxy(
|
|
110
|
-
secondaryContractDeploymentInit,
|
|
111
|
-
primaryContractAddress
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
emit DeployedERC1167Proxies(
|
|
115
|
-
primaryContractAddress,
|
|
116
|
-
secondaryContractAddress,
|
|
117
|
-
primaryContractDeploymentInit,
|
|
118
|
-
secondaryContractDeploymentInit,
|
|
119
|
-
postDeploymentModule,
|
|
120
|
-
postDeploymentModuleCalldata
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
/* execute the post deployment logic in the postDeploymentModule if postDeploymentModule is not address(0) */
|
|
124
|
-
if (postDeploymentModule != address(0)) {
|
|
125
|
-
/* execute the post deployment logic in the postDeploymentModule */
|
|
126
|
-
IPostDeploymentModule(postDeploymentModule).executePostDeployment(
|
|
127
|
-
primaryContractAddress,
|
|
128
|
-
secondaryContractAddress,
|
|
129
|
-
postDeploymentModuleCalldata
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* @inheritdoc ILSP23LinkedContractsFactory
|
|
136
|
-
*/
|
|
137
|
-
function computeAddresses(
|
|
138
|
-
PrimaryContractDeployment calldata primaryContractDeployment,
|
|
139
|
-
SecondaryContractDeployment calldata secondaryContractDeployment,
|
|
140
|
-
address postDeploymentModule,
|
|
141
|
-
bytes calldata postDeploymentModuleCalldata
|
|
142
|
-
)
|
|
143
|
-
public
|
|
144
|
-
view
|
|
145
|
-
override
|
|
146
|
-
returns (
|
|
147
|
-
address primaryContractAddress,
|
|
148
|
-
address secondaryContractAddress
|
|
149
|
-
)
|
|
150
|
-
{
|
|
151
|
-
bytes32 primaryContractGeneratedSalt = _generatePrimaryContractSalt(
|
|
152
|
-
primaryContractDeployment,
|
|
153
|
-
secondaryContractDeployment,
|
|
154
|
-
postDeploymentModule,
|
|
155
|
-
postDeploymentModuleCalldata
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
primaryContractAddress = Create2.computeAddress(
|
|
159
|
-
primaryContractGeneratedSalt,
|
|
160
|
-
keccak256(primaryContractDeployment.creationBytecode)
|
|
161
|
-
);
|
|
162
|
-
|
|
163
|
-
bytes memory secondaryContractByteCodeWithAllParams;
|
|
164
|
-
if (secondaryContractDeployment.addPrimaryContractAddress) {
|
|
165
|
-
secondaryContractByteCodeWithAllParams = abi.encodePacked(
|
|
166
|
-
secondaryContractDeployment.creationBytecode,
|
|
167
|
-
abi.encode(primaryContractAddress),
|
|
168
|
-
secondaryContractDeployment.extraConstructorParams
|
|
169
|
-
);
|
|
170
|
-
} else {
|
|
171
|
-
secondaryContractByteCodeWithAllParams = secondaryContractDeployment
|
|
172
|
-
.creationBytecode;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
secondaryContractAddress = Create2.computeAddress(
|
|
176
|
-
keccak256(abi.encodePacked(primaryContractAddress)),
|
|
177
|
-
keccak256(secondaryContractByteCodeWithAllParams)
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* @inheritdoc ILSP23LinkedContractsFactory
|
|
183
|
-
*/
|
|
184
|
-
function computeERC1167Addresses(
|
|
185
|
-
PrimaryContractDeploymentInit calldata primaryContractDeploymentInit,
|
|
186
|
-
SecondaryContractDeploymentInit
|
|
187
|
-
calldata secondaryContractDeploymentInit,
|
|
188
|
-
address postDeploymentModule,
|
|
189
|
-
bytes calldata postDeploymentModuleCalldata
|
|
190
|
-
)
|
|
191
|
-
public
|
|
192
|
-
view
|
|
193
|
-
override
|
|
194
|
-
returns (
|
|
195
|
-
address primaryContractAddress,
|
|
196
|
-
address secondaryContractAddress
|
|
197
|
-
)
|
|
198
|
-
{
|
|
199
|
-
bytes32 primaryContractGeneratedSalt = _generatePrimaryContractProxySalt(
|
|
200
|
-
primaryContractDeploymentInit,
|
|
201
|
-
secondaryContractDeploymentInit,
|
|
202
|
-
postDeploymentModule,
|
|
203
|
-
postDeploymentModuleCalldata
|
|
204
|
-
);
|
|
205
|
-
|
|
206
|
-
primaryContractAddress = Clones.predictDeterministicAddress(
|
|
207
|
-
primaryContractDeploymentInit.implementationContract,
|
|
208
|
-
primaryContractGeneratedSalt
|
|
209
|
-
);
|
|
210
|
-
|
|
211
|
-
secondaryContractAddress = Clones.predictDeterministicAddress(
|
|
212
|
-
secondaryContractDeploymentInit.implementationContract,
|
|
213
|
-
keccak256(abi.encodePacked(primaryContractAddress))
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function _deployPrimaryContract(
|
|
218
|
-
PrimaryContractDeployment calldata primaryContractDeployment,
|
|
219
|
-
SecondaryContractDeployment calldata secondaryContractDeployment,
|
|
220
|
-
address postDeploymentModule,
|
|
221
|
-
bytes calldata postDeploymentModuleCalldata
|
|
222
|
-
) internal returns (address primaryContractAddress) {
|
|
223
|
-
bytes32 primaryContractGeneratedSalt = _generatePrimaryContractSalt(
|
|
224
|
-
primaryContractDeployment,
|
|
225
|
-
secondaryContractDeployment,
|
|
226
|
-
postDeploymentModule,
|
|
227
|
-
postDeploymentModuleCalldata
|
|
228
|
-
);
|
|
229
|
-
|
|
230
|
-
/* deploy the primary contract */
|
|
231
|
-
primaryContractAddress = Create2.deploy(
|
|
232
|
-
primaryContractDeployment.fundingAmount,
|
|
233
|
-
primaryContractGeneratedSalt,
|
|
234
|
-
primaryContractDeployment.creationBytecode
|
|
235
|
-
);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
function _deploySecondaryContract(
|
|
239
|
-
SecondaryContractDeployment calldata secondaryContractDeployment,
|
|
240
|
-
address primaryContractAddress
|
|
241
|
-
) internal returns (address secondaryContractAddress) {
|
|
242
|
-
/**
|
|
243
|
-
* If `addPrimaryContractAddress` is `true`, the following will be appended to the constructor params:
|
|
244
|
-
* - The primary contract address
|
|
245
|
-
* - `extraConstructorParams`
|
|
246
|
-
*/
|
|
247
|
-
bytes memory secondaryContractByteCode = secondaryContractDeployment
|
|
248
|
-
.creationBytecode;
|
|
249
|
-
|
|
250
|
-
if (secondaryContractDeployment.addPrimaryContractAddress) {
|
|
251
|
-
secondaryContractByteCode = abi.encodePacked(
|
|
252
|
-
secondaryContractByteCode,
|
|
253
|
-
abi.encode(primaryContractAddress),
|
|
254
|
-
secondaryContractDeployment.extraConstructorParams
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
secondaryContractAddress = Create2.deploy(
|
|
259
|
-
secondaryContractDeployment.fundingAmount,
|
|
260
|
-
keccak256(abi.encodePacked(primaryContractAddress)),
|
|
261
|
-
secondaryContractByteCode
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
function _deployAndInitializePrimaryContractProxy(
|
|
266
|
-
PrimaryContractDeploymentInit calldata primaryContractDeploymentInit,
|
|
267
|
-
SecondaryContractDeploymentInit
|
|
268
|
-
calldata secondaryContractDeploymentInit,
|
|
269
|
-
address postDeploymentModule,
|
|
270
|
-
bytes calldata postDeploymentModuleCalldata
|
|
271
|
-
) internal returns (address primaryContractAddress) {
|
|
272
|
-
bytes32 primaryContractGeneratedSalt = _generatePrimaryContractProxySalt(
|
|
273
|
-
primaryContractDeploymentInit,
|
|
274
|
-
secondaryContractDeploymentInit,
|
|
275
|
-
postDeploymentModule,
|
|
276
|
-
postDeploymentModuleCalldata
|
|
277
|
-
);
|
|
278
|
-
|
|
279
|
-
/* deploy the primary contract proxy with the primaryContractGeneratedSalt */
|
|
280
|
-
primaryContractAddress = Clones.cloneDeterministic(
|
|
281
|
-
primaryContractDeploymentInit.implementationContract,
|
|
282
|
-
primaryContractGeneratedSalt
|
|
283
|
-
);
|
|
284
|
-
|
|
285
|
-
/* initialize the primary contract proxy */
|
|
286
|
-
(bool success, bytes memory returnedData) = primaryContractAddress.call{
|
|
287
|
-
value: primaryContractDeploymentInit.fundingAmount
|
|
288
|
-
}(primaryContractDeploymentInit.initializationCalldata);
|
|
289
|
-
if (!success) {
|
|
290
|
-
revert PrimaryContractProxyInitFailureError(returnedData);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
function _deployAndInitializeSecondaryContractProxy(
|
|
295
|
-
SecondaryContractDeploymentInit
|
|
296
|
-
calldata secondaryContractDeploymentInit,
|
|
297
|
-
address primaryContractAddress
|
|
298
|
-
) internal returns (address secondaryContractAddress) {
|
|
299
|
-
/* deploy the secondary contract proxy with the primaryContractGeneratedSalt */
|
|
300
|
-
secondaryContractAddress = Clones.cloneDeterministic(
|
|
301
|
-
secondaryContractDeploymentInit.implementationContract,
|
|
302
|
-
keccak256(abi.encodePacked(primaryContractAddress))
|
|
303
|
-
);
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* If `addPrimaryContractAddress` is `true`, the following will be appended to the `initializationCalldata`:
|
|
307
|
-
* - The primary contract address
|
|
308
|
-
* - `extraInitializationBytes`
|
|
309
|
-
*/
|
|
310
|
-
bytes
|
|
311
|
-
memory secondaryInitializationBytes = secondaryContractDeploymentInit
|
|
312
|
-
.initializationCalldata;
|
|
313
|
-
|
|
314
|
-
if (secondaryContractDeploymentInit.addPrimaryContractAddress) {
|
|
315
|
-
secondaryInitializationBytes = abi.encodePacked(
|
|
316
|
-
secondaryInitializationBytes,
|
|
317
|
-
abi.encode(primaryContractAddress),
|
|
318
|
-
secondaryContractDeploymentInit.extraInitializationParams
|
|
319
|
-
);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/* initialize the primary contract proxy */
|
|
323
|
-
(bool success, bytes memory returnedData) = secondaryContractAddress
|
|
324
|
-
.call{value: secondaryContractDeploymentInit.fundingAmount}(
|
|
325
|
-
secondaryInitializationBytes
|
|
326
|
-
);
|
|
327
|
-
if (!success) {
|
|
328
|
-
revert SecondaryContractProxyInitFailureError(returnedData);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
function _generatePrimaryContractSalt(
|
|
333
|
-
PrimaryContractDeployment calldata primaryContractDeployment,
|
|
334
|
-
SecondaryContractDeployment calldata secondaryContractDeployment,
|
|
335
|
-
address postDeploymentModule,
|
|
336
|
-
bytes calldata postDeploymentModuleCalldata
|
|
337
|
-
) internal pure virtual returns (bytes32 primaryContractGeneratedSalt) {
|
|
338
|
-
/* generate salt for the primary contract
|
|
339
|
-
* the salt is generated by hashing the following elements:
|
|
340
|
-
* - the salt
|
|
341
|
-
* - the secondary contract bytecode
|
|
342
|
-
* - the secondary addPrimaryContractAddress boolean
|
|
343
|
-
* - the secondary extraConstructorParams
|
|
344
|
-
* - the postDeploymentModule address
|
|
345
|
-
* - the postDeploymentModuleCalldata
|
|
346
|
-
*
|
|
347
|
-
*/
|
|
348
|
-
primaryContractGeneratedSalt = keccak256(
|
|
349
|
-
abi.encode(
|
|
350
|
-
primaryContractDeployment.salt,
|
|
351
|
-
secondaryContractDeployment.creationBytecode,
|
|
352
|
-
secondaryContractDeployment.addPrimaryContractAddress,
|
|
353
|
-
secondaryContractDeployment.extraConstructorParams,
|
|
354
|
-
postDeploymentModule,
|
|
355
|
-
postDeploymentModuleCalldata
|
|
356
|
-
)
|
|
357
|
-
);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
function _generatePrimaryContractProxySalt(
|
|
361
|
-
PrimaryContractDeploymentInit calldata primaryContractDeploymentInit,
|
|
362
|
-
SecondaryContractDeploymentInit
|
|
363
|
-
calldata secondaryContractDeploymentInit,
|
|
364
|
-
address postDeploymentModule,
|
|
365
|
-
bytes calldata postDeploymentModuleCalldata
|
|
366
|
-
)
|
|
367
|
-
internal
|
|
368
|
-
pure
|
|
369
|
-
virtual
|
|
370
|
-
returns (bytes32 primaryContractProxyGeneratedSalt)
|
|
371
|
-
{
|
|
372
|
-
/**
|
|
373
|
-
* Generate the salt for the primary contract
|
|
374
|
-
* The salt is generated by hashing the following elements:
|
|
375
|
-
* - the salt
|
|
376
|
-
* - the secondary implementation contract address
|
|
377
|
-
* - the secondary contract initialization calldata
|
|
378
|
-
* - the secondary contract addPrimaryContractAddress boolean
|
|
379
|
-
* - the secondary contract extra initialization params (if any)
|
|
380
|
-
* - the postDeploymentModule address
|
|
381
|
-
* - the callda to the post deployment module
|
|
382
|
-
*
|
|
383
|
-
*/
|
|
384
|
-
primaryContractProxyGeneratedSalt = keccak256(
|
|
385
|
-
abi.encode(
|
|
386
|
-
primaryContractDeploymentInit.salt,
|
|
387
|
-
secondaryContractDeploymentInit.implementationContract,
|
|
388
|
-
secondaryContractDeploymentInit.initializationCalldata,
|
|
389
|
-
secondaryContractDeploymentInit.addPrimaryContractAddress,
|
|
390
|
-
secondaryContractDeploymentInit.extraInitializationParams,
|
|
391
|
-
postDeploymentModule,
|
|
392
|
-
postDeploymentModuleCalldata
|
|
393
|
-
)
|
|
394
|
-
);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
4
|
+
import "@lukso/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# LSP23 Linked Contracts Deployment Module
|
|
2
|
+
|
|
3
|
+
This folder contains modules related to the deployment of LSP23 Linked Contracts. The modules are essential for initializing and post-deploying actions for Universal Profiles.
|
|
4
|
+
|
|
5
|
+
## Modules
|
|
6
|
+
|
|
7
|
+
- **UniversalProfileInitPostDeploymentModule**: This module is responsible for the initial setup after the deployment of a Universal Profile Init contract.
|
|
8
|
+
|
|
9
|
+
- **Standardized Address**: `0x000000000066093407b6704B89793beFfD0D8F00`
|
|
10
|
+
- **Standardized Salt**: `0x12a6712f113536d8b01d99f72ce168c7e10901240d73e80eeb821d01aa4c2b1a`
|
|
11
|
+
- [More Details](./deployment-UP-init-module.md)
|
|
12
|
+
|
|
13
|
+
- **UniversalProfilePostDeploymentModule**: This module is responsible for the initial setup after the deployment of a Universal Profile contract.
|
|
14
|
+
- **Standardized Address**: `0x0000005aD606bcFEF9Ea6D0BbE5b79847054BcD7`
|
|
15
|
+
- **Standardized Salt**: `0x42ff55d7957589c62da54a4368b10a2bc549f2038bbb6880ec6b3e0ecae2ba58`
|
|
16
|
+
- [More Details](./deployment-UP-module.md)
|
|
17
|
+
|
|
18
|
+
## Setup
|
|
19
|
+
|
|
20
|
+
Before deploying any of these modules, make sure that the following contracts are already deployed on the same network:
|
|
21
|
+
|
|
22
|
+
- [Nick's Factory contract](https://github.com/Arachnid/deterministic-deployment-proxy/tree/master)
|
|
23
|
+
- [LSP23 Linked Contracts Factory](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#lsp23linkedcontractsfactory-deployment)
|
package/contracts/LSP23LinkedContractsFactory/modules/UniversalProfileInitPostDeploymentModule.sol
CHANGED
|
@@ -1,63 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
OPERATION_4_DELEGATECALL
|
|
6
|
-
} from "@erc725/smart-contracts/contracts/constants.sol";
|
|
7
|
-
|
|
8
|
-
import {UniversalProfileInit} from "../../UniversalProfileInit.sol";
|
|
9
|
-
|
|
10
|
-
contract UniversalProfileInitPostDeploymentModule is UniversalProfileInit {
|
|
11
|
-
constructor() {
|
|
12
|
-
_disableInitializers();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function setDataAndTransferOwnership(
|
|
16
|
-
bytes32[] memory dataKeys,
|
|
17
|
-
bytes[] memory dataValues,
|
|
18
|
-
address newOwner
|
|
19
|
-
) public payable {
|
|
20
|
-
// check that the msg.sender is the owner
|
|
21
|
-
require(
|
|
22
|
-
msg.sender == owner(),
|
|
23
|
-
"UniversalProfileInitPostDeploymentModule: setDataAndTransferOwnership only allowed through delegate call"
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
// update the dataKeys and dataValues in the UniversalProfile contract
|
|
27
|
-
for (uint256 i = 0; i < dataKeys.length; ) {
|
|
28
|
-
_setData(dataKeys[i], dataValues[i]);
|
|
29
|
-
|
|
30
|
-
unchecked {
|
|
31
|
-
++i;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// transfer the ownership of the UniversalProfile contract to the newOwner
|
|
36
|
-
_setOwner(newOwner);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function executePostDeployment(
|
|
40
|
-
address universalProfile,
|
|
41
|
-
address keyManager,
|
|
42
|
-
bytes calldata setDataBatchBytes
|
|
43
|
-
) public {
|
|
44
|
-
// retrieve the dataKeys and dataValues to setData from the initializationCalldata bytes
|
|
45
|
-
(bytes32[] memory dataKeys, bytes[] memory dataValues) = abi.decode(
|
|
46
|
-
setDataBatchBytes,
|
|
47
|
-
(bytes32[], bytes[])
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
// call the execute function with delegate_call on the universalProfile contract to setData and transferOwnership
|
|
51
|
-
UniversalProfileInit(payable(universalProfile)).execute(
|
|
52
|
-
OPERATION_4_DELEGATECALL,
|
|
53
|
-
address(this),
|
|
54
|
-
0,
|
|
55
|
-
abi.encodeWithSignature(
|
|
56
|
-
"setDataAndTransferOwnership(bytes32[],bytes[],address)",
|
|
57
|
-
dataKeys,
|
|
58
|
-
dataValues,
|
|
59
|
-
keyManager
|
|
60
|
-
)
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
4
|
+
import "@lukso/lsp23-contracts/contracts/modules/UniversalProfileInitPostDeploymentModule.sol";
|
package/contracts/LSP23LinkedContractsFactory/modules/UniversalProfilePostDeploymentModule.sol
CHANGED
|
@@ -1,61 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
OPERATION_4_DELEGATECALL
|
|
6
|
-
} from "@erc725/smart-contracts/contracts/constants.sol";
|
|
7
|
-
|
|
8
|
-
import {UniversalProfile} from "../../UniversalProfile.sol";
|
|
9
|
-
|
|
10
|
-
contract UniversalProfilePostDeploymentModule is UniversalProfile {
|
|
11
|
-
constructor() UniversalProfile(address(0)) {}
|
|
12
|
-
|
|
13
|
-
function setDataAndTransferOwnership(
|
|
14
|
-
bytes32[] memory dataKeys,
|
|
15
|
-
bytes[] memory dataValues,
|
|
16
|
-
address newOwner
|
|
17
|
-
) public payable {
|
|
18
|
-
// check that the msg.sender is the owner
|
|
19
|
-
require(
|
|
20
|
-
msg.sender == owner(),
|
|
21
|
-
"UniversalProfileInitPostDeploymentModule: setDataAndTransferOwnership only allowed through delegate call"
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
// update the dataKeys and dataValues in the UniversalProfile contract
|
|
25
|
-
for (uint256 i = 0; i < dataKeys.length; ) {
|
|
26
|
-
_setData(dataKeys[i], dataValues[i]);
|
|
27
|
-
|
|
28
|
-
unchecked {
|
|
29
|
-
++i;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// transfer the ownership of the UniversalProfile contract to the newOwner
|
|
34
|
-
_setOwner(newOwner);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function executePostDeployment(
|
|
38
|
-
address universalProfile,
|
|
39
|
-
address keyManager,
|
|
40
|
-
bytes calldata setDataBatchBytes
|
|
41
|
-
) public {
|
|
42
|
-
// retrieve the dataKeys and dataValues to setData from the initializationCalldata bytes
|
|
43
|
-
(bytes32[] memory dataKeys, bytes[] memory dataValues) = abi.decode(
|
|
44
|
-
setDataBatchBytes,
|
|
45
|
-
(bytes32[], bytes[])
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
// call the execute function with delegate_call on the universalProfile contract to setData and transferOwnership
|
|
49
|
-
UniversalProfile(payable(universalProfile)).execute(
|
|
50
|
-
OPERATION_4_DELEGATECALL,
|
|
51
|
-
address(this),
|
|
52
|
-
0,
|
|
53
|
-
abi.encodeWithSignature(
|
|
54
|
-
"setDataAndTransferOwnership(bytes32[],bytes[],address)",
|
|
55
|
-
dataKeys,
|
|
56
|
-
dataValues,
|
|
57
|
-
keyManager
|
|
58
|
-
)
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
4
|
+
import "@lukso/lsp23-contracts/contracts/modules/UniversalProfilePostDeploymentModule.sol";
|
|
@@ -1,68 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache 2.0
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @notice Reading the latest nonce of address `from` in the channel ID `channelId`.
|
|
7
|
-
*
|
|
8
|
-
* @dev Get the nonce for a specific `from` address that can be used for signing relay transactions via {executeRelayCall}.
|
|
9
|
-
*
|
|
10
|
-
* @param from The address of the signer of the transaction.
|
|
11
|
-
* @param channelId The channel id that the signer wants to use for executing the transaction.
|
|
12
|
-
*
|
|
13
|
-
* @return The current nonce on a specific `channelId`.
|
|
14
|
-
*/
|
|
15
|
-
function getNonce(
|
|
16
|
-
address from,
|
|
17
|
-
uint128 channelId
|
|
18
|
-
) external view returns (uint256);
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @notice Executing the following payload given the nonce `nonce` and signature `signature`. Payload: `payload`
|
|
22
|
-
*
|
|
23
|
-
* @dev Allows any address (executor) to execute a payload (= abi-encoded function call), given they have a valid signature from a signer address and a valid `nonce` for this signer.
|
|
24
|
-
* The signature MUST be generated according to the signature format defined by the LSP25 standard.
|
|
25
|
-
*
|
|
26
|
-
* @param signature A 65 bytes long signature for a meta transaction according to LSP25.
|
|
27
|
-
* @param nonce The nonce of the address that signed the calldata (in a specific `_channel`), obtained via {getNonce}. Used to prevent replay attack.
|
|
28
|
-
* @param validityTimestamps Two `uint128` timestamps concatenated together that describes
|
|
29
|
-
* when the relay transaction is valid "from" (left `uint128`) and "until" as a deadline (right `uint128`).
|
|
30
|
-
* @param payload The abi-encoded function call to execute.
|
|
31
|
-
*
|
|
32
|
-
* @return The data being returned by the function executed.
|
|
33
|
-
*
|
|
34
|
-
* @custom:requirements
|
|
35
|
-
* - `nonce` MUST be a valid nonce nonce provided (see {getNonce} function).
|
|
36
|
-
* - The transaction MUST be submitted within a valid time period defined by the `validityTimestamp`.
|
|
37
|
-
*
|
|
38
|
-
* @custom:hint You can use `validityTimestamps == 0` to define an `executeRelayCall` transaction that is indefinitely valid,
|
|
39
|
-
* meaning that does not require to start from a specific date/time, or that has an expiration date/time.
|
|
40
|
-
*/
|
|
41
|
-
function executeRelayCall(
|
|
42
|
-
bytes calldata signature,
|
|
43
|
-
uint256 nonce,
|
|
44
|
-
uint256 validityTimestamps,
|
|
45
|
-
bytes calldata payload
|
|
46
|
-
) external payable returns (bytes memory);
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @notice Executing a batch of relay calls (= meta-transactions).
|
|
50
|
-
*
|
|
51
|
-
* @dev Same as {executeRelayCall} but execute a batch of signed calldata payloads (abi-encoded function calls) in a single transaction.
|
|
52
|
-
*
|
|
53
|
-
* @param signatures An array of 65 bytes long signatures for meta transactions according to LSP25.
|
|
54
|
-
* @param nonces An array of nonces of the addresses that signed the calldata payloads (in specific channels). Obtained via {getNonce}. Used to prevent replay attack.
|
|
55
|
-
* @param validityTimestamps An array of two `uint128` concatenated timestamps that describe when the relay transaction is valid "from" (left `uint128`) and "until" (right `uint128`).
|
|
56
|
-
* @param values An array of amount of native tokens to be transferred for each calldata `payload`.
|
|
57
|
-
* @param payloads An array of abi-encoded function calls to be executed successively.
|
|
58
|
-
*
|
|
59
|
-
* @return An array of abi-decoded data returned by the functions executed.
|
|
60
|
-
*/
|
|
61
|
-
function executeRelayCallBatch(
|
|
62
|
-
bytes[] calldata signatures,
|
|
63
|
-
uint256[] calldata nonces,
|
|
64
|
-
uint256[] calldata validityTimestamps,
|
|
65
|
-
uint256[] calldata values,
|
|
66
|
-
bytes[] calldata payloads
|
|
67
|
-
) external payable returns (bytes[] memory);
|
|
68
|
-
}
|
|
4
|
+
import "@lukso/lsp25-contracts/contracts/ILSP25ExecuteRelayCall.sol";
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
bytes4 constant _INTERFACEID_LSP25 = 0x5ac79908;
|
|
6
|
-
|
|
7
|
-
// version number used to validate signed relayed call
|
|
8
|
-
uint256 constant LSP25_VERSION = 25;
|
|
4
|
+
import "@lukso/lsp25-contracts/contracts/LSP25Constants.sol";
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
* @notice Relay call not valid yet.
|
|
6
|
-
*
|
|
7
|
-
* @dev Reverts when the relay call is cannot yet bet executed.
|
|
8
|
-
* This mean that the starting timestamp provided to {executeRelayCall} function is bigger than the current timestamp.
|
|
9
|
-
*/
|
|
10
|
-
error RelayCallBeforeStartTime();
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @notice Relay call expired (deadline passed).
|
|
14
|
-
*
|
|
15
|
-
* @dev Reverts when the period to execute the relay call has expired.
|
|
16
|
-
*/
|
|
17
|
-
error RelayCallExpired();
|
|
4
|
+
import "@lukso/lsp25-contracts/contracts/LSP25Errors.sol";
|