@lukso/lsp-smart-contracts 0.10.0 → 0.10.2
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 +14 -1
- package/artifacts/Create2Factory.json +2 -2
- package/artifacts/LSP0ERC725Account.json +4 -4
- package/artifacts/LSP0ERC725AccountInit.json +4 -4
- package/artifacts/LSP11BasicSocialRecovery.json +2 -2
- package/artifacts/LSP11BasicSocialRecoveryInit.json +2 -2
- package/artifacts/LSP16UniversalFactory.json +27 -21
- package/artifacts/LSP1UniversalReceiverDelegateUP.json +2 -2
- package/artifacts/LSP1UniversalReceiverDelegateVault.json +2 -2
- package/artifacts/LSP6KeyManager.json +2 -2
- package/artifacts/LSP6KeyManagerInit.json +2 -2
- package/artifacts/LSP7CompatibleERC20Mintable.json +2 -2
- package/artifacts/LSP7CompatibleERC20MintableInit.json +2 -2
- package/artifacts/LSP7Mintable.json +2 -2
- package/artifacts/LSP7MintableInit.json +2 -2
- package/artifacts/LSP8CompatibleERC721Mintable.json +2 -2
- package/artifacts/LSP8CompatibleERC721MintableInit.json +2 -2
- package/artifacts/LSP8Mintable.json +2 -2
- package/artifacts/LSP8MintableInit.json +2 -2
- package/artifacts/LSP9Vault.json +2 -2
- package/artifacts/LSP9VaultInit.json +2 -2
- package/artifacts/UniversalProfile.json +4 -4
- package/artifacts/UniversalProfileInit.json +4 -4
- package/artifacts/UniversalReceiverAddressStore.json +2 -2
- package/contracts/Factories/Create2Factory.sol +11 -3
- package/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +13 -5
- package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +11 -6
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +256 -186
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +20 -6
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +23 -9
- package/contracts/LSP0ERC725Account/LSP0Utils.sol +3 -5
- package/contracts/LSP10ReceivedVaults/LSP10Utils.sol +25 -10
- package/contracts/LSP11BasicSocialRecovery/ILSP11BasicSocialRecovery.sol +4 -2
- package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol +3 -1
- package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol +65 -23
- package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.sol +7 -2
- package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInitAbstract.sol +14 -4
- package/contracts/LSP11BasicSocialRecovery/LSP11Errors.sol +4 -1
- package/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +17 -16
- package/contracts/LSP14Ownable2Step/LSP14Errors.sol +4 -1
- package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +22 -11
- package/contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol +333 -128
- package/contracts/LSP17ContractExtension/LSP17Extendable.sol +38 -16
- package/contracts/LSP17ContractExtension/LSP17Extension.sol +20 -8
- package/contracts/LSP17ContractExtension/LSP17Utils.sol +4 -5
- package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +5 -5
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +38 -14
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +31 -11
- package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +34 -9
- package/contracts/LSP20CallVerification/{ILSP20CallVerification.sol → ILSP20CallVerifier.sol} +7 -2
- package/contracts/LSP20CallVerification/LSP20CallVerification.sol +24 -9
- package/contracts/LSP20CallVerification/LSP20Errors.sol +1 -1
- package/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +62 -36
- package/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +3 -1
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +15 -4
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +18 -5
- package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +32 -12
- package/contracts/LSP6KeyManager/ILSP6KeyManager.sol +17 -8
- package/contracts/LSP6KeyManager/LSP6Constants.sol +3 -9
- package/contracts/LSP6KeyManager/LSP6Errors.sol +4 -1
- package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +114 -72
- package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +7 -2
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +96 -46
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol +10 -5
- package/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +98 -32
- package/contracts/LSP6KeyManager/LSP6Utils.sol +42 -34
- package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +8 -6
- package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +13 -10
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +96 -26
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +11 -9
- package/contracts/LSP7DigitalAsset/LSP7Errors.sol +8 -2
- package/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +9 -2
- package/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +1 -5
- package/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +4 -6
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +6 -2
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +32 -12
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +28 -7
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +8 -2
- package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +6 -2
- package/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +6 -1
- package/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +13 -3
- package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +14 -5
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +3 -1
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +12 -10
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +95 -28
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +14 -10
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +23 -10
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +3 -1
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +3 -1
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +6 -2
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +72 -30
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +77 -27
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +6 -2
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +6 -2
- package/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +3 -1
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +8 -2
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +6 -2
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +3 -1
- package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +5 -1
- package/contracts/LSP9Vault/ILSP9Vault.sol +13 -5
- package/contracts/LSP9Vault/LSP9Vault.sol +7 -2
- package/contracts/LSP9Vault/LSP9VaultCore.sol +108 -51
- package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +10 -3
- package/contracts/Legacy/Registries/AddressRegistry.sol +13 -4
- package/contracts/Legacy/Registries/AddressRegistryRequiresERC725.sol +6 -2
- package/contracts/Legacy/UniversalReceiverAddressStore.sol +17 -6
- package/contracts/UniversalProfile.sol +14 -5
- package/contracts/UniversalProfileInit.sol +17 -5
- package/contracts/UniversalProfileInitAbstract.sol +17 -9
- package/devdocs/LSP0ERC725Account.json +33 -19
- package/devdocs/LSP0ERC725AccountInit.json +33 -20
- package/devdocs/LSP16UniversalFactory.json +87 -22
- package/devdocs/LSP9Vault.json +3 -3
- package/devdocs/LSP9VaultInit.json +3 -3
- package/devdocs/UniversalProfile.json +32 -18
- package/devdocs/UniversalProfileInit.json +33 -19
- package/dist/constants.cjs.js +310 -182
- package/dist/constants.d.ts +178 -48
- package/dist/constants.es.js +310 -182
- package/package.json +19 -17
- package/userdocs/LSP0ERC725Account.json +5 -2
- package/userdocs/LSP0ERC725AccountInit.json +8 -2
- package/userdocs/UniversalProfile.json +3 -3
- package/userdocs/UniversalProfileInit.json +6 -3
- package/contracts/Custom/EIP191Signer.sol +0 -12
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
4
|
// modules
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
OwnableUnset
|
|
7
|
+
} from "@erc725/smart-contracts/contracts/custom/OwnableUnset.sol";
|
|
8
|
+
import {
|
|
9
|
+
Initializable
|
|
10
|
+
} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
|
7
11
|
import {LSP9VaultCore} from "./LSP9VaultCore.sol";
|
|
8
12
|
|
|
9
13
|
// libraries
|
|
@@ -37,7 +41,10 @@ abstract contract LSP9VaultInitAbstract is Initializable, LSP9VaultCore {
|
|
|
37
41
|
OwnableUnset._setOwner(newOwner);
|
|
38
42
|
|
|
39
43
|
// set key SupportedStandards:LSP9Vault
|
|
40
|
-
_setData(
|
|
44
|
+
_setData(
|
|
45
|
+
_LSP9_SUPPORTED_STANDARDS_KEY,
|
|
46
|
+
_LSP9_SUPPORTED_STANDARDS_VALUE
|
|
47
|
+
);
|
|
41
48
|
|
|
42
49
|
newOwner.tryNotifyUniversalReceiver(
|
|
43
50
|
_TYPEID_LSP9_OwnershipTransferred_RecipientNotification,
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
4
|
// libraries
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
EnumerableSet
|
|
7
|
+
} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
|
6
8
|
|
|
7
9
|
// modules
|
|
8
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
ERC165Storage
|
|
12
|
+
} from "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";
|
|
9
13
|
|
|
10
14
|
contract AddressRegistry is ERC165Storage {
|
|
11
15
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
@@ -25,8 +29,13 @@ contract AddressRegistry is ERC165Storage {
|
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
function getIndex(address _address) public view returns (uint256) {
|
|
28
|
-
require(
|
|
29
|
-
|
|
32
|
+
require(
|
|
33
|
+
_addressStore.contains(_address),
|
|
34
|
+
"EnumerableSet: Index not found"
|
|
35
|
+
);
|
|
36
|
+
return
|
|
37
|
+
_addressStore._inner._indexes[bytes32(uint256(uint160(_address)))] -
|
|
38
|
+
1;
|
|
30
39
|
}
|
|
31
40
|
|
|
32
41
|
function getAllRawValues() public view returns (bytes32[] memory) {
|
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
4
|
// libraries
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
EnumerableSet
|
|
7
|
+
} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
|
6
8
|
|
|
7
9
|
// modules
|
|
8
10
|
import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
9
11
|
import {AddressRegistry} from "./AddressRegistry.sol";
|
|
10
12
|
|
|
11
13
|
// constants
|
|
12
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
_INTERFACEID_ERC725Y
|
|
16
|
+
} from "@erc725/smart-contracts/contracts/constants.sol";
|
|
13
17
|
|
|
14
18
|
contract AddressRegistryRequiresERC725 is AddressRegistry {
|
|
15
19
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
4
|
// libraries
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
EnumerableSet
|
|
7
|
+
} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
|
6
8
|
|
|
7
9
|
// modules
|
|
8
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
ERC165Storage
|
|
12
|
+
} from "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";
|
|
9
13
|
import {AddressRegistry} from "./Registries/AddressRegistry.sol";
|
|
10
14
|
|
|
11
15
|
contract UniversalReceiverAddressStore is ERC165Storage, AddressRegistry {
|
|
@@ -23,17 +27,21 @@ contract UniversalReceiverAddressStore is ERC165Storage, AddressRegistry {
|
|
|
23
27
|
_registerInterface(_INTERFACE_ID_LSP1DELEGATE);
|
|
24
28
|
}
|
|
25
29
|
|
|
26
|
-
function addAddress(
|
|
30
|
+
function addAddress(
|
|
31
|
+
address _address
|
|
32
|
+
) public override onlyAccount returns (bool) {
|
|
27
33
|
return _addressStore.add(_address);
|
|
28
34
|
}
|
|
29
35
|
|
|
30
|
-
function removeAddress(
|
|
36
|
+
function removeAddress(
|
|
37
|
+
address _address
|
|
38
|
+
) public override onlyAccount returns (bool) {
|
|
31
39
|
return _addressStore.remove(_address);
|
|
32
40
|
}
|
|
33
41
|
|
|
34
42
|
function universalReceiverDelegate(
|
|
35
43
|
address sender,
|
|
36
|
-
uint256
|
|
44
|
+
uint256 /* value */,
|
|
37
45
|
bytes32 typeId,
|
|
38
46
|
bytes memory
|
|
39
47
|
) external onlyAccount returns (bytes memory) {
|
|
@@ -47,7 +55,10 @@ contract UniversalReceiverAddressStore is ERC165Storage, AddressRegistry {
|
|
|
47
55
|
|
|
48
56
|
/* Modifers */
|
|
49
57
|
modifier onlyAccount() {
|
|
50
|
-
require(
|
|
58
|
+
require(
|
|
59
|
+
msg.sender == account,
|
|
60
|
+
"Only the connected account call this function"
|
|
61
|
+
);
|
|
51
62
|
_;
|
|
52
63
|
}
|
|
53
64
|
}
|
|
@@ -17,11 +17,20 @@ import {
|
|
|
17
17
|
*/
|
|
18
18
|
contract UniversalProfile is LSP0ERC725Account {
|
|
19
19
|
/**
|
|
20
|
-
* @notice
|
|
21
|
-
* @
|
|
20
|
+
* @notice Deploying the contract with owner set to: `initialOwner`
|
|
21
|
+
* @dev Set `initialOwner` as the contract owner and set the `SupportedStandards:LSP3UniversalProfile` data key
|
|
22
|
+
* in the ERC725Y data key/value store. The `constructor` also allows funding the contract on deployment.
|
|
23
|
+
*
|
|
24
|
+
* Emitted Events:
|
|
25
|
+
* - ValueReceived: when the contract is funded on deployment.
|
|
26
|
+
*
|
|
27
|
+
* @param initialOwner the owner of the contract
|
|
22
28
|
*/
|
|
23
|
-
constructor(address
|
|
24
|
-
// set key SupportedStandards:LSP3UniversalProfile
|
|
25
|
-
_setData(
|
|
29
|
+
constructor(address initialOwner) payable LSP0ERC725Account(initialOwner) {
|
|
30
|
+
// set data key SupportedStandards:LSP3UniversalProfile
|
|
31
|
+
_setData(
|
|
32
|
+
_LSP3_SUPPORTED_STANDARDS_KEY,
|
|
33
|
+
_LSP3_SUPPORTED_STANDARDS_VALUE
|
|
34
|
+
);
|
|
26
35
|
}
|
|
27
36
|
}
|
|
@@ -11,17 +11,29 @@ import {UniversalProfileInitAbstract} from "./UniversalProfileInitAbstract.sol";
|
|
|
11
11
|
*/
|
|
12
12
|
contract UniversalProfileInit is UniversalProfileInitAbstract {
|
|
13
13
|
/**
|
|
14
|
-
* @
|
|
14
|
+
* @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
|
+
* after it has been deployed. This is intended so that the sole purpose of this contract is to be used as a base
|
|
17
|
+
* contract behind a proxy.
|
|
15
18
|
*/
|
|
16
19
|
constructor() {
|
|
17
20
|
_disableInitializers();
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
/**
|
|
21
|
-
* @notice
|
|
22
|
-
* @
|
|
24
|
+
* @notice Initializing the contract owner to: `initialOwner`
|
|
25
|
+
* @dev Set `initialOwner` as the contract owner and set the `SupportedStandards:LSP3UniversalProfile` data key in the ERC725Y data key/value store.
|
|
26
|
+
* The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier.
|
|
27
|
+
* The `initialize(address)` function also allows funding the contract on initialization.
|
|
28
|
+
*
|
|
29
|
+
* Emitted Events:
|
|
30
|
+
* - ValueReceived: when the contract is funded on initialization.
|
|
31
|
+
*
|
|
32
|
+
* @param initialOwner the owner of the contract
|
|
23
33
|
*/
|
|
24
|
-
function initialize(
|
|
25
|
-
|
|
34
|
+
function initialize(
|
|
35
|
+
address initialOwner
|
|
36
|
+
) external payable virtual initializer {
|
|
37
|
+
UniversalProfileInitAbstract._initialize(initialOwner);
|
|
26
38
|
}
|
|
27
39
|
}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
pragma solidity ^0.8.4;
|
|
3
3
|
|
|
4
4
|
// modules
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
LSP0ERC725AccountInitAbstract
|
|
7
|
+
} from "./LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol";
|
|
6
8
|
|
|
7
9
|
// constants
|
|
8
10
|
import {
|
|
@@ -15,16 +17,22 @@ import {
|
|
|
15
17
|
* @author Fabian Vogelsteller <fabian@lukso.network>
|
|
16
18
|
* @dev Implementation of the ERC725Account + LSP1 universalReceiver
|
|
17
19
|
*/
|
|
18
|
-
abstract contract UniversalProfileInitAbstract is
|
|
20
|
+
abstract contract UniversalProfileInitAbstract is
|
|
21
|
+
LSP0ERC725AccountInitAbstract
|
|
22
|
+
{
|
|
19
23
|
/**
|
|
20
|
-
* @
|
|
21
|
-
* @dev
|
|
22
|
-
* @param newOwner the owner of the contract
|
|
24
|
+
* @inheritdoc LSP0ERC725AccountInitAbstract
|
|
25
|
+
* @dev Set the `SupportedStandards:LSP3UniversalProfile` data key in the ERC725Y data key/value store.
|
|
23
26
|
*/
|
|
24
|
-
function _initialize(
|
|
25
|
-
|
|
27
|
+
function _initialize(
|
|
28
|
+
address initialOwner
|
|
29
|
+
) internal virtual override onlyInitializing {
|
|
30
|
+
LSP0ERC725AccountInitAbstract._initialize(initialOwner);
|
|
26
31
|
|
|
27
|
-
// set key SupportedStandards:LSP3UniversalProfile
|
|
28
|
-
_setData(
|
|
32
|
+
// set data key SupportedStandards:LSP3UniversalProfile
|
|
33
|
+
_setData(
|
|
34
|
+
_LSP3_SUPPORTED_STANDARDS_KEY,
|
|
35
|
+
_LSP3_SUPPORTED_STANDARDS_VALUE
|
|
36
|
+
);
|
|
29
37
|
}
|
|
30
38
|
}
|
|
@@ -73,7 +73,8 @@
|
|
|
73
73
|
{
|
|
74
74
|
"details": "reverts when the call to the owner does not return the magic value",
|
|
75
75
|
"params": {
|
|
76
|
-
"postCall": "
|
|
76
|
+
"postCall": "True if the execution call was done, False otherwise",
|
|
77
|
+
"returnedData": "The data returned by the call to the logic verifier"
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
],
|
|
@@ -91,7 +92,8 @@
|
|
|
91
92
|
"kind": "dev",
|
|
92
93
|
"methods": {
|
|
93
94
|
"acceptOwnership()": {
|
|
94
|
-
"
|
|
95
|
+
"custom: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')`.",
|
|
96
|
+
"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."
|
|
95
97
|
},
|
|
96
98
|
"batchCalls(bytes[])": {
|
|
97
99
|
"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.",
|
|
@@ -103,27 +105,32 @@
|
|
|
103
105
|
}
|
|
104
106
|
},
|
|
105
107
|
"constructor": {
|
|
106
|
-
"
|
|
108
|
+
"custom:events": "{ValueReceived} event when funding the contract on deployment.",
|
|
109
|
+
"details": "Set `initialOwner` as the contract owner. The `constructor` also allows funding the contract on deployment.",
|
|
107
110
|
"params": {
|
|
108
|
-
"
|
|
111
|
+
"initialOwner": "The owner of the contract."
|
|
109
112
|
}
|
|
110
113
|
},
|
|
111
114
|
"execute(uint256,address,uint256,bytes)": {
|
|
115
|
+
"custom:events": "- {Executed} event, when a call is executed under `operationType` 0, 3 and 4 - {ContractCreated} event, when a contract is created under `operationType` 1 and 2 - {ValueReceived} event when receiving native tokens.",
|
|
116
|
+
"custom: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",
|
|
112
117
|
"details": "Executes any call on other addresses.",
|
|
113
118
|
"params": {
|
|
114
|
-
"data": "The call data to execute on `target`, or the bytecode of the contract to deploy
|
|
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 (
|
|
119
|
+
"data": "The call data to execute on `target`, or the bytecode of the contract to deploy.",
|
|
120
|
+
"operationType": "The operation to execute: `CALL = 0`, `CREATE = 1` `CREATE2 = 2`, `STATICCALL = 3`, `DELEGATECALL = 4`.",
|
|
121
|
+
"target": "The address (smart contract/EOA) to interact with, `target` will be unused if a contract is created (`CREATE` & `CREATE2`).",
|
|
117
122
|
"value": "The amount of native tokens to transfer (in Wei)."
|
|
118
123
|
}
|
|
119
124
|
},
|
|
120
125
|
"executeBatch(uint256[],address[],uint256[],bytes[])": {
|
|
126
|
+
"custom:events": "- {Executed} event, when a call is executed under `operationType` 0, 3 and 4 (each iteration) - {ContractCreated} event, when a contract is created under `operationType` 1 and 2 (each iteration) - {ValueReceived} event when receiving native tokens.",
|
|
127
|
+
"custom: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",
|
|
121
128
|
"details": "Generic batch executor function that executes any call on other addresses",
|
|
122
129
|
"params": {
|
|
123
|
-
"datas": "The list of call data to execute on `targets`, or the creation bytecode of the contracts to deploy
|
|
124
|
-
"operationsType": "The list of operations type used: CALL = 0
|
|
125
|
-
"targets": "The list of addresses to call. `targets` will be unused if a contract is created (
|
|
126
|
-
"values": "The list of native token amounts to transfer (in Wei)"
|
|
130
|
+
"datas": "The list of call data to execute on `targets`, or the creation bytecode of the contracts to deploy.",
|
|
131
|
+
"operationsType": "The list of operations type used: `CALL = 0`, `CREATE = 1`, `CREATE2 = 2`, `STATICCALL = 3`, `DELEGATECALL = 4`.",
|
|
132
|
+
"targets": "The list of addresses to call. `targets` will be unused if a contract is created (`CREATE` & `CREATE2`).",
|
|
133
|
+
"values": "The list of native token amounts to transfer (in Wei)."
|
|
127
134
|
}
|
|
128
135
|
},
|
|
129
136
|
"getData(bytes32)": {
|
|
@@ -143,7 +150,7 @@
|
|
|
143
150
|
}
|
|
144
151
|
},
|
|
145
152
|
"isValidSignature(bytes32,bytes)": {
|
|
146
|
-
"details": "Handles two cases:
|
|
153
|
+
"details": "Handles two cases: 1. 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. 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 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
154
|
"params": {
|
|
148
155
|
"dataHash": "The hash of the data to be validated.",
|
|
149
156
|
"signature": "A signature that can validate the previous parameter (Hash)."
|
|
@@ -156,36 +163,43 @@
|
|
|
156
163
|
"details": "Returns the address of the current owner."
|
|
157
164
|
},
|
|
158
165
|
"pendingOwner()": {
|
|
159
|
-
"details": "The address that ownership of the contract is transferred to. This address may use
|
|
166
|
+
"details": "The address that ownership of the contract is transferred to. This address may use {acceptOwnership()} to gain ownership of the contract."
|
|
160
167
|
},
|
|
161
168
|
"renounceOwnership()": {
|
|
162
|
-
"
|
|
169
|
+
"custom:danger": "Leaves the contract without an owner. 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.",
|
|
170
|
+
"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"
|
|
163
171
|
},
|
|
164
172
|
"setData(bytes32,bytes)": {
|
|
173
|
+
"custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event.",
|
|
174
|
+
"custom: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",
|
|
165
175
|
"details": "Sets singular data for a given `dataKey`",
|
|
166
176
|
"params": {
|
|
167
177
|
"dataKey": "The key to retrieve stored value",
|
|
168
|
-
"dataValue": "The value to set
|
|
178
|
+
"dataValue": "The value to set"
|
|
169
179
|
}
|
|
170
180
|
},
|
|
171
181
|
"setDataBatch(bytes32[],bytes[])": {
|
|
182
|
+
"custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event. (on each iteration of setting data)",
|
|
183
|
+
"custom: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",
|
|
172
184
|
"details": "Sets array of data for multiple given `dataKeys`",
|
|
173
185
|
"params": {
|
|
174
186
|
"dataKeys": "The array of data keys for values to set",
|
|
175
|
-
"dataValues": "The array of values to set
|
|
187
|
+
"dataValues": "The array of values to set"
|
|
176
188
|
}
|
|
177
189
|
},
|
|
178
190
|
"supportsInterface(bytes4)": {
|
|
179
191
|
"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
192
|
},
|
|
181
193
|
"transferOwnership(address)": {
|
|
182
|
-
"
|
|
194
|
+
"custom: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.",
|
|
195
|
+
"details": "Sets the address of the `pendingNewOwner` as a pending owner that should call {`acceptOwnership()`} in order to complete the ownership transfer to become the new {`owner()`} 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
196
|
"params": {
|
|
184
|
-
"
|
|
197
|
+
"pendingNewOwner": "The address of the new pending owner."
|
|
185
198
|
}
|
|
186
199
|
},
|
|
187
200
|
"universalReceiver(bytes32,bytes)": {
|
|
188
|
-
"
|
|
201
|
+
"custom:events": "- {ValueReceived} when receiving native tokens. - {UniversalReceiver} event.",
|
|
202
|
+
"details": "The function performs the following steps: 1. 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. 2. 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.",
|
|
189
203
|
"params": {
|
|
190
204
|
"receivedData": "The data received.",
|
|
191
205
|
"typeId": "The type of call received."
|
|
@@ -73,7 +73,8 @@
|
|
|
73
73
|
{
|
|
74
74
|
"details": "reverts when the call to the owner does not return the magic value",
|
|
75
75
|
"params": {
|
|
76
|
-
"postCall": "
|
|
76
|
+
"postCall": "True if the execution call was done, False otherwise",
|
|
77
|
+
"returnedData": "The data returned by the call to the logic verifier"
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
],
|
|
@@ -91,7 +92,8 @@
|
|
|
91
92
|
"kind": "dev",
|
|
92
93
|
"methods": {
|
|
93
94
|
"acceptOwnership()": {
|
|
94
|
-
"
|
|
95
|
+
"custom: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')`.",
|
|
96
|
+
"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."
|
|
95
97
|
},
|
|
96
98
|
"batchCalls(bytes[])": {
|
|
97
99
|
"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.",
|
|
@@ -103,24 +105,28 @@
|
|
|
103
105
|
}
|
|
104
106
|
},
|
|
105
107
|
"constructor": {
|
|
106
|
-
"details": "
|
|
108
|
+
"details": "Locks the base contract on deployment, so that it cannot be initialized, owned and controlled by anyone after it has been deployed. This is intended so that the sole purpose of this contract is to be used as a base contract behind a proxy."
|
|
107
109
|
},
|
|
108
110
|
"execute(uint256,address,uint256,bytes)": {
|
|
111
|
+
"custom:events": "- {Executed} event, when a call is executed under `operationType` 0, 3 and 4 - {ContractCreated} event, when a contract is created under `operationType` 1 and 2 - {ValueReceived} event when receiving native tokens.",
|
|
112
|
+
"custom: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",
|
|
109
113
|
"details": "Executes any call on other addresses.",
|
|
110
114
|
"params": {
|
|
111
|
-
"data": "The call data to execute on `target`, or the bytecode of the contract to deploy
|
|
112
|
-
"operationType": "The operation to execute: CALL = 0 CREATE = 1 CREATE2 = 2 STATICCALL = 3 DELEGATECALL = 4",
|
|
113
|
-
"target": "The address (smart contract/EOA) to interact with, `target` will be unused if a contract is created (
|
|
115
|
+
"data": "The call data to execute on `target`, or the bytecode of the contract to deploy.",
|
|
116
|
+
"operationType": "The operation to execute: `CALL = 0`, `CREATE = 1` `CREATE2 = 2`, `STATICCALL = 3`, `DELEGATECALL = 4`.",
|
|
117
|
+
"target": "The address (smart contract/EOA) to interact with, `target` will be unused if a contract is created (`CREATE` & `CREATE2`).",
|
|
114
118
|
"value": "The amount of native tokens to transfer (in Wei)."
|
|
115
119
|
}
|
|
116
120
|
},
|
|
117
121
|
"executeBatch(uint256[],address[],uint256[],bytes[])": {
|
|
122
|
+
"custom:events": "- {Executed} event, when a call is executed under `operationType` 0, 3 and 4 (each iteration) - {ContractCreated} event, when a contract is created under `operationType` 1 and 2 (each iteration) - {ValueReceived} event when receiving native tokens.",
|
|
123
|
+
"custom: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",
|
|
118
124
|
"details": "Generic batch executor function that executes any call on other addresses",
|
|
119
125
|
"params": {
|
|
120
|
-
"datas": "The list of call data to execute on `targets`, or the creation bytecode of the contracts to deploy
|
|
121
|
-
"operationsType": "The list of operations type used: CALL = 0
|
|
122
|
-
"targets": "The list of addresses to call. `targets` will be unused if a contract is created (
|
|
123
|
-
"values": "The list of native token amounts to transfer (in Wei)"
|
|
126
|
+
"datas": "The list of call data to execute on `targets`, or the creation bytecode of the contracts to deploy.",
|
|
127
|
+
"operationsType": "The list of operations type used: `CALL = 0`, `CREATE = 1`, `CREATE2 = 2`, `STATICCALL = 3`, `DELEGATECALL = 4`.",
|
|
128
|
+
"targets": "The list of addresses to call. `targets` will be unused if a contract is created (`CREATE` & `CREATE2`).",
|
|
129
|
+
"values": "The list of native token amounts to transfer (in Wei)."
|
|
124
130
|
}
|
|
125
131
|
},
|
|
126
132
|
"getData(bytes32)": {
|
|
@@ -140,13 +146,13 @@
|
|
|
140
146
|
}
|
|
141
147
|
},
|
|
142
148
|
"initialize(address)": {
|
|
143
|
-
"details": "
|
|
149
|
+
"details": "Set `initialOwner` as the contract owner. The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier. The `initialize(address)` function also allows funding the contract on initialization. Emitted Events: - ValueReceived: when the contract is funded on initialization.",
|
|
144
150
|
"params": {
|
|
145
|
-
"
|
|
151
|
+
"initialOwner": "the owner of the contract"
|
|
146
152
|
}
|
|
147
153
|
},
|
|
148
154
|
"isValidSignature(bytes32,bytes)": {
|
|
149
|
-
"details": "Handles two cases:
|
|
155
|
+
"details": "Handles two cases: 1. 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. 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 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.",
|
|
150
156
|
"params": {
|
|
151
157
|
"dataHash": "The hash of the data to be validated.",
|
|
152
158
|
"signature": "A signature that can validate the previous parameter (Hash)."
|
|
@@ -159,36 +165,43 @@
|
|
|
159
165
|
"details": "Returns the address of the current owner."
|
|
160
166
|
},
|
|
161
167
|
"pendingOwner()": {
|
|
162
|
-
"details": "The address that ownership of the contract is transferred to. This address may use
|
|
168
|
+
"details": "The address that ownership of the contract is transferred to. This address may use {acceptOwnership()} to gain ownership of the contract."
|
|
163
169
|
},
|
|
164
170
|
"renounceOwnership()": {
|
|
165
|
-
"
|
|
171
|
+
"custom:danger": "Leaves the contract without an owner. 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.",
|
|
172
|
+
"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"
|
|
166
173
|
},
|
|
167
174
|
"setData(bytes32,bytes)": {
|
|
175
|
+
"custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event.",
|
|
176
|
+
"custom: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",
|
|
168
177
|
"details": "Sets singular data for a given `dataKey`",
|
|
169
178
|
"params": {
|
|
170
179
|
"dataKey": "The key to retrieve stored value",
|
|
171
|
-
"dataValue": "The value to set
|
|
180
|
+
"dataValue": "The value to set"
|
|
172
181
|
}
|
|
173
182
|
},
|
|
174
183
|
"setDataBatch(bytes32[],bytes[])": {
|
|
184
|
+
"custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event. (on each iteration of setting data)",
|
|
185
|
+
"custom: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",
|
|
175
186
|
"details": "Sets array of data for multiple given `dataKeys`",
|
|
176
187
|
"params": {
|
|
177
188
|
"dataKeys": "The array of data keys for values to set",
|
|
178
|
-
"dataValues": "The array of values to set
|
|
189
|
+
"dataValues": "The array of values to set"
|
|
179
190
|
}
|
|
180
191
|
},
|
|
181
192
|
"supportsInterface(bytes4)": {
|
|
182
193
|
"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`."
|
|
183
194
|
},
|
|
184
195
|
"transferOwnership(address)": {
|
|
185
|
-
"
|
|
196
|
+
"custom: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.",
|
|
197
|
+
"details": "Sets the address of the `pendingNewOwner` as a pending owner that should call {`acceptOwnership()`} in order to complete the ownership transfer to become the new {`owner()`} of the account. Notifies the pending owner via LSP1Standard by calling {universalReceiver()} on the pending owner if it's an address that supports LSP1.",
|
|
186
198
|
"params": {
|
|
187
|
-
"
|
|
199
|
+
"pendingNewOwner": "The address of the new pending owner."
|
|
188
200
|
}
|
|
189
201
|
},
|
|
190
202
|
"universalReceiver(bytes32,bytes)": {
|
|
191
|
-
"
|
|
203
|
+
"custom:events": "- {ValueReceived} when receiving native tokens. - {UniversalReceiver} event.",
|
|
204
|
+
"details": "The function performs the following steps: 1. 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. 2. 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.",
|
|
192
205
|
"params": {
|
|
193
206
|
"receivedData": "The data received.",
|
|
194
207
|
"typeId": "The type of call received."
|