@lukso/lsp-smart-contracts 0.8.2 → 0.10.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 +29 -8
- package/artifacts/LSP0ERC725Account.json +90 -50
- package/artifacts/LSP0ERC725AccountInit.json +90 -50
- package/artifacts/LSP11BasicSocialRecovery.json +2 -2
- package/artifacts/LSP11BasicSocialRecoveryInit.json +2 -2
- package/artifacts/LSP16UniversalFactory.json +31 -2
- package/artifacts/LSP1UniversalReceiverDelegateUP.json +19 -35
- package/artifacts/LSP1UniversalReceiverDelegateVault.json +13 -13
- package/artifacts/LSP4Compatibility.json +39 -40
- package/artifacts/LSP4DigitalAssetMetadata.json +39 -40
- package/artifacts/LSP4DigitalAssetMetadataInitAbstract.json +39 -40
- package/artifacts/LSP6KeyManager.json +107 -8
- package/artifacts/LSP6KeyManagerInit.json +119 -20
- package/artifacts/LSP7CappedSupply.json +78 -38
- package/artifacts/LSP7CappedSupplyInitAbstract.json +78 -38
- package/artifacts/LSP7CompatibleERC20.json +78 -38
- package/artifacts/LSP7CompatibleERC20InitAbstract.json +78 -38
- package/artifacts/LSP7CompatibleERC20Mintable.json +80 -40
- package/artifacts/LSP7CompatibleERC20MintableInit.json +80 -40
- package/artifacts/LSP7DigitalAsset.json +78 -38
- package/artifacts/LSP7DigitalAssetInitAbstract.json +78 -38
- package/artifacts/LSP7Mintable.json +80 -40
- package/artifacts/LSP7MintableInit.json +80 -40
- package/artifacts/LSP8CappedSupply.json +39 -40
- package/artifacts/LSP8CappedSupplyInitAbstract.json +39 -40
- package/artifacts/LSP8CompatibleERC721.json +42 -43
- package/artifacts/LSP8CompatibleERC721InitAbstract.json +42 -43
- package/artifacts/LSP8CompatibleERC721Mintable.json +44 -45
- package/artifacts/LSP8CompatibleERC721MintableInit.json +44 -45
- package/artifacts/LSP8IdentifiableDigitalAsset.json +39 -40
- package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +39 -40
- package/artifacts/LSP8Mintable.json +41 -42
- package/artifacts/LSP8MintableInit.json +41 -42
- package/artifacts/LSP9Vault.json +73 -55
- package/artifacts/LSP9VaultInit.json +73 -55
- package/artifacts/UniversalProfile.json +90 -50
- package/artifacts/UniversalProfileInit.json +90 -50
- package/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +62 -0
- package/contracts/LSP0ERC725Account/LSP0Constants.sol +1 -1
- package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +36 -6
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +605 -219
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +31 -5
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +37 -3
- package/contracts/LSP0ERC725Account/LSP0Utils.sol +0 -1
- package/contracts/LSP10ReceivedVaults/LSP10Utils.sol +71 -60
- package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol +5 -7
- package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.sol +0 -1
- package/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +27 -4
- package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +41 -84
- package/contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol +8 -8
- package/contracts/LSP17ContractExtension/LSP17Extendable.sol +10 -5
- package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +0 -4
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +129 -77
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +45 -16
- package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +12 -0
- package/contracts/LSP20CallVerification/ILSP20CallVerification.sol +30 -0
- package/contracts/LSP20CallVerification/LSP20CallVerification.sol +83 -0
- package/contracts/LSP20CallVerification/LSP20Constants.sol +17 -0
- package/contracts/LSP20CallVerification/LSP20Errors.sol +15 -0
- package/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +26 -12
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +0 -1
- package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +76 -66
- package/contracts/LSP6KeyManager/ILSP6KeyManager.sol +12 -3
- package/contracts/LSP6KeyManager/LSP6Constants.sol +9 -3
- package/contracts/LSP6KeyManager/LSP6Errors.sol +22 -1
- package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +172 -29
- package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +0 -1
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +270 -100
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +187 -67
- package/contracts/LSP6KeyManager/LSP6Utils.sol +31 -20
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +79 -30
- package/contracts/LSP7DigitalAsset/LSP7Errors.sol +5 -0
- package/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +2 -2
- package/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +24 -0
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +1 -2
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +1 -2
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +3 -5
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +3 -5
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +27 -29
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +1 -1
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +1 -2
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +1 -2
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +5 -5
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +6 -6
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +2 -2
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +2 -2
- package/contracts/LSP9Vault/ILSP9Vault.sol +27 -0
- package/contracts/LSP9Vault/LSP9Constants.sol +1 -1
- package/contracts/LSP9Vault/LSP9Vault.sol +11 -8
- package/contracts/LSP9Vault/LSP9VaultCore.sol +96 -71
- package/contracts/LSP9Vault/LSP9VaultInit.sol +2 -1
- package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +19 -7
- package/contracts/UniversalProfileInitAbstract.sol +5 -0
- package/devdocs/Create2Factory.json +16 -0
- package/devdocs/LSP0ERC725Account.json +200 -0
- package/devdocs/LSP0ERC725AccountInit.json +203 -0
- package/devdocs/LSP11BasicSocialRecovery.json +146 -0
- package/devdocs/LSP11BasicSocialRecoveryInit.json +146 -0
- package/devdocs/LSP16UniversalFactory.json +51 -0
- package/devdocs/LSP1UniversalReceiverDelegateUP.json +80 -0
- package/devdocs/LSP1UniversalReceiverDelegateVault.json +62 -0
- package/devdocs/LSP4Compatibility.json +79 -0
- package/devdocs/LSP4DigitalAssetMetadata.json +84 -0
- package/devdocs/LSP4DigitalAssetMetadataInitAbstract.json +77 -0
- package/devdocs/LSP6KeyManager.json +257 -0
- package/devdocs/LSP6KeyManagerInit.json +260 -0
- package/devdocs/LSP7CappedSupply.json +211 -0
- package/devdocs/LSP7CappedSupplyInitAbstract.json +206 -0
- package/devdocs/LSP7CompatibleERC20.json +225 -0
- package/devdocs/LSP7CompatibleERC20InitAbstract.json +218 -0
- package/devdocs/LSP7CompatibleERC20Mintable.json +217 -0
- package/devdocs/LSP7CompatibleERC20MintableInit.json +227 -0
- package/devdocs/LSP7DigitalAsset.json +210 -0
- package/devdocs/LSP7DigitalAssetInitAbstract.json +202 -0
- package/devdocs/LSP7Mintable.json +219 -0
- package/devdocs/LSP7MintableInit.json +220 -0
- package/devdocs/LSP8CappedSupply.json +232 -0
- package/devdocs/LSP8CappedSupplyInitAbstract.json +227 -0
- package/devdocs/LSP8CompatibleERC721.json +298 -0
- package/devdocs/LSP8CompatibleERC721InitAbstract.json +291 -0
- package/devdocs/LSP8CompatibleERC721Mintable.json +290 -0
- package/devdocs/LSP8CompatibleERC721MintableInit.json +300 -0
- package/devdocs/LSP8IdentifiableDigitalAsset.json +230 -0
- package/devdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +223 -0
- package/devdocs/LSP8Mintable.json +242 -0
- package/devdocs/LSP8MintableInit.json +245 -0
- package/devdocs/LSP9Vault.json +171 -0
- package/devdocs/LSP9VaultInit.json +175 -0
- package/devdocs/UniversalProfile.json +199 -0
- package/devdocs/UniversalProfileInit.json +202 -0
- package/devdocs/UniversalReceiverAddressStore.json +9 -0
- package/dist/constants.cjs.js +31569 -0
- package/dist/constants.d.ts +31681 -0
- package/dist/constants.es.js +31550 -0
- package/package.json +70 -52
- package/userdocs/Create2Factory.json +5 -0
- package/userdocs/LSP0ERC725Account.json +47 -0
- package/userdocs/LSP0ERC725AccountInit.json +47 -0
- package/userdocs/LSP11BasicSocialRecovery.json +29 -0
- package/userdocs/LSP11BasicSocialRecoveryInit.json +29 -0
- package/userdocs/LSP16UniversalFactory.json +5 -0
- package/userdocs/LSP1UniversalReceiverDelegateUP.json +10 -0
- package/userdocs/LSP1UniversalReceiverDelegateVault.json +10 -0
- package/userdocs/LSP4Compatibility.json +20 -0
- package/userdocs/LSP4DigitalAssetMetadata.json +23 -0
- package/userdocs/LSP4DigitalAssetMetadataInitAbstract.json +20 -0
- package/userdocs/LSP6KeyManager.json +18 -0
- package/userdocs/LSP6KeyManagerInit.json +18 -0
- package/userdocs/LSP7CappedSupply.json +29 -0
- package/userdocs/LSP7CappedSupplyInitAbstract.json +26 -0
- package/userdocs/LSP7CompatibleERC20.json +35 -0
- package/userdocs/LSP7CompatibleERC20InitAbstract.json +32 -0
- package/userdocs/LSP7CompatibleERC20Mintable.json +32 -0
- package/userdocs/LSP7CompatibleERC20MintableInit.json +35 -0
- package/userdocs/LSP7DigitalAsset.json +29 -0
- package/userdocs/LSP7DigitalAssetInitAbstract.json +26 -0
- package/userdocs/LSP7Mintable.json +29 -0
- package/userdocs/LSP7MintableInit.json +29 -0
- package/userdocs/LSP8CappedSupply.json +23 -0
- package/userdocs/LSP8CappedSupplyInitAbstract.json +20 -0
- package/userdocs/LSP8CompatibleERC721.json +29 -0
- package/userdocs/LSP8CompatibleERC721InitAbstract.json +26 -0
- package/userdocs/LSP8CompatibleERC721Mintable.json +26 -0
- package/userdocs/LSP8CompatibleERC721MintableInit.json +29 -0
- package/userdocs/LSP8IdentifiableDigitalAsset.json +23 -0
- package/userdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +20 -0
- package/userdocs/LSP8Mintable.json +23 -0
- package/userdocs/LSP8MintableInit.json +23 -0
- package/userdocs/LSP9Vault.json +38 -0
- package/userdocs/LSP9VaultInit.json +38 -0
- package/userdocs/UniversalProfile.json +50 -0
- package/userdocs/UniversalProfileInit.json +50 -0
- package/userdocs/UniversalReceiverAddressStore.json +5 -0
- package/CONTRIBUTING.md +0 -57
- package/common/constants.d.ts +0 -738
- package/common/constants.js +0 -785
- package/contracts/Utils/GasLib.sol +0 -17
- package/module/constants.d.ts +0 -738
- package/module/constants.js +0 -782
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
pragma solidity ^0.8.4;
|
|
3
|
+
|
|
4
|
+
// interfaces
|
|
5
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
6
|
+
import {IERC725X} from "@erc725/smart-contracts/contracts/interfaces/IERC725X.sol";
|
|
7
|
+
import {IERC725Y} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
|
|
8
|
+
import {ILSP1UniversalReceiver} from "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
|
|
9
|
+
import {ILSP14Ownable2Step} from "../LSP14Ownable2Step/ILSP14Ownable2Step.sol";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @title Interface of LSP9Vault built on top of ERC725, LSP1UniversalReceiver
|
|
13
|
+
* @dev this interface implicitly inherits: IERC165, IERC725X, IERC725Y, ILSP1UniversalReceiver, ILSP14Ownable2Step
|
|
14
|
+
*/
|
|
15
|
+
interface ILSP9Vault {
|
|
16
|
+
/**
|
|
17
|
+
* @notice Emitted when receiving native tokens
|
|
18
|
+
* @param sender The address of the sender
|
|
19
|
+
* @param value The amount of native tokens received
|
|
20
|
+
*/
|
|
21
|
+
event ValueReceived(address indexed sender, uint256 indexed value);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @dev Receives and executes a batch of function calls on this contract.
|
|
25
|
+
*/
|
|
26
|
+
function batchCalls(bytes[] calldata data) external returns (bytes[] memory results);
|
|
27
|
+
}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
// interfaces
|
|
5
|
-
import {IERC725Y} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
|
|
6
|
-
|
|
7
4
|
// modules
|
|
8
5
|
import {OwnableUnset} from "@erc725/smart-contracts/contracts/custom/OwnableUnset.sol";
|
|
9
|
-
import {ERC725} from "@erc725/smart-contracts/contracts/ERC725.sol";
|
|
10
6
|
import {LSP9VaultCore} from "./LSP9VaultCore.sol";
|
|
11
7
|
|
|
8
|
+
// libraries
|
|
9
|
+
import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
|
|
10
|
+
|
|
12
11
|
// constants
|
|
13
|
-
import {_INTERFACEID_LSP1} from "../LSP1UniversalReceiver/LSP1Constants.sol";
|
|
14
12
|
import {
|
|
15
|
-
_INTERFACEID_LSP9,
|
|
16
13
|
_LSP9_SUPPORTED_STANDARDS_KEY,
|
|
17
|
-
_LSP9_SUPPORTED_STANDARDS_VALUE
|
|
14
|
+
_LSP9_SUPPORTED_STANDARDS_VALUE,
|
|
15
|
+
_TYPEID_LSP9_OwnershipTransferred_RecipientNotification
|
|
18
16
|
} from "../LSP9Vault/LSP9Constants.sol";
|
|
19
17
|
|
|
20
18
|
/**
|
|
@@ -23,6 +21,8 @@ import {
|
|
|
23
21
|
* @dev Could be owned by a UniversalProfile and able to register received asset with UniversalReceiverDelegateVault
|
|
24
22
|
*/
|
|
25
23
|
contract LSP9Vault is LSP9VaultCore {
|
|
24
|
+
using LSP1Utils for address;
|
|
25
|
+
|
|
26
26
|
/**
|
|
27
27
|
* @notice Sets the owner of the contract and sets the SupportedStandards:LSP9Vault key
|
|
28
28
|
* @param newOwner the owner of the contract
|
|
@@ -35,6 +35,9 @@ contract LSP9Vault is LSP9VaultCore {
|
|
|
35
35
|
// set key SupportedStandards:LSP9Vault
|
|
36
36
|
_setData(_LSP9_SUPPORTED_STANDARDS_KEY, _LSP9_SUPPORTED_STANDARDS_VALUE);
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
newOwner.tryNotifyUniversalReceiver(
|
|
39
|
+
_TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
|
|
40
|
+
""
|
|
41
|
+
);
|
|
39
42
|
}
|
|
40
43
|
}
|
|
@@ -3,10 +3,10 @@ pragma solidity ^0.8.4;
|
|
|
3
3
|
|
|
4
4
|
// interfaces
|
|
5
5
|
import {ILSP1UniversalReceiver} from "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
|
|
6
|
+
import {ILSP9Vault} from "./ILSP9Vault.sol";
|
|
6
7
|
|
|
7
8
|
// libraries
|
|
8
9
|
import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";
|
|
9
|
-
import {GasLib} from "../Utils/GasLib.sol";
|
|
10
10
|
|
|
11
11
|
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
|
|
12
12
|
import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
|
|
@@ -58,20 +58,14 @@ contract LSP9VaultCore is
|
|
|
58
58
|
ERC725YCore,
|
|
59
59
|
LSP14Ownable2Step,
|
|
60
60
|
LSP17Extendable,
|
|
61
|
-
ILSP1UniversalReceiver
|
|
61
|
+
ILSP1UniversalReceiver,
|
|
62
|
+
ILSP9Vault
|
|
62
63
|
{
|
|
63
64
|
using ERC165Checker for address;
|
|
64
65
|
using LSP1Utils for address;
|
|
65
66
|
|
|
66
67
|
address private _reentrantDelegate;
|
|
67
68
|
|
|
68
|
-
/**
|
|
69
|
-
* @notice Emitted when receiving native tokens
|
|
70
|
-
* @param sender The address of the sender
|
|
71
|
-
* @param value The amount of native tokens received
|
|
72
|
-
*/
|
|
73
|
-
event ValueReceived(address indexed sender, uint256 indexed value);
|
|
74
|
-
|
|
75
69
|
/**
|
|
76
70
|
* @dev Emits an event when receiving native tokens
|
|
77
71
|
*
|
|
@@ -211,6 +205,37 @@ contract LSP9VaultCore is
|
|
|
211
205
|
_supportsInterfaceInERC165Extension(interfaceId);
|
|
212
206
|
}
|
|
213
207
|
|
|
208
|
+
/**
|
|
209
|
+
* @dev Receives and executes a batch of function calls on this contract.
|
|
210
|
+
*/
|
|
211
|
+
function batchCalls(bytes[] calldata data) public returns (bytes[] memory results) {
|
|
212
|
+
results = new bytes[](data.length);
|
|
213
|
+
for (uint256 i; i < data.length; ) {
|
|
214
|
+
(bool success, bytes memory result) = address(this).delegatecall(data[i]);
|
|
215
|
+
|
|
216
|
+
if (!success) {
|
|
217
|
+
// Look for revert reason and bubble it up if present
|
|
218
|
+
if (result.length > 0) {
|
|
219
|
+
// The easiest way to bubble the revert reason is using memory via assembly
|
|
220
|
+
// solhint-disable no-inline-assembly
|
|
221
|
+
/// @solidity memory-safe-assembly
|
|
222
|
+
assembly {
|
|
223
|
+
let returndata_size := mload(result)
|
|
224
|
+
revert(add(32, result), returndata_size)
|
|
225
|
+
}
|
|
226
|
+
} else {
|
|
227
|
+
revert("LSP9: batchCalls reverted");
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
results[i] = result;
|
|
232
|
+
|
|
233
|
+
unchecked {
|
|
234
|
+
++i;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
214
239
|
/**
|
|
215
240
|
* @inheritdoc IERC725X
|
|
216
241
|
* @param operationType The operation to execute: CALL = 0 CREATE = 1 CREATE2 = 2 STATICCALL = 3
|
|
@@ -236,14 +261,14 @@ contract LSP9VaultCore is
|
|
|
236
261
|
*
|
|
237
262
|
* @dev Emits a {ValueReceived} event when receiving native tokens.
|
|
238
263
|
*/
|
|
239
|
-
function
|
|
264
|
+
function executeBatch(
|
|
240
265
|
uint256[] memory operationsType,
|
|
241
266
|
address[] memory targets,
|
|
242
267
|
uint256[] memory values,
|
|
243
268
|
bytes[] memory datas
|
|
244
269
|
) public payable virtual override onlyOwner returns (bytes[] memory) {
|
|
245
270
|
if (msg.value != 0) emit ValueReceived(msg.sender, msg.value);
|
|
246
|
-
return
|
|
271
|
+
return _executeBatch(operationsType, targets, values, datas);
|
|
247
272
|
}
|
|
248
273
|
|
|
249
274
|
/**
|
|
@@ -254,7 +279,9 @@ contract LSP9VaultCore is
|
|
|
254
279
|
*
|
|
255
280
|
* Emits a {DataChanged} event.
|
|
256
281
|
*/
|
|
257
|
-
function setData(bytes32 dataKey, bytes memory dataValue) public virtual override {
|
|
282
|
+
function setData(bytes32 dataKey, bytes memory dataValue) public payable virtual override {
|
|
283
|
+
if (msg.value != 0) revert ERC725Y_MsgValueDisallowed();
|
|
284
|
+
|
|
258
285
|
bool isURD = _validateAndIdentifyCaller();
|
|
259
286
|
if (isURD) {
|
|
260
287
|
if (
|
|
@@ -276,13 +303,20 @@ contract LSP9VaultCore is
|
|
|
276
303
|
*
|
|
277
304
|
* Emits a {DataChanged} event.
|
|
278
305
|
*/
|
|
279
|
-
function
|
|
306
|
+
function setDataBatch(bytes32[] memory dataKeys, bytes[] memory dataValues)
|
|
307
|
+
public
|
|
308
|
+
payable
|
|
309
|
+
virtual
|
|
310
|
+
override
|
|
311
|
+
{
|
|
280
312
|
bool isURD = _validateAndIdentifyCaller();
|
|
281
313
|
if (dataKeys.length != dataValues.length) {
|
|
282
|
-
revert ERC725Y_DataKeysValuesLengthMismatch(
|
|
314
|
+
revert ERC725Y_DataKeysValuesLengthMismatch();
|
|
283
315
|
}
|
|
284
316
|
|
|
285
|
-
|
|
317
|
+
if (msg.value != 0) revert ERC725Y_MsgValueDisallowed();
|
|
318
|
+
|
|
319
|
+
for (uint256 i = 0; i < dataKeys.length; ) {
|
|
286
320
|
if (isURD) {
|
|
287
321
|
if (
|
|
288
322
|
bytes12(dataKeys[i]) == _LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX ||
|
|
@@ -293,6 +327,10 @@ contract LSP9VaultCore is
|
|
|
293
327
|
}
|
|
294
328
|
}
|
|
295
329
|
_setData(dataKeys[i], dataValues[i]);
|
|
330
|
+
|
|
331
|
+
unchecked {
|
|
332
|
+
++i;
|
|
333
|
+
}
|
|
296
334
|
}
|
|
297
335
|
}
|
|
298
336
|
|
|
@@ -373,21 +411,59 @@ contract LSP9VaultCore is
|
|
|
373
411
|
}
|
|
374
412
|
|
|
375
413
|
/**
|
|
376
|
-
* @
|
|
414
|
+
* @inheritdoc LSP14Ownable2Step
|
|
415
|
+
*
|
|
416
|
+
* @dev same as ILSP14.transferOwnership with the additional requirement:
|
|
377
417
|
*
|
|
378
|
-
*
|
|
418
|
+
* Requirements:
|
|
419
|
+
* - when notifying the new owner via LSP1, the typeId used MUST be keccak256('LSP9OwnershipTransferStarted')
|
|
379
420
|
*/
|
|
380
|
-
function transferOwnership(address
|
|
421
|
+
function transferOwnership(address newOwner)
|
|
381
422
|
public
|
|
382
423
|
virtual
|
|
383
424
|
override(LSP14Ownable2Step, OwnableUnset)
|
|
384
425
|
onlyOwner
|
|
385
426
|
{
|
|
386
|
-
LSP14Ownable2Step._transferOwnership(
|
|
427
|
+
LSP14Ownable2Step._transferOwnership(newOwner);
|
|
428
|
+
|
|
429
|
+
address currentOwner = owner();
|
|
430
|
+
emit OwnershipTransferStarted(currentOwner, newOwner);
|
|
431
|
+
|
|
432
|
+
newOwner.tryNotifyUniversalReceiver(_TYPEID_LSP9_OwnershipTransferStarted, "");
|
|
433
|
+
|
|
434
|
+
require(
|
|
435
|
+
currentOwner == owner(),
|
|
436
|
+
"LSP14: newOwner MUST accept ownership in a separate transaction"
|
|
437
|
+
);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* @inheritdoc LSP14Ownable2Step
|
|
442
|
+
*
|
|
443
|
+
* @dev same as ILSP14.acceptOwnership with the additional requirement:
|
|
444
|
+
*
|
|
445
|
+
* Requirements:
|
|
446
|
+
* - when notifying the previous owner via LSP1, the typeId used MUST be keccak256('LSP9OwnershipTransferred_SenderNotification')
|
|
447
|
+
* - when notifying the new owner via LSP1, the typeId used MUST be keccak256('LSP9OwnershipTransferred_RecipientNotification')
|
|
448
|
+
*/
|
|
449
|
+
function acceptOwnership() public virtual override {
|
|
450
|
+
address previousOwner = owner();
|
|
451
|
+
|
|
452
|
+
_acceptOwnership();
|
|
453
|
+
|
|
454
|
+
previousOwner.tryNotifyUniversalReceiver(
|
|
455
|
+
_TYPEID_LSP9_OwnershipTransferred_SenderNotification,
|
|
456
|
+
""
|
|
457
|
+
);
|
|
458
|
+
|
|
459
|
+
msg.sender.tryNotifyUniversalReceiver(
|
|
460
|
+
_TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
|
|
461
|
+
""
|
|
462
|
+
);
|
|
387
463
|
}
|
|
388
464
|
|
|
389
465
|
/**
|
|
390
|
-
* @
|
|
466
|
+
* @inheritdoc LSP14Ownable2Step
|
|
391
467
|
*/
|
|
392
468
|
function renounceOwnership()
|
|
393
469
|
public
|
|
@@ -445,55 +521,4 @@ contract LSP9VaultCore is
|
|
|
445
521
|
|
|
446
522
|
revert ERC725X_UnknownOperationType(operationType);
|
|
447
523
|
}
|
|
448
|
-
|
|
449
|
-
// --- LSP14 URD Hooks
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
* @dev Calls the universalReceiver function of the sender when ownerhsip transfer starts
|
|
453
|
-
* if supports LSP1 InterfaceId
|
|
454
|
-
*/
|
|
455
|
-
function _notifyLSP1SenderOnOwnershipTransferStart(address notifiedContract, bytes memory data)
|
|
456
|
-
internal
|
|
457
|
-
virtual
|
|
458
|
-
override
|
|
459
|
-
{
|
|
460
|
-
if (ERC165Checker.supportsERC165InterfaceUnchecked(notifiedContract, _INTERFACEID_LSP1)) {
|
|
461
|
-
ILSP1UniversalReceiver(notifiedContract).universalReceiver(
|
|
462
|
-
_TYPEID_LSP9_OwnershipTransferStarted,
|
|
463
|
-
data
|
|
464
|
-
);
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
/**
|
|
469
|
-
* @dev Calls the universalReceiver function of the sender when ownerhsip transfer is complete
|
|
470
|
-
* if supports LSP1 InterfaceId
|
|
471
|
-
*/
|
|
472
|
-
function _notifyLSP1SenderOnOwnershipTransferCompletion(
|
|
473
|
-
address notifiedContract,
|
|
474
|
-
bytes memory data
|
|
475
|
-
) internal virtual override {
|
|
476
|
-
if (ERC165Checker.supportsERC165InterfaceUnchecked(notifiedContract, _INTERFACEID_LSP1)) {
|
|
477
|
-
ILSP1UniversalReceiver(notifiedContract).universalReceiver(
|
|
478
|
-
_TYPEID_LSP9_OwnershipTransferred_SenderNotification,
|
|
479
|
-
data
|
|
480
|
-
);
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* @dev Calls the universalReceiver function of the recipient when ownerhsip transfer is complete
|
|
486
|
-
* if supports LSP1 InterfaceId
|
|
487
|
-
*/
|
|
488
|
-
function _notifyLSP1RecipientOnOwnershipTransferCompletion(
|
|
489
|
-
address notifiedContract,
|
|
490
|
-
bytes memory data
|
|
491
|
-
) internal virtual override {
|
|
492
|
-
if (ERC165Checker.supportsERC165InterfaceUnchecked(notifiedContract, _INTERFACEID_LSP1)) {
|
|
493
|
-
ILSP1UniversalReceiver(notifiedContract).universalReceiver(
|
|
494
|
-
_TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
|
|
495
|
-
data
|
|
496
|
-
);
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
524
|
}
|
|
@@ -18,7 +18,8 @@ contract LSP9VaultInit is LSP9VaultInitAbstract {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* @notice
|
|
21
|
+
* @notice Initializing the contract owner to: `newOwner`
|
|
22
|
+
* @dev Sets the owner of the contract and sets the SupportedStandards:LSP9Vault key
|
|
22
23
|
* @param newOwner the owner of the contract
|
|
23
24
|
*/
|
|
24
25
|
function initialize(address newOwner) external payable virtual initializer {
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
|
-
// interfaces
|
|
5
|
-
import {IERC725Y} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
|
|
6
|
-
|
|
7
4
|
// modules
|
|
8
5
|
import {OwnableUnset} from "@erc725/smart-contracts/contracts/custom/OwnableUnset.sol";
|
|
9
6
|
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
|
10
7
|
import {LSP9VaultCore} from "./LSP9VaultCore.sol";
|
|
11
8
|
|
|
9
|
+
// libraries
|
|
10
|
+
import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
|
|
11
|
+
|
|
12
12
|
// constants
|
|
13
|
-
import {_INTERFACEID_LSP1} from "../LSP1UniversalReceiver/LSP1Constants.sol";
|
|
14
13
|
import {
|
|
15
|
-
_INTERFACEID_LSP9,
|
|
16
14
|
_LSP9_SUPPORTED_STANDARDS_KEY,
|
|
17
|
-
_LSP9_SUPPORTED_STANDARDS_VALUE
|
|
15
|
+
_LSP9_SUPPORTED_STANDARDS_VALUE,
|
|
16
|
+
_TYPEID_LSP9_OwnershipTransferred_RecipientNotification
|
|
18
17
|
} from "../LSP9Vault/LSP9Constants.sol";
|
|
19
18
|
|
|
20
19
|
/**
|
|
@@ -23,6 +22,16 @@ import {
|
|
|
23
22
|
* @dev Could be owned by a UniversalProfile and able to register received asset with UniversalReceiverDelegateVault
|
|
24
23
|
*/
|
|
25
24
|
abstract contract LSP9VaultInitAbstract is Initializable, LSP9VaultCore {
|
|
25
|
+
using LSP1Utils for address;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @notice Initializing the contract owner to: `newOwner`
|
|
29
|
+
* @dev Sets the owner of the contract and sets the SupportedStandards:LSP9Vault key.
|
|
30
|
+
* ERC725X & ERC725Y parent contracts are not initialised as they don't have
|
|
31
|
+
* non-zero initial state. If you decide to add non-zero initial state to any of those
|
|
32
|
+
* contracts, you MUST initialize them here
|
|
33
|
+
* @param newOwner the owner of the contract
|
|
34
|
+
*/
|
|
26
35
|
function _initialize(address newOwner) internal virtual onlyInitializing {
|
|
27
36
|
if (msg.value != 0) emit ValueReceived(msg.sender, msg.value);
|
|
28
37
|
OwnableUnset._setOwner(newOwner);
|
|
@@ -30,6 +39,9 @@ abstract contract LSP9VaultInitAbstract is Initializable, LSP9VaultCore {
|
|
|
30
39
|
// set key SupportedStandards:LSP9Vault
|
|
31
40
|
_setData(_LSP9_SUPPORTED_STANDARDS_KEY, _LSP9_SUPPORTED_STANDARDS_VALUE);
|
|
32
41
|
|
|
33
|
-
|
|
42
|
+
newOwner.tryNotifyUniversalReceiver(
|
|
43
|
+
_TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
|
|
44
|
+
""
|
|
45
|
+
);
|
|
34
46
|
}
|
|
35
47
|
}
|
|
@@ -16,6 +16,11 @@ import {
|
|
|
16
16
|
* @dev Implementation of the ERC725Account + LSP1 universalReceiver
|
|
17
17
|
*/
|
|
18
18
|
abstract contract UniversalProfileInitAbstract is LSP0ERC725AccountInitAbstract {
|
|
19
|
+
/**
|
|
20
|
+
* @notice Initializing the contract owner to: `newOwner`
|
|
21
|
+
* @dev Sets the owner of the contract and sets the SupportedStandards:LSP3UniversalProfile key
|
|
22
|
+
* @param newOwner the owner of the contract
|
|
23
|
+
*/
|
|
19
24
|
function _initialize(address newOwner) internal virtual override onlyInitializing {
|
|
20
25
|
LSP0ERC725AccountInitAbstract._initialize(newOwner);
|
|
21
26
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "dev",
|
|
3
|
+
"methods": {
|
|
4
|
+
"computeAddress(bytes32,bytes32)": {
|
|
5
|
+
"details": "Returns the address where a contract will be stored if deployed via {deploy}. Any change in the `bytecodeHash` or `salt` will result in a new destination address."
|
|
6
|
+
},
|
|
7
|
+
"computeAddress(bytes32,bytes32,address)": {
|
|
8
|
+
"details": "Returns the address where a contract will be stored if deployed via {deploy} from a contract located at `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}."
|
|
9
|
+
},
|
|
10
|
+
"deploy(bytes32,bytes)": {
|
|
11
|
+
"details": "Deploys a contract using `CREATE2`. The address where the contract will be deployed can be known in advance via {computeAddress}. The bytecode for a contract can be obtained from Solidity with `type(contractName).creationCode`. Requirements: - `bytecode` must not be empty. - `salt` must have not been used for `bytecode` already."
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"title": "contract to deploy contracts with precomputed addresses, using create2 opcode based on https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Create2.sol DO NOT TOUCH",
|
|
15
|
+
"version": 1
|
|
16
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "Fabian Vogelsteller <fabian@lukso.network>, Jean Cavallera (CJ42)",
|
|
3
|
+
"details": "A smart contract account including basic functionalities such as: - Detecting supported standards using ERC165 https://eips.ethereum.org/EIPS/eip-165 - Executing several operation on other addresses including creating contracts using ERC725X https://github.com/ERC725Alliance/ERC725/blob/develop/docs/ERC-725.md - Storing data in a generic way using ERC725Y https://github.com/ERC725Alliance/ERC725/blob/develop/docs/ERC-725.md - Validating signatures using ERC1271 https://eips.ethereum.org/EIPS/eip-1271 - Receiving notification and react on them using LSP1 https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md - Secure ownership management using LSP14 https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md - Extending the account with new functions and interfaceIds of future standards using LSP17 https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md - Verifying calls on the owner to allow unified and standard interaction with the account using LSP20 https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-20-CallVerification.md",
|
|
4
|
+
"errors": {
|
|
5
|
+
"CannotTransferOwnershipToSelf()": [
|
|
6
|
+
{
|
|
7
|
+
"details": "reverts when trying to transfer ownership to the address(this)"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"ERC725X_ContractDeploymentFailed()": [
|
|
11
|
+
{
|
|
12
|
+
"details": "reverts when contract deployment via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` failed. whether using operation type 1 (CREATE) or 2 (CREATE2)."
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"ERC725X_CreateOperationsRequireEmptyRecipientAddress()": [
|
|
16
|
+
{
|
|
17
|
+
"details": "reverts when passing a `to` address while deploying a contract va `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` whether using operation type 1 (CREATE) or 2 (CREATE2)."
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"ERC725X_ExecuteParametersEmptyArray()": [
|
|
21
|
+
{
|
|
22
|
+
"details": "reverts when one of the array parameter provided to `executeBatch(uint256[],address[],uint256[],bytes[]) is an empty array"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"ERC725X_ExecuteParametersLengthMismatch()": [
|
|
26
|
+
{
|
|
27
|
+
"details": "reverts when there is not the same number of operation, to addresses, value, and data."
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"ERC725X_InsufficientBalance(uint256,uint256)": [
|
|
31
|
+
{
|
|
32
|
+
"details": "reverts when trying to send more native tokens `value` than available in current `balance`.",
|
|
33
|
+
"params": {
|
|
34
|
+
"balance": "the balance of the ERC725X contract.",
|
|
35
|
+
"value": "the amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`."
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"ERC725X_MsgValueDisallowedInDelegateCall()": [
|
|
40
|
+
{
|
|
41
|
+
"details": "the `value` parameter (= sending native tokens) is not allowed when making a delegatecall via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` because msg.value is persisting."
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"ERC725X_MsgValueDisallowedInStaticCall()": [
|
|
45
|
+
{
|
|
46
|
+
"details": "the `value` parameter (= sending native tokens) is not allowed when making a staticcall via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` because sending native tokens is a state changing operation."
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"ERC725X_NoContractBytecodeProvided()": [
|
|
50
|
+
{
|
|
51
|
+
"details": "reverts when no contract bytecode was provided as parameter when trying to deploy a contract via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`, whether using operation type 1 (CREATE) or 2 (CREATE2)."
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"ERC725X_UnknownOperationType(uint256)": [
|
|
55
|
+
{
|
|
56
|
+
"details": "reverts when the `operationTypeProvided` is none of the default operation types available. (CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4)"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"ERC725Y_DataKeysValuesLengthMismatch()": [
|
|
60
|
+
{
|
|
61
|
+
"details": "reverts when there is not the same number of elements in the lists of data keys and data values when calling setDataBatch."
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"LSP20CallingVerifierFailed(bool)": [
|
|
65
|
+
{
|
|
66
|
+
"details": "reverts when the call to the owner fail with no revert reason",
|
|
67
|
+
"params": {
|
|
68
|
+
"postCall": "True if the execution call was done, False otherwise"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"LSP20InvalidMagicValue(bool,bytes)": [
|
|
73
|
+
{
|
|
74
|
+
"details": "reverts when the call to the owner does not return the magic value",
|
|
75
|
+
"params": {
|
|
76
|
+
"postCall": "The data returned by the call to the logic verifier"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"NoExtensionFoundForFunctionSelector(bytes4)": [
|
|
81
|
+
{
|
|
82
|
+
"details": "reverts when there is no extension for the function selector being called with"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"NotInRenounceOwnershipInterval(uint256,uint256)": [
|
|
86
|
+
{
|
|
87
|
+
"details": "reverts when trying to renounce ownership before the initial confirmation delay"
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"kind": "dev",
|
|
92
|
+
"methods": {
|
|
93
|
+
"acceptOwnership()": {
|
|
94
|
+
"details": "Transfer ownership of the contract from the current `owner()` to the `pendingOwner()`. Once this function is called: - the current `owner()` will loose access to the functions restricted to the `owner()` only. - the `pendingOwner()` will gain access to the functions restricted to the `owner()` only. Requirements: - MUST be called by the pendingOwner. - When notifying the previous owner via LSP1, the typeId used MUST be keccak256('LSP0OwnershipTransferred_SenderNotification'). - When notifying the new owner via LSP1, the typeId used MUST be keccak256('LSP0OwnershipTransferred_RecipientNotification')."
|
|
95
|
+
},
|
|
96
|
+
"batchCalls(bytes[])": {
|
|
97
|
+
"details": "Allows a caller to batch different function calls in one call. Perform a delegatecall on self, to call different functions with preserving the context It is not possible to send value along the functions call due to the use of delegatecall.",
|
|
98
|
+
"params": {
|
|
99
|
+
"data": "An array of ABI encoded function calls to be called on the contract."
|
|
100
|
+
},
|
|
101
|
+
"returns": {
|
|
102
|
+
"results": "An array of values returned by the executed functions."
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"constructor": {
|
|
106
|
+
"details": "Sets the owner of the contract on deployment and allows funding. Emits a {ValueReceived} event when funding the contract on deployment.",
|
|
107
|
+
"params": {
|
|
108
|
+
"newOwner": "The owner of the contract."
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"execute(uint256,address,uint256,bytes)": {
|
|
112
|
+
"details": "Executes any call on other addresses.",
|
|
113
|
+
"params": {
|
|
114
|
+
"data": "The call data to execute on `target`, or the bytecode of the contract to deploy Requirements: - if a `value` is provided, the contract MUST have at least this amount in its balance to execute successfully. - if the operation type is {STATICCALL} or {DELEGATECALL}, `value` SHOULD be 0. - `target` SHOULD be address(0) when deploying a contract. - MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to LSP20 - CallVerification specification Emits a {Executed} event, when a call is executed under `operationType` 0, 3 and 4 Emits a {ContractCreated} event, when a contract is created under `operationType` 1 and 2 Emits a {ValueReceived} event when receiving native tokens.",
|
|
115
|
+
"operationType": "The operation to execute: CALL = 0 CREATE = 1 CREATE2 = 2 STATICCALL = 3 DELEGATECALL = 4",
|
|
116
|
+
"target": "The address (smart contract/EOA) to interact with, `target` will be unused if a contract is created (operation 1 and 2)",
|
|
117
|
+
"value": "The amount of native tokens to transfer (in Wei)."
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"executeBatch(uint256[],address[],uint256[],bytes[])": {
|
|
121
|
+
"details": "Generic batch executor function that executes any call on other addresses",
|
|
122
|
+
"params": {
|
|
123
|
+
"datas": "The list of call data to execute on `targets`, or the creation bytecode of the contracts to deploy Requirements: - The length of the parameters provided MUST be equal - if a `value` is provided, the contract MUST have at least this amount in its balance to execute successfully. - if the operation type is {STATICCALL} or {DELEGATECALL}, `value` SHOULD be 0. - `target` SHOULD be address(0) when deploying a contract. - MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to LSP20 - CallVerification specification Emits a {Executed} event, when a call is executed under `operationType` 0, 3 and 4 (each iteration) Emits a {ContractCreated} event, when a contract is created under `operationType` 1 and 2 (each iteration) Emits a {ValueReceived} event when receiving native tokens.",
|
|
124
|
+
"operationsType": "The list of operations type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4",
|
|
125
|
+
"targets": "The list of addresses to call. `targets` will be unused if a contract is created (operation types 1 and 2).",
|
|
126
|
+
"values": "The list of native token amounts to transfer (in Wei)"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"getData(bytes32)": {
|
|
130
|
+
"params": {
|
|
131
|
+
"dataKey": "The key which value to retrieve"
|
|
132
|
+
},
|
|
133
|
+
"returns": {
|
|
134
|
+
"dataValue": "The data stored at the key"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"getDataBatch(bytes32[])": {
|
|
138
|
+
"params": {
|
|
139
|
+
"dataKeys": "The array of keys which values to retrieve"
|
|
140
|
+
},
|
|
141
|
+
"returns": {
|
|
142
|
+
"dataValues": "The array of data stored at multiple keys"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"isValidSignature(bytes32,bytes)": {
|
|
146
|
+
"details": "Handles two cases: - If the owner is an EOA, recovers an address from the hash and the signature provided: - Returns the magicValue 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 fail value indicating that the signature is not valid. - If the owner is a smart contract, it forwards the call of {isValidSignature} to the owner contract: - If the contract fails or returns the fail value, the {isValidSignature} on the account returns the fail value, indicating that the signature is not valid. - If the {isValidSignature} on the owner returned the magicValue, the {isValidSignature} on the account returns the magicValue, indicating that it's a valid signature.",
|
|
147
|
+
"params": {
|
|
148
|
+
"dataHash": "The hash of the data to be validated.",
|
|
149
|
+
"signature": "A signature that can validate the previous parameter (Hash)."
|
|
150
|
+
},
|
|
151
|
+
"returns": {
|
|
152
|
+
"magicValue": "A bytes4 value that indicates if the signature is valid or not."
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"owner()": {
|
|
156
|
+
"details": "Returns the address of the current owner."
|
|
157
|
+
},
|
|
158
|
+
"pendingOwner()": {
|
|
159
|
+
"details": "The address that ownership of the contract is transferred to. This address may use `acceptOwnership()` to gain ownership of the contract."
|
|
160
|
+
},
|
|
161
|
+
"renounceOwnership()": {
|
|
162
|
+
"details": "Renounce ownership of the contract in a 2-step process. 1. the first call will initiate the process of renouncing ownership. 2. the second is used as a confirmation and will leave the contract without an owner. MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to LSP20 - CallVerification specification WARNING: once ownership of the contract has been renounced, any functions that are restricted to be called by the owner will be permanently inaccessible, making these functions not callable anymore and unusable."
|
|
163
|
+
},
|
|
164
|
+
"setData(bytes32,bytes)": {
|
|
165
|
+
"details": "Sets singular data for a given `dataKey`",
|
|
166
|
+
"params": {
|
|
167
|
+
"dataKey": "The key to retrieve stored value",
|
|
168
|
+
"dataValue": "The value to set Requirements: - MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to LSP20 - CallVerification specification Emits a {ValueReceived} event when receiving native tokens. Emits a {DataChanged} event."
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"setDataBatch(bytes32[],bytes[])": {
|
|
172
|
+
"details": "Sets array of data for multiple given `dataKeys`",
|
|
173
|
+
"params": {
|
|
174
|
+
"dataKeys": "The array of data keys for values to set",
|
|
175
|
+
"dataValues": "The array of values to set Requirements: - MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to LSP20 - CallVerification specification Emits a {ValueReceived} event when receiving native tokens. Emits a {DataChanged} event. (on each iteration of setting data)"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"supportsInterface(bytes4)": {
|
|
179
|
+
"details": "Returns true if this contract implements the interface defined by `interfaceId`. If the contract doesn't support the `interfaceId`, it forwards the call to the `supportsInterface` extension according to LSP17, and checks if the extension implements the interface defined by `interfaceId`."
|
|
180
|
+
},
|
|
181
|
+
"transferOwnership(address)": {
|
|
182
|
+
"details": "Sets the pending owner address as an address that should call {acceptOwnership} in order to complete the ownership transfer of the account. Notifies the pending owner via LSP1Standard by calling {universalReceiver} on the pending owner if it's an address that supports LSP1.",
|
|
183
|
+
"params": {
|
|
184
|
+
"_pendingOwner": "The address of the new pending owner. Requirements: - MUST pass when called by the owner or by an authorized address that passes the verification check performed on the owner according to LSP20 - CallVerification specification. - When notifying the new owner via LSP1, the typeId used MUST be keccak256('LSP0OwnershipTransferStarted'). - pending owner cannot accept ownership in the same tx via the LSP1 hook."
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"universalReceiver(bytes32,bytes)": {
|
|
188
|
+
"details": "The function performs the following steps: - Emits {ValueReceived} when receiving native tokens. - Query the ERC725Y 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. - Query the ERC725Y storage with the data key {_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY + <bytes32 typeId>}. (Check {LSP2-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. - Emits a {UniversalReceiver} event.",
|
|
189
|
+
"params": {
|
|
190
|
+
"receivedData": "The data received.",
|
|
191
|
+
"typeId": "The type of call received."
|
|
192
|
+
},
|
|
193
|
+
"returns": {
|
|
194
|
+
"returnedValues": "The ABI encoded return value of the LSP1UniversalReceiverDelegate call and the LSP1TypeIdDelegate call."
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"title": "Deployable Implementation of LSP0-ERC725Account Standard https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md",
|
|
199
|
+
"version": 1
|
|
200
|
+
}
|