@lukso/lsp-smart-contracts 0.12.0 → 0.13.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 -2
- package/artifacts/LSP0ERC725Account.json +19 -19
- package/artifacts/LSP0ERC725AccountInit.json +19 -19
- package/artifacts/LSP11BasicSocialRecovery.json +2 -2
- package/artifacts/LSP11BasicSocialRecoveryInit.json +2 -2
- package/artifacts/LSP1UniversalReceiverDelegateUP.json +15 -15
- package/artifacts/LSP1UniversalReceiverDelegateVault.json +15 -15
- package/artifacts/LSP4DigitalAssetMetadata.json +5 -0
- package/artifacts/LSP4DigitalAssetMetadataInitAbstract.json +5 -0
- package/artifacts/LSP6KeyManager.json +15 -15
- package/artifacts/LSP6KeyManagerInit.json +15 -15
- package/artifacts/LSP7CappedSupply.json +71 -49
- package/artifacts/LSP7CappedSupplyInitAbstract.json +71 -49
- package/artifacts/LSP7CompatibleERC20.json +71 -49
- package/artifacts/LSP7CompatibleERC20InitAbstract.json +71 -49
- package/artifacts/LSP7CompatibleERC20Mintable.json +78 -51
- package/artifacts/LSP7CompatibleERC20MintableInit.json +78 -51
- package/artifacts/LSP7DigitalAsset.json +71 -49
- package/artifacts/LSP7DigitalAssetInitAbstract.json +71 -49
- package/artifacts/LSP7Mintable.json +78 -51
- package/artifacts/LSP7MintableInit.json +78 -51
- package/artifacts/LSP8CappedSupply.json +187 -36
- package/artifacts/LSP8CappedSupplyInitAbstract.json +200 -49
- package/artifacts/LSP8CompatibleERC721.json +187 -36
- package/artifacts/LSP8CompatibleERC721InitAbstract.json +200 -49
- package/artifacts/LSP8CompatibleERC721Mintable.json +195 -39
- package/artifacts/LSP8CompatibleERC721MintableInit.json +208 -52
- package/artifacts/LSP8IdentifiableDigitalAsset.json +187 -36
- package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +200 -49
- package/artifacts/LSP8Mintable.json +195 -39
- package/artifacts/LSP8MintableInit.json +208 -52
- package/artifacts/LSP9Vault.json +19 -19
- package/artifacts/LSP9VaultInit.json +19 -19
- package/artifacts/UniversalProfile.json +19 -19
- package/artifacts/UniversalProfileInit.json +19 -19
- package/contracts/LSP0ERC725Account/LSP0Constants.sol +1 -1
- package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +7 -3
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +62 -62
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +2 -1
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +3 -1
- package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +11 -10
- package/contracts/LSP17Extensions/Extension4337.sol +26 -1
- package/contracts/LSP17Extensions/OnERC721ReceivedExtension.sol +2 -1
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +31 -33
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +24 -17
- package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +1 -1
- package/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol +1 -5
- package/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +9 -0
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +20 -34
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol +47 -0
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +19 -31
- package/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +13 -6
- package/contracts/LSP6KeyManager/LSP6KeyManager.sol +2 -1
- package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +16 -10
- package/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +2 -1
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +14 -16
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +6 -2
- package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +20 -9
- package/contracts/LSP7DigitalAsset/LSP7Constants.sol +1 -1
- package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +7 -5
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +129 -36
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +5 -2
- package/contracts/LSP7DigitalAsset/LSP7Errors.sol +6 -0
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +4 -2
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +7 -4
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +4 -2
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +5 -2
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +8 -2
- package/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +12 -1
- package/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +4 -0
- package/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +4 -0
- package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +77 -4
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +15 -12
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +19 -3
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +25 -16
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +222 -28
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +28 -15
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +16 -8
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +9 -8
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +13 -2
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +6 -2
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +4 -2
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +13 -2
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +6 -2
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +6 -2
- package/contracts/LSP9Vault/LSP9Constants.sol +1 -1
- package/contracts/LSP9Vault/LSP9Vault.sol +3 -2
- package/contracts/LSP9Vault/LSP9VaultCore.sol +22 -37
- package/contracts/LSP9Vault/LSP9VaultInit.sol +2 -1
- package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +1 -1
- package/contracts/UniversalProfile.sol +4 -2
- package/contracts/UniversalProfileInit.sol +8 -5
- package/contracts/UniversalProfileInitAbstract.sol +4 -2
- package/contracts/Version.sol +6 -5
- package/devdocs/LSP0ERC725Account.json +3 -8
- package/devdocs/LSP0ERC725AccountInit.json +2 -7
- package/devdocs/LSP1UniversalReceiverDelegateUP.json +0 -6
- package/devdocs/LSP1UniversalReceiverDelegateVault.json +0 -6
- package/devdocs/LSP4DigitalAssetMetadata.json +11 -5
- package/devdocs/LSP4DigitalAssetMetadataInitAbstract.json +7 -2
- package/devdocs/LSP6KeyManager.json +2 -7
- package/devdocs/LSP6KeyManagerInit.json +2 -7
- package/devdocs/LSP7CappedSupply.json +22 -8
- package/devdocs/LSP7CappedSupplyInitAbstract.json +22 -8
- package/devdocs/LSP7CompatibleERC20.json +23 -8
- package/devdocs/LSP7CompatibleERC20InitAbstract.json +22 -8
- package/devdocs/LSP7CompatibleERC20Mintable.json +23 -8
- package/devdocs/LSP7CompatibleERC20MintableInit.json +24 -9
- package/devdocs/LSP7DigitalAsset.json +27 -12
- package/devdocs/LSP7DigitalAssetInitAbstract.json +22 -8
- package/devdocs/LSP7Mintable.json +24 -8
- package/devdocs/LSP7MintableInit.json +25 -9
- package/devdocs/LSP8CappedSupply.json +66 -10
- package/devdocs/LSP8CappedSupplyInitAbstract.json +66 -10
- package/devdocs/LSP8CompatibleERC721.json +69 -11
- package/devdocs/LSP8CompatibleERC721InitAbstract.json +67 -11
- package/devdocs/LSP8CompatibleERC721Mintable.json +69 -11
- package/devdocs/LSP8CompatibleERC721MintableInit.json +70 -12
- package/devdocs/LSP8IdentifiableDigitalAsset.json +71 -14
- package/devdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +66 -10
- package/devdocs/LSP8Mintable.json +68 -10
- package/devdocs/LSP8MintableInit.json +69 -11
- package/devdocs/LSP9Vault.json +0 -6
- package/devdocs/LSP9VaultInit.json +0 -6
- package/devdocs/UniversalProfile.json +3 -8
- package/devdocs/UniversalProfileInit.json +4 -9
- package/dist/constants.cjs.js +4552 -1859
- package/dist/constants.d.ts +4143 -1371
- package/dist/constants.es.js +4551 -1859
- package/package.json +2 -2
- package/userdocs/LSP0ERC725Account.json +3 -3
- package/userdocs/LSP0ERC725AccountInit.json +3 -3
- package/userdocs/LSP1UniversalReceiverDelegateUP.json +3 -3
- package/userdocs/LSP1UniversalReceiverDelegateVault.json +3 -3
- package/userdocs/LSP6KeyManager.json +3 -3
- package/userdocs/LSP6KeyManagerInit.json +3 -3
- package/userdocs/LSP7CappedSupply.json +8 -3
- package/userdocs/LSP7CappedSupplyInitAbstract.json +8 -3
- package/userdocs/LSP7CompatibleERC20.json +8 -3
- package/userdocs/LSP7CompatibleERC20InitAbstract.json +8 -3
- package/userdocs/LSP7CompatibleERC20Mintable.json +8 -3
- package/userdocs/LSP7CompatibleERC20MintableInit.json +9 -4
- package/userdocs/LSP7DigitalAsset.json +8 -3
- package/userdocs/LSP7DigitalAssetInitAbstract.json +8 -3
- package/userdocs/LSP7Mintable.json +8 -3
- package/userdocs/LSP7MintableInit.json +9 -4
- package/userdocs/LSP8CappedSupply.json +20 -3
- package/userdocs/LSP8CappedSupplyInitAbstract.json +20 -3
- package/userdocs/LSP8CompatibleERC721.json +20 -3
- package/userdocs/LSP8CompatibleERC721InitAbstract.json +20 -3
- package/userdocs/LSP8CompatibleERC721Mintable.json +20 -3
- package/userdocs/LSP8CompatibleERC721MintableInit.json +21 -4
- package/userdocs/LSP8IdentifiableDigitalAsset.json +20 -3
- package/userdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +19 -2
- package/userdocs/LSP8Mintable.json +19 -2
- package/userdocs/LSP8MintableInit.json +20 -3
- package/userdocs/LSP9Vault.json +3 -3
- package/userdocs/LSP9VaultInit.json +3 -3
- package/userdocs/UniversalProfile.json +3 -3
- package/userdocs/UniversalProfileInit.json +3 -3
package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol
CHANGED
|
@@ -64,19 +64,23 @@ abstract contract LSP8CompatibleERC721InitAbstract is
|
|
|
64
64
|
* @param name_ The name of the token.
|
|
65
65
|
* @param symbol_ The symbol of the token.
|
|
66
66
|
* @param newOwner_ The owner of the token contract.
|
|
67
|
+
* @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection).
|
|
68
|
+
* @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create.
|
|
67
69
|
*/
|
|
68
70
|
|
|
69
71
|
function _initialize(
|
|
70
72
|
string memory name_,
|
|
71
73
|
string memory symbol_,
|
|
72
74
|
address newOwner_,
|
|
73
|
-
uint256
|
|
75
|
+
uint256 lsp4TokenType_,
|
|
76
|
+
uint256 lsp8TokenIdSchema_
|
|
74
77
|
) internal virtual override onlyInitializing {
|
|
75
78
|
LSP8IdentifiableDigitalAssetInitAbstract._initialize(
|
|
76
79
|
name_,
|
|
77
80
|
symbol_,
|
|
78
81
|
newOwner_,
|
|
79
|
-
|
|
82
|
+
lsp4TokenType_,
|
|
83
|
+
lsp8TokenIdSchema_
|
|
80
84
|
);
|
|
81
85
|
}
|
|
82
86
|
|
|
@@ -325,7 +329,7 @@ abstract contract LSP8CompatibleERC721InitAbstract is
|
|
|
325
329
|
* @inheritdoc LSP8IdentifiableDigitalAssetCore
|
|
326
330
|
*
|
|
327
331
|
* @custom:events
|
|
328
|
-
* - LSP7 {
|
|
332
|
+
* - LSP7 {OperatorAuthorizationChanged} event.
|
|
329
333
|
* - ERC721 {Approval} event.
|
|
330
334
|
*/
|
|
331
335
|
function authorizeOperator(
|
|
@@ -353,7 +357,7 @@ abstract contract LSP8CompatibleERC721InitAbstract is
|
|
|
353
357
|
bool isAdded = _operators[tokenId].add(operator);
|
|
354
358
|
if (!isAdded) revert LSP8OperatorAlreadyAuthorized(operator, tokenId);
|
|
355
359
|
|
|
356
|
-
emit
|
|
360
|
+
emit OperatorAuthorizationChanged(
|
|
357
361
|
operator,
|
|
358
362
|
tokenOwner,
|
|
359
363
|
tokenId,
|
|
@@ -366,10 +370,7 @@ abstract contract LSP8CompatibleERC721InitAbstract is
|
|
|
366
370
|
tokenId,
|
|
367
371
|
operatorNotificationData
|
|
368
372
|
);
|
|
369
|
-
operator.
|
|
370
|
-
_TYPEID_LSP8_TOKENOPERATOR,
|
|
371
|
-
lsp1Data
|
|
372
|
-
);
|
|
373
|
+
operator.notifyUniversalReceiver(_TYPEID_LSP8_TOKENOPERATOR, lsp1Data);
|
|
373
374
|
}
|
|
374
375
|
|
|
375
376
|
/**
|
|
@@ -14,13 +14,24 @@ contract LSP8CompatibleERC721Mintable is LSP8CompatibleERC721 {
|
|
|
14
14
|
* @param name_ The name of the token.
|
|
15
15
|
* @param symbol_ The symbol of the token.
|
|
16
16
|
* @param newOwner_ The owner of the token contract.
|
|
17
|
+
* @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection).
|
|
18
|
+
* @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create.
|
|
17
19
|
*/
|
|
18
20
|
constructor(
|
|
19
21
|
string memory name_,
|
|
20
22
|
string memory symbol_,
|
|
21
23
|
address newOwner_,
|
|
22
|
-
uint256
|
|
23
|
-
|
|
24
|
+
uint256 lsp4TokenType_,
|
|
25
|
+
uint256 lsp8TokenIdSchema_
|
|
26
|
+
)
|
|
27
|
+
LSP8CompatibleERC721(
|
|
28
|
+
name_,
|
|
29
|
+
symbol_,
|
|
30
|
+
newOwner_,
|
|
31
|
+
lsp4TokenType_,
|
|
32
|
+
lsp8TokenIdSchema_
|
|
33
|
+
)
|
|
34
|
+
{}
|
|
24
35
|
|
|
25
36
|
/**
|
|
26
37
|
* @notice Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `force`).
|
|
@@ -26,18 +26,22 @@ contract LSP8CompatibleERC721MintableInit is
|
|
|
26
26
|
* @param name_ The name of the token.
|
|
27
27
|
* @param symbol_ The symbol of the token.
|
|
28
28
|
* @param newOwner_ The owner of the token contract.
|
|
29
|
+
* @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection).
|
|
30
|
+
* @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create.
|
|
29
31
|
*/
|
|
30
32
|
function initialize(
|
|
31
33
|
string memory name_,
|
|
32
34
|
string memory symbol_,
|
|
33
35
|
address newOwner_,
|
|
34
|
-
uint256
|
|
36
|
+
uint256 lsp4TokenType_,
|
|
37
|
+
uint256 lsp8TokenIdSchema_
|
|
35
38
|
) external virtual initializer {
|
|
36
39
|
LSP8CompatibleERC721MintableInitAbstract._initialize(
|
|
37
40
|
name_,
|
|
38
41
|
symbol_,
|
|
39
42
|
newOwner_,
|
|
40
|
-
|
|
43
|
+
lsp4TokenType_,
|
|
44
|
+
lsp8TokenIdSchema_
|
|
41
45
|
);
|
|
42
46
|
}
|
|
43
47
|
}
|
package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol
CHANGED
|
@@ -19,13 +19,15 @@ contract LSP8CompatibleERC721MintableInitAbstract is
|
|
|
19
19
|
string memory name_,
|
|
20
20
|
string memory symbol_,
|
|
21
21
|
address newOwner_,
|
|
22
|
-
uint256
|
|
22
|
+
uint256 lsp4TokenType_,
|
|
23
|
+
uint256 lsp8TokenIdSchema_
|
|
23
24
|
) internal virtual override onlyInitializing {
|
|
24
25
|
LSP8CompatibleERC721InitAbstract._initialize(
|
|
25
26
|
name_,
|
|
26
27
|
symbol_,
|
|
27
28
|
newOwner_,
|
|
28
|
-
|
|
29
|
+
lsp4TokenType_,
|
|
30
|
+
lsp8TokenIdSchema_
|
|
29
31
|
);
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -21,13 +21,24 @@ contract LSP8Mintable is LSP8IdentifiableDigitalAsset, ILSP8Mintable {
|
|
|
21
21
|
* @param name_ The name of the token.
|
|
22
22
|
* @param symbol_ The symbol of the token.
|
|
23
23
|
* @param newOwner_ The owner of the token contract.
|
|
24
|
+
* @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection).
|
|
25
|
+
* @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create.
|
|
24
26
|
*/
|
|
25
27
|
constructor(
|
|
26
28
|
string memory name_,
|
|
27
29
|
string memory symbol_,
|
|
28
30
|
address newOwner_,
|
|
29
|
-
uint256
|
|
30
|
-
|
|
31
|
+
uint256 lsp4TokenType_,
|
|
32
|
+
uint256 lsp8TokenIdSchema_
|
|
33
|
+
)
|
|
34
|
+
LSP8IdentifiableDigitalAsset(
|
|
35
|
+
name_,
|
|
36
|
+
symbol_,
|
|
37
|
+
newOwner_,
|
|
38
|
+
lsp4TokenType_,
|
|
39
|
+
lsp8TokenIdSchema_
|
|
40
|
+
)
|
|
41
|
+
{}
|
|
31
42
|
|
|
32
43
|
/**
|
|
33
44
|
* @notice Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `force`).
|
|
@@ -23,18 +23,22 @@ contract LSP8MintableInit is LSP8MintableInitAbstract {
|
|
|
23
23
|
* @param name_ The name of the token.
|
|
24
24
|
* @param symbol_ The symbol of the token.
|
|
25
25
|
* @param newOwner_ The owner of the token contract.
|
|
26
|
+
* @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection).
|
|
27
|
+
* @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create.
|
|
26
28
|
*/
|
|
27
29
|
function initialize(
|
|
28
30
|
string memory name_,
|
|
29
31
|
string memory symbol_,
|
|
30
32
|
address newOwner_,
|
|
31
|
-
uint256
|
|
33
|
+
uint256 lsp4TokenType_,
|
|
34
|
+
uint256 lsp8TokenIdSchema_
|
|
32
35
|
) external virtual initializer {
|
|
33
36
|
LSP8MintableInitAbstract._initialize(
|
|
34
37
|
name_,
|
|
35
38
|
symbol_,
|
|
36
39
|
newOwner_,
|
|
37
|
-
|
|
40
|
+
lsp4TokenType_,
|
|
41
|
+
lsp8TokenIdSchema_
|
|
38
42
|
);
|
|
39
43
|
}
|
|
40
44
|
}
|
|
@@ -23,18 +23,22 @@ abstract contract LSP8MintableInitAbstract is
|
|
|
23
23
|
* @param name_ The name of the token.
|
|
24
24
|
* @param symbol_ The symbol of the token.
|
|
25
25
|
* @param newOwner_ The owner of the token contract.
|
|
26
|
+
* @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection).
|
|
27
|
+
* @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create.
|
|
26
28
|
*/
|
|
27
29
|
function _initialize(
|
|
28
30
|
string memory name_,
|
|
29
31
|
string memory symbol_,
|
|
30
32
|
address newOwner_,
|
|
31
|
-
uint256
|
|
33
|
+
uint256 lsp4TokenType_,
|
|
34
|
+
uint256 lsp8TokenIdSchema_
|
|
32
35
|
) internal virtual override onlyInitializing {
|
|
33
36
|
LSP8IdentifiableDigitalAssetInitAbstract._initialize(
|
|
34
37
|
name_,
|
|
35
38
|
symbol_,
|
|
36
39
|
newOwner_,
|
|
37
|
-
|
|
40
|
+
lsp4TokenType_,
|
|
41
|
+
lsp8TokenIdSchema_
|
|
38
42
|
);
|
|
39
43
|
}
|
|
40
44
|
|
|
@@ -17,7 +17,7 @@ bytes constant _LSP9_SUPPORTED_STANDARDS_VALUE = hex"7c0334a1";
|
|
|
17
17
|
// keccak256('LSP9ValueReceived')
|
|
18
18
|
bytes32 constant _TYPEID_LSP9_VALUE_RECEIVED = 0x468cd1581d7bc001c3b685513d2b929b55437be34700410383d58f3aa1ea0abc;
|
|
19
19
|
|
|
20
|
-
//
|
|
20
|
+
// Ownership Transfer Type IDs
|
|
21
21
|
|
|
22
22
|
// keccak256('LSP9OwnershipTransferStarted')
|
|
23
23
|
bytes32 constant _TYPEID_LSP9_OwnershipTransferStarted = 0xaefd43f45fed1bcd8992f23c803b6f4ec45cf6b62b0d404d565f290a471e763f;
|
|
@@ -5,6 +5,7 @@ pragma solidity ^0.8.4;
|
|
|
5
5
|
import {
|
|
6
6
|
OwnableUnset
|
|
7
7
|
} from "@erc725/smart-contracts/contracts/custom/OwnableUnset.sol";
|
|
8
|
+
import {Version} from "../Version.sol";
|
|
8
9
|
import {LSP9VaultCore} from "./LSP9VaultCore.sol";
|
|
9
10
|
|
|
10
11
|
// libraries
|
|
@@ -23,7 +24,7 @@ import {
|
|
|
23
24
|
* @author Fabian Vogelsteller, Yamen Merhi, Jean Cavallera
|
|
24
25
|
* @dev Could be owned by an EOA or by a contract and is able to receive and send assets. Also allows for registering received assets by leveraging the key-value storage.
|
|
25
26
|
*/
|
|
26
|
-
contract LSP9Vault is LSP9VaultCore {
|
|
27
|
+
contract LSP9Vault is LSP9VaultCore, Version {
|
|
27
28
|
using LSP1Utils for address;
|
|
28
29
|
|
|
29
30
|
/**
|
|
@@ -57,7 +58,7 @@ contract LSP9Vault is LSP9VaultCore {
|
|
|
57
58
|
_LSP9_SUPPORTED_STANDARDS_VALUE
|
|
58
59
|
);
|
|
59
60
|
|
|
60
|
-
newOwner.
|
|
61
|
+
newOwner.notifyUniversalReceiver(
|
|
61
62
|
_TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
|
|
62
63
|
""
|
|
63
64
|
);
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
import {ILSP9Vault} from "./ILSP9Vault.sol";
|
|
13
13
|
|
|
14
14
|
// libraries
|
|
15
|
-
import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";
|
|
16
15
|
import {
|
|
17
16
|
ERC165Checker
|
|
18
17
|
} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
|
|
@@ -20,7 +19,6 @@ import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
|
|
|
20
19
|
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
|
|
21
20
|
|
|
22
21
|
// modules
|
|
23
|
-
import {Version} from "../Version.sol";
|
|
24
22
|
import {ERC725XCore} from "@erc725/smart-contracts/contracts/ERC725XCore.sol";
|
|
25
23
|
import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol";
|
|
26
24
|
import {
|
|
@@ -81,7 +79,6 @@ import {
|
|
|
81
79
|
contract LSP9VaultCore is
|
|
82
80
|
ERC725XCore,
|
|
83
81
|
ERC725YCore,
|
|
84
|
-
Version,
|
|
85
82
|
LSP14Ownable2Step,
|
|
86
83
|
LSP17Extendable,
|
|
87
84
|
ILSP1UniversalReceiver,
|
|
@@ -438,9 +435,9 @@ contract LSP9VaultCore is
|
|
|
438
435
|
address currentOwner = owner();
|
|
439
436
|
emit OwnershipTransferStarted(currentOwner, newOwner);
|
|
440
437
|
|
|
441
|
-
newOwner.
|
|
438
|
+
newOwner.notifyUniversalReceiver(
|
|
442
439
|
_TYPEID_LSP9_OwnershipTransferStarted,
|
|
443
|
-
|
|
440
|
+
abi.encode(currentOwner, newOwner)
|
|
444
441
|
);
|
|
445
442
|
|
|
446
443
|
// reset the transfer ownership lock
|
|
@@ -455,19 +452,19 @@ contract LSP9VaultCore is
|
|
|
455
452
|
* - When notifying the previous owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_SenderNotification].
|
|
456
453
|
* - When notifying the new owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_RecipientNotification].
|
|
457
454
|
*/
|
|
458
|
-
function acceptOwnership() public virtual override
|
|
455
|
+
function acceptOwnership() public virtual override notInTransferOwnership {
|
|
459
456
|
address previousOwner = owner();
|
|
460
457
|
|
|
461
458
|
_acceptOwnership();
|
|
462
459
|
|
|
463
|
-
previousOwner.
|
|
460
|
+
previousOwner.notifyUniversalReceiver(
|
|
464
461
|
_TYPEID_LSP9_OwnershipTransferred_SenderNotification,
|
|
465
|
-
|
|
462
|
+
abi.encode(previousOwner, msg.sender)
|
|
466
463
|
);
|
|
467
464
|
|
|
468
|
-
msg.sender.
|
|
465
|
+
msg.sender.notifyUniversalReceiver(
|
|
469
466
|
_TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
|
|
470
|
-
|
|
467
|
+
abi.encode(previousOwner, msg.sender)
|
|
471
468
|
);
|
|
472
469
|
}
|
|
473
470
|
|
|
@@ -488,9 +485,9 @@ contract LSP9VaultCore is
|
|
|
488
485
|
LSP14Ownable2Step._renounceOwnership();
|
|
489
486
|
|
|
490
487
|
if (owner() == address(0)) {
|
|
491
|
-
previousOwner.
|
|
488
|
+
previousOwner.notifyUniversalReceiver(
|
|
492
489
|
_TYPEID_LSP9_OwnershipTransferred_SenderNotification,
|
|
493
|
-
|
|
490
|
+
abi.encode(previousOwner, address(0))
|
|
494
491
|
);
|
|
495
492
|
}
|
|
496
493
|
}
|
|
@@ -603,10 +600,19 @@ contract LSP9VaultCore is
|
|
|
603
600
|
mappedExtensionDataKey
|
|
604
601
|
);
|
|
605
602
|
|
|
606
|
-
//
|
|
603
|
+
// Prevent casting data shorter than 20 bytes to an address to avoid
|
|
604
|
+
// unintentionally calling a different extension, return address(0) instead.
|
|
605
|
+
if (extensionData.length < 20) {
|
|
606
|
+
return (address(0), false);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// CHECK if the `extensionData` is 21 bytes long
|
|
610
|
+
// - 20 bytes = extension's address
|
|
611
|
+
// - 1 byte `0x01` as a boolean indicating if the contract should forward the value to the extension or not
|
|
607
612
|
if (extensionData.length == 21) {
|
|
608
|
-
//
|
|
609
|
-
|
|
613
|
+
// If the last byte is set to `0x01` (`true`)
|
|
614
|
+
// this indicates that the contract should forward the value to the extension
|
|
615
|
+
if (extensionData[20] == 0x01) {
|
|
610
616
|
// Return the address of the extension
|
|
611
617
|
return (address(bytes20(extensionData)), true);
|
|
612
618
|
}
|
|
@@ -616,7 +622,7 @@ contract LSP9VaultCore is
|
|
|
616
622
|
}
|
|
617
623
|
|
|
618
624
|
/**
|
|
619
|
-
* @dev
|
|
625
|
+
* @dev Internal method restricting the call to the owner of the contract and the UniversalReceiverDelegate
|
|
620
626
|
*/
|
|
621
627
|
function _validateAndIdentifyCaller()
|
|
622
628
|
internal
|
|
@@ -633,27 +639,6 @@ contract LSP9VaultCore is
|
|
|
633
639
|
}
|
|
634
640
|
}
|
|
635
641
|
|
|
636
|
-
/**
|
|
637
|
-
* @dev This function overrides the {ERC725YCore} internal {_setData} function to optimize gas usage by emitting only the first 256 bytes of the `dataValue`.
|
|
638
|
-
*
|
|
639
|
-
* @custom:events {DataChanged} event with only the first 256 bytes of {dataValue}.
|
|
640
|
-
*
|
|
641
|
-
* @param dataKey The key to store the data value under.
|
|
642
|
-
* @param dataValue The data value to be stored.
|
|
643
|
-
*/
|
|
644
|
-
function _setData(
|
|
645
|
-
bytes32 dataKey,
|
|
646
|
-
bytes memory dataValue
|
|
647
|
-
) internal virtual override {
|
|
648
|
-
_store[dataKey] = dataValue;
|
|
649
|
-
emit DataChanged(
|
|
650
|
-
dataKey,
|
|
651
|
-
dataValue.length <= 256
|
|
652
|
-
? dataValue
|
|
653
|
-
: BytesLib.slice(dataValue, 0, 256)
|
|
654
|
-
);
|
|
655
|
-
}
|
|
656
|
-
|
|
657
642
|
/**
|
|
658
643
|
* @dev This function overrides the {ERC725XCore} internal {_execute} function to disable operation type DELEGATECALL (4).
|
|
659
644
|
*
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
4
|
// modules
|
|
5
|
+
import {Version} from "../Version.sol";
|
|
5
6
|
import {LSP9VaultInitAbstract} from "./LSP9VaultInitAbstract.sol";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -9,7 +10,7 @@ import {LSP9VaultInitAbstract} from "./LSP9VaultInitAbstract.sol";
|
|
|
9
10
|
* @author Fabian Vogelsteller, Yamen Merhi, Jean Cavallera
|
|
10
11
|
* @dev Could be owned by a UniversalProfile and able to register received asset with UniversalReceiverDelegateVault
|
|
11
12
|
*/
|
|
12
|
-
contract LSP9VaultInit is LSP9VaultInitAbstract {
|
|
13
|
+
contract LSP9VaultInit is LSP9VaultInitAbstract, Version {
|
|
13
14
|
/**
|
|
14
15
|
* @dev initialize (= lock) base implementation contract on deployment
|
|
15
16
|
*/
|
|
@@ -60,7 +60,7 @@ abstract contract LSP9VaultInitAbstract is Initializable, LSP9VaultCore {
|
|
|
60
60
|
_LSP9_SUPPORTED_STANDARDS_VALUE
|
|
61
61
|
);
|
|
62
62
|
|
|
63
|
-
newOwner.
|
|
63
|
+
newOwner.notifyUniversalReceiver(
|
|
64
64
|
_TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
|
|
65
65
|
""
|
|
66
66
|
);
|
|
@@ -19,7 +19,9 @@ contract UniversalProfile is LSP0ERC725Account {
|
|
|
19
19
|
/**
|
|
20
20
|
* @notice Deploying a UniversalProfile contract with owner set to address `initialOwner`.
|
|
21
21
|
*
|
|
22
|
-
* @dev Set `initialOwner` as the contract owner and the `SupportedStandards:
|
|
22
|
+
* @dev Set `initialOwner` as the contract owner and the `SupportedStandards:LSP3Profile` data key in the ERC725Y data key/value store.
|
|
23
|
+
* - The `constructor` is payable and allows funding the contract on deployment.
|
|
24
|
+
* - The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier.
|
|
23
25
|
*
|
|
24
26
|
* @param initialOwner the owner of the contract
|
|
25
27
|
*
|
|
@@ -29,7 +31,7 @@ contract UniversalProfile is LSP0ERC725Account {
|
|
|
29
31
|
* - {DataChanged} event when setting the {_LSP3_SUPPORTED_STANDARDS_KEY}.
|
|
30
32
|
*/
|
|
31
33
|
constructor(address initialOwner) payable LSP0ERC725Account(initialOwner) {
|
|
32
|
-
// set data key SupportedStandards:
|
|
34
|
+
// set data key SupportedStandards:LSP3Profile
|
|
33
35
|
_setData(
|
|
34
36
|
_LSP3_SUPPORTED_STANDARDS_KEY,
|
|
35
37
|
_LSP3_SUPPORTED_STANDARDS_VALUE
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
4
|
// modules
|
|
5
|
+
import {Version} from "./Version.sol";
|
|
5
6
|
import {UniversalProfileInitAbstract} from "./UniversalProfileInitAbstract.sol";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -9,12 +10,11 @@ import {UniversalProfileInitAbstract} from "./UniversalProfileInitAbstract.sol";
|
|
|
9
10
|
* @author Fabian Vogelsteller <fabian@lukso.network>
|
|
10
11
|
* @dev Implementation of the ERC725Account + LSP1 universalReceiver
|
|
11
12
|
*/
|
|
12
|
-
contract UniversalProfileInit is UniversalProfileInitAbstract {
|
|
13
|
+
contract UniversalProfileInit is UniversalProfileInitAbstract, Version {
|
|
13
14
|
/**
|
|
14
15
|
* @notice deploying a `UniversalProfileInit` base contract to be used behind proxy
|
|
15
|
-
* @dev Locks the base contract on deployment, so that it cannot be initialized, owned and controlled by anyone
|
|
16
|
-
*
|
|
17
|
-
* contract behind a proxy.
|
|
16
|
+
* @dev Locks the base contract on deployment, so that it cannot be initialized, owned and controlled by anyone after it has been deployed.
|
|
17
|
+
* This is intended so that the sole purpose of this contract is to be used as a base contract behind a proxy.
|
|
18
18
|
*/
|
|
19
19
|
constructor() {
|
|
20
20
|
_disableInitializers();
|
|
@@ -23,13 +23,16 @@ contract UniversalProfileInit is UniversalProfileInitAbstract {
|
|
|
23
23
|
/**
|
|
24
24
|
* @notice Initializing a UniversalProfile contract with owner set to address `initialOwner`.
|
|
25
25
|
*
|
|
26
|
-
* @dev Set `initialOwner` as the contract owner and the `SupportedStandards:
|
|
26
|
+
* @dev Set `initialOwner` as the contract owner and the `SupportedStandards:LSP3Profile` data key in the ERC725Y data key/value store.
|
|
27
|
+
* - The `initialize(address)` function is payable and allows funding the contract on initialization.
|
|
28
|
+
* - The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier.
|
|
27
29
|
*
|
|
28
30
|
* @param initialOwner the owner of the contract
|
|
29
31
|
*
|
|
30
32
|
* @custom:events
|
|
31
33
|
* - {UniversalReceiver} event when funding the contract on deployment.
|
|
32
34
|
* - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.
|
|
35
|
+
* - {DataChanged} event when setting the {_LSP3_SUPPORTED_STANDARDS_KEY}.
|
|
33
36
|
*/
|
|
34
37
|
function initialize(
|
|
35
38
|
address initialOwner
|
|
@@ -21,7 +21,8 @@ abstract contract UniversalProfileInitAbstract is
|
|
|
21
21
|
LSP0ERC725AccountInitAbstract
|
|
22
22
|
{
|
|
23
23
|
/**
|
|
24
|
-
* @dev Set `initialOwner` as the contract owner and the `SupportedStandards:
|
|
24
|
+
* @dev Set `initialOwner` as the contract owner and the `SupportedStandards:LSP3Profile` data key in the ERC725Y data key/value store.
|
|
25
|
+
* The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier.
|
|
25
26
|
*
|
|
26
27
|
* @param initialOwner The owner of the contract.
|
|
27
28
|
*
|
|
@@ -30,13 +31,14 @@ abstract contract UniversalProfileInitAbstract is
|
|
|
30
31
|
* @custom:events
|
|
31
32
|
* - {UniversalReceiver} event when funding the contract on deployment.
|
|
32
33
|
* - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.
|
|
34
|
+
* - {DataChanged} event when setting the {_LSP3_SUPPORTED_STANDARDS_KEY}.
|
|
33
35
|
*/
|
|
34
36
|
function _initialize(
|
|
35
37
|
address initialOwner
|
|
36
38
|
) internal virtual override onlyInitializing {
|
|
37
39
|
LSP0ERC725AccountInitAbstract._initialize(initialOwner);
|
|
38
40
|
|
|
39
|
-
// set data key SupportedStandards:
|
|
41
|
+
// set data key SupportedStandards:LSP3Profile
|
|
40
42
|
_setData(
|
|
41
43
|
_LSP3_SUPPORTED_STANDARDS_KEY,
|
|
42
44
|
_LSP3_SUPPORTED_STANDARDS_VALUE
|
package/contracts/Version.sol
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
4
|
abstract contract Version {
|
|
5
|
-
string internal constant _VERSION = "0.12.0";
|
|
6
|
-
|
|
7
5
|
/**
|
|
8
6
|
* @dev Get the version of the contract.
|
|
9
7
|
* @notice Contract version.
|
|
10
8
|
*
|
|
11
9
|
* @return The version of the the contract.
|
|
12
10
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
// DO NOT CHANGE
|
|
12
|
+
// Comments block below is used by release-please to automatically update the version in this file.
|
|
13
|
+
// x-release-please-start-version
|
|
14
|
+
string public constant VERSION = "0.13.0";
|
|
15
|
+
|
|
16
|
+
// x-release-please-end
|
|
16
17
|
}
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
},
|
|
141
141
|
"constructor": {
|
|
142
142
|
"custom:events": "- {UniversalReceiver} event when funding the contract on deployment. - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.",
|
|
143
|
-
"details": "Set `initialOwner` as the contract owner. The `constructor` also allows funding the contract on deployment.",
|
|
143
|
+
"details": "Set `initialOwner` as the contract owner. - The `constructor` also allows funding the contract on deployment. - The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier.",
|
|
144
144
|
"params": {
|
|
145
145
|
"initialOwner": "The owner of the contract."
|
|
146
146
|
}
|
|
@@ -187,6 +187,7 @@
|
|
|
187
187
|
}
|
|
188
188
|
},
|
|
189
189
|
"isValidSignature(bytes32,bytes)": {
|
|
190
|
+
"custom:warning": "This function does not enforce by default the inclusion of the address of this contract in the signature digest. It is recommended that protocols or applications using this contract include the targeted address (= this contract) in the data to sign. To ensure that a signature is valid for a specific LSP0ERC725Account and prevent signatures from the same EOA to be replayed across different LSP0ERC725Accounts.",
|
|
190
191
|
"details": "Handles two cases: 1. If the owner is an EOA, recovers an address from the hash and the signature provided: - Returns the `_ERC1271_SUCCESSVALUE` if the address recovered is the same as the owner, indicating that it was a valid signature. - If the address is different, it returns the `_ERC1271_FAILVALUE` indicating that the signature is not valid. 2. If the owner is a smart contract, it forwards the call of {isValidSignature()} to the owner contract: - If the contract fails or returns the `_ERC1271_FAILVALUE`, the {isValidSignature()} on the account returns the `_ERC1271_FAILVALUE`, indicating that the signature is not valid. - If the {isValidSignature()} on the owner returned the `_ERC1271_SUCCESSVALUE`, the {isValidSignature()} on the account returns the `_ERC1271_SUCCESSVALUE`, indicating that it's a valid signature.",
|
|
191
192
|
"params": {
|
|
192
193
|
"dataHash": "The hash of the data to be validated.",
|
|
@@ -244,7 +245,7 @@
|
|
|
244
245
|
},
|
|
245
246
|
"universalReceiver(bytes32,bytes)": {
|
|
246
247
|
"custom:events": "- {UniversalReceiver} when receiving native tokens. - {UniversalReceiver} event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.",
|
|
247
|
-
"details": "Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps: 1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]. - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. 2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function.",
|
|
248
|
+
"details": "Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps: 1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]. - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. 2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. This function delegates internally the handling of native tokens to the {universalReceiver} function itself passing `_TYPEID_LSP0_VALUE_RECEIVED` as typeId and the calldata as received data.",
|
|
248
249
|
"params": {
|
|
249
250
|
"receivedData": "The data received.",
|
|
250
251
|
"typeId": "The type of call received."
|
|
@@ -252,12 +253,6 @@
|
|
|
252
253
|
"returns": {
|
|
253
254
|
"returnedValues": "The ABI encoded return value of the LSP1UniversalReceiverDelegate call and the LSP1TypeIdDelegate call."
|
|
254
255
|
}
|
|
255
|
-
},
|
|
256
|
-
"version()": {
|
|
257
|
-
"details": "Get the version of the contract.",
|
|
258
|
-
"returns": {
|
|
259
|
-
"_0": "The version of the the contract."
|
|
260
|
-
}
|
|
261
256
|
}
|
|
262
257
|
},
|
|
263
258
|
"title": "Deployable Implementation of [LSP-0-ERC725Account] Standard.",
|
|
@@ -190,6 +190,7 @@
|
|
|
190
190
|
}
|
|
191
191
|
},
|
|
192
192
|
"isValidSignature(bytes32,bytes)": {
|
|
193
|
+
"custom:warning": "This function does not enforce by default the inclusion of the address of this contract in the signature digest. It is recommended that protocols or applications using this contract include the targeted address (= this contract) in the data to sign. To ensure that a signature is valid for a specific LSP0ERC725Account and prevent signatures from the same EOA to be replayed across different LSP0ERC725Accounts.",
|
|
193
194
|
"details": "Handles two cases: 1. If the owner is an EOA, recovers an address from the hash and the signature provided: - Returns the `_ERC1271_SUCCESSVALUE` if the address recovered is the same as the owner, indicating that it was a valid signature. - If the address is different, it returns the `_ERC1271_FAILVALUE` indicating that the signature is not valid. 2. If the owner is a smart contract, it forwards the call of {isValidSignature()} to the owner contract: - If the contract fails or returns the `_ERC1271_FAILVALUE`, the {isValidSignature()} on the account returns the `_ERC1271_FAILVALUE`, indicating that the signature is not valid. - If the {isValidSignature()} on the owner returned the `_ERC1271_SUCCESSVALUE`, the {isValidSignature()} on the account returns the `_ERC1271_SUCCESSVALUE`, indicating that it's a valid signature.",
|
|
194
195
|
"params": {
|
|
195
196
|
"dataHash": "The hash of the data to be validated.",
|
|
@@ -247,7 +248,7 @@
|
|
|
247
248
|
},
|
|
248
249
|
"universalReceiver(bytes32,bytes)": {
|
|
249
250
|
"custom:events": "- {UniversalReceiver} when receiving native tokens. - {UniversalReceiver} event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.",
|
|
250
|
-
"details": "Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps: 1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]. - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. 2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function.",
|
|
251
|
+
"details": "Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps: 1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]. - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. 2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. This function delegates internally the handling of native tokens to the {universalReceiver} function itself passing `_TYPEID_LSP0_VALUE_RECEIVED` as typeId and the calldata as received data.",
|
|
251
252
|
"params": {
|
|
252
253
|
"receivedData": "The data received.",
|
|
253
254
|
"typeId": "The type of call received."
|
|
@@ -255,12 +256,6 @@
|
|
|
255
256
|
"returns": {
|
|
256
257
|
"returnedValues": "The ABI encoded return value of the LSP1UniversalReceiverDelegate call and the LSP1TypeIdDelegate call."
|
|
257
258
|
}
|
|
258
|
-
},
|
|
259
|
-
"version()": {
|
|
260
|
-
"details": "Get the version of the contract.",
|
|
261
|
-
"returns": {
|
|
262
|
-
"_0": "The version of the the contract."
|
|
263
|
-
}
|
|
264
259
|
}
|
|
265
260
|
},
|
|
266
261
|
"title": "Deployable Proxy Implementation of [LSP-0-ERC725Account] Standard.",
|
|
@@ -27,12 +27,6 @@
|
|
|
27
27
|
"returns": {
|
|
28
28
|
"_0": "The result of the reaction for `typeId`."
|
|
29
29
|
}
|
|
30
|
-
},
|
|
31
|
-
"version()": {
|
|
32
|
-
"details": "Get the version of the contract.",
|
|
33
|
-
"returns": {
|
|
34
|
-
"_0": "The version of the the contract."
|
|
35
|
-
}
|
|
36
30
|
}
|
|
37
31
|
},
|
|
38
32
|
"title": "Implementation of a UniversalReceiverDelegate for the [LSP-0-ERC725Account]",
|
|
@@ -26,12 +26,6 @@
|
|
|
26
26
|
"returns": {
|
|
27
27
|
"_0": "The result of the reaction for `typeId`."
|
|
28
28
|
}
|
|
29
|
-
},
|
|
30
|
-
"version()": {
|
|
31
|
-
"details": "Get the version of the contract.",
|
|
32
|
-
"returns": {
|
|
33
|
-
"_0": "The version of the the contract."
|
|
34
|
-
}
|
|
35
29
|
}
|
|
36
30
|
},
|
|
37
31
|
"title": "Implementation of a UniversalReceiverDelegate for the [LSP9Vault]",
|