@lukso/lsp-smart-contracts 0.4.3
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/CONTRIBUTING.md +18 -0
- package/LICENSE +201 -0
- package/README.md +75 -0
- package/artifacts/Create2Factory.json +107 -0
- package/artifacts/LSP1UniversalReceiverDelegateUP.json +64 -0
- package/artifacts/LSP1UniversalReceiverDelegateUPInit.json +66 -0
- package/artifacts/LSP1UniversalReceiverDelegateVault.json +64 -0
- package/artifacts/LSP1UniversalReceiverDelegateVaultInit.json +66 -0
- package/artifacts/LSP6KeyManager.json +222 -0
- package/artifacts/LSP6KeyManagerInit.json +224 -0
- package/artifacts/LSP7CappedSupply.json +404 -0
- package/artifacts/LSP7CappedSupplyInit.json +481 -0
- package/artifacts/LSP7CompatibilityForERC20.json +495 -0
- package/artifacts/LSP7DigitalAsset.json +417 -0
- package/artifacts/LSP7DigitalAssetInit.json +455 -0
- package/artifacts/LSP7Mintable.json +445 -0
- package/artifacts/LSP7MintableInit.json +483 -0
- package/artifacts/LSP8CappedSupply.json +459 -0
- package/artifacts/LSP8CappedSupplyInit.json +508 -0
- package/artifacts/LSP8CompatibilityForERC721.json +711 -0
- package/artifacts/LSP8IdentifiableDigitalAsset.json +467 -0
- package/artifacts/LSP8IdentifiableDigitalAssetInit.json +482 -0
- package/artifacts/LSP8Mintable.json +495 -0
- package/artifacts/LSP8MintableInit.json +510 -0
- package/artifacts/UniversalProfile.json +373 -0
- package/artifacts/UniversalProfileInit.json +375 -0
- package/constants.ts +350 -0
- package/contracts/Factories/Create2Factory.sol +92 -0
- package/contracts/LSP0ERC725Account/LSP0Constants.sol +14 -0
- package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +23 -0
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +119 -0
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +20 -0
- package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +33 -0
- package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +37 -0
- package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol +22 -0
- package/contracts/LSP1UniversalReceiver/LSP1Constants.sol +17 -0
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/Handling/TokenAndVaultHandling.sol +189 -0
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +26 -0
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUPCore.sol +52 -0
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUPInit.sol +26 -0
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUPInitAbstract.sol +28 -0
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/Handling/TokenHandling.sol +114 -0
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +23 -0
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVaultCore.sol +41 -0
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVaultInit.sol +23 -0
- package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVaultInitAbstract.sol +25 -0
- package/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +23 -0
- package/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +47 -0
- package/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +19 -0
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +36 -0
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInit.sol +30 -0
- package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +41 -0
- package/contracts/LSP6KeyManager/ILSP6KeyManager.sol +52 -0
- package/contracts/LSP6KeyManager/LSP6Constants.sol +28 -0
- package/contracts/LSP6KeyManager/LSP6KeyManager.sol +21 -0
- package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +444 -0
- package/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +19 -0
- package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +26 -0
- package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +186 -0
- package/contracts/LSP7DigitalAsset/LSP7Constants.sol +12 -0
- package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +35 -0
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +394 -0
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInit.sol +29 -0
- package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +44 -0
- package/contracts/LSP7DigitalAsset/extensions/ILSP7CappedSupply.sol +17 -0
- package/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibilityForERC20.sol +47 -0
- package/contracts/LSP7DigitalAsset/extensions/ILSP7Mintable.sol +32 -0
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +45 -0
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyCore.sol +55 -0
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInit.sol +24 -0
- package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +50 -0
- package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibilityForERC20.sol +76 -0
- package/contracts/LSP7DigitalAsset/extensions/LSP7Mintable.sol +41 -0
- package/contracts/LSP7DigitalAsset/extensions/LSP7MintableCore.sol +26 -0
- package/contracts/LSP7DigitalAsset/extensions/LSP7MintableInit.sol +26 -0
- package/contracts/LSP7DigitalAsset/extensions/LSP7MintableInitAbstract.sol +47 -0
- package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +223 -0
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +18 -0
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +35 -0
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +470 -0
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInit.sol +29 -0
- package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +41 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CappedSupply.sol +17 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibilityForERC721.sol +108 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8Mintable.sol +32 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +53 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyCore.sol +56 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInit.sol +24 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +55 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibilityConstants.sol +6 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibilityForERC721.sol +252 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Mintable.sol +36 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8MintableCore.sol +29 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8MintableInit.sol +24 -0
- package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8MintableInitAbstract.sol +44 -0
- package/contracts/LSP9Vault/LSP9Constants.sol +12 -0
- package/contracts/LSP9Vault/LSP9Vault.sol +56 -0
- package/contracts/LSP9Vault/LSP9VaultCore.sol +174 -0
- package/contracts/LSP9Vault/LSP9VaultInit.sol +19 -0
- package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +60 -0
- package/contracts/UniversalProfile.sol +37 -0
- package/contracts/UniversalProfileCore.sol +56 -0
- package/contracts/UniversalProfileInit.sol +19 -0
- package/contracts/UniversalProfileInitAbstract.sol +48 -0
- package/contracts/Utils/ERC725Utils.sol +169 -0
- package/contracts/Utils/LSP2Utils.sol +127 -0
- package/contracts/Utils/LSP6Utils.sol +77 -0
- package/contracts/Utils/UtilsLib.sol +23 -0
- package/package.json +84 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
// modules
|
|
5
|
+
import "@erc725/smart-contracts/contracts/ERC725Y.sol";
|
|
6
|
+
|
|
7
|
+
// interfaces
|
|
8
|
+
import "./ILSP4Compatibility.sol";
|
|
9
|
+
|
|
10
|
+
// libraries
|
|
11
|
+
import "../Utils/ERC725Utils.sol";
|
|
12
|
+
|
|
13
|
+
// constants
|
|
14
|
+
import "./LSP4Constants.sol";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @title LSP4Compatibility
|
|
18
|
+
* @author Matthew Stevens
|
|
19
|
+
* @dev LSP4 extension, for compatibility with clients & tools that expect ERC20/721.
|
|
20
|
+
*/
|
|
21
|
+
abstract contract LSP4Compatibility is ERC725Y, ILSP4Compatibility {
|
|
22
|
+
// --- Token queries
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @dev Returns the name of the token.
|
|
26
|
+
* @return The name of the token
|
|
27
|
+
*/
|
|
28
|
+
function name() public view virtual override returns (string memory) {
|
|
29
|
+
bytes memory data = ERC725Utils.getDataSingle(
|
|
30
|
+
this,
|
|
31
|
+
_LSP4_METADATA_TOKEN_NAME_KEY
|
|
32
|
+
);
|
|
33
|
+
return string(data);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @dev Returns the symbol of the token, usually a shorter version of the name.
|
|
38
|
+
* @return The symbol of the token
|
|
39
|
+
*/
|
|
40
|
+
function symbol() public view virtual override returns (string memory) {
|
|
41
|
+
bytes memory data = ERC725Utils.getDataSingle(
|
|
42
|
+
this,
|
|
43
|
+
_LSP4_METADATA_TOKEN_SYMBOL_KEY
|
|
44
|
+
);
|
|
45
|
+
return string(data);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// SPDX-License-Identifier: CC0-1.0
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
// --- ERC725Y entries
|
|
5
|
+
|
|
6
|
+
// bytes16(keccak256('SupportedStandard')) + bytes12(0) + bytes4(keccak256('LSP4DigitalAsset'))
|
|
7
|
+
bytes32 constant _LSP4_SUPPORTED_STANDARDS_KEY = 0xeafec4d89fa9619884b6b89135626455000000000000000000000000a4d96624;
|
|
8
|
+
|
|
9
|
+
// bytes4(keccak256('LSP4DigitalAsset'))
|
|
10
|
+
bytes constant _LSP4_SUPPORTED_STANDARDS_VALUE = hex"a4d96624";
|
|
11
|
+
|
|
12
|
+
// keccak256('LSP4TokenName')
|
|
13
|
+
bytes32 constant _LSP4_METADATA_TOKEN_NAME_KEY = 0xdeba1e292f8ba88238e10ab3c7f88bd4be4fac56cad5194b6ecceaf653468af1;
|
|
14
|
+
|
|
15
|
+
// keccak256('LSP4TokenSymbol')
|
|
16
|
+
bytes32 constant _LSP4_METADATA_TOKEN_SYMBOL_KEY = 0x2f0a68ab07768e01943a599e73362a0e17a63a72e94dd2e384d2c1d4db932756;
|
|
17
|
+
|
|
18
|
+
// keccak256('LSP4Metadata')
|
|
19
|
+
bytes32 constant _LSP4_METADATA_KEY = 0x9afb95cacc9f95858ec44aa8c3b685511002e30ae54415823f406128b85b238e;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
// modules
|
|
5
|
+
import "@erc725/smart-contracts/contracts/ERC725Y.sol";
|
|
6
|
+
|
|
7
|
+
// constants
|
|
8
|
+
import "./LSP4Constants.sol";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @title LSP4DigitalAssetMetadata
|
|
12
|
+
* @author Matthew Stevens
|
|
13
|
+
* @dev Implementation of a LSP8 compliant contract.
|
|
14
|
+
*/
|
|
15
|
+
abstract contract LSP4DigitalAssetMetadata is ERC725Y {
|
|
16
|
+
/**
|
|
17
|
+
* @notice Sets the name, symbol of the token and the owner, and sets the SupportedStandards:LSP4DigitalAsset key
|
|
18
|
+
* @param name_ The name of the token
|
|
19
|
+
* @param symbol_ The symbol of the token
|
|
20
|
+
* @param newOwner_ The owner of the token contract
|
|
21
|
+
*/
|
|
22
|
+
constructor(
|
|
23
|
+
string memory name_,
|
|
24
|
+
string memory symbol_,
|
|
25
|
+
address newOwner_
|
|
26
|
+
) ERC725Y(newOwner_) {
|
|
27
|
+
// SupportedStandards:LSP4DigitalAsset
|
|
28
|
+
_setData(
|
|
29
|
+
_LSP4_SUPPORTED_STANDARDS_KEY,
|
|
30
|
+
_LSP4_SUPPORTED_STANDARDS_VALUE
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
_setData(_LSP4_METADATA_TOKEN_NAME_KEY, bytes(name_));
|
|
34
|
+
_setData(_LSP4_METADATA_TOKEN_SYMBOL_KEY, bytes(symbol_));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
// constants
|
|
5
|
+
import "./LSP4Constants.sol";
|
|
6
|
+
import "./LSP4DigitalAssetMetadataInitAbstract.sol";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @title LSP4DigitalAssetMetadata
|
|
10
|
+
* @author Matthew Stevens
|
|
11
|
+
* @dev Deployable Proxy Implementation of a LSP8 compliant contract.
|
|
12
|
+
*/
|
|
13
|
+
abstract contract LSP4DigitalAssetMetadataInit is
|
|
14
|
+
LSP4DigitalAssetMetadataInitAbstract
|
|
15
|
+
{
|
|
16
|
+
/**
|
|
17
|
+
* @inheritdoc LSP4DigitalAssetMetadataInitAbstract
|
|
18
|
+
*/
|
|
19
|
+
function initialize(
|
|
20
|
+
string memory name_,
|
|
21
|
+
string memory symbol_,
|
|
22
|
+
address newOwner_
|
|
23
|
+
) public virtual override initializer {
|
|
24
|
+
LSP4DigitalAssetMetadataInitAbstract.initialize(
|
|
25
|
+
name_,
|
|
26
|
+
symbol_,
|
|
27
|
+
newOwner_
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
// modules
|
|
5
|
+
import "@erc725/smart-contracts/contracts/ERC725YInitAbstract.sol";
|
|
6
|
+
|
|
7
|
+
// constants
|
|
8
|
+
import "./LSP4Constants.sol";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @title LSP4DigitalAssetMetadata
|
|
12
|
+
* @author Matthew Stevens
|
|
13
|
+
* @dev Inheritable Proxy Implementation of a LSP8 compliant contract.
|
|
14
|
+
*/
|
|
15
|
+
abstract contract LSP4DigitalAssetMetadataInitAbstract is
|
|
16
|
+
Initializable,
|
|
17
|
+
ERC725YInitAbstract
|
|
18
|
+
{
|
|
19
|
+
/**
|
|
20
|
+
* @notice Sets the name, symbol of the token and the owner, and sets the SupportedStandards:LSP4DigitalAsset key
|
|
21
|
+
* @param name_ The name of the token
|
|
22
|
+
* @param symbol_ The symbol of the token
|
|
23
|
+
* @param newOwner_ The owner of the token contract
|
|
24
|
+
*/
|
|
25
|
+
function initialize(
|
|
26
|
+
string memory name_,
|
|
27
|
+
string memory symbol_,
|
|
28
|
+
address newOwner_
|
|
29
|
+
) public virtual onlyInitializing {
|
|
30
|
+
ERC725YInitAbstract.initialize(newOwner_);
|
|
31
|
+
|
|
32
|
+
// set SupportedStandards:LSP4DigitalAsset
|
|
33
|
+
_setData(
|
|
34
|
+
_LSP4_SUPPORTED_STANDARDS_KEY,
|
|
35
|
+
_LSP4_SUPPORTED_STANDARDS_VALUE
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
_setData(_LSP4_METADATA_TOKEN_NAME_KEY, bytes(name_));
|
|
39
|
+
_setData(_LSP4_METADATA_TOKEN_SYMBOL_KEY, bytes(symbol_));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
// interfaces
|
|
5
|
+
import "@openzeppelin/contracts/interfaces/IERC1271.sol";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @dev Contract acting as a controller of an ERC725 Account, using permissions stored in the ERC725Y storage
|
|
9
|
+
*/
|
|
10
|
+
interface ILSP6KeyManager is
|
|
11
|
+
IERC1271
|
|
12
|
+
/* is ERC165 */
|
|
13
|
+
{
|
|
14
|
+
event Executed(uint256 indexed _value, bytes _data);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @notice get latest nonce for `_from` for channel ID: `_channel`
|
|
18
|
+
* @dev use channel ID = 0 for sequential nonces, any other number for out-of-order execution (= execution in parallel)
|
|
19
|
+
* @param _address caller address
|
|
20
|
+
* @param _channel channel id
|
|
21
|
+
*/
|
|
22
|
+
function getNonce(address _address, uint256 _channel)
|
|
23
|
+
external
|
|
24
|
+
view
|
|
25
|
+
returns (uint256);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @notice execute the following payload on the ERC725Account: `_data`
|
|
29
|
+
* @dev the ERC725Account will return some data on successful call, or revert on failure
|
|
30
|
+
* @param _data the payload to execute. Obtained in web3 via encodeABI()
|
|
31
|
+
* @return result_ the data being returned by the ERC725 Account
|
|
32
|
+
*/
|
|
33
|
+
function execute(bytes calldata _data)
|
|
34
|
+
external
|
|
35
|
+
payable
|
|
36
|
+
returns (bytes memory);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @dev allows anybody to execute given they have a signed message from an executor
|
|
40
|
+
* @param _signedFor this KeyManager
|
|
41
|
+
* @param _nonce the address' nonce (in a specific `_channel`), obtained via `getNonce(...)`. Used to prevent replay attack
|
|
42
|
+
* @param _data obtained via encodeABI() in web3
|
|
43
|
+
* @param _signature bytes32 ethereum signature
|
|
44
|
+
* @return result_ the data being returned by the ERC725 Account
|
|
45
|
+
*/
|
|
46
|
+
function executeRelayCall(
|
|
47
|
+
address _signedFor,
|
|
48
|
+
uint256 _nonce,
|
|
49
|
+
bytes calldata _data,
|
|
50
|
+
bytes memory _signature
|
|
51
|
+
) external payable returns (bytes memory);
|
|
52
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// SPDX-License-Identifier: CC0-1.0
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
// --- ERC165 interface ids
|
|
5
|
+
bytes4 constant _INTERFACEID_LSP6 = 0x6f4df48b;
|
|
6
|
+
|
|
7
|
+
/* solhint-disable */
|
|
8
|
+
// PERMISSION KEYS
|
|
9
|
+
// prettier-ignore
|
|
10
|
+
bytes8 constant _SET_PERMISSIONS = 0x4b80742d00000000; // AddressPermissions:<...>
|
|
11
|
+
bytes12 constant _ADDRESS_PERMISSIONS = 0x4b80742d0000000082ac0000; // AddressPermissions:Permissions:<address> --> bytes32
|
|
12
|
+
bytes12 constant _ADDRESS_ALLOWEDADDRESSES = 0x4b80742d00000000c6dd0000; // AddressPermissions:AllowedAddresses:<address> --> address[]
|
|
13
|
+
bytes12 constant _ADDRESS_ALLOWEDFUNCTIONS = 0x4b80742d000000008efe0000; // AddressPermissions:AllowedFunctions:<address> --> bytes4[]
|
|
14
|
+
bytes12 constant _ADDRESS_ALLOWEDSTANDARDS = 0x4b80742d000000003efa0000; // AddressPermissions:AllowedStandards:<address> --> bytes4[]
|
|
15
|
+
/* solhint-enable */
|
|
16
|
+
|
|
17
|
+
// PERMISSIONS VALUES
|
|
18
|
+
// prettier-ignore
|
|
19
|
+
bytes32 constant _PERMISSION_CHANGEOWNER = 0x0000000000000000000000000000000000000000000000000000000000000001; // [240 x 0 bits...] 0000 0000 0000 0001
|
|
20
|
+
bytes32 constant _PERMISSION_CHANGEPERMISSIONS = 0x0000000000000000000000000000000000000000000000000000000000000002; // [ ... ] .... .... .... 0010
|
|
21
|
+
bytes32 constant _PERMISSION_ADDPERMISSIONS = 0x0000000000000000000000000000000000000000000000000000000000000004; // [ ... ] .... .... .... 0100
|
|
22
|
+
bytes32 constant _PERMISSION_SETDATA = 0x0000000000000000000000000000000000000000000000000000000000000008; // [ ... ] .... .... .... 1000
|
|
23
|
+
bytes32 constant _PERMISSION_CALL = 0x0000000000000000000000000000000000000000000000000000000000000010; // [ ... ] .... .... 0001 ....
|
|
24
|
+
bytes32 constant _PERMISSION_STATICCALL = 0x0000000000000000000000000000000000000000000000000000000000000020; // [ ... ] .... .... 0010 ....
|
|
25
|
+
bytes32 constant _PERMISSION_DELEGATECALL = 0x0000000000000000000000000000000000000000000000000000000000000040; // [ ... ] .... .... 0100 ....
|
|
26
|
+
bytes32 constant _PERMISSION_DEPLOY = 0x0000000000000000000000000000000000000000000000000000000000000080; // [ ... ] .... .... 1000 ....
|
|
27
|
+
bytes32 constant _PERMISSION_TRANSFERVALUE = 0x0000000000000000000000000000000000000000000000000000000000000100; // [ ... ] .... 0001 .... ....
|
|
28
|
+
bytes32 constant _PERMISSION_SIGN = 0x0000000000000000000000000000000000000000000000000000000000000200; // [ ... ] .... 0010 .... ....
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
pragma solidity ^0.8.6;
|
|
3
|
+
|
|
4
|
+
// modules
|
|
5
|
+
import "./LSP6KeyManagerCore.sol";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title Implementation of a contract acting as a controller of an ERC725 Account, using permissions stored in the ERC725Y storage
|
|
9
|
+
* @author Fabian Vogelsteller, Jean Cavallera
|
|
10
|
+
* @dev all the permissions can be set on the ERC725 Account using `setData(...)` with the keys constants below
|
|
11
|
+
*/
|
|
12
|
+
contract LSP6KeyManager is LSP6KeyManagerCore {
|
|
13
|
+
/**
|
|
14
|
+
* @notice Initiate the account with the address of the ERC725Account contract and sets LSP6KeyManager InterfaceId
|
|
15
|
+
* @param _account The address of the ER725Account to control
|
|
16
|
+
*/
|
|
17
|
+
constructor(address _account) {
|
|
18
|
+
account = ERC725(_account);
|
|
19
|
+
_registerInterface(_INTERFACEID_LSP6);
|
|
20
|
+
}
|
|
21
|
+
}
|