From ea66f9988e75a90fceef05ba3e2623b8f4f2e9b9 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Wed, 5 Jul 2023 14:29:03 +0100 Subject: [PATCH 01/12] add LSP8 ABI docs + setup redirects --- .../LSP8IdentifiableDigitalAsset.md | 968 ++++++++++++++++++ docs/contracts/introduction.md | 2 +- .../LSP8-Identifiable-Digital-Asset.md | 4 +- .../lsp1-universal-receiver-delegate-up.md | 2 +- .../lsp1-universal-receiver-delegate-vault.md | 2 +- .../lsp8-identifiable-digital-asset.md | 613 ----------- docusaurus.config.js | 6 +- 7 files changed, 978 insertions(+), 619 deletions(-) create mode 100644 docs/contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md delete mode 100644 docs/standards/smart-contracts/lsp8-identifiable-digital-asset.md diff --git a/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md new file mode 100644 index 0000000000..b6cc27c78e --- /dev/null +++ b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md @@ -0,0 +1,968 @@ +# LSP8IdentifiableDigitalAsset + +:::info Solidity contract + +[`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) + +::: + +> Implementation of a LSP8 Identifiable Digital Asset, a contract that represents a non-fungible token. + +Standard implementation contract of the LSP8 standard. Minting and transferring are done using by giving a unique `tokenId`. This implementation is agnostic to the way tokens are created. A supply mechanism has to be added in a derived contract using [`_mint`](#_mint) For a generic mechanism, see [`LSP7Mintable`](#lsp7mintable). + +## Methods + +### authorizeOperator + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizeoperator) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `authorizeOperator(address,bytes32)` +- Function selector: `0xcf5182ba` + +::: + +```solidity +function authorizeOperator( + address operator, + bytes32 tokenId +) external nonpayable; +``` + +Allow an `operator` address to transfer or burn a specific `tokenId` on behalf of its token owner. See [`isOperatorFor`](#isoperatorfor). + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ---------------------------------------- | +| `operator` | `address` | The address to authorize as an operator. | +| `tokenId` | `bytes32` | The token ID operator has access to.. | + +### balanceOf + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#balanceof) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `balanceOf(address)` +- Function selector: `0x70a08231` + +::: + +```solidity +function balanceOf(address tokenOwner) external view returns (uint256); +``` + +Get the number of token IDs owned by `tokenOwner`. + +#### Parameters + +| Name | Type | Description | +| ------------ | :-------: | ----------------------- | +| `tokenOwner` | `address` | The address to query \* | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------------------------------------------------- | +| `0` | `uint256` | The total number of token IDs that `tokenOwner` owns. | + +### getData + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdata) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `getData(bytes32)` +- Function selector: `0x54f6127f` + +::: + +```solidity +function getData(bytes32 dataKey) external view returns (bytes dataValue); +``` + +_Gets singular data at a given `dataKey`_ + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | ------------------------------- | +| `dataKey` | `bytes32` | The key which value to retrieve | + +#### Returns + +| Name | Type | Description | +| ----------- | :-----: | -------------------------- | +| `dataValue` | `bytes` | The data stored at the key | + +### getDataBatch + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatch) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `getDataBatch(bytes32[])` +- Function selector: `0xdedff9c6` + +::: + +```solidity +function getDataBatch( + bytes32[] dataKeys +) external view returns (bytes[] dataValues); +``` + +_Gets array of data for multiple given keys_ + +#### Parameters + +| Name | Type | Description | +| ---------- | :---------: | ------------------------------------------ | +| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve | + +#### Returns + +| Name | Type | Description | +| ------------ | :-------: | ----------------------------------------- | +| `dataValues` | `bytes[]` | The array of data stored at multiple keys | + +### getOperatorsOf + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getoperatorsof) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `getOperatorsOf(bytes32)` +- Function selector: `0x49a6078d` + +::: + +```solidity +function getOperatorsOf(bytes32 tokenId) external view returns (address[]); +``` + +Returns all `operator` addresses that are allowed to transfer or burn a specific `tokenId` on behalf of its owner. + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | -------------------------------------- | +| `tokenId` | `bytes32` | The token ID to get the operators for. | + +#### Returns + +| Name | Type | Description | +| ---- | :---------: | ------------------------------------------------------------------------------------------------------------ | +| `0` | `address[]` | An array of operators allowed to transfer or burn a specific `tokenId`. Requirements - `tokenId` must exist. | + +### isOperatorFor + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isoperatorfor) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `isOperatorFor(address,bytes32)` +- Function selector: `0x2a3654a4` + +::: + +```solidity +function isOperatorFor( + address operator, + bytes32 tokenId +) external view returns (bool); +``` + +Returns whether `operator` address is an operator for a given `tokenId`. + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ------------------------------------------------------------- | +| `operator` | `address` | The address to query operator status for. | +| `tokenId` | `bytes32` | The token ID to check if `operator` is allowed to operate on. | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | --------------------------------------------------------------------- | +| `0` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. | + +### owner + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#owner) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `owner()` +- Function selector: `0x8da5cb5b` + +::: + +```solidity +function owner() external view returns (address); +``` + +Returns the address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------- | +| `0` | `address` | - | + +### renounceOwnership + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#renounceownership) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `renounceOwnership()` +- Function selector: `0x715018a6` + +::: + +```solidity +function renounceOwnership() external nonpayable; +``` + +Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner. + +### revokeOperator + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokeoperator) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `revokeOperator(address,bytes32)` +- Function selector: `0x0b0c6d82` + +::: + +```solidity +function revokeOperator(address operator, bytes32 tokenId) external nonpayable; +``` + +Remove access of `operator` for a given `tokenId`, disallowing it to transfer `tokenId` on behalf of its owner. See also [`isOperatorFor`](#isoperatorfor). + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ---------------------------------------------------- | +| `operator` | `address` | The address to revoke as an operator. | +| `tokenId` | `bytes32` | The tokenId `operator` is revoked from operating on. | + +### setData + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdata) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `setData(bytes32,bytes)` +- Function selector: `0x7f23690c` + +::: + +```solidity +function setData(bytes32 dataKey, bytes dataValue) external payable; +``` + +_Sets singular data for a given `dataKey`_ + +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dataKey` | `bytes32` | The key to retrieve stored value | +| `dataValue` | `bytes` | The value to set SHOULD only be callable by the owner of the contract set via ERC173 The function is marked as payable to enable flexibility on child contracts If the function is not intended to receive value, an additional check should be implemented to check that value equal 0. Emits a {DataChanged} event. | + +### setDataBatch + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatch) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `setDataBatch(bytes32[],bytes[])` +- Function selector: `0x97902421` + +::: + +```solidity +function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; +``` + +Sets array of data for multiple given `dataKeys` SHOULD only be callable by the owner of the contract set via ERC173 The function is marked as payable to enable flexibility on child contracts If the function is not intended to receive value, an additional check should be implemented to check that value equal + +0. Emits a [`DataChanged`](#datachanged) event. + +#### Parameters + +| Name | Type | Description | +| ------------ | :---------: | ---------------------------------------- | +| `dataKeys` | `bytes32[]` | The array of data keys for values to set | +| `dataValues` | `bytes[]` | The array of values to set | + +### supportsInterface + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#supportsinterface) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `supportsInterface(bytes4)` +- Function selector: `0x01ffc9a7` + +::: + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool); +``` + +Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas. + +#### Parameters + +| Name | Type | Description | +| ------------- | :------: | ----------- | +| `interfaceId` | `bytes4` | - | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | ----------- | +| `0` | `bool` | - | + +### tokenIdsOf + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenidsof) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `tokenIdsOf(address)` +- Function selector: `0xa3b261f2` + +::: + +```solidity +function tokenIdsOf(address tokenOwner) external view returns (bytes32[]); +``` + +Returns the list of token IDs that the `tokenOwner` address owns. + +#### Parameters + +| Name | Type | Description | +| ------------ | :-------: | ---------------------------------------------------------- | +| `tokenOwner` | `address` | The address that we want to get the list of token IDs for. | + +#### Returns + +| Name | Type | Description | +| ---- | :---------: | ------------------------------------------------------- | +| `0` | `bytes32[]` | An array of `bytes32[] tokenIds` owned by `tokenOwner`. | + +### tokenOwnerOf + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenownerof) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `tokenOwnerOf(bytes32)` +- Function selector: `0x217b2270` + +::: + +```solidity +function tokenOwnerOf(bytes32 tokenId) external view returns (address); +``` + +Returns the list of `tokenIds` for the `tokenOwner` address. + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | -------------------------------------------- | +| `tokenId` | `bytes32` | tokenOwner The address to query owned tokens | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------------------------------------- | +| `0` | `address` | The owner address of the given `tokenId`. | + +### totalSupply + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#totalsupply) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `totalSupply()` +- Function selector: `0x18160ddd` + +::: + +```solidity +function totalSupply() external view returns (uint256); +``` + +Returns the number of existing tokens that have been minted in this contract. + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ------------------------------ | +| `0` | `uint256` | The number of existing tokens. | + +### transfer + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `transfer(address,address,bytes32,bool,bytes)` +- Function selector: `0x511b6952` + +::: + +```solidity +function transfer( + address from, + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) external nonpayable; +``` + +Transfer a given `tokenId` token from the `from` address to the `to` address. If operators are set for a specific `tokenId`, all the operators are revoked after the tokenId have been transferred. The `allowNonLSP1Recipient` parameter MUST be set to `true` when transferring tokens to Externally Owned Accounts (EOAs) or contracts that do not implement the LSP1 standard. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | The address that owns the given `tokenId`. | +| `to` | `address` | The address that will receive the `tokenId`. | +| `tokenId` | `bytes32` | The token ID to transfer. | +| `allowNonLSP1Recipient` | `bool` | When set to `true`, the `to` address CAN be any addres. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. | +| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses. | + +### transferBatch + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferbatch) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `transferBatch(address[],address[],bytes32[],bool[],bytes[])` +- Function selector: `0x7e87632c` + +::: + +```solidity +function transferBatch( + address[] from, + address[] to, + bytes32[] tokenId, + bool[] allowNonLSP1Recipient, + bytes[] data +) external nonpayable; +``` + +Transfers multiple tokens at once based on the arrays of `from`, `to` and `tokenId`. If any transfer fails, the whole call will revert. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :---------: | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address[]` | An array of sending addresses. | +| `to` | `address[]` | An array of recipient addresses. | +| `tokenId` | `bytes32[]` | An array of token IDs to transfer. | +| `allowNonLSP1Recipient` | `bool[]` | When set to `true`, `to` may be any address. When set to `false`, `to` must be a contract that supports the LSP1 standard and not revert. | +| `data` | `bytes[]` | Any additional data the caller wants included in the emitted event, and sent in the hooks to the `from` and `to` addresses. | + +### transferOwnership + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferownership) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Function signature: `transferOwnership(address)` +- Function selector: `0xf2fde38b` + +::: + +```solidity +function transferOwnership(address newOwner) external nonpayable; +``` + +Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner. + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ----------- | +| `newOwner` | `address` | - | + +--- + +## Events + +### AuthorizedOperator + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizedoperator) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Event signature: `AuthorizedOperator(address,address,bytes32)` +- Event hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` + +::: + +```solidity +event AuthorizedOperator(address indexed operator, address indexed tokenOwner, bytes32 indexed tokenId); +``` + +#### Parameters + +| Name | Type | Description | +| -------------------------- | :-------: | ----------- | +| `operator` **`indexed`** | `address` | - | +| `tokenOwner` **`indexed`** | `address` | - | +| `tokenId` **`indexed`** | `bytes32` | - | + +### DataChanged + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#datachanged) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Event signature: `DataChanged(bytes32,bytes)` +- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` + +::: + +```solidity +event DataChanged(bytes32 indexed dataKey, bytes dataValue); +``` + +_Emitted when data at a key is changed_ + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ----------- | +| `dataKey` **`indexed`** | `bytes32` | - | +| `dataValue` | `bytes` | - | + +### OwnershipTransferred + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownershiptransferred) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Event signature: `OwnershipTransferred(address,address)` +- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` + +::: + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------------- | :-------: | ----------- | +| `previousOwner` **`indexed`** | `address` | - | +| `newOwner` **`indexed`** | `address` | - | + +### RevokedOperator + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokedoperator) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Event signature: `RevokedOperator(address,address,bytes32)` +- Event hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` + +::: + +```solidity +event RevokedOperator(address indexed operator, address indexed tokenOwner, bytes32 indexed tokenId); +``` + +#### Parameters + +| Name | Type | Description | +| -------------------------- | :-------: | ----------- | +| `operator` **`indexed`** | `address` | - | +| `tokenOwner` **`indexed`** | `address` | - | +| `tokenId` **`indexed`** | `bytes32` | - | + +### Transfer + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Event signature: `Transfer(address,address,address,bytes32,bool,bytes)` +- Event hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` + +::: + +```solidity +event Transfer(address operator, address indexed from, address indexed to, bytes32 indexed tokenId, bool allowNonLSP1Recipient, bytes data); +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ----------- | +| `operator` | `address` | - | +| `from` **`indexed`** | `address` | - | +| `to` **`indexed`** | `address` | - | +| `tokenId` **`indexed`** | `bytes32` | - | +| `allowNonLSP1Recipient` | `bool` | - | +| `data` | `bytes` | - | + +--- + +## Errors + +### ERC725Y_DataKeysValuesEmptyArray + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `ERC725Y_DataKeysValuesEmptyArray()` +- Error hash: `0x97da5f95` + +::: + +```solidity +error ERC725Y_DataKeysValuesEmptyArray(); +``` + +reverts when one of the array parameter provided to `setDataBatch` is an empty array + +### ERC725Y_DataKeysValuesLengthMismatch + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` +- Error hash: `0x3bcc8979` + +::: + +```solidity +error ERC725Y_DataKeysValuesLengthMismatch(); +``` + +reverts when there is not the same number of elements in the lists of data keys and data values when calling setDataBatch. + +### ERC725Y_MsgValueDisallowed + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `ERC725Y_MsgValueDisallowed()` +- Error hash: `0xf36ba737` + +::: + +```solidity +error ERC725Y_MsgValueDisallowed(); +``` + +reverts when sending value to the `setData(..)` functions + +### LSP4TokenNameNotEditable + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP4TokenNameNotEditable()` +- Error hash: `0x85c169bd` + +::: + +```solidity +error LSP4TokenNameNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. + +### LSP4TokenSymbolNotEditable + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP4TokenSymbolNotEditable()` +- Error hash: `0x76755b38` + +::: + +```solidity +error LSP4TokenSymbolNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. + +### LSP8CannotSendToAddressZero + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoaddresszero) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP8CannotSendToAddressZero()` +- Error hash: `0x24ecef4d` + +::: + +```solidity +error LSP8CannotSendToAddressZero(); +``` + +reverts when trying to send token to the zero address. + +### LSP8CannotSendToSelf + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoself) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP8CannotSendToSelf()` +- Error hash: `0x5d67d6c1` + +::: + +```solidity +error LSP8CannotSendToSelf(); +``` + +reverts when specifying the same address for `from` and `to` in a token transfer. + +### LSP8CannotUseAddressZeroAsOperator + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotuseaddresszeroasoperator) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP8CannotUseAddressZeroAsOperator()` +- Error hash: `0x9577b8b3` + +::: + +```solidity +error LSP8CannotUseAddressZeroAsOperator(); +``` + +reverts when trying to set the zero address as an operator. + +### LSP8InvalidTransferBatch + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8invalidtransferbatch) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP8InvalidTransferBatch()` +- Error hash: `0x93a83119` + +::: + +```solidity +error LSP8InvalidTransferBatch(); +``` + +reverts when the parameters used for `transferBatch` have different lengths. + +### LSP8NonExistentTokenId + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistenttokenid) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP8NonExistentTokenId(bytes32)` +- Error hash: `0xae8f9a36` + +::: + +```solidity +error LSP8NonExistentTokenId(bytes32 tokenId); +``` + +reverts when `tokenId` has not been minted. + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | ----------- | +| `tokenId` | `bytes32` | - | + +### LSP8NonExistingOperator + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistingoperator) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP8NonExistingOperator(address,bytes32)` +- Error hash: `0x4aa31a8c` + +::: + +```solidity +error LSP8NonExistingOperator(address operator, bytes32 tokenId); +``` + +reverts when `operator` is not an operator for the `tokenId`. + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ----------- | +| `operator` | `address` | - | +| `tokenId` | `bytes32` | - | + +### LSP8NotTokenOperator + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenoperator) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP8NotTokenOperator(bytes32,address)` +- Error hash: `0x1294d2a9` + +::: + +```solidity +error LSP8NotTokenOperator(bytes32 tokenId, address caller); +``` + +reverts when `caller` is not an allowed operator for `tokenId`. + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | ----------- | +| `tokenId` | `bytes32` | - | +| `caller` | `address` | - | + +### LSP8NotTokenOwner + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenowner) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP8NotTokenOwner(address,bytes32,address)` +- Error hash: `0x5b271ea2` + +::: + +```solidity +error LSP8NotTokenOwner(address tokenOwner, bytes32 tokenId, address caller); +``` + +reverts when `caller` is not the `tokenOwner` of the `tokenId`. + +#### Parameters + +| Name | Type | Description | +| ------------ | :-------: | ----------- | +| `tokenOwner` | `address` | - | +| `tokenId` | `bytes32` | - | +| `caller` | `address` | - | + +### LSP8NotifyTokenReceiverContractMissingLSP1Interface + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP8NotifyTokenReceiverContractMissingLSP1Interface(address)` +- Error hash: `0x4349776d` + +::: + +```solidity +error LSP8NotifyTokenReceiverContractMissingLSP1Interface( + address tokenReceiver +); +``` + +reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool allowNonLSP1Recipient` set as `false`. + +#### Parameters + +| Name | Type | Description | +| --------------- | :-------: | ----------- | +| `tokenReceiver` | `address` | - | + +### LSP8NotifyTokenReceiverIsEOA + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceiveriseoa) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP8NotifyTokenReceiverIsEOA(address)` +- Error hash: `0x03173137` + +::: + +```solidity +error LSP8NotifyTokenReceiverIsEOA(address tokenReceiver); +``` + +reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool allowNonLSP1Recipient` set as `false`. + +#### Parameters + +| Name | Type | Description | +| --------------- | :-------: | ----------- | +| `tokenReceiver` | `address` | - | + +### LSP8OperatorAlreadyAuthorized + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8operatoralreadyauthorized) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP8OperatorAlreadyAuthorized(address,bytes32)` +- Error hash: `0xa7626b68` + +::: + +```solidity +error LSP8OperatorAlreadyAuthorized(address operator, bytes32 tokenId); +``` + +reverts when `operator` is already authorized for the `tokenId`. + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ----------- | +| `operator` | `address` | - | +| `tokenId` | `bytes32` | - | + +### LSP8TokenOwnerCannotBeOperator + +:::note Links + +- Specification details in [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownercannotbeoperator) +- Solidity implementation in [**LSP8IdentifiableDigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP8TokenOwnerCannotBeOperator()` +- Error hash: `0x89fdad62` + +::: + +```solidity +error LSP8TokenOwnerCannotBeOperator(); +``` + +reverts when trying to authorize or revoke the token's owner as an operator. diff --git a/docs/contracts/introduction.md b/docs/contracts/introduction.md index 5b2ecdcc77..116df0a87f 100644 --- a/docs/contracts/introduction.md +++ b/docs/contracts/introduction.md @@ -74,7 +74,7 @@ The **Digital Asset (Token and NFT 2.0)** contracts are the newest advanced vers - **[LSP4DigitalAssetMetadata](./contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md)**: a contract that sets the **metadata** of the **Digital Asset**. - **[LSP7DigitalAsset](./contracts/LSP7DigitalAsset/LSP7DigitalAsset.md)**: a contract that either represents a fungible or non-fungible token (NFT). -- **[LSP8IdentifiableDigitalAsset](../standards/smart-contracts/lsp8-identifiable-digital-asset.md)**: a contract that represents a non-fungible token (NFT). It uses a bytes32 tokenId to allow many uses of token identification, including numbers, contract addresses, and hashed values (e.g., serial numbers). +- **[LSP8IdentifiableDigitalAsset](./contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md)**: a contract that represents a non-fungible token (NFT). It uses a bytes32 tokenId to allow many uses of token identification, including numbers, contract addresses, and hashed values (e.g., serial numbers). ### Generic Standards diff --git a/docs/standards/nft-2.0/LSP8-Identifiable-Digital-Asset.md b/docs/standards/nft-2.0/LSP8-Identifiable-Digital-Asset.md index cee8851a8d..7e39c9a58a 100644 --- a/docs/standards/nft-2.0/LSP8-Identifiable-Digital-Asset.md +++ b/docs/standards/nft-2.0/LSP8-Identifiable-Digital-Asset.md @@ -80,7 +80,7 @@ The Metadata defined by the **ERC725Y Data Keys** can be set for **each tokenId* It is expected in the LUKSO's ecosystem to use **smart contract based accounts** to operate on the blockchain, which includes receiving and sending tokens. EOAs can receive tokens but they will be mainly used to control these accounts and not to hold tokens. -To ensure a **safe asset transfer**, an additional boolean parameter was added to the [transfer](../smart-contracts//lsp8-identifiable-digital-asset.md#transfer) and mint functions: +To ensure a **safe asset transfer**, an additional boolean parameter was added to the [transfer](../../contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md#transfer) and mint functions: - If set to **False**, the transfer will only pass if the recipient is a smart contract that implements the **[LSP1-UniversalReceiver](../generic-standards/lsp1-universal-receiver.md)** standard. @@ -102,7 +102,7 @@ Implementing the **[LSP1-UniversalReceiver](../generic-standards/lsp1-universal- :::caution -When LSP8 assets are transfered, the LSP8 contract will notify the token sender and recipient using [`_notifyTokenSender(...)`](../smart-contracts/lsp8-identifiable-digital-asset.md#_notifytokensender) and [`_notifyTokenReceiver(...)`](../smart-contracts/lsp8-identifiable-digital-asset.md#_notifytokenreceiver). +When LSP8 assets are transfered, the LSP8 contract will notify the token sender and recipient using [`_notifyTokenSender(...)`](../../contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md#_notifytokensender) and [`_notifyTokenReceiver(...)`](../../contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md#_notifytokenreceiver). **These methods will make external calls** to the [`universalReceiver(...)`](../smart-contracts/lsp0-erc725-account.md#universalreceiver) functions of both the sender and recipient. diff --git a/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-up.md b/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-up.md index 2fa3254759..fec6a9dd05 100644 --- a/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-up.md +++ b/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-up.md @@ -13,7 +13,7 @@ sidebar_position: 5 The **LSP1UniversalReceiverDelegateUP** is a contract called by the **[`universalReceiver(...)`](./lsp0-erc725-account.md#universalreceiver)** function of the **[LSP0ERC725Account](./lsp0-erc725-account.md)** contract that: -- Writes the data keys representing assets received from type **[LSP7-DigitalAsset](../../contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md)** and **[LSP8-IdentifiableDigitalAsset](./lsp8-identifiable-digital-asset.md)** into the account storage, and removes them when the balance is zero according to the **[LSP5-ReceivedAssets Standard](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-5-ReceivedAssets.md)**. +- Writes the data keys representing assets received from type **[LSP7-DigitalAsset](../../contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md)** and **[LSP8-IdentifiableDigitalAsset](../../contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md)** into the account storage, and removes them when the balance is zero according to the **[LSP5-ReceivedAssets Standard](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-5-ReceivedAssets.md)**. - Writes the data keys representing the owned vaults from type **[LSP9-Vault](./lsp9-vault.md)** into your account storage, and removes them when **transferring ownership** to other accounts according to the **[LSP10-ReceivedVaults Standard](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-5-ReceivedAssets.md)**. diff --git a/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-vault.md b/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-vault.md index 45d8440e26..671bf884da 100644 --- a/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-vault.md +++ b/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-vault.md @@ -13,7 +13,7 @@ sidebar_position: 6 The **LSP1UniversalReceiverDelegateVault** is a contract called by the **[`universalReceiver(...)`](./lsp9-vault.md#universalreceiver)** function of the **[LSP9Vault](./lsp9-vault.md)** contract that: -- Writes the data keys representing assets received from type **[LSP7-DigitalAsset](../../contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md)** and **[LSP8-IdentifiableDigitalAsset](./lsp8-identifiable-digital-asset.md)** into the account storage, and removes them when the balance is zero according to the **[LSP5-ReceivedAssets Standard](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-5-ReceivedAssets.md)**. +- Writes the data keys representing assets received from type **[LSP7-DigitalAsset](../../contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md)** and **[LSP8-IdentifiableDigitalAsset](../../contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md)** into the account storage, and removes them when the balance is zero according to the **[LSP5-ReceivedAssets Standard](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-5-ReceivedAssets.md)**. The requirements stated in the **[LSP1UniversalReceiverDelegateUP](./lsp1-universal-receiver-delegate-up.md)** contract doesn't apply in this contract to execute the logic above correctly, as the address registred under the [LSP1UniversalReceiverDelegate](../generic-standards/lsp1-universal-receiver.md/#extension) data key has write access to the storage on the LSP9Vault. diff --git a/docs/standards/smart-contracts/lsp8-identifiable-digital-asset.md b/docs/standards/smart-contracts/lsp8-identifiable-digital-asset.md deleted file mode 100644 index ebb2c7ef1b..0000000000 --- a/docs/standards/smart-contracts/lsp8-identifiable-digital-asset.md +++ /dev/null @@ -1,613 +0,0 @@ ---- -title: LSP8IdentifiableDigitalAsset -sidebar_position: 10 ---- - -# LSP8IdentifiableDigitalAsset - -:::info Solidity contract - -[`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - -::: - -:::note -_LSP8IdentifiableDigitalAsset contract also contains the methods from the [ERC165 Standard](https://eips.ethereum.org/EIPS/eip-165):_ - -```solidity -function supportsInterface(bytes4 interfaceId) public view returns (bool) -``` - -::: - -## Public Functions - -### constructor - -```solidity -constructor( - string memory name_, - string memory symbol_, - address newOwner_ -) LSP4DigitalAssetMetadata(name_, symbol_, newOwner_) -``` - -Sets the **initial owner** of the token, and sets the following data keys on the [**ERC725Y Data Key-Value Store**](./lsp0-erc725-account#setdata): - -- name: token's name. -- symbol: token's symbol. -- [**SupportedStandards:LSP4DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#supportedstandardslsp4digitalasset) data key. - -#### Parameters: - -| Name | Type | Description | -| :---------- | :-------- | :------------------------- | -| `name_` | `string` | The name of the token. | -| `symbol_` | `string` | The symbol of the token. | -| `newOwner_` | `address` | The owner of the contract. | - -### totalSupply - -```solidity -function totalSupply() public view returns (uint256 value) -``` - -Returns the number of existing tokens of this contract. - -#### Return Values: - -| Name | Type | Description | -| :------ | :-------- | :----------------------------- | -| `value` | `uint256` | The number of existing tokens. | - -### balanceOf - -```solidity -function balanceOf(address tokenOwner) public view returns (uint256 value) -``` - -Returns the number of tokens owned by the `tokenOwner` address. - -#### Parameters: - -| Name | Type | Description | -| :----------- | :-------- | :-------------------- | -| `tokenOwner` | `address` | The address to query. | - -#### Return Values: - -| Name | Type | Description | -| :------ | :-------- | :------------------------------------------ | -| `value` | `uint256` | The number of tokens owned by this address. | - -### tokenOwnerOf - -```solidity -function tokenOwnerOf(bytes32 tokenId) public view returns (address tokenOwner) -``` - -Returns the `tokenOwner` address of the `tokenId`. - -#### Parameters: - -| Name | Type | Description | -| :-------- | :-------- | :------------------ | -| `tokenId` | `bytes32` | The token to query. | - -#### Return Values: - -| Name | Type | Description | -| :----------- | :-------- | :--------------- | -| `tokenOwner` | `address` | The token owner. | - -:::note - -#### Requirements: - -- `tokenId` must exist. - -::: - -### tokenIdsOf - -```solidity -function tokenIdsOf(address tokenOwner) public view returns (bytes32[] memory tokensId) -``` - -Returns the list of `tokenIds` for the `tokenOwner` address. - -#### Parameters: - -| Name | Type | Description | -| :----------- | :-------- | :-------------------- | -| `tokenOwner` | `address` | The address to query. | - -#### Return Values: - -| Name | Type | Description | -| :--------- | :---------- | :--------------------------- | -| `tokensId` | `bytes32[]` | The list of owned token ids. | - -### authorizeOperator - -```solidity -function authorizeOperator( - address operator, - bytes32 tokenId -) public -``` - -Sets the `operator` address as an operator of a particular `tokenId`. - -_Triggers the **[AuthorizedOperator](#authorizedoperator)** event when an address gets authorized as an operator._ - -#### Parameters: - -| Name | Type | Description | -| :--------- | :-------- | :--------------------------------------- | -| `operator` | `address` | The address to authorize as an operator. | -| `tokenId` | `bytes32` | The token to enable operator status to. | - -:::note - -#### Requirements: - -- `tokenId` must exist. -- Caller must be current `tokenOwner` of `tokenId`. -- `operator` cannot be calling address. -- `operator` cannot be the zero address. - -::: - -### revokeOperator - -```solidity -function revokeOperator( - address operator - bytes32 tokenId -) public -``` - -Removes the `operator` address as an operator of a particular `tokenId`. - -_Triggers the **[RevokedOperator](#revokedoperator)** event when an address gets revoked as an operator._ - -#### Parameters: - -| Name | Type | Description | -| :--------- | :-------- | :--------------------------------------- | -| `operator` | `address` | The address to revoke as an operator. | -| `tokenId` | `bytes32` | The token to disable operator status to. | - -:::note - -#### Requirements: - -- `tokenId` must exist. -- Caller must be current `tokenOwner` of `tokenId`. -- `operator` cannot be calling address. -- `operator` cannot be the zero address. - -::: - -### isOperatorFor - -:::info -The tokenOwner is its own operator. -::: - -```solidity -function isOperatorFor( - address operator, - bytes32 tokenId -) public view returns (bool result) -``` - -Returns whether the `operator` address is an operator of the `tokenId`. Operators can send and burn tokens on behalf of their owners. - -#### Parameters: - -| Name | Type | Description | -| :--------- | :-------- | :---------------------------------------- | -| `operator` | `address` | The address to query operator status for. | -| `tokenId` | `bytes32` | The token to query. | - -#### Return Values: - -| Name | Type | Description | -| :------- | :----- | :-------------------------------------------------------------------- | -| `result` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. | - -:::note - -#### Requirements: - -- `tokenId` must exist. -- Caller must be current `tokenOwner` of `tokenId`. - -::: - -### getOperatorsOf - -```solidity -function getOperatorsOf(bytes32 tokenId) public view returns (address[] memory operators) -``` - -Returns all `operator` addresses of a particular `tokenId`. - -#### Parameters: - -| Name | Type | Description | -| :-------- | :-------- | :------------------ | -| `tokenId` | `bytes32` | The token to query. | - -#### Return Values: - -| Name | Type | Description | -| :---------- | :---------- | :--------------------- | -| `operators` | `address[]` | The list of operators. | - -:::note - -#### Requirements: - -- `tokenId` must exist. - -::: - -### transfer - -```solidity -function transfer( - address from, - address to, - bytes32 tokenId, - bool allowNonLSP1Recipient, - bytes memory data -) public -``` - -Transfers the token with a particular `tokenId` from the `from` address to the `to` address. The `allowNonLSP1Recipient` parameter **MUST** be set to TRUE when transferring tokens to Externally Owned Accounts (EOAs) or contracts that do not implement the [LSP1 - Universal Receiver Delegate](../generic-standards/lsp1-universal-receiver.md) standard. - -_Triggers the **[Transfer](#transfer-2)** event when the token gets successfully transferred._ - -#### Parameters: - -| Name | Type | Description | -| :---------------------- | :-------- | :---------------------------------------------------------------------------------------------------------------------------------------- | -| `from` | `address` | The sender address. | -| `to` | `address` | The recipient address. | -| `tokenId` | `bytes32` | The token to transfer. | -| `allowNonLSP1Recipient` | `bool` | When set to TRUE, `to` may be any address; when set to FALSE `to` must be a contract that supports LSP1 UniversalReceiver and not revert. | -| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | - -:::note - -#### Requirements: - -- `from` cannot be the zero address. -- `to` cannot be the zero address. -- `from` and `to` cannot be the same address. -- `tokenId` token must be owned by from. -- If the caller is not `from`, it must be an operator of `tokenId`. - -::: - -### transferBatch - -```solidity -function transferBatch( - address[] from, - address[] to, - bytes32[] tokenId, - bool[] allowNonLSP1Recipient, - bytes[] memory data -) public -``` - -Transfers multiple tokens based on the `from`, `to`, and `tokenId` arrays. If any transfer fails, the whole call will revert. - -_Triggers the **[Transfer](#transfer-2)** event when the tokens get successfully transferred._ - -#### Parameters: - -| Name | Type | Description | -| :---------------------- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------- | -| `from` | `address[]` | The list of sender addresses. | -| `to` | `address[]` | The list of recipient addresses. | -| `tokenId` | `bytes32[]` | The list of tokenIds to transfer. | -| `allowNonLSP1Recipient` | `bool[]` | When set to TRUE, `to` may be any address; when set to FALSE `to` must be a contract that supports LSP1 UniversalReceiver and not revert. | -| `data` | `bytes[]` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | - -:::note - -#### Requirements: - -- `from`, `to`, `tokenId` lists are the same length. -- No values in `from` can be the zero address. -- No values in `to` can be the zero address. -- `from` and `to` cannot be the same address at the same index of each lists. -- Each `tokenId` token must be owned by `from`. -- If the caller is not `from`, it must be an operator of each `tokenId`. - -::: - -## Internal Functions - -These internal functions can be extended via `override` to add some custom logic. - -### \_mint - -```solidity -function _mint( - address to, - bytes32 tokenId, - bool allowNonLSP1Recipient, - bytes memory data -) internal virtual -``` - -Mints `tokenId` and transfers it to `to`. - -_Triggers the **[Transfer](#transfer-2)** event when tokens get successfully transferred._ - -#### Parameters: - -| Name | Type | Description | -| :---------------------- | :-------- | :---------------------------------------------------------------------------------------------------------------------------------------- | -| `to` | `address` | The recipient address. | -| `tokenId` | `bytes32` | The token to transfer. | -| `allowNonLSP1Recipient` | `bool` | When set to TRUE, `to` may be any address; when set to FALSE `to` must be a contract that supports LSP1 UniversalReceiver and not revert. | -| `memory` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hook to `to` address. | - -:::note - -#### Requirements: - -- `tokenId` must not exist. -- `to` cannot be the zero address. - -::: - -### \_transfer - -```solidity -function _transfer( - address from, - address to, - bytes32 tokenId, - bool allowNonLSP1Recipient, - bytes memory data -) internal virtual -``` - -Transfers `tokenId` from `from` to `to`. - -_Triggers the **[Transfer](#transfer-2)** event when tokens get successfully transferred._ - -#### Parameters: - -| Name | Type | Description | -| :---------------------- | :-------- | :---------------------------------------------------------------------------------------------------------------------------------------- | -| `from` | `address` | The sender address. | -| `to` | `address` | The recipient address. | -| `tokenId` | `bytes32` | The token to transfer. | -| `allowNonLSP1Recipient` | `bool` | When set to TRUE, `to` may be any address; when set to FALSE `to` must be a contract that supports LSP1 UniversalReceiver and not revert. | -| `memory` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | - -:::note - -#### Requirements: - -- `to` cannot be the zero address. -- `tokenId` token must be owned by `from`. - -::: - -### \_burn - -```solidity -function _burn( - address from, - bytes32 tokenId, - bytes memory data -) internal virtual -``` - -Burns `tokenId` and clear the operators authorized for the `tokenId`. - -_Triggers the **[Transfer](#transfer-2)** event when tokens get successfully transferred._ - -#### Parameters: - -| Name | Type | Description | -| :-------- | :-------- | :------------------------------------------------------------------------------------------------------ | -| `from` | `address` | The sender address. | -| `tokenId` | `bytes32` | The token to burn. | -| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hook to `from` address. | - -:::note - -#### Requirements: - -- `from` cannot be the zero address. -- `tokenId` must exist. - -::: - -### \_beforeTokenTransfer - -```solidity -function _beforeTokenTransfer( - address from, - address to, - bytes32 tokenId -) internal virtual -``` - -Hook that is called before any token transfer, including minting and burning. - -#### Parameters: - -| Name | Type | Description | -| :-------- | :-------- | :--------------------- | -| `from` | `address` | The sender address. | -| `to` | `address` | The recipient address. | -| `tokenId` | `bytes32` | The token to transfer. | - -### \_notifyTokenSender - -```solidity -function _notifyTokenSender( - address from, - address to, - bytes32 tokenId, - bytes memory data -) internal virtual -``` - -An attempt is made to notify the token receiver about the `tokenId` token being received by calling the **[universalReceiver(...)](./lsp0-erc725-account.md#universalreceiver)** function on the receiver address if it exists. - -#### Parameters: - -| Name | Type | Description | -| :-------- | :-------- | :------------------------------------------------------------------------------------------------------------------ | -| `from` | `address` | The sender address. | -| `to` | `address` | The recipient address. | -| `tokenId` | `bytes32` | The token to transfer. | -| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | - -### \_notifyTokenReceiver - -```solidity -function _notifyTokenReceiver( - address from, - address to, - bytes32 tokenId, - bool allowNonLSP1Recipient, - bytes memory data -) internal virtual -``` - -An attempt is made to notify the token receiver about the `tokenId` token being received by calling the **[universalReceiver(...)](./lsp0-erc725-account.md#universalreceiver)** function on the receiver address if it exists. - -#### Parameters: - -| Name | Type | Description | -| :---------------------- | :-------- | :---------------------------------------------------------------------------------------------------------------------------------------- | -| `from` | `address` | The sender address. | -| `to` | `address` | The recipient address. | -| `tokenId` | `bytes32` | The token to transfer. | -| `allowNonLSP1Recipient` | `bool` | When set to TRUE, `to` may be any address; when set to FALSE `to` must be a contract that supports LSP1 UniversalReceiver and not revert. | -| `memory` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | - -### \_revokeOperator - -```solidity -function _revokeOperator( - address operator, - address tokenOwner, - bytes32 tokenId -) internal virtual -``` - -Revoke the `operator` of the `tokenId` token which belongs to `tokenOwner`. - -#### Parameters: - -| Name | Type | Description | -| :----------- | :-------- | :---------------------------------------- | -| `operator` | `address` | The address of the operator to revoke. | -| `tokenOwner` | `address` | The address that is the owner of tokenId. | -| `tokenId` | `bytes32` | The token to disable operator status to. | - -### \_clearOperators - -```solidity -function clearOperators( - address tokenOwner, - bytes32 tokenId -) internal virtual -``` - -Revoke the all current operators of the `tokenId` token which belongs to `tokenOwner`. - -#### Parameters - -| Name | Type | Description | -| :----------- | :-------- | :---------------------------------------- | -| `tokenOwner` | `address` | The address that is the owner of tokenId. | -| `tokenId` | `bytes32` | The token to disable operator status to. | - -## Events - -### Transfer - -```solidity -event Transfer( - address operator, - address from, - address to, - bytes32 tokenId, - bool allowNonLSP1Recipient, - bytes data -) -``` - -_Fired when the **[transfer](#transfer)** function gets executed successfuly._ - -#### Values: - -| Name | Type | Description | -| :---------------------- | :-------- | :---------------------------------------------------------------------------------------------------------------------- | -| `operator` | `address` | The address of operator sending tokens. | -| `from` | `address` | The address which tokens are sent. | -| `to` | `address` | The recipient address. | -| `tokenId` | `bytes32` | The token to transfer. | -| `allowNonLSP1Recipient` | `bool` | When set to `true`, may be any address; When set to `false`, address must be a contract supporting LSP1 and not revert. | -| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to from and to addresses. | - -### AuthorizedOperator - -```solidity -event AuthorizedOperator( - address operator, - address tokenOwner, - bytes32 tokenId -) -``` - -_Fired when the **[authorizeOperator](#authorizeoperator)** function gets successfully executed._ - -#### Values: - -| Name | Type | Description | -| :----------- | :-------- | :----------------------------------------------------------------- | -| `operator` | `address` | The address authorized as an operator. | -| `tokenOwner` | `address` | The token owner. | -| `tokenId` | `bytes32` | The token that `operator` address has access to from `tokenOwner`. | - -### RevokedOperator - -```solidity -event RevokedOperator( - address operator, - address tokenOwner, - bytes32 tokenId -) -``` - -_Fired when the **[revokeOperator](#revokeoperator)** function gets successfully executed._ - -#### Values: - -| Name | Type | Description | -| :----------- | :-------- | :---------------------------------------- | -| `operator` | `address` | The address authorized as an operator. | -| `tokenOwner` | `address` | The token owner. | -| `tokenId` | `bytes32` | The token revoked from `operator` access. | - -## References - -- [LUKSO Standards Proposals: LSP8 - Identifiable Digital Asset (Standard Specification, GitHub)](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md) -- [LSP8 Identifiable Digital Asset: Solidity implementations (GitHub)](https://github.com/lukso-network/lsp-universalprofile-smart-contracts/tree/develop/contracts/LSP8IdentifiableDigitalAsset) diff --git a/docusaurus.config.js b/docusaurus.config.js index 452bfa8d3c..ea234c157d 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -63,7 +63,7 @@ module.exports = { }, { from: '/contracts/identifiable-digital-asset', - to: '/standards/smart-contracts/lsp8-identifiable-digital-asset', + to: '/contracts/contracts/LSP8IdentifiableDigitalAsset', }, { from: '/guides/universal-profile/browser-extension/install-browser-extension', @@ -98,6 +98,10 @@ module.exports = { from: '/standards/smart-contracts/lsp4-digital-asset-metadata', to: '/contracts/contracts/LSP4DigitalAssetMetadata', }, + { + from: '/standards/smart-contracts/lsp8-identifiable-digital-asset', + to: '/contracts/contracts/LSP8IdentifiableDigitalAsset', + }, ], }, ], From feb45793a98be8762a0c486b65b0ea3e5534ccb3 Mon Sep 17 00:00:00 2001 From: b00ste Date: Thu, 6 Jul 2023 18:07:37 +0300 Subject: [PATCH 02/12] Update script to add specs links to each `.md` --- docs/contracts/_links.md | 170 ++++++++++++++++++++++++++++++++++++++ scripts/contracts-sync.sh | 6 +- 2 files changed, 175 insertions(+), 1 deletion(-) create mode 100644 docs/contracts/_links.md diff --git a/docs/contracts/_links.md b/docs/contracts/_links.md new file mode 100644 index 0000000000..70c20a551a --- /dev/null +++ b/docs/contracts/_links.md @@ -0,0 +1,170 @@ + + + + +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md +[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md +[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md +[LSP-3-UniversalProfile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md +[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md +[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md +[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md +[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md +[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md +[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md +[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md +[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md +[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md +[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md +[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md +[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md +[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md +[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md + + + +[ERC725]: https://docs.lukso.tech/standards/lsp-background/erc725 +[UniversalProfile]: https://docs.lukso.tech/standards/universal-profile/introduction +[LSP0ERC725Account]: https://docs.lukso.tech/standards/universal-profile/lsp0-erc725account +[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver +[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver-delegate +[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/generic-standards/lsp2-json-schema +[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/nft-2.0/LSP4-Digital-Asset-Metadata +[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp5-received-assets +[LSP6KeyManager]: https://docs.lukso.tech/standards/universal-profile/lsp6-key-manager +[LSP7DigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP7-Digital-Asset +[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP8-Identifiable-Digital-Asset +[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp10-received-vaults +[LSP14Ownable2Step]: https://docs.lukso.tech/standards/generic-standards/lsp14-ownable-2-step +[LSP17ContractExtension]: https://docs.lukso.tech/standards/generic-standards/lsp17-contract-extension +[LSP20CallVerification]: https://docs.lukso.tech/standards/generic-standards/lsp20-call-verification + + + +[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725.sol +[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Init.sol +[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725InitAbstract +[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725X.sol +[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInit.sol +[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInitAbstract.sol +[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725Y.sol +[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInit.sol +[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInitAbstract.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165.sol +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/proxy/utils/Initializable.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/EnumerableSet.sol +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YCore.sol +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XCore.sol +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/custom/OwnableUnset.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol + + + +[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Utils.sol +[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Constants.sol +[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInitAbstract.sol +[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfile.sol +[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInit.sol +[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Utils.sol +[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Constants.sol +[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Errors.sol +[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/ontracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +[`LSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +[`ILSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Utils.sol +[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Constants.sol +[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/ILSP6KeyManager.sol +[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Errors.sol +[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol +[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManager.sol +[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +[`LSP7DigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +[`LSP7CompatibleERC20InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +[`LSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +[`LSP7CompatibleERC20MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +[`LSP7CompatibleERC20Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Errors.sol +[`LSP7CompatibleERC20MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +[`ILSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Constants.sol +[`LSP8IdentifiableDigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +[`LSP8CompatibleERC721InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +[`LSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +[`ILSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +[`LSP8CompatibleERC721MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.s +[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +[`LSP8CompatibleERC721Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +[`LSP8CompatibleERC721MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.s +[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Constants.sol +[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Errors.sol +[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extendable.sol +[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extension.sol +[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Constants.sol +[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Errors.sol +[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Utils.sol +[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20CallVerification.sol +[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/ILSP20CallVerifier.sol +[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Constants.sol +[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Errors.sol +[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +[`generateArrayElementKeyAtIndex(bytes32,uint128)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L48 +[`generateMappingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L108 +[`generateMappingWithGroupingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L165 +[`isCompactBytesArray(bytes)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L288 +[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Utils.sol +[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Constants.sol +[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Utils.sol +[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Constants.sol + + diff --git a/scripts/contracts-sync.sh b/scripts/contracts-sync.sh index 9e2a9e532a..1059202134 100644 --- a/scripts/contracts-sync.sh +++ b/scripts/contracts-sync.sh @@ -9,4 +9,8 @@ git clone --depth 1 --branch test-docs-sync https://github.com/lukso-network/ls rsync -av --progress lsp-smart-contracts/docs/. ../docs/contracts/ cd .. -rm -rf tmpDocsSync \ No newline at end of file +rm -rf tmpDocsSync + +# Add Specs Links to the end of each file +for FILE in docs/contracts/contracts/**/*.md; do cat $FILE docs/contracts/_links.md > $FILE.copy; done +for FILE in docs/contracts/contracts/**/*.md.copy; do cp $FILE `echo $FILE | sed 's/.copy//g'` && rm $FILE; done From 61f000a4395c5dbf106a9200fa586a72bafe58e5 Mon Sep 17 00:00:00 2001 From: b00ste Date: Thu, 6 Jul 2023 18:08:20 +0300 Subject: [PATCH 03/12] Add LSP1 ABI auto-generated docs --- .../LSP1UniversalReceiverDelegateUP.md | 530 ++++++++++++++++++ .../LSP1UniversalReceiverDelegateVault.md | 445 +++++++++++++++ .../LSP4DigitalAssetMetadata.md | 170 ++++++ .../LSP7DigitalAsset/LSP7DigitalAsset.md | 170 ++++++ 4 files changed, 1315 insertions(+) create mode 100644 docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md create mode 100644 docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md diff --git a/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md b/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md new file mode 100644 index 0000000000..aa84d11667 --- /dev/null +++ b/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md @@ -0,0 +1,530 @@ +# LSP1UniversalReceiverDelegateUP + +:::info Standard Specifications + +[`LSP-1-UniversalReceiver`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md) + +::: +:::info Soldity implementation + +[`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) + +::: + +> Implementation of a UniversalReceiverDelegate for the [LSP-0-ERC725Account] + +The [`LSP1UniversalReceiverDelegateUP`](#lsp1universalreceiverdelegateup) follows the [LSP-1-UniversalReceiver] standard and is designed for [LSP-0-ERC725Account] contracts. The [`LSP1UniversalReceiverDelegateUP`](#lsp1universalreceiverdelegateup) is a contract called by the [`universalReceiver(...)`](#universalreceiver) function of the [LSP-0-ERC725Account] contract that: + +- Writes the data keys representing assets received from type [LSP-7-DigitalAsset] and [LSP-8-IdentifiableDigitalAsset] into the account storage, and removes them when the balance is zero according to the [LSP-5-ReceivedAssets] Standard. + +- Writes the data keys representing the owned vaults from type [LSP-9-Vault] into your account storage, and removes them when transferring ownership to other accounts according to the [LSP-10-ReceivedVaults] Standard. + +## Methods + +### supportsInterface + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#supportsinterface) +- Solidity implementation in [**LSP1UniversalReceiverDelegateUP**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Function signature: `supportsInterface(bytes4)` +- Function selector: `0x01ffc9a7` + +::: + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool); +``` + +_Achieves the goal of ERC165 to detect supported interfaces and LSP17 by checking if the interfaceId being queried is supported on another linked extension._ + +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`. + +#### Parameters + +| Name | Type | Description | +| ------------- | :------: | ----------- | +| `interfaceId` | `bytes4` | - | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | ----------- | +| `0` | `bool` | - | + +### universalReceiver + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#universalreceiver) +- Solidity implementation in [**LSP1UniversalReceiverDelegateUP**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Function signature: `universalReceiver(bytes32,)` +- Function selector: `0x534e72c8` + +::: + +```solidity +function universalReceiver( + bytes32 typeId, + bytes +) external payable returns (bytes result); +``` + +_Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts (UniversalReceiverDelegates) that react on the whole transaction and on the specific typeId, respectively. The notification is achieved by emitting a [`UniversalReceiver`](#universalreceiver) event on the call with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract._ + +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] + `. (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. + +
+ +**Emitted events:** + +- [`ValueReceived`](#valuereceived) when receiving native tokens. +- [`UniversalReceiver`](#universalreceiver) event. + +
+ +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | -------------------------- | +| `typeId` | `bytes32` | The type of call received. | +| `_1` | `bytes` | - | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | ----------- | +| `result` | `bytes` | - | + +## Events + +### UniversalReceiver + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#universalreceiver) +- Solidity implementation in [**LSP1UniversalReceiverDelegateUP**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Event signature: `UniversalReceiver(address,uint256,bytes32,bytes,bytes)` +- Event hash: `0x9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c2` + +::: + +```solidity +event UniversalReceiver(address indexed from, uint256 indexed value, bytes32 indexed typeId, bytes receivedData, bytes returnedValue); +``` + +_`from` sent `value` native tokens and a notification using `typeId` and `receivedData`._ + +The event is emitted when `universalReceiver(...)` reacted successfully on all of the following inputs: + +- A valid notifier: `from` + +- A valid amount of native tokens are sent: `value` + +- A supported type ID: `typeId` + +- Arbitrary data which may or may not be used: `receivedData` And returned a valid result: `returnedValue` based on the inputs. + +#### Parameters + +| Name | Type | Description | +| ---------------------- | :-------: | --------------------------------------------------------------- | +| `from` **`indexed`** | `address` | The address calling the {universalReceiver(...)} function. | +| `value` **`indexed`** | `uint256` | The amount sent to the {universalReceiver(...)} function. | +| `typeId` **`indexed`** | `bytes32` | The hash of a specific standard or a hook. | +| `receivedData` | `bytes` | The arbitrary data passed to {universalReceiver(...)} function. | +| `returnedValue` | `bytes` | The value returned by the {universalReceiver(...)} function. | + +## Errors + +### CannotRegisterEOAsAsAssets + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#cannotregistereoasasassets) +- Solidity implementation in [**LSP1UniversalReceiverDelegateUP**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Error signature: `CannotRegisterEOAsAsAssets(address)` +- Error hash: `0xa5295345` + +::: + +```solidity +error CannotRegisterEOAsAsAssets(address caller); +``` + +_EOA: `caller` cannot be registered as an asset._ + +Reverts when EOA calls the [`universalReceiver(..)`](#universalreceiver) function with an asset/vault typeId. + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ---------------------- | +| `caller` | `address` | The address of the EOA | + +### InvalidLSP10ReceivedVaultsArrayLength + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#invalidlsp10receivedvaultsarraylength) +- Solidity implementation in [**LSP1UniversalReceiverDelegateUP**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Error signature: `InvalidLSP10ReceivedVaultsArrayLength(bytes,uint256)` +- Error hash: `0x12ce1c39` + +::: + +```solidity +error InvalidLSP10ReceivedVaultsArrayLength( + bytes invalidValueStored, + uint256 invalidValueLength +); +``` + +_The data stored under `LSP10ReceivedVaults[]` Data Key is invalid. Value storred: `invalidValueStored`. Value length: `invalidValueLength`._ + +Reverts when the value stored under the 'LSP10ReceivedVaults[]' data key is not valid. The value stored under this data key should be exactly 16 bytes long. Only possible valid values are: + +- any valid uint128 values i.e. `0x00000000000000000000000000000000` (zero), meaning empty array, no vaults received. i.e. `0x00000000000000000000000000000005` (non-zero), meaning 5 array elements, 5 vaults received. + +- `0x` (nothing stored under this data key, equivalent to empty array) + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | ------------------------------------------------------------------------------------------------------ | +| `invalidValueStored` | `bytes` | The invalid value stored under the `LSP10ReceivedVaults[]` data key. | +| `invalidValueLength` | `uint256` | The invalid number of bytes stored under the `LSP10ReceivedVaults[]` data key (MUST be 16 bytes long). | + +### InvalidLSP5ReceivedAssetsArrayLength + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#invalidlsp5receivedassetsarraylength) +- Solidity implementation in [**LSP1UniversalReceiverDelegateUP**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Error signature: `InvalidLSP5ReceivedAssetsArrayLength(bytes,uint256)` +- Error hash: `0xecba7af8` + +::: + +```solidity +error InvalidLSP5ReceivedAssetsArrayLength( + bytes invalidValueStored, + uint256 invalidValueLength +); +``` + +_The data stored under `LSP5ReceivedAssets[]` Data Key is invalid. Value storred: `invalidValueStored`. Value length: `invalidValueLength`._ + +Reverts when the value stored under the 'LSP5ReceivedAssets[]' data key is not valid. The value stored under this data key should be exactly 16 bytes long. Only possible valid values are: + +- any valid uint128 values i.e. `0x00000000000000000000000000000000` (zero), empty array, no assets received. i.e. `0x00000000000000000000000000000005` (non-zero), 5 array elements, 5 assets received. + +- `0x` (nothing stored under this data key, equivalent to empty array) + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | ------------------------------------------------------------------------------------------------------------- | +| `invalidValueStored` | `bytes` | The invalid value stored under the `LSP5ReceivedAssets[]` data key. | +| `invalidValueLength` | `uint256` | The invalid number of bytes stored under the `LSP5ReceivedAssets[]` data key (MUST be exactly 16 bytes long). | + +### MaxLSP10VaultsCountReached + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#maxlsp10vaultscountreached) +- Solidity implementation in [**LSP1UniversalReceiverDelegateUP**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Error signature: `MaxLSP10VaultsCountReached(address)` +- Error hash: `0x11610270` + +::: + +```solidity +error MaxLSP10VaultsCountReached(address notRegisteredVault); +``` + +_Limit reached. Cannot register more vaults. Failed to register: `notRegisteredVault`._ + +Reverts when the `LSP10Vaults[]` array reaches its maximum limit (`max(uint128)`). + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | ------------------------------------------------------ | +| `notRegisteredVault` | `address` | The address of the vault that could not be registered. | + +### MaxLSP5ReceivedAssetsCountReached + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#maxlsp5receivedassetscountreached) +- Solidity implementation in [**LSP1UniversalReceiverDelegateUP**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Error signature: `MaxLSP5ReceivedAssetsCountReached(address)` +- Error hash: `0x0b51a2d0` + +::: + +```solidity +error MaxLSP5ReceivedAssetsCountReached(address notRegisteredAsset); +``` + +_Limit reached. Cannot register more assets. Failed to register: `notRegisteredAsset`._ + +Reverts when the `LSP5ReceivedAssets[]` array reaches its maximum limit (`max(uint128)`). + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | ------------------------------------------------------ | +| `notRegisteredAsset` | `address` | The address of the asset that could not be registered. | + +### NativeTokensNotAccepted + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#nativetokensnotaccepted) +- Solidity implementation in [**LSP1UniversalReceiverDelegateUP**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Error signature: `NativeTokensNotAccepted()` +- Error hash: `0x114b721a` + +::: + +```solidity +error NativeTokensNotAccepted(); +``` + +_Cannot send native tokens to [`universalReceiver(...)`](#universalreceiver) function of the delegated contract._ + +Reverts when [`universalReceiver(...)`](#universalreceiver) function in the delegated contract is called with a value different than 0. + +### ReceivedAssetsIndexSuperiorToUint128 + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#receivedassetsindexsuperiortouint128) +- Solidity implementation in [**LSP1UniversalReceiverDelegateUP**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Error signature: `ReceivedAssetsIndexSuperiorToUint128(uint256)` +- Error hash: `0xe8a4fba0` + +::: + +```solidity +error ReceivedAssetsIndexSuperiorToUint128(uint256 index); +``` + +_Asset index stored under the `ReceivedAssetsMap` Data Key is invalid. Invalid index: `index`._ + +Reverts when the received assets index is superior to `uint128`. + +#### Parameters + +| Name | Type | Description | +| ------- | :-------: | -------------------------- | +| `index` | `uint256` | The received assets index. | + +### VaultIndexSuperiorToUint128 + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#vaultindexsuperiortouint128) +- Solidity implementation in [**LSP1UniversalReceiverDelegateUP**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Error signature: `VaultIndexSuperiorToUint128(uint256)` +- Error hash: `0x76f9db1b` + +::: + +```solidity +error VaultIndexSuperiorToUint128(uint256 index); +``` + +_Vault index stored under the `ReceivedVaultsMap` Data Key is invalid. Invalid index: `index`._ + +Reverts when the vault index is superior to `uint128`. + +#### Parameters + +| Name | Type | Description | +| ------- | :-------: | ---------------- | +| `index` | `uint256` | The vault index. | + + + + +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md +[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md +[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md +[LSP-3-UniversalProfile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md +[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md +[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md +[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md +[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md +[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md +[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md +[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md +[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md +[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md +[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md +[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md +[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md +[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md +[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md + + + +[ERC725]: https://docs.lukso.tech/standards/lsp-background/erc725 +[UniversalProfile]: https://docs.lukso.tech/standards/universal-profile/introduction +[LSP0ERC725Account]: https://docs.lukso.tech/standards/universal-profile/lsp0-erc725account +[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver +[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver-delegate +[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/generic-standards/lsp2-json-schema +[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/nft-2.0/LSP4-Digital-Asset-Metadata +[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp5-received-assets +[LSP6KeyManager]: https://docs.lukso.tech/standards/universal-profile/lsp6-key-manager +[LSP7DigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP7-Digital-Asset +[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP8-Identifiable-Digital-Asset +[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp10-received-vaults +[LSP14Ownable2Step]: https://docs.lukso.tech/standards/generic-standards/lsp14-ownable-2-step +[LSP17ContractExtension]: https://docs.lukso.tech/standards/generic-standards/lsp17-contract-extension +[LSP20CallVerification]: https://docs.lukso.tech/standards/generic-standards/lsp20-call-verification + + + +[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725.sol +[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Init.sol +[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725InitAbstract +[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725X.sol +[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInit.sol +[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInitAbstract.sol +[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725Y.sol +[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInit.sol +[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInitAbstract.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165.sol +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/proxy/utils/Initializable.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/EnumerableSet.sol +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YCore.sol +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XCore.sol +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/custom/OwnableUnset.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol + + + +[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Utils.sol +[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Constants.sol +[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInitAbstract.sol +[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfile.sol +[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInit.sol +[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Utils.sol +[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Constants.sol +[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Errors.sol +[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/ontracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +[`LSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +[`ILSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Utils.sol +[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Constants.sol +[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/ILSP6KeyManager.sol +[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Errors.sol +[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol +[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManager.sol +[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +[`LSP7DigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +[`LSP7CompatibleERC20InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +[`LSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +[`LSP7CompatibleERC20MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +[`LSP7CompatibleERC20Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Errors.sol +[`LSP7CompatibleERC20MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +[`ILSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Constants.sol +[`LSP8IdentifiableDigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +[`LSP8CompatibleERC721InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +[`LSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +[`ILSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +[`LSP8CompatibleERC721MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.s +[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +[`LSP8CompatibleERC721Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +[`LSP8CompatibleERC721MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.s +[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Constants.sol +[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Errors.sol +[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extendable.sol +[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extension.sol +[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Constants.sol +[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Errors.sol +[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Utils.sol +[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20CallVerification.sol +[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/ILSP20CallVerifier.sol +[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Constants.sol +[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Errors.sol +[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +[`generateArrayElementKeyAtIndex(bytes32,uint128)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L48 +[`generateMappingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L108 +[`generateMappingWithGroupingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L165 +[`isCompactBytesArray(bytes)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L288 +[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Utils.sol +[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Constants.sol +[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Utils.sol +[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Constants.sol + + diff --git a/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md b/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md new file mode 100644 index 0000000000..9c39311c88 --- /dev/null +++ b/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md @@ -0,0 +1,445 @@ +# LSP1UniversalReceiverDelegateVault + +:::info Standard Specifications + +[`LSP-1-UniversalReceiver`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md) + +::: +:::info Soldity implementation + +[`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) + +::: + +> Implementation of a UniversalReceiverDelegate for the [LSP9Vault] + +The [`LSP1UniversalReceiverDelegateVault`](#lsp1universalreceiverdelegatevault) follows the [LSP-1-UniversalReceiver] standard and is designed for [LSP9Vault] contracts. The [`LSP1UniversalReceiverDelegateVault`](#lsp1universalreceiverdelegatevault) is a contract called by the [`universalReceiver(...)`](#universalreceiver) function of the [LSP-9-Vault] contract that: + +- Writes the data keys representing assets received from type [LSP-7-DigitalAsset] and [LSP-8-IdentifiableDigitalAsset] into the account storage, and removes them when the balance is zero according to the [LSP-5-ReceivedAssets] Standard. + +## Methods + +### supportsInterface + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#supportsinterface) +- Solidity implementation in [**LSP1UniversalReceiverDelegateVault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) +- Function signature: `supportsInterface(bytes4)` +- Function selector: `0x01ffc9a7` + +::: + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool); +``` + +_Achieves the goal of ERC165 to detect supported interfaces and LSP17 by checking if the interfaceId being queried is supported on another linked extension._ + +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`. + +#### Parameters + +| Name | Type | Description | +| ------------- | :------: | ----------- | +| `interfaceId` | `bytes4` | - | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | ----------- | +| `0` | `bool` | - | + +### universalReceiver + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#universalreceiver) +- Solidity implementation in [**LSP1UniversalReceiverDelegateVault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) +- Function signature: `universalReceiver(bytes32,)` +- Function selector: `0x534e72c8` + +::: + +```solidity +function universalReceiver( + bytes32 typeId, + bytes +) external payable returns (bytes result); +``` + +_Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts (UniversalReceiverDelegates) that react on the whole transaction and on the specific typeId, respectively. The notification is achieved by emitting a [`UniversalReceiver`](#universalreceiver) event on the call with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract._ + +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] + `. (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. + +
+ +**Emitted events:** + +- [`ValueReceived`](#valuereceived) when receiving native tokens. +- [`UniversalReceiver`](#universalreceiver) event. + +
+ +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | -------------------------- | +| `typeId` | `bytes32` | The type of call received. | +| `_1` | `bytes` | - | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | ----------- | +| `result` | `bytes` | - | + +## Events + +### UniversalReceiver + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#universalreceiver) +- Solidity implementation in [**LSP1UniversalReceiverDelegateVault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) +- Event signature: `UniversalReceiver(address,uint256,bytes32,bytes,bytes)` +- Event hash: `0x9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c2` + +::: + +```solidity +event UniversalReceiver(address indexed from, uint256 indexed value, bytes32 indexed typeId, bytes receivedData, bytes returnedValue); +``` + +_`from` sent `value` native tokens and a notification using `typeId` and `receivedData`._ + +The event is emitted when `universalReceiver(...)` reacted successfully on all of the following inputs: + +- A valid notifier: `from` + +- A valid amount of native tokens are sent: `value` + +- A supported type ID: `typeId` + +- Arbitrary data which may or may not be used: `receivedData` And returned a valid result: `returnedValue` based on the inputs. + +#### Parameters + +| Name | Type | Description | +| ---------------------- | :-------: | --------------------------------------------------------------- | +| `from` **`indexed`** | `address` | The address calling the {universalReceiver(...)} function. | +| `value` **`indexed`** | `uint256` | The amount sent to the {universalReceiver(...)} function. | +| `typeId` **`indexed`** | `bytes32` | The hash of a specific standard or a hook. | +| `receivedData` | `bytes` | The arbitrary data passed to {universalReceiver(...)} function. | +| `returnedValue` | `bytes` | The value returned by the {universalReceiver(...)} function. | + +## Errors + +### CannotRegisterEOAsAsAssets + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#cannotregistereoasasassets) +- Solidity implementation in [**LSP1UniversalReceiverDelegateVault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) +- Error signature: `CannotRegisterEOAsAsAssets(address)` +- Error hash: `0xa5295345` + +::: + +```solidity +error CannotRegisterEOAsAsAssets(address caller); +``` + +_EOA: `caller` cannot be registered as an asset._ + +Reverts when EOA calls the [`universalReceiver(..)`](#universalreceiver) function with an asset/vault typeId. + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ---------------------- | +| `caller` | `address` | The address of the EOA | + +### InvalidLSP5ReceivedAssetsArrayLength + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#invalidlsp5receivedassetsarraylength) +- Solidity implementation in [**LSP1UniversalReceiverDelegateVault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) +- Error signature: `InvalidLSP5ReceivedAssetsArrayLength(bytes,uint256)` +- Error hash: `0xecba7af8` + +::: + +```solidity +error InvalidLSP5ReceivedAssetsArrayLength( + bytes invalidValueStored, + uint256 invalidValueLength +); +``` + +_The data stored under `LSP5ReceivedAssets[]` Data Key is invalid. Value storred: `invalidValueStored`. Value length: `invalidValueLength`._ + +Reverts when the value stored under the 'LSP5ReceivedAssets[]' data key is not valid. The value stored under this data key should be exactly 16 bytes long. Only possible valid values are: + +- any valid uint128 values i.e. `0x00000000000000000000000000000000` (zero), empty array, no assets received. i.e. `0x00000000000000000000000000000005` (non-zero), 5 array elements, 5 assets received. + +- `0x` (nothing stored under this data key, equivalent to empty array) + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | ------------------------------------------------------------------------------------------------------------- | +| `invalidValueStored` | `bytes` | The invalid value stored under the `LSP5ReceivedAssets[]` data key. | +| `invalidValueLength` | `uint256` | The invalid number of bytes stored under the `LSP5ReceivedAssets[]` data key (MUST be exactly 16 bytes long). | + +### MaxLSP5ReceivedAssetsCountReached + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#maxlsp5receivedassetscountreached) +- Solidity implementation in [**LSP1UniversalReceiverDelegateVault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) +- Error signature: `MaxLSP5ReceivedAssetsCountReached(address)` +- Error hash: `0x0b51a2d0` + +::: + +```solidity +error MaxLSP5ReceivedAssetsCountReached(address notRegisteredAsset); +``` + +_Limit reached. Cannot register more assets. Failed to register: `notRegisteredAsset`._ + +Reverts when the `LSP5ReceivedAssets[]` array reaches its maximum limit (`max(uint128)`). + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | ------------------------------------------------------ | +| `notRegisteredAsset` | `address` | The address of the asset that could not be registered. | + +### NativeTokensNotAccepted + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#nativetokensnotaccepted) +- Solidity implementation in [**LSP1UniversalReceiverDelegateVault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) +- Error signature: `NativeTokensNotAccepted()` +- Error hash: `0x114b721a` + +::: + +```solidity +error NativeTokensNotAccepted(); +``` + +_Cannot send native tokens to [`universalReceiver(...)`](#universalreceiver) function of the delegated contract._ + +Reverts when [`universalReceiver(...)`](#universalreceiver) function in the delegated contract is called with a value different than 0. + +### ReceivedAssetsIndexSuperiorToUint128 + +:::note Links + +- Specification details in [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#receivedassetsindexsuperiortouint128) +- Solidity implementation in [**LSP1UniversalReceiverDelegateVault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) +- Error signature: `ReceivedAssetsIndexSuperiorToUint128(uint256)` +- Error hash: `0xe8a4fba0` + +::: + +```solidity +error ReceivedAssetsIndexSuperiorToUint128(uint256 index); +``` + +_Asset index stored under the `ReceivedAssetsMap` Data Key is invalid. Invalid index: `index`._ + +Reverts when the received assets index is superior to `uint128`. + +#### Parameters + +| Name | Type | Description | +| ------- | :-------: | -------------------------- | +| `index` | `uint256` | The received assets index. | + + + + +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md +[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md +[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md +[LSP-3-UniversalProfile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md +[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md +[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md +[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md +[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md +[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md +[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md +[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md +[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md +[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md +[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md +[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md +[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md +[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md +[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md + + + +[ERC725]: https://docs.lukso.tech/standards/lsp-background/erc725 +[UniversalProfile]: https://docs.lukso.tech/standards/universal-profile/introduction +[LSP0ERC725Account]: https://docs.lukso.tech/standards/universal-profile/lsp0-erc725account +[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver +[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver-delegate +[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/generic-standards/lsp2-json-schema +[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/nft-2.0/LSP4-Digital-Asset-Metadata +[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp5-received-assets +[LSP6KeyManager]: https://docs.lukso.tech/standards/universal-profile/lsp6-key-manager +[LSP7DigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP7-Digital-Asset +[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP8-Identifiable-Digital-Asset +[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp10-received-vaults +[LSP14Ownable2Step]: https://docs.lukso.tech/standards/generic-standards/lsp14-ownable-2-step +[LSP17ContractExtension]: https://docs.lukso.tech/standards/generic-standards/lsp17-contract-extension +[LSP20CallVerification]: https://docs.lukso.tech/standards/generic-standards/lsp20-call-verification + + + +[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725.sol +[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Init.sol +[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725InitAbstract +[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725X.sol +[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInit.sol +[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInitAbstract.sol +[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725Y.sol +[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInit.sol +[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInitAbstract.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165.sol +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/proxy/utils/Initializable.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/EnumerableSet.sol +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YCore.sol +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XCore.sol +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/custom/OwnableUnset.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol + + + +[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Utils.sol +[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Constants.sol +[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInitAbstract.sol +[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfile.sol +[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInit.sol +[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Utils.sol +[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Constants.sol +[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Errors.sol +[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/ontracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +[`LSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +[`ILSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Utils.sol +[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Constants.sol +[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/ILSP6KeyManager.sol +[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Errors.sol +[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol +[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManager.sol +[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +[`LSP7DigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +[`LSP7CompatibleERC20InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +[`LSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +[`LSP7CompatibleERC20MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +[`LSP7CompatibleERC20Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Errors.sol +[`LSP7CompatibleERC20MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +[`ILSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Constants.sol +[`LSP8IdentifiableDigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +[`LSP8CompatibleERC721InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +[`LSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +[`ILSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +[`LSP8CompatibleERC721MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.s +[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +[`LSP8CompatibleERC721Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +[`LSP8CompatibleERC721MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.s +[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Constants.sol +[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Errors.sol +[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extendable.sol +[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extension.sol +[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Constants.sol +[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Errors.sol +[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Utils.sol +[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20CallVerification.sol +[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/ILSP20CallVerifier.sol +[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Constants.sol +[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Errors.sol +[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +[`generateArrayElementKeyAtIndex(bytes32,uint128)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L48 +[`generateMappingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L108 +[`generateMappingWithGroupingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L165 +[`isCompactBytesArray(bytes)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L288 +[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Utils.sol +[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Constants.sol +[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Utils.sol +[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Constants.sol + + diff --git a/docs/contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md b/docs/contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md index 843ed45e55..7dc59dd593 100644 --- a/docs/contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md +++ b/docs/contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md @@ -352,3 +352,173 @@ error LSP4TokenSymbolNotEditable(); ``` Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. + + + + +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md +[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md +[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md +[LSP-3-UniversalProfile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md +[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md +[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md +[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md +[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md +[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md +[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md +[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md +[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md +[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md +[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md +[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md +[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md +[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md +[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md + + + +[ERC725]: https://docs.lukso.tech/standards/lsp-background/erc725 +[UniversalProfile]: https://docs.lukso.tech/standards/universal-profile/introduction +[LSP0ERC725Account]: https://docs.lukso.tech/standards/universal-profile/lsp0-erc725account +[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver +[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver-delegate +[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/generic-standards/lsp2-json-schema +[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/nft-2.0/LSP4-Digital-Asset-Metadata +[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp5-received-assets +[LSP6KeyManager]: https://docs.lukso.tech/standards/universal-profile/lsp6-key-manager +[LSP7DigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP7-Digital-Asset +[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP8-Identifiable-Digital-Asset +[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp10-received-vaults +[LSP14Ownable2Step]: https://docs.lukso.tech/standards/generic-standards/lsp14-ownable-2-step +[LSP17ContractExtension]: https://docs.lukso.tech/standards/generic-standards/lsp17-contract-extension +[LSP20CallVerification]: https://docs.lukso.tech/standards/generic-standards/lsp20-call-verification + + + +[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725.sol +[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Init.sol +[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725InitAbstract +[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725X.sol +[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInit.sol +[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInitAbstract.sol +[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725Y.sol +[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInit.sol +[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInitAbstract.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165.sol +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/proxy/utils/Initializable.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/EnumerableSet.sol +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YCore.sol +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XCore.sol +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/custom/OwnableUnset.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol + + + +[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Utils.sol +[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Constants.sol +[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInitAbstract.sol +[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfile.sol +[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInit.sol +[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Utils.sol +[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Constants.sol +[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Errors.sol +[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/ontracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +[`LSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +[`ILSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Utils.sol +[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Constants.sol +[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/ILSP6KeyManager.sol +[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Errors.sol +[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol +[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManager.sol +[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +[`LSP7DigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +[`LSP7CompatibleERC20InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +[`LSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +[`LSP7CompatibleERC20MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +[`LSP7CompatibleERC20Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Errors.sol +[`LSP7CompatibleERC20MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +[`ILSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Constants.sol +[`LSP8IdentifiableDigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +[`LSP8CompatibleERC721InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +[`LSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +[`ILSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +[`LSP8CompatibleERC721MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.s +[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +[`LSP8CompatibleERC721Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +[`LSP8CompatibleERC721MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.s +[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Constants.sol +[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Errors.sol +[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extendable.sol +[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extension.sol +[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Constants.sol +[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Errors.sol +[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Utils.sol +[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20CallVerification.sol +[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/ILSP20CallVerifier.sol +[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Constants.sol +[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Errors.sol +[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +[`generateArrayElementKeyAtIndex(bytes32,uint128)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L48 +[`generateMappingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L108 +[`generateMappingWithGroupingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L165 +[`isCompactBytesArray(bytes)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L288 +[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Utils.sol +[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Constants.sol +[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Utils.sol +[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Constants.sol + + diff --git a/docs/contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md b/docs/contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md index 29bf95eb3f..54b0263a55 100644 --- a/docs/contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md +++ b/docs/contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md @@ -1049,3 +1049,173 @@ error LSP7TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. <br/> + + + + +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md +[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md +[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md +[LSP-3-UniversalProfile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md +[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md +[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md +[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md +[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md +[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md +[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md +[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md +[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md +[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md +[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md +[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md +[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md +[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md +[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md + + + +[ERC725]: https://docs.lukso.tech/standards/lsp-background/erc725 +[UniversalProfile]: https://docs.lukso.tech/standards/universal-profile/introduction +[LSP0ERC725Account]: https://docs.lukso.tech/standards/universal-profile/lsp0-erc725account +[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver +[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver-delegate +[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/generic-standards/lsp2-json-schema +[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/nft-2.0/LSP4-Digital-Asset-Metadata +[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp5-received-assets +[LSP6KeyManager]: https://docs.lukso.tech/standards/universal-profile/lsp6-key-manager +[LSP7DigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP7-Digital-Asset +[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP8-Identifiable-Digital-Asset +[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp10-received-vaults +[LSP14Ownable2Step]: https://docs.lukso.tech/standards/generic-standards/lsp14-ownable-2-step +[LSP17ContractExtension]: https://docs.lukso.tech/standards/generic-standards/lsp17-contract-extension +[LSP20CallVerification]: https://docs.lukso.tech/standards/generic-standards/lsp20-call-verification + + + +[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725.sol +[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Init.sol +[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725InitAbstract +[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725X.sol +[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInit.sol +[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInitAbstract.sol +[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725Y.sol +[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInit.sol +[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInitAbstract.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165.sol +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/proxy/utils/Initializable.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/EnumerableSet.sol +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YCore.sol +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XCore.sol +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/custom/OwnableUnset.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol + + + +[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Utils.sol +[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Constants.sol +[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInitAbstract.sol +[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfile.sol +[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInit.sol +[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Utils.sol +[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Constants.sol +[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Errors.sol +[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/ontracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +[`LSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +[`ILSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Utils.sol +[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Constants.sol +[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/ILSP6KeyManager.sol +[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Errors.sol +[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol +[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManager.sol +[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +[`LSP7DigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +[`LSP7CompatibleERC20InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +[`LSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +[`LSP7CompatibleERC20MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +[`LSP7CompatibleERC20Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Errors.sol +[`LSP7CompatibleERC20MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +[`ILSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Constants.sol +[`LSP8IdentifiableDigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +[`LSP8CompatibleERC721InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +[`LSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +[`ILSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +[`LSP8CompatibleERC721MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.s +[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +[`LSP8CompatibleERC721Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +[`LSP8CompatibleERC721MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.s +[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Constants.sol +[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Errors.sol +[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extendable.sol +[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extension.sol +[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Constants.sol +[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Errors.sol +[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Utils.sol +[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20CallVerification.sol +[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/ILSP20CallVerifier.sol +[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Constants.sol +[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Errors.sol +[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +[`generateArrayElementKeyAtIndex(bytes32,uint128)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L48 +[`generateMappingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L108 +[`generateMappingWithGroupingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L165 +[`isCompactBytesArray(bytes)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L288 +[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Utils.sol +[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Constants.sol +[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Utils.sol +[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Constants.sol + + From eb7121c1fae43b05fbc3f7ff6f4e5774da920533 Mon Sep 17 00:00:00 2001 From: Bianca Date: Thu, 6 Jul 2023 23:26:43 +0200 Subject: [PATCH 04/12] Committer: Bianca --- docs/guides/browser-extension/install-browser-extension.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/guides/browser-extension/install-browser-extension.md b/docs/guides/browser-extension/install-browser-extension.md index 10e066cf2e..f49aafa928 100644 --- a/docs/guides/browser-extension/install-browser-extension.md +++ b/docs/guides/browser-extension/install-browser-extension.md @@ -18,6 +18,8 @@ The current UP Browser Extenstion deploys profiles on the [Testnet](http://docs. :::note If you have **MetaMask** installed, _right click on both_ MetaMask and UP Extension and select _"This Can Read and Change Site Data > When you Click the Extension"_. Then you you can select for every website which extension you use. By closing the tab you can reset this selection. +It is important not to forget the previous step. Otherwise, it might conflict with the UP Browser Extension, and this might prevent you from finalizing the setup process. + ::: From 47961ed7f9996e7cb591e6ea463eaa2d863b9dcb Mon Sep 17 00:00:00 2001 From: b00ste Date: Fri, 7 Jul 2023 12:57:46 +0300 Subject: [PATCH 05/12] Add redirects and update local links --- docs/contracts/introduction.md | 4 +- .../set-default-implementation.md | 2 +- docs/guides/vault/edit-vault-data.md | 2 +- .../lsp1-universal-receiver-delegate.md | 2 +- .../lsp1-universal-receiver-delegate-up.md | 75 ------------------- .../lsp1-universal-receiver-delegate-vault.md | 67 ----------------- docs/standards/smart-contracts/lsp9-vault.md | 2 +- .../universal-profile/introduction.md | 2 +- .../lsp10-received-vaults.md | 4 +- .../universal-profile/lsp5-received-assets.md | 3 +- .../standards/universal-profile/lsp9-vault.md | 2 +- docusaurus.config.js | 12 ++- 12 files changed, 20 insertions(+), 157 deletions(-) delete mode 100644 docs/standards/smart-contracts/lsp1-universal-receiver-delegate-up.md delete mode 100644 docs/standards/smart-contracts/lsp1-universal-receiver-delegate-vault.md diff --git a/docs/contracts/introduction.md b/docs/contracts/introduction.md index 5b2ecdcc77..6c03b846b5 100644 --- a/docs/contracts/introduction.md +++ b/docs/contracts/introduction.md @@ -64,7 +64,7 @@ Some of the LSP standards do not have a contract implementation as they represen The **Universal Profile** contracts allow a better representation of the identity on the blockchain and better control over it. - **[LSP0ERC725Account](../standards/smart-contracts/lsp0-erc725-account.md)**: a contract that can be used as an account and represents an **identity on-chain**. -- **[LSP1UniversalReceiverDelegateUP](../standards/smart-contracts/lsp1-universal-receiver-delegate-up.md)**: a contract that allows the account to react to the calls that it receives (Normal transaction, Token transfer, Vaults transfer, etc.). +- **[LSP1UniversalReceiverDelegateUP](./contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md)**: a contract that allows the account to react to the calls that it receives (Normal transaction, Token transfer, Vaults transfer, etc.). - **[LSP6KeyManager](../standards/smart-contracts/lsp6-key-manager.md)**: a contract that allows **multi-control** over the account using different permissions. - **LSP11BasicSocialRecovery** @@ -81,7 +81,7 @@ The **Digital Asset (Token and NFT 2.0)** contracts are the newest advanced vers These contracts are not just related to one specific section and could be used with the **Universal Profile**, **Digital Asset**, and **NFT 2.0** contracts. - **[LSP9Vault](../standards/smart-contracts/lsp9-vault.md)**: a contract representing a **Vault** able to execute and hold assets could be owned by an LSP0ERC725Account contract. -- **[LSP1UniversalReceiverDelegateVault](../standards/smart-contracts/lsp1-universal-receiver-delegate-vault.md)**: a contract that allows the vault to react to the calls it receives (Normal transaction, Token transfer, etc.). +- **[LSP1UniversalReceiverDelegateVault](./contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md)**: a contract that allows the vault to react to the calls it receives (Normal transaction, Token transfer, etc.). - **LSP14Ownable2Step** - **LSP17ContractExtension** - **LSP20CallVerification** diff --git a/docs/guides/universal-receiver-delegate/set-default-implementation.md b/docs/guides/universal-receiver-delegate/set-default-implementation.md index 7bb70da9ea..fa0e9ea996 100644 --- a/docs/guides/universal-receiver-delegate/set-default-implementation.md +++ b/docs/guides/universal-receiver-delegate/set-default-implementation.md @@ -14,7 +14,7 @@ Users deploying their Universal Profiles using the guides that utilize **[lsp-fa ::: -This guide will teach you how to deploy and set the default implementation of the **[Universal Receiver Delegate](../../standards/smart-contracts/lsp1-universal-receiver-delegate-up.md)** (URD) used by the Universal Profile. This contract will register the addresses of the **[received assets](../../standards/universal-profile/lsp5-received-assets.md)** and **[vaults](../../standards/universal-profile/lsp10-received-vaults.md)** and will remove them on a balance equal to 0. This contract requires the [**`SUPER_SETDATA` Permission**](../../standards/universal-profile/lsp6-key-manager.md#super-permissions) to interact with the profile through the KeyManager. +This guide will teach you how to deploy and set the default implementation of the **[Universal Receiver Delegate](../../contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md)** (URD) used by the Universal Profile. This contract will register the addresses of the **[received assets](../../standards/universal-profile/lsp5-received-assets.md)** and **[vaults](../../standards/universal-profile/lsp10-received-vaults.md)** and will remove them on a balance equal to 0. This contract requires the [**`SUPER_SETDATA` Permission**](../../standards/universal-profile/lsp6-key-manager.md#super-permissions) to interact with the profile through the KeyManager. ![UniversalReceiverDelegate setting data keys on profile](/img/standards/lsp1delegate/token-transfer-4.jpg) diff --git a/docs/guides/vault/edit-vault-data.md b/docs/guides/vault/edit-vault-data.md index 74c1358921..213fee9b23 100644 --- a/docs/guides/vault/edit-vault-data.md +++ b/docs/guides/vault/edit-vault-data.md @@ -8,7 +8,7 @@ import TabItem from '@theme/TabItem'; # Edit Vault Data -This guide will teach you how to set data to an **[LSP9Vault](../../standards/smart-contracts/lsp9-vault.md)** contract through a UniversalProfile owned by an LSP6KeyManager. Any data can be attached to the vault, and since it supports the **[LSP1-UniversalReceiver](../../standards/generic-standards/lsp1-universal-receiver.md)** standard, we will set the [**Universal Receiver Delegate**](../../standards/smart-contracts/lsp1-universal-receiver-delegate-vault.md) address inside the storage. +This guide will teach you how to set data to an **[LSP9Vault](../../standards/smart-contracts/lsp9-vault.md)** contract through a UniversalProfile owned by an LSP6KeyManager. Any data can be attached to the vault, and since it supports the **[LSP1-UniversalReceiver](../../standards/generic-standards/lsp1-universal-receiver.md)** standard, we will set the [**Universal Receiver Delegate**](../../contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md) address inside the storage. ## Setting Data (Universal Receiver Delegate) diff --git a/docs/standards/generic-standards/lsp1-universal-receiver-delegate.md b/docs/standards/generic-standards/lsp1-universal-receiver-delegate.md index e3cea779d9..7a7a91ee4f 100644 --- a/docs/standards/generic-standards/lsp1-universal-receiver-delegate.md +++ b/docs/standards/generic-standards/lsp1-universal-receiver-delegate.md @@ -63,7 +63,7 @@ In summary, delegation provides a flexible way for smart contracts to handle and ## Implementations -There are several implementations of the standard. The **[LSP1UniversalReceiverDelegateUP](../smart-contracts/lsp1-universal-receiver-delegate-up.md)** contract is one of them and is used as a delegate to the `universalReceiver(...)` function of **UniversalProfile** contract. +There are several implementations of the standard. The **[LSP1UniversalReceiverDelegateUP](../../contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/)** contract is one of them and is used as a delegate to the `universalReceiver(...)` function of **UniversalProfile** contract. At the moment, this contract allows to: diff --git a/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-up.md b/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-up.md deleted file mode 100644 index 2fa3254759..0000000000 --- a/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-up.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: LSP1UniversalReceiverDelegateUP -sidebar_position: 5 ---- - -# LSP1UniversalReceiverDelegateUP - -:::info Solidity contract - -[`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) - -::: - -The **LSP1UniversalReceiverDelegateUP** is a contract called by the **[`universalReceiver(...)`](./lsp0-erc725-account.md#universalreceiver)** function of the **[LSP0ERC725Account](./lsp0-erc725-account.md)** contract that: - -- Writes the data keys representing assets received from type **[LSP7-DigitalAsset](../../contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md)** and **[LSP8-IdentifiableDigitalAsset](./lsp8-identifiable-digital-asset.md)** into the account storage, and removes them when the balance is zero according to the **[LSP5-ReceivedAssets Standard](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-5-ReceivedAssets.md)**. - -- Writes the data keys representing the owned vaults from type **[LSP9-Vault](./lsp9-vault.md)** into your account storage, and removes them when **transferring ownership** to other accounts according to the **[LSP10-ReceivedVaults Standard](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-5-ReceivedAssets.md)**. - -The following two requirements are required to execute the logic above correctly: - -1. The owner of the **LSP0ERC725Account** contract should be a contract allowing the UniversalReceiverDelegate to call `setDataBatch(..)` function. - -For example, in the case of having the **LSP6KeyManager** as owner of the **LSP0ERC725Account**: - -The **LSP1UniversalReceiverDelegateUP** contract should be granted the **[`SUPER_SETDATA`](../universal-profile/lsp6-key-manager.md#permission-values)** and **[`REENTRANCY`](../universal-profile/lsp6-key-manager.md#permission-values)** permission on the account (otherwise, the transaction will not pass and will not write any data keys to the storage). - -:::note -_LSP1UniversalReceiverDelegateUP contract also contains the methods from the [ERC165 Standard](https://eips.ethereum.org/EIPS/eip-165):_ - -```solidity -function supportsInterface(bytes4 interfaceId) public view returns (bool) -``` - -::: - -## Functions - -### universalReceiver - -```solidity -function universalReceiver( - bytes32 typeId, - bytes memory data -) public payable returns (bytes memory result) -``` - -Writes the data keys of the received **LSP7DigitalAsset**, **LSP8IdentifiableDigitalAsset**, and **LSP9Vault** contract addresses into the account storage according to the **LSP5ReceivedAssets** and **LSP10-ReceivedVaults** Standard. - -The data keys representing an asset/vault are cleared when the asset/vault is no longer owned by the account. - -In case when the data registered is corrupted such as not stored correctly with standard length (LSP5ReceivedAssets), or when the token received is already registered or when the token being sent is not sent as full balance, the **LSP1UniversalReceiverDelegateUP** will pass and return and not modify any data key on the account. - -#### Parameters: - -| Name | Type | Description | -| :------- | :-------- | :--------------------------------------------------------------------------- | -| `typeId` | `bytes32` | The token hooks of the contract. | -| `data` | `bytes` | The data that is associated with the asset or vault transfer (concatenated). | - -> **Note:** if the function is called by LSP0's [`universalReceiver(...)`](./lsp0-erc725-account.md#universalreceiver) function, it will receives the following **extra calldata**: -> -> - `bytes20 caller`: The token's or vault's smart contract address. -> - `bytes32 value`: The amount of value sent to the universalReceiver function. - -#### Return Values: - -| Name | Type | Description | -| :------- | :------ | :---------------------------------------------------------------------------------------------------------------- | -| `result` | `bytes` | The value that is returned by the **Key Manager**'s **[`execute(...)`](./lsp6-key-manager.md#execute)** function. | - -## References - -- [LUKSO Standards Proposals: LSP1 - Universal Receiver (Standard Specification, GitHub)](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md) -- [LSP1 Universal Receiver: Solidity implementations (GitHub)](https://github.com/lukso-network/lsp-universalprofile-smart-contracts/tree/develop/contracts/LSP1UniversalReceiver) diff --git a/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-vault.md b/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-vault.md deleted file mode 100644 index 45d8440e26..0000000000 --- a/docs/standards/smart-contracts/lsp1-universal-receiver-delegate-vault.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: LSP1UniversalReceiverDelegateVault -sidebar_position: 6 ---- - -# LSP1UniversalReceiverDelegateVault - -:::info Solidity contract - -[`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) - -::: - -The **LSP1UniversalReceiverDelegateVault** is a contract called by the **[`universalReceiver(...)`](./lsp9-vault.md#universalreceiver)** function of the **[LSP9Vault](./lsp9-vault.md)** contract that: - -- Writes the data keys representing assets received from type **[LSP7-DigitalAsset](../../contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md)** and **[LSP8-IdentifiableDigitalAsset](./lsp8-identifiable-digital-asset.md)** into the account storage, and removes them when the balance is zero according to the **[LSP5-ReceivedAssets Standard](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-5-ReceivedAssets.md)**. - -The requirements stated in the **[LSP1UniversalReceiverDelegateUP](./lsp1-universal-receiver-delegate-up.md)** contract doesn't apply in this contract to execute the logic above correctly, as the address registred under the [LSP1UniversalReceiverDelegate](../generic-standards/lsp1-universal-receiver.md/#extension) data key has write access to the storage on the LSP9Vault. - -:::note -_LSP1UniversalReceiverDelegateVault contract also contains the methods from the [ERC165 Standard](https://eips.ethereum.org/EIPS/eip-165):_ - -```solidity -function supportsInterface(bytes4 interfaceId) public view returns (bool) -``` - -::: - -## Functions - -### universalReceiverDelegate - -```solidity -function universalReceiver( - bytes32 typeId, - bytes memory data -) public payable returns (bytes memory result) -``` - -Writes the received **LSP7-DigitalAsset** or **LSP8-IdentifiableDigitalAsset** assets into the vault storage according to the **LSP5-ReceivedAssets** standard. - -:::note -The data key representing an **asset** is cleared when the asset is not owned by the vault anymore. -::: - -#### Parameters: - -| Name | Type | Description | -| :------- | :-------- | :--------------------------------------------------------------------------- | -| `typeId` | `bytes32` | The token hooks of the contract. | -| `data` | `bytes` | The data that is associated with the asset or vault transfer (concatenated). | - -> **Note:** if the function is called by LSP9's [`universalReceiver(...)`](./lsp9-vault.md#universalReceiver) function, it will receives the following **extra calldata**: -> -> - `bytes20 caller`: The token's or vault's smart contract address. -> - `bytes32 value`: The amount of value sent to the universalReceiver function. - -#### Return Values: - -| Name | Type | Description | -| :------- | :---- | :---------- | -| `result` | bytes | Empty bytes | - -## References - -- [LUKSO Standards Proposals: LSP1 - Universal Receiver (Standard Specification, GitHub)](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md) -- [LSP1 Universal Receiver: Solidity implementations (GitHub)](https://github.com/lukso-network/lsp-universalprofile-smart-contracts/tree/develop/contracts/LSP1UniversalReceiver) diff --git a/docs/standards/smart-contracts/lsp9-vault.md b/docs/standards/smart-contracts/lsp9-vault.md index cd341aff64..49e2ea704d 100644 --- a/docs/standards/smart-contracts/lsp9-vault.md +++ b/docs/standards/smart-contracts/lsp9-vault.md @@ -323,7 +323,7 @@ function universalReceiver( ``` Forwards the call to the **UniversalReceiverDelegate** contract if its address is stored at the [LSP1UniversalReceiverDelegate](../generic-standards/lsp1-universal-receiver.md#extension) data Key. -The contract being called is expected to be an **[LSP1UniversalReceiverDelegateVault](./lsp1-universal-receiver-delegate-vault.md)**, supporting [LSP1UniversalReceiverDelegate InterfaceId](../../contracts/interface-ids.md) using ERC165. +The contract being called is expected to be an **[LSP1UniversalReceiverDelegateVault](../../contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md)**, supporting [LSP1UniversalReceiverDelegate InterfaceId](../../contracts/interface-ids.md) using ERC165. _Triggers the **[UniversalReceiver](#universalreceiver-1)** event when this function gets successfully executed._ diff --git a/docs/standards/universal-profile/introduction.md b/docs/standards/universal-profile/introduction.md index dd69f35a53..316095588c 100644 --- a/docs/standards/universal-profile/introduction.md +++ b/docs/standards/universal-profile/introduction.md @@ -30,7 +30,7 @@ The diagram below shows the standard architecture used by LUKSO for Universal Pr | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ![LSP0-ERC725Account](/img/standards/lsp0/lsp0-erc725account-contract.jpeg) | **[LSP0 - ERC725Account](./lsp0-erc725account.md)**: This standard represents the core account contract. It consists of [ERC725X](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x), allowing a contract to interact with any address or smart contract on the blockchain, and [ERC725Y](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725y), a generic key-value store that allows storing an unlimited amount of data in the smart contract. It also contains [ERC1271](https://eips.ethereum.org/EIPS/eip-1271) to verify if messages were signed by the ERC725Account's owner. If the owner is a Key Manager supporting ERC1271, it will delegate the call to the KeyManager. Lastly, it contains the [LSP1 - UniversalReceiver](../generic-standards/lsp1-universal-receiver.md), which allows this contract to be notified of any incoming asset. Using the [LSP1 - UniversalReceiverDelegate](../generic-standards/lsp1-universal-receiver-delegate.md) logic, you can delegate the universal receiver call that an asset will do to an external contract, customizing the behaviour you want towards the asset. More on that below. | | ![LSP6-KeyManager](/img/standards/lsp6/lsp6-key-manager-contract.jpeg) | **[LSP6 - KeyManager](./lsp6-key-manager.md)**: A standard representing a smart contract that can act as the owner of an [LSP0 - ERC725Account](./lsp0-erc725account.md). It reads permissions of addresses from the ERC725Account's key-value store, and restricts access based on these permissions. Transactions can be executed directly by permissioned users or by anyone with the help of a signed message by permissioned users. | -| ![LSP1 - UniversalReceiverDelegate](/img/standards/lsp1delegate/lsp1-universal-receiver-delegate-contract.jpeg) | **[LSP1 - UniversalReceiverDelegate](../generic-standards/lsp1-universal-receiver-delegate.md)**: By setting the **[`LSP1 - UniversalReceiverDelegate`](../generic-standards/lsp1-universal-receiver#extension)** data key in your ERC725Account to a contract address, you can delegate any call to the `universalReceiver(...)` function of the account to this contract, which allows you to revert on certain incoming assets or add other logic. The [standard **LSP1 - UniversalReceiverDelegate** implementation](../smart-contracts/lsp1-universal-receiver-delegate-up.md) will write every [LSP7 and LSP8](../nft-2.0/introduction.md) asset you receive into your ERC725Account using the [LSP5 - ReceivedAsset](./lsp5-received-assets.md) standard. This allows any interface to list all token contracts that hold a balance of your account, right from the smart contract. | +| ![LSP1 - UniversalReceiverDelegate](/img/standards/lsp1delegate/lsp1-universal-receiver-delegate-contract.jpeg) | **[LSP1 - UniversalReceiverDelegate](../generic-standards/lsp1-universal-receiver-delegate.md)**: By setting the **[`LSP1 - UniversalReceiverDelegate`](../generic-standards/lsp1-universal-receiver#extension)** data key in your ERC725Account to a contract address, you can delegate any call to the `universalReceiver(...)` function of the account to this contract, which allows you to revert on certain incoming assets or add other logic. The [standard **LSP1 - UniversalReceiverDelegate** implementation](../../contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md) will write every [LSP7 and LSP8](../nft-2.0/introduction.md) asset you receive into your ERC725Account using the [LSP5 - ReceivedAsset](./lsp5-received-assets.md) standard. This allows any interface to list all token contracts that hold a balance of your account, right from the smart contract. | :::note diff --git a/docs/standards/universal-profile/lsp10-received-vaults.md b/docs/standards/universal-profile/lsp10-received-vaults.md index e815a12d82..742deaec15 100644 --- a/docs/standards/universal-profile/lsp10-received-vaults.md +++ b/docs/standards/universal-profile/lsp10-received-vaults.md @@ -25,7 +25,6 @@ Make sure to understand the **[ERC725Y Generic Key/Value Store](../lsp-backgroun ::: - This Metadata standard describes two data keys that can be added to an [ERC725Y](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md) smart contract to keep track of received and owned [LSP9-Vaults](./lsp9-vault.md). ### `LSP10Vaults[]` @@ -42,7 +41,6 @@ This data key represents a list of all the vaults owned by the contract. } ``` - :::tip Recommendation It is recommended to query the **`LSP10Vaults[]`** data key to check if a smart contract supports the **[LSP10 - ReceivedVaults](./lsp10-received-vaults.md)** standard. @@ -76,7 +74,7 @@ The data keys are also set on the **sender's Universal Profile** to remove the v ::: -If set when transferring vaults, these data keys are automatically updated in the UniversalProfile storage via the [LSP1UniversalReceiverDelegateUP](../smart-contracts/lsp1-universal-receiver-delegate-up.md) contract. +If set when transferring vaults, these data keys are automatically updated in the UniversalProfile storage via the [LSP1UniversalReceiverDelegateUP](../../contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md) contract. ![Vault transfer detailed flow](/img/standards/lsp10/detailed-vault-transfer.jpeg) diff --git a/docs/standards/universal-profile/lsp5-received-assets.md b/docs/standards/universal-profile/lsp5-received-assets.md index 23591eaccc..9ca7f7b9b7 100644 --- a/docs/standards/universal-profile/lsp5-received-assets.md +++ b/docs/standards/universal-profile/lsp5-received-assets.md @@ -25,7 +25,6 @@ Make sure to understand the **[ERC725Y Generic Key/Value Store](../lsp-backgroun ::: - This Metadata standard describes two data keys that can be added to an [ERC725Y](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725y) smart contract to reference and keep track of received assets. ### `LSP5ReceivedAssets[]` @@ -75,7 +74,7 @@ The data keys are also set on the **sender Universal Profile** to remove the tok ::: -If set when transferring tokens, these data keys are automatically updated in the Universal Profile storage via the [LSP1UniversalReceiverDelegateUP](../smart-contracts/lsp1-universal-receiver-delegate-up.md) contract. +If set when transferring tokens, these data keys are automatically updated in the Universal Profile storage via the [LSP1UniversalReceiverDelegateUP](../../contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md) contract. :::note Check the [token transfer scenario](../generic-standards/lsp1-universal-receiver-delegate#token-transfer-scenario) for more details. diff --git a/docs/standards/universal-profile/lsp9-vault.md b/docs/standards/universal-profile/lsp9-vault.md index 3ba2c13a42..a4a5614cfe 100644 --- a/docs/standards/universal-profile/lsp9-vault.md +++ b/docs/standards/universal-profile/lsp9-vault.md @@ -56,7 +56,7 @@ See the **[LSP1-UniversalReceiver](../generic-standards/lsp1-universal-receiver. :::caution -The implementation of the **UniversalReceiverDelegate** used by the Universal Profile is different from the one used by the vault. Check [LSP1UniversalReceiverDelegateVault](../smart-contracts/lsp1-universal-receiver-delegate-vault.md) +The implementation of the **UniversalReceiverDelegate** used by the Universal Profile is different from the one used by the vault. Check [LSP1UniversalReceiverDelegateVault](../../contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md) ::: diff --git a/docusaurus.config.js b/docusaurus.config.js index 452bfa8d3c..a357bd9951 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -91,13 +91,21 @@ module.exports = { to: '/contracts/interface-ids', }, { - from: '/standards/smart-contracts/lsp7-digital-assets', - to: '/contracts/contracts/LSP7DigitalAsset', + from: '/standards/smart-contracts/lsp1-universal-receiver-delegate-up', + to: '/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP', + }, + { + from: '/standards/smart-contracts/lsp1-universal-receiver-delegate-vault', + to: '/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault', }, { from: '/standards/smart-contracts/lsp4-digital-asset-metadata', to: '/contracts/contracts/LSP4DigitalAssetMetadata', }, + { + from: '/standards/smart-contracts/lsp7-digital-assets', + to: '/contracts/contracts/LSP7DigitalAsset', + }, ], }, ], From 2ecad21af0f027d8ee5f32df52a864396c24bc1f Mon Sep 17 00:00:00 2001 From: b00ste Date: Fri, 7 Jul 2023 13:34:53 +0300 Subject: [PATCH 06/12] Update global links --- docs/contracts/_links.md | 4 - .../LSP1UniversalReceiverDelegateUP.md | 5 +- .../LSP1UniversalReceiverDelegateVault.md | 5 +- .../LSP4DigitalAssetMetadata.md | 5 +- .../LSP7DigitalAsset/LSP7DigitalAsset.md | 5 +- .../LSP8IdentifiableDigitalAsset.md | 167 ++++++++++++++++++ 6 files changed, 171 insertions(+), 20 deletions(-) diff --git a/docs/contracts/_links.md b/docs/contracts/_links.md index 70c20a551a..9ec8becf45 100644 --- a/docs/contracts/_links.md +++ b/docs/contracts/_links.md @@ -158,10 +158,6 @@ [`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Constants.sol [`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Errors.sol [`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol -[`generateArrayElementKeyAtIndex(bytes32,uint128)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L48 -[`generateMappingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L108 -[`generateMappingWithGroupingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L165 -[`isCompactBytesArray(bytes)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L288 [`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Utils.sol [`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Constants.sol [`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Utils.sol diff --git a/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md b/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md index aa84d11667..742c1e5ed9 100644 --- a/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md +++ b/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md @@ -358,6 +358,7 @@ Reverts when the vault index is superior to `uint128`. | Name | Type | Description | | ------- | :-------: | ---------------- | | `index` | `uint256` | The vault index. | + @@ -518,10 +519,6 @@ Reverts when the vault index is superior to `uint128`. [`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Constants.sol [`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Errors.sol [`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol -[`generateArrayElementKeyAtIndex(bytes32,uint128)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L48 -[`generateMappingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L108 -[`generateMappingWithGroupingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L165 -[`isCompactBytesArray(bytes)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L288 [`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Utils.sol [`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Constants.sol [`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Utils.sol diff --git a/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md b/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md index 9c39311c88..41c4faeec5 100644 --- a/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md +++ b/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md @@ -273,6 +273,7 @@ Reverts when the received assets index is superior to `uint128`. | Name | Type | Description | | ------- | :-------: | -------------------------- | | `index` | `uint256` | The received assets index. | + @@ -433,10 +434,6 @@ Reverts when the received assets index is superior to `uint128`. [`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Constants.sol [`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Errors.sol [`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol -[`generateArrayElementKeyAtIndex(bytes32,uint128)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L48 -[`generateMappingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L108 -[`generateMappingWithGroupingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L165 -[`isCompactBytesArray(bytes)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L288 [`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Utils.sol [`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Constants.sol [`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Utils.sol diff --git a/docs/contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md b/docs/contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md index 7dc59dd593..e8a0e90a52 100644 --- a/docs/contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md +++ b/docs/contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md @@ -352,6 +352,7 @@ error LSP4TokenSymbolNotEditable(); ``` Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. + @@ -512,10 +513,6 @@ Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital ass [`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Constants.sol [`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Errors.sol [`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol -[`generateArrayElementKeyAtIndex(bytes32,uint128)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L48 -[`generateMappingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L108 -[`generateMappingWithGroupingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L165 -[`isCompactBytesArray(bytes)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L288 [`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Utils.sol [`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Constants.sol [`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Utils.sol diff --git a/docs/contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md b/docs/contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md index 54b0263a55..016a3eb5b7 100644 --- a/docs/contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md +++ b/docs/contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md @@ -1049,6 +1049,7 @@ error LSP7TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. <br/> + @@ -1209,10 +1210,6 @@ reverts when trying to authorize or revoke the token's owner as an operator. [`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Constants.sol [`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Errors.sol [`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol -[`generateArrayElementKeyAtIndex(bytes32,uint128)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L48 -[`generateMappingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L108 -[`generateMappingWithGroupingKey(bytes10,bytes20)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L165 -[`isCompactBytesArray(bytes)`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol#L288 [`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Utils.sol [`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Constants.sol [`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Utils.sol diff --git a/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md index b6cc27c78e..5ff7213710 100644 --- a/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md +++ b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md @@ -966,3 +966,170 @@ error LSP8TokenOwnerCannotBeOperator(); ``` reverts when trying to authorize or revoke the token's owner as an operator. + + + + + +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md +[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md +[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md +[LSP-3-UniversalProfile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md +[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md +[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md +[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md +[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md +[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md +[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md +[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md +[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md +[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md +[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md +[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md +[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md +[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md +[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md + + + +[ERC725]: https://docs.lukso.tech/standards/lsp-background/erc725 +[UniversalProfile]: https://docs.lukso.tech/standards/universal-profile/introduction +[LSP0ERC725Account]: https://docs.lukso.tech/standards/universal-profile/lsp0-erc725account +[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver +[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver-delegate +[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/generic-standards/lsp2-json-schema +[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/nft-2.0/LSP4-Digital-Asset-Metadata +[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp5-received-assets +[LSP6KeyManager]: https://docs.lukso.tech/standards/universal-profile/lsp6-key-manager +[LSP7DigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP7-Digital-Asset +[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP8-Identifiable-Digital-Asset +[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp10-received-vaults +[LSP14Ownable2Step]: https://docs.lukso.tech/standards/generic-standards/lsp14-ownable-2-step +[LSP17ContractExtension]: https://docs.lukso.tech/standards/generic-standards/lsp17-contract-extension +[LSP20CallVerification]: https://docs.lukso.tech/standards/generic-standards/lsp20-call-verification + + + +[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725.sol +[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Init.sol +[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725InitAbstract +[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725X.sol +[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInit.sol +[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInitAbstract.sol +[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725Y.sol +[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInit.sol +[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInitAbstract.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165.sol +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/proxy/utils/Initializable.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/EnumerableSet.sol +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YCore.sol +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XCore.sol +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/custom/OwnableUnset.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol + + + +[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Utils.sol +[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Constants.sol +[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInitAbstract.sol +[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfile.sol +[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInit.sol +[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Utils.sol +[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Constants.sol +[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Errors.sol +[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/ontracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +[`LSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +[`ILSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Utils.sol +[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Constants.sol +[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/ILSP6KeyManager.sol +[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Errors.sol +[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol +[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManager.sol +[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +[`LSP7DigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +[`LSP7CompatibleERC20InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +[`LSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +[`LSP7CompatibleERC20MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +[`LSP7CompatibleERC20Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Errors.sol +[`LSP7CompatibleERC20MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +[`ILSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Constants.sol +[`LSP8IdentifiableDigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +[`LSP8CompatibleERC721InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +[`LSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +[`ILSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +[`LSP8CompatibleERC721MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.s +[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +[`LSP8CompatibleERC721Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +[`LSP8CompatibleERC721MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.s +[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Constants.sol +[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Errors.sol +[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extendable.sol +[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extension.sol +[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Constants.sol +[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Errors.sol +[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Utils.sol +[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20CallVerification.sol +[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/ILSP20CallVerifier.sol +[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Constants.sol +[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Errors.sol +[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Utils.sol +[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Constants.sol +[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Utils.sol +[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Constants.sol + + From bd14cdc80dd438bd2107233f42f35b99ce1b6feb Mon Sep 17 00:00:00 2001 From: biancabuzea200 Date: Fri, 7 Jul 2023 12:54:52 +0200 Subject: [PATCH 07/12] enhance docs around UP-Metamask conflict --- docs/guides/browser-extension/install-browser-extension.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/guides/browser-extension/install-browser-extension.md b/docs/guides/browser-extension/install-browser-extension.md index 10e066cf2e..f49aafa928 100644 --- a/docs/guides/browser-extension/install-browser-extension.md +++ b/docs/guides/browser-extension/install-browser-extension.md @@ -18,6 +18,8 @@ The current UP Browser Extenstion deploys profiles on the [Testnet](http://docs. :::note If you have **MetaMask** installed, _right click on both_ MetaMask and UP Extension and select _"This Can Read and Change Site Data > When you Click the Extension"_. Then you you can select for every website which extension you use. By closing the tab you can reset this selection. +It is important not to forget the previous step. Otherwise, it might conflict with the UP Browser Extension, and this might prevent you from finalizing the setup process. + ::: From 262b0a0f3221b443e391d81782c25e07292491ec Mon Sep 17 00:00:00 2001 From: biancabuzea200 <34369307+biancabuzea200@users.noreply.github.com> Date: Fri, 7 Jul 2023 15:44:25 +0200 Subject: [PATCH 08/12] Update docs/guides/browser-extension/install-browser-extension.md Co-authored-by: Jean Cvllr <31145285+CJ42@users.noreply.github.com> --- docs/guides/browser-extension/install-browser-extension.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/browser-extension/install-browser-extension.md b/docs/guides/browser-extension/install-browser-extension.md index f49aafa928..438bcf1486 100644 --- a/docs/guides/browser-extension/install-browser-extension.md +++ b/docs/guides/browser-extension/install-browser-extension.md @@ -18,7 +18,7 @@ The current UP Browser Extenstion deploys profiles on the [Testnet](http://docs. :::note If you have **MetaMask** installed, _right click on both_ MetaMask and UP Extension and select _"This Can Read and Change Site Data > When you Click the Extension"_. Then you you can select for every website which extension you use. By closing the tab you can reset this selection. -It is important not to forget the previous step. Otherwise, it might conflict with the UP Browser Extension, and this might prevent you from finalizing the setup process. +**It is important not to forget the previous step. Otherwise, it might conflict with the UP Browser Extension, and this might prevent you from finalising the setup process.** ::: From 9389d3d5059ad4779f2d5d3ad2f06aedc824072f Mon Sep 17 00:00:00 2001 From: Felix Hildebrandt Date: Fri, 7 Jul 2023 18:46:19 +0200 Subject: [PATCH 09/12] feat: Minor improvements & styling --- docs/guides/universal-profile/read-profile-data.md | 7 +++---- docs/guides/vault/interact-with-contracts.md | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/guides/universal-profile/read-profile-data.md b/docs/guides/universal-profile/read-profile-data.md index c278ed4f87..0a2db4d720 100644 --- a/docs/guides/universal-profile/read-profile-data.md +++ b/docs/guides/universal-profile/read-profile-data.md @@ -44,7 +44,7 @@ To inspect the address and check if it has an ERC725 contract, we can call its i - [LSP3 - Universal Profile Metadata](../../standards/universal-profile/lsp3-universal-profile-metadata) describes the data in the Universal Profile contract storage, and which keys to use to retrieve it. We can import the schema directly from the [erc725.js](../../tools/erc725js/schemas#standard-lsp-schemas) library. - - `SupportedStandards` shows the interface using a Metadata Standard with a key. In our case we use `SupportedStandards:LSP3UniversalProfile` from to check if the contract is an Universal Profile. + - `SupportedStandards` shows the interface using a Metadata Standard with a key. In our case we use `SupportedStandards:LSP3UniversalProfile` from to check if the contract is a Universal Profile. - `LSP3Profile` shows the data of the Universal Profile. - `LSP12IssuedAssets[]` shows assets the Universal Profile issued. - `LSP5ReceivedAssets[]` shows assets the Universal Profile received. @@ -249,7 +249,7 @@ async function fetchProfile(address) { const profile = new ERC725(erc725schema, address, provider, config); return await profile.fetchData(); } catch (error) { - return console.log('This is not an ERC725 Contract'); + return console.log('This is not an ERC725 Contract'); } } @@ -265,7 +265,7 @@ async function fetchProfileData(address) { const profile = new ERC725(erc725schema, address, provider, config); return await profile.fetchData('LSP3Profile'); } catch (error) { - return console.log('This is not an ERC725 Contract'); + return console.log('This is not an ERC725 Contract'); } } @@ -278,5 +278,4 @@ fetchProfile(SAMPLE_PROFILE_ADDRESS).then((profileData) => fetchProfileData(SAMPLE_PROFILE_ADDRESS).then((profileData) => console.log(JSON.stringify(profileData, undefined, 2)), ); - ``` diff --git a/docs/guides/vault/interact-with-contracts.md b/docs/guides/vault/interact-with-contracts.md index 841818175c..1449e05e00 100644 --- a/docs/guides/vault/interact-with-contracts.md +++ b/docs/guides/vault/interact-with-contracts.md @@ -124,7 +124,7 @@ const myEOA = new ethers.Wallet(privateKey).connect(provider); Further we will create instances for our contracts -- Create an Universal Profile contract instance from `universalProfileAddress`. +- Create a Universal Profile contract instance from `universalProfileAddress`. - Create a Target Contract instance from the `targetContractAddress`. From 3b3f9bd1884d0325c3b473e7909a92a1b3045785 Mon Sep 17 00:00:00 2001 From: biancabuzea200 Date: Fri, 7 Jul 2023 20:35:02 +0200 Subject: [PATCH 10/12] #861n1df24-enhancing-docs-on-Metamask-UP-conflict --- docs/guides/browser-extension/install-browser-extension.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/guides/browser-extension/install-browser-extension.md b/docs/guides/browser-extension/install-browser-extension.md index a457edd34b..438bcf1486 100644 --- a/docs/guides/browser-extension/install-browser-extension.md +++ b/docs/guides/browser-extension/install-browser-extension.md @@ -18,10 +18,8 @@ The current UP Browser Extenstion deploys profiles on the [Testnet](http://docs. :::note If you have **MetaMask** installed, _right click on both_ MetaMask and UP Extension and select _"This Can Read and Change Site Data > When you Click the Extension"_. Then you you can select for every website which extension you use. By closing the tab you can reset this selection. - **It is important not to forget the previous step. Otherwise, it might conflict with the UP Browser Extension, and this might prevent you from finalising the setup process.** - ::: From 57662df5ed169853817fd8a828784a38d2c7dcd0 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Fri, 7 Jul 2023 15:22:54 +0100 Subject: [PATCH 11/12] add LSP6 ABI Technical reference --- .../LSP6KeyManager/LSP6KeyManager.md | 986 ++++++++++++++++++ docs/contracts/introduction.md | 2 +- .../key-manager/execute-relay-transactions.md | 6 +- .../universal-profile/create-profile.md | 2 +- docs/standards/relayer-api.md | 3 +- .../smart-contracts/lsp6-key-manager.md | 273 ----- .../universal-profile/lsp6-key-manager.md | 10 +- .../classes/universal-profile.md | 14 +- docusaurus.config.js | 6 +- 9 files changed, 1010 insertions(+), 292 deletions(-) create mode 100644 docs/contracts/contracts/LSP6KeyManager/LSP6KeyManager.md delete mode 100644 docs/standards/smart-contracts/lsp6-key-manager.md diff --git a/docs/contracts/contracts/LSP6KeyManager/LSP6KeyManager.md b/docs/contracts/contracts/LSP6KeyManager/LSP6KeyManager.md new file mode 100644 index 0000000000..936763c8e0 --- /dev/null +++ b/docs/contracts/contracts/LSP6KeyManager/LSP6KeyManager.md @@ -0,0 +1,986 @@ +# LSP6KeyManager + +:::info Solidity contract + +[`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) + +::: + +> Implementation of a contract acting as a controller of an ERC725 Account, using permissions stored in the ERC725Y storage. + +All the permissions can be set on the ERC725 Account using `setData(bytes32,bytes)` or `setData(bytes32[],bytes[])`. + +## Methods + +### constructor + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#constructor) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) + +::: + +```solidity +constructor(address target_); +``` + +_Deploying a LSP6KeyManager linked to contract at address `target_`.\_ + +Deploy a Key Manager and set the `target_` address in the contract storage, making this Key Manager linked to this `target_` contract. + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | ------------------------------------------------------------------------ | +| `target_` | `address` | The address of the contract to control and forward calldata payloads to. | + +### execute + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#execute) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Function signature: `execute(bytes)` +- Function selector: `0x09c5eabe` + +::: + +```solidity +function execute(bytes payload) external payable returns (bytes); +``` + +_execute the following payload on the linked contract: `payload`_ + +execute a `payload` on the linked [`target`](#target) after having verified the permissions associated with the function being run. The `payload` MUST be a valid abi-encoded function call of one of the functions present in the linked [`target`](#target), otherwise the call will fail. The linked [`target`](#target) will return some data on successful execution, or revert on failure. + +
+ +**Emitted events:** + +- VerifiedCall event when the permissions related to `payload` have been verified successfully. + +
+ +#### Parameters + +| Name | Type | Description | +| --------- | :-----: | ---------------------------------------------------------------- | +| `payload` | `bytes` | the abi-encoded function call to execute on the linked {target}. | + +#### Returns + +| Name | Type | Description | +| ---- | :-----: | ---------------------------------------------------------------------------- | +| `0` | `bytes` | the abi-decoded data returned by the function called on the linked {target}. | + +### executeBatch + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#executebatch) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Function signature: `executeBatch(uint256[],bytes[])` +- Function selector: `0xbf0176ff` + +::: + +```solidity +function executeBatch( + uint256[] values, + bytes[] payloads +) external payable returns (bytes[]); +``` + +Same as [`execute`](#execute) but execute a batch of payloads (abi-encoded function calls) in a single transaction. + +
+ +**Emitted events:** + +- VerifiedCall event for each permissions related to each `payload` that have been verified successfully. + +
+ +#### Parameters + +| Name | Type | Description | +| ---------- | :---------: | -------------------------------------------------------------------------------------- | +| `values` | `uint256[]` | An array of amount of native tokens to be transferred for each `payload`. | +| `payloads` | `bytes[]` | An array of abi-encoded function calls to execute successively on the linked {target}. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------------------------------------------------------------------------------------------- | +| `0` | `bytes[]` | An array of abi-decoded of return data returned by the functions called on the linked {target}. | + +### executeRelayCall + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#executerelaycall) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Function signature: `executeRelayCall(bytes,uint256,uint256,bytes)` +- Function selector: `0x4c8a4e74` + +::: + +:::tip Hint + +If you are looking to learn how to sign and execute relay transactions via the Key Manager, see our Javascript step by step guide [_"Execute Relay Transactions"_](../../../guides/key-manager/execute-relay-transactions.md). See the LSP6 Standard page for more details on how to [generate a valid signature for Execute Relay Call](../../../standards/universal-profile/lsp6-key-manager.md#how-to-sign-relay-transactions). + +::: + +```solidity +function executeRelayCall( + bytes signature, + uint256 nonce, + uint256 validityTimestamps, + bytes payload +) external payable returns (bytes); +``` + +Allows any address (executor) to execute a payload (= abi-encoded function call) in the linked [`target`](#target) given they have a signed message from a controller with some permissions. + +
+ +**Emitted events:** + +- [`VerifiedCall`](#verifiedcall) event when the permissions related to `payload` have been verified successfully. + +
+ +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `signature` | `bytes` | a 65 bytes long signature for a meta transaction according to LSP6. | +| `nonce` | `uint256` | the nonce of the address that signed the calldata (in a specific `_channel`), obtained via {getNonce}. Used to prevent replay attack. | +| `validityTimestamps` | `uint256` | \* Two `uint128` timestamps concatenated together that describes when the relay transaction is valid "from" (left `uint128`) and "until" as a deadline (right `uint128`). | +| `payload` | `bytes` | the abi-encoded function call to execute on the linked {target}. | + +#### Returns + +| Name | Type | Description | +| ---- | :-----: | ---------------------------------------------------------------------- | +| `0` | `bytes` | the data being returned by the function called on the linked {target}. | + +### executeRelayCallBatch + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#executerelaycallbatch) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Function signature: `executeRelayCallBatch(bytes[],uint256[],uint256[],uint256[],bytes[])` +- Function selector: `0xa20856a5` + +::: + +```solidity +function executeRelayCallBatch( + bytes[] signatures, + uint256[] nonces, + uint256[] validityTimestamps, + uint256[] values, + bytes[] payloads +) external payable returns (bytes[]); +``` + +Same as [`executeRelayCall`](#executerelaycall) but execute a batch of signed calldata payloads (abi-encoded function calls) in a single transaction. The signed transactions can be from multiple controllers, not necessarely the same controller signer, as long as each of these controllers that signed have the right permissions related to the calldata `payload` they signed. + +
+ +**Requirements:** + +- the length of `signatures`, `nonces`, `validityTimestamps`, `values` and `payloads` MUST be the same. +- the value sent to this function (`msg.value`) MUST be equal to the sum of all `values` in the batch. There should not be any excess value sent to this function. + +
+ +#### Parameters + +| Name | Type | Description | +| -------------------- | :---------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `signatures` | `bytes[]` | An array of 65 bytes long signatures for meta transactions according to LSP6. | +| `nonces` | `uint256[]` | An array of nonces of the addresses that signed the calldata payloads (in specific channels). Obtained via {getNonce}. Used to prevent replay attack. | +| `validityTimestamps` | `uint256[]` | An array of two `uint128` concatenated timestamps that describe when the relay transaction is valid "from" (left `uint128`) and "until" (right `uint128`). | +| `values` | `uint256[]` | An array of amount of native tokens to be transferred for each calldata `payload`. | +| `payloads` | `bytes[]` | An array of abi-encoded function calls to execute successively on the linked {target}. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | -------------------------------------------------------------------------------------------- | +| `0` | `bytes[]` | An array of abi-decoded return data returned by the functions called on the linked {target}. | + +### getNonce + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#getnonce) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Function signature: `getNonce(address,uint128)` +- Function selector: `0xb44581d9` + +::: + +:::info + +A signer can choose its channel number arbitrarily. Channel ID = 0 can be used for sequential nonces (transactions that are order dependant), any other channel ID for out-of-order execution (= execution in parallel). + +::: + +```solidity +function getNonce( + address from, + uint128 channelId +) external view returns (uint256); +``` + +_Get latest nonce for `from` in channel ID: `channelId`._ + +Get the nonce for a specific controller `from` address that can be used for signing relay transaction. + +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | -------------------------------------------------------------------------- | +| `from` | `address` | the address of the signer of the transaction. | +| `channelId` | `uint128` | the channel id that the signer wants to use for executing the transaction. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------- | +| `0` | `uint256` | the current nonce on a specific `channelId` | + +### isValidSignature + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#isvalidsignature) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Function signature: `isValidSignature(bytes32,bytes)` +- Function selector: `0x1626ba7e` + +::: + +```solidity +function isValidSignature( + bytes32 dataHash, + bytes signature +) external view returns (bytes4 magicValue); +``` + +Checks if a signature was signed by a controller that has the permission `SIGN`. If the signer is a controller with the permission `SIGN`, it will return the ERC1271 magic value. + +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | ------------------------------------------- | +| `dataHash` | `bytes32` | - | +| `signature` | `bytes` | Signature byte array associated with \_data | + +#### Returns + +| Name | Type | Description | +| ------------ | :------: | ---------------------------------------------------- | +| `magicValue` | `bytes4` | `0x1626ba7e` on success, or `0xffffffff` on failure. | + +### lsp20VerifyCall + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#lsp20verifycall) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Function signature: `lsp20VerifyCall(address,uint256,bytes)` +- Function selector: `0x9bf04b11` + +::: + +```solidity +function lsp20VerifyCall( + address caller, + uint256 msgValue, + bytes data +) external nonpayable returns (bytes4); +``` + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ----------------------------------------------------- | +| `caller` | `address` | The address who called the function on the msg.sender | +| `msgValue` | `uint256` | - | +| `data` | `bytes` | - | + +#### Returns + +| Name | Type | Description | +| ---- | :------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `0` | `bytes4` | MUST return the first 3 bytes of `lsp20VerifyCall(address,uint256,bytes)` function selector if the call to the function is allowed, concatened with a byte that determines if the lsp20VerifyCallResult function should be called after the original function call. The byte that invoke the lsp20VerifyCallResult function is strictly `0x01`. | + +### lsp20VerifyCallResult + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#,)) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Function signature: `,)` +- Function selector: `0x9f47dbd3` + +::: + +```solidity +function lsp20VerifyCallResult( + bytes32, + bytes +) external nonpayable returns (bytes4); +``` + +#### Parameters + +| Name | Type | Description | +| ---- | :-------: | ----------- | +| `_0` | `bytes32` | - | +| `_1` | `bytes` | - | + +#### Returns + +| Name | Type | Description | +| ---- | :------: | ---------------------------------------------------------------------------------------------- | +| `0` | `bytes4` | MUST return the lsp20VerifyCallResult function selector if the call to the function is allowed | + +### supportsInterface + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#supportsinterface) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Function signature: `supportsInterface(bytes4)` +- Function selector: `0x01ffc9a7` + +::: + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool); +``` + +See [`IERC165-supportsInterface`](#ierc165-supportsinterface). + +#### Parameters + +| Name | Type | Description | +| ------------- | :------: | ----------- | +| `interfaceId` | `bytes4` | - | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | ----------- | +| `0` | `bool` | - | + +### target + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#target) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Function signature: `target()` +- Function selector: `0xd4b83992` + +::: + +```solidity +function target() external view returns (address); +``` + +Get the address of the contract linked to this Key Manager. + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | --------------------------------- | +| `0` | `address` | the address of the linked account | + +--- + +## Events + +### VerifiedCall + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#verifiedcall) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Event signature: `VerifiedCall(address,uint256,bytes4)` +- Event hash: `0xa54458b75709e42f79700ffb6cfc57c7e224d8a77a52c457ee7ecb8e22636280` + +::: + +```solidity +event VerifiedCall(address indexed signer, uint256 indexed value, bytes4 indexed selector); +``` + +Emitted when the LSP6KeyManager contract verified the permissions of the `signer` successfully. + +#### Parameters + +| Name | Type | Description | +| ------------------------ | :-------: | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| `signer` **`indexed`** | `address` | the address of the controller that executed the calldata payload (either directly via {execute} or via meta transaction using {executeRelayCall}). | +| `value` **`indexed`** | `uint256` | the amount of native token to be transferred in the calldata payload. | +| `selector` **`indexed`** | `bytes4` | the bytes4 function of the function that was executed on the linked {target} | + +--- + +## Errors + +### AddressPermissionArrayIndexValueNotAnAddress + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#addresspermissionarrayindexvaluenotanaddress) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `AddressPermissionArrayIndexValueNotAnAddress(bytes32,bytes)` +- Error hash: `0x8f4afa38` + +::: + +```solidity +error AddressPermissionArrayIndexValueNotAnAddress( + bytes32 dataKey, + bytes invalidValue +); +``` + +Reverts when trying to set a value that is not 20 bytes long (not an `address`) under the `AddressPermissions[index]` data key. + +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | ----------------------------------------------------------------------------------------------------- | +| `dataKey` | `bytes32` | The `AddressPermissions[index]` data key, that specify the index in the `AddressPermissions[]` array. | +| `invalidValue` | `bytes` | The invalid value that was attempted to be set under `AddressPermissions[index]`. | + +### BatchExecuteParamsLengthMismatch + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#batchexecuteparamslengthmismatch) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `BatchExecuteParamsLengthMismatch()` +- Error hash: `0x55a187db` + +::: + +```solidity +error BatchExecuteParamsLengthMismatch(); +``` + +Reverts when the array parameters `uint256[] value` and `bytes[] payload` have different sizes. There should be the same number of elements for each array parameters. + +### BatchExecuteRelayCallParamsLengthMismatch + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#batchexecuterelaycallparamslengthmismatch) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `BatchExecuteRelayCallParamsLengthMismatch()` +- Error hash: `0xb4d50d21` + +::: + +```solidity +error BatchExecuteRelayCallParamsLengthMismatch(); +``` + +Reverts when providing array parameters of different sizes to `executeRelayCall(bytes[],uint256[],bytes[])` + +### CallingKeyManagerNotAllowed + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#callingkeymanagernotallowed) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `CallingKeyManagerNotAllowed()` +- Error hash: `0xa431b236` + +::: + +```solidity +error CallingKeyManagerNotAllowed(); +``` + +Reverts when calling the KeyManager through `execute(uint256,address,uint256,bytes)`. + +### CannotSendValueToSetData + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#cannotsendvaluetosetdata) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `CannotSendValueToSetData()` +- Error hash: `0x59a529fc` + +::: + +```solidity +error CannotSendValueToSetData(); +``` + +Reverts when trying to call to the `setData(byte32,bytes)` or `setData(bytes32[],bytes[]) functions on the linked [`target`](#target) while sending value. + +### DelegateCallDisallowedViaKeyManager + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#delegatecalldisallowedviakeymanager) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `DelegateCallDisallowedViaKeyManager()` +- Error hash: `0x80d6ebae` + +::: + +```solidity +error DelegateCallDisallowedViaKeyManager(); +``` + +Reverts when trying to do a `delegatecall` via the ERC725X.execute(uint256,address,uint256,bytes) (operation type 4) function of the linked [`target`](#target). `DELEGATECALL` is disallowed by default on the LSP6KeyManager. + +### ERC725Y_DataKeysValuesLengthMismatch + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` +- Error hash: `0x3bcc8979` + +::: + +```solidity +error ERC725Y_DataKeysValuesLengthMismatch(); +``` + +reverts when there is not the same number of elements in the lists of data keys and data values when calling setDataBatch. + +### InvalidERC725Function + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invaliderc725function) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `InvalidERC725Function(bytes4)` +- Error hash: `0x2ba8851c` + +::: + +```solidity +error InvalidERC725Function(bytes4 invalidFunction); +``` + +Reverts when trying to call a function on the linked [`target`](#target), that is not any of the following: + +- `setData(bytes32,bytes)` (ERC725Y) + +- `setDataBatch(bytes32[],bytes[])` (ERC725Y) + +- `execute(uint256,address,uint256,bytes)` (ERC725X) + +- `transferOwnership(address)` + +- `acceptOwnership()` (LSP14) + +#### Parameters + +| Name | Type | Description | +| ----------------- | :------: | ------------------------------------------------------------------------------------------------------------------------- | +| `invalidFunction` | `bytes4` | The `bytes4` selector of the function selector that was attempted to be called on the linked {target} but not recognised. | + +### InvalidEncodedAllowedCalls + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invalidencodedallowedcalls) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `InvalidEncodedAllowedCalls(bytes)` +- Error hash: `0x187e77ab` + +::: + +```solidity +error InvalidEncodedAllowedCalls(bytes allowedCallsValue); +``` + +Reverts when `allowedCallsValue` is not properly encoded as a `(bytes4,address,bytes4,bytes4)[CompactBytesArray]` (CompactBytesArray made of tuples that are 32 bytes long each). See LSP2 value type `CompactBytesArray` for more infos. + +#### Parameters + +| Name | Type | Description | +| ------------------- | :-----: | ----------------------------------------------------------------------------------------------------------------- | +| `allowedCallsValue` | `bytes` | The list of allowedCalls that are not encoded correctly as a `(bytes4,address,bytes4,bytes4)[CompactBytesArray]`. | + +### InvalidEncodedAllowedERC725YDataKeys + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invalidencodedallowederc725ydatakeys) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `InvalidEncodedAllowedERC725YDataKeys(bytes,string)` +- Error hash: `0xae6cbd37` + +::: + +```solidity +error InvalidEncodedAllowedERC725YDataKeys(bytes value, string context); +``` + +Reverts when `value` is not encoded properly as a `bytes32[CompactBytesArray]`. The `context` string provides context on when this error occured (\_e.g: when fetching the `AllowedERC725YDataKeys` to verify the permissions of a controller, or when validating the `AllowedERC725YDataKeys` when setting them for a controller). + +#### Parameters + +| Name | Type | Description | +| --------- | :------: | ---------------------------------------------------------- | +| `value` | `bytes` | The value that is not a valid `bytes32[CompactBytesArray]` | +| `context` | `string` | A brief description of where the error occured. | + +### InvalidLSP6Target + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invalidlsp6target) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `InvalidLSP6Target()` +- Error hash: `0xfc854579` + +::: + +```solidity +error InvalidLSP6Target(); +``` + +Reverts when the address provided to set as the [`target`](#target) linked to this KeyManager is invalid (_e.g. `address(0)`_). + +### InvalidPayload + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invalidpayload) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `InvalidPayload(bytes)` +- Error hash: `0x3621bbcc` + +::: + +```solidity +error InvalidPayload(bytes payload); +``` + +Reverst when the payload is invalid. + +#### Parameters + +| Name | Type | Description | +| --------- | :-----: | ----------- | +| `payload` | `bytes` | - | + +### InvalidRelayNonce + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invalidrelaynonce) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `InvalidRelayNonce(address,uint256,bytes)` +- Error hash: `0xc9bd9eb9` + +::: + +```solidity +error InvalidRelayNonce(address signer, uint256 invalidNonce, bytes signature); +``` + +Reverts when the `signer` address retrieved from the `signature` has an invalid nonce: `invalidNonce`. + +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | --------------------------------------------------- | +| `signer` | `address` | The address of the signer | +| `invalidNonce` | `uint256` | The nonce retrieved for the `signer` address | +| `signature` | `bytes` | The signature used to retrieve the `signer` address | + +### InvalidWhitelistedCall + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invalidwhitelistedcall) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `InvalidWhitelistedCall(address)` +- Error hash: `0x6fd203c5` + +::: + +```solidity +error InvalidWhitelistedCall(address from); +``` + +Reverts when verifying the permissions of a `from` address for its allowed calls, and has a "any whitelisted call" allowed call set. A `from` address is not allowed to have 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff in its list of `AddressPermissions:AllowedCalls:
`, as this allows any STANDARD:ADDRESS:FUNCTION. This is equivalent to granting the SUPER permission and should never be valid. + +#### Parameters + +| Name | Type | Description | +| ------ | :-------: | ------------------------------------------------------------------ | +| `from` | `address` | The controller address that has any allowed calls whitelisted set. | + +### LSP6BatchExcessiveValueSent + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#lsp6batchexcessivevaluesent) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `LSP6BatchExcessiveValueSent(uint256,uint256)` +- Error hash: `0xa51868b6` + +::: + +```solidity +error LSP6BatchExcessiveValueSent(uint256 totalValues, uint256 msgValue); +``` + +This error occurs when there was too much funds sent to the batch functions `execute(uint256[],bytes[])` or `executeRelayCall(bytes[],uint256[],uint256[],bytes[])` to cover the sum of all the values forwarded on Reverts to avoid the KeyManager to holds some remaining funds sent to the following batch functions: + +- execute(uint256[],bytes[]) + +- executeRelayCall(bytes[],uint256[],uint256[],bytes[]) This error occurs when `msg.value` is more than the sum of all the values being forwarded on each payloads (`values[]` parameter from the batch functions above). + +#### Parameters + +| Name | Type | Description | +| ------------- | :-------: | ----------- | +| `totalValues` | `uint256` | - | +| `msgValue` | `uint256` | - | + +### LSP6BatchInsufficientValueSent + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#lsp6batchinsufficientvaluesent) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `LSP6BatchInsufficientValueSent(uint256,uint256)` +- Error hash: `0x30a324ac` + +::: + +```solidity +error LSP6BatchInsufficientValueSent(uint256 totalValues, uint256 msgValue); +``` + +This error occurs when there was not enough funds sent to the batch functions `execute(uint256[],bytes[])` or `executeRelayCall(bytes[],uint256[],uint256[],bytes[])` to cover the sum of all the values forwarded on each payloads (`values[]` parameter from the batch functions above). This mean that `msg.value` is less than the sum of all the values being forwarded on each payloads (`values[]` parameters). + +#### Parameters + +| Name | Type | Description | +| ------------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `totalValues` | `uint256` | The sum of all the values forwarded on each payloads (`values[]` parameter from the batch functions above). | +| `msgValue` | `uint256` | The amount of native tokens sent to the batch functions `execute(uint256[],bytes[])` or `executeRelayCall(bytes[],uint256[],uint256[],bytes[])`. | + +### NoCallsAllowed + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#nocallsallowed) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `NoCallsAllowed(address)` +- Error hash: `0x6cb60587` + +::: + +```solidity +error NoCallsAllowed(address from); +``` + +Reverts when the `from` address has no `AllowedCalls` set and cannot interact with any address using the linked [`target`](#target). + +#### Parameters + +| Name | Type | Description | +| ------ | :-------: | ------------------------------------- | +| `from` | `address` | The address that has no AllowedCalls. | + +### NoERC725YDataKeysAllowed + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#noerc725ydatakeysallowed) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `NoERC725YDataKeysAllowed(address)` +- Error hash: `0xed7fa509` + +::: + +```solidity +error NoERC725YDataKeysAllowed(address from); +``` + +Reverts when the `from` address has no AllowedERC725YDataKeys set and cannot set any ERC725Y data key on the ERC725Y storage of the linked [`target`](#target). + +#### Parameters + +| Name | Type | Description | +| ------ | :-------: | ----------------------------------------------------- | +| `from` | `address` | The address that has no `AllowedERC725YDataKeys` set. | + +### NoPermissionsSet + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#nopermissionsset) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `NoPermissionsSet(address)` +- Error hash: `0xf292052a` + +::: + +```solidity +error NoPermissionsSet(address from); +``` + +Reverts when address `from` does not have any permissions set on the account linked to this Key Manager + +#### Parameters + +| Name | Type | Description | +| ------ | :-------: | ------------------------------------------ | +| `from` | `address` | the address that does not have permissions | + +### NotAllowedCall + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#notallowedcall) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `NotAllowedCall(address,address,bytes4)` +- Error hash: `0x45147bce` + +::: + +```solidity +error NotAllowedCall(address from, address to, bytes4 selector); +``` + +Reverts when `from` is not authorised to call the `execute(uint256,address,uint256,bytes)` function because of a not allowed callType, address, standard or function. + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `from` | `address` | address The controller that tried to call the `execute(uint256,address,uint256,bytes)` function. | +| `to` | `address` | The address of an EOA or contract that `from` tried to call using the linked {target} | +| `selector` | `bytes4` | If `to` is a contract, the bytes4 selector of the function that `from` is trying to call. If no function is called (e.g: a native token transfer), selector = 0x00000000 | + +### NotAllowedERC725YDataKey + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#notallowederc725ydatakey) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `NotAllowedERC725YDataKey(address,bytes32)` +- Error hash: `0x557ae079` + +::: + +```solidity +error NotAllowedERC725YDataKey(address from, bytes32 disallowedKey); +``` + +Reverts when address `from` is not authorised to set the key `disallowedKey` on the linked [`target`](#target). + +#### Parameters + +| Name | Type | Description | +| --------------- | :-------: | ------------------------------------------------------------------------------------------------------ | +| `from` | `address` | address The controller that tried to `setData` on the linked {target}. | +| `disallowedKey` | `bytes32` | A bytes32 data key that `from` is not authorised to set on the ERC725Y storage of the linked {target}. | + +### NotAuthorised + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#notauthorised) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `NotAuthorised(address,string)` +- Error hash: `0x3bdad6e6` + +::: + +```solidity +error NotAuthorised(address from, string permission); +``` + +Reverts when address `from` is not authorised and does not have `permission` on the linked [`target`](#target) + +#### Parameters + +| Name | Type | Description | +| ------------ | :-------: | ------------------------------------------------------------------------------ | +| `from` | `address` | address The address that was not authorised. | +| `permission` | `string` | permission The permission required (\_e.g: `SETDATA`, `CALL`, `TRANSFERVALUE`) | + +### NotRecognisedPermissionKey + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#notrecognisedpermissionkey) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `NotRecognisedPermissionKey(bytes32)` +- Error hash: `0x0f7d735b` + +::: + +```solidity +error NotRecognisedPermissionKey(bytes32 dataKey); +``` + +Reverts when `dataKey` is a bytes32 value that does not adhere to any of the permission data keys defined by the LSP6 standard + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | ------------------------------------------------------------------------------ | +| `dataKey` | `bytes32` | The dataKey that does not match any of the standard LSP6 permission data keys. | + +### RelayCallBeforeStartTime + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#relaycallbeforestarttime) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `RelayCallBeforeStartTime()` +- Error hash: `0x00de4b8a` + +::: + +```solidity +error RelayCallBeforeStartTime(); +``` + +Reverts when the start timestamp provided to [`executeRelayCall`](#executerelaycall) function is bigger than the current timestamp. + +### RelayCallExpired + +:::note Links + +- Specification details in [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#relaycallexpired) +- Solidity implementation in [**LSP6KeyManager**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `RelayCallExpired()` +- Error hash: `0x5c53a98c` + +::: + +```solidity +error RelayCallExpired(); +``` + +Reverts when the period to execute the relay call has expired. diff --git a/docs/contracts/introduction.md b/docs/contracts/introduction.md index 5a7203a718..73f74a5cfd 100644 --- a/docs/contracts/introduction.md +++ b/docs/contracts/introduction.md @@ -65,7 +65,7 @@ The **Universal Profile** contracts allow a better representation of the identit - **[LSP0ERC725Account](../standards/smart-contracts/lsp0-erc725-account.md)**: a contract that can be used as an account and represents an **identity on-chain**. - **[LSP1UniversalReceiverDelegateUP](./contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md)**: a contract that allows the account to react to the calls that it receives (Normal transaction, Token transfer, Vaults transfer, etc.). -- **[LSP6KeyManager](../standards/smart-contracts/lsp6-key-manager.md)**: a contract that allows **multi-control** over the account using different permissions. +- **[LSP6KeyManager](../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md)**: a contract that allows **multi-control** over the account using different permissions. - **LSP11BasicSocialRecovery** ### Digital Assets diff --git a/docs/guides/key-manager/execute-relay-transactions.md b/docs/guides/key-manager/execute-relay-transactions.md index 4196a68f94..9893f37c39 100644 --- a/docs/guides/key-manager/execute-relay-transactions.md +++ b/docs/guides/key-manager/execute-relay-transactions.md @@ -160,7 +160,7 @@ const keyManager = new ethers.Contract( ### Step 3 - Prepare the relay call parameters -Get the `nonce` of the controller key from the KeyManager by instantiating the KeyManager smart contract instance and calling the [`getNonce`](../../standards/smart-contracts/lsp6-key-manager.md#getnonce) function. +Get the `nonce` of the controller key from the KeyManager by instantiating the KeyManager smart contract instance and calling the [`getNonce`](../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md#getnonce) function. The `channelId` is used to prevent nonce conflicts when multiple apps send transactions to the same KeyManager at the same time. Read more about [out of order execution here](../../standards/universal-profile/lsp6-key-manager.md#out-of-order-execution). @@ -288,7 +288,7 @@ let { signature } = await eip191Signer.signDataWithIntendedValidator( -Now the `signature`, `abiPayload`, `nonce`, `validityTimestamps` and `keyManagerAddress` can be sent to a third party to execute the transaction using [`executeRelayCall`](../../standards/smart-contracts/lsp6-key-manager#executerelaycall). +Now the `signature`, `abiPayload`, `nonce`, `validityTimestamps` and `keyManagerAddress` can be sent to a third party to execute the transaction using [`executeRelayCall`](../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md#executerelaycall). ## Execute via `executeRelayCall` @@ -347,7 +347,7 @@ const executeRelayCallTransaction = await keyManager :::tip LSP6KeyManager executeRelayCall -You can find more information about the [LSP6KeyManager `executeRelayCall` here](../../standards/smart-contracts/lsp6-key-manager#executerelaycall). +You can find more information about the [LSP6KeyManager `executeRelayCall` here](../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md#executerelaycall). ::: diff --git a/docs/guides/universal-profile/create-profile.md b/docs/guides/universal-profile/create-profile.md index 230e3bf56b..0dae2fb7c3 100644 --- a/docs/guides/universal-profile/create-profile.md +++ b/docs/guides/universal-profile/create-profile.md @@ -42,7 +42,7 @@ In the context of Universal Profile, _reading data from the contract storage can - `execute(...)` = transfer LYX to addresses, call other contracts, or create and deploy new contracts (see [ERC725X](../../standards/universal-profile/lsp0-erc725account#erc725x---generic-executor) executor) - `transferOwnership(...)` = make an address be the new owner of the Universal Profile. -In this guide, our Universal Profile's owner will be a contract called a **Key Manager**. The [Key Manager](../../standards/smart-contracts/lsp6-key-manager.md) is a smart contract that enables granting specific permissions to `addresses`, so that they can interact with the Universal Profile. For example, transferring LYX on behalf of the Universal Profile. +In this guide, our Universal Profile's owner will be a contract called a **Key Manager**. The [Key Manager](../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md) is a smart contract that enables granting specific permissions to `addresses`, so that they can interact with the Universal Profile. For example, transferring LYX on behalf of the Universal Profile. :::info Learn More You can implement any complex ownership structure (and fine-grained control) on top of Universal Profiles. The structure includes having a UP owned and controlled by: diff --git a/docs/standards/relayer-api.md b/docs/standards/relayer-api.md index f5babd51e2..a5ea0de3bf 100644 --- a/docs/standards/relayer-api.md +++ b/docs/standards/relayer-api.md @@ -10,7 +10,7 @@ import TabItem from '@theme/TabItem'; ## POST `/execute` -Executes a signed transaction on behalf of a Universal Profile using [`executeRelayCall()`](./smart-contracts/lsp6-key-manager#executerelaycall). +Executes a signed transaction on behalf of a Universal Profile using [`executeRelayCall()`](../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md#executerelaycall). - Use signed message provided in request for authentication. - Calculate and return the transaction hash in response. @@ -39,6 +39,7 @@ Returns the available quota left for a registered Universal Profile. - `signature` is the message value signed by a controller key with the [`SIGN` permission](./universal-profile/lsp6-key-manager#permissions) of the Universal Profile. The hash to sign should be calculated as [EIP-712](https://eips.ethereum.org/EIPS/eip-712) hash where the message is `keccack256(address, timestamp)`. Make sure that no matter the language or platform timestamp is of type `int`, `int256`, `uint` or `uint256`. In the backend the message is reconstructed using [soliditysha3()](https://web3js.readthedocs.io/en/v1.7.4/web3-utils.html#soliditysha3) to verify the signature. [Web3.js](https://web3js.readthedocs.io/en/v1.8.0/web3-eth-accounts.html?#sign) and [ethers.js](https://docs.ethers.io/v5/api/signer/#Signer-signMessage) both automatically hash when using their native sign functions. This may need to be done manually if using a different library. + - `timestamp` in **seconds**. Must be now +/- 5 seconds.
diff --git a/docs/standards/smart-contracts/lsp6-key-manager.md b/docs/standards/smart-contracts/lsp6-key-manager.md deleted file mode 100644 index cadc8ec180..0000000000 --- a/docs/standards/smart-contracts/lsp6-key-manager.md +++ /dev/null @@ -1,273 +0,0 @@ ---- -title: LSP6KeyManager -sidebar_position: 8 ---- - -# LSP6KeyManager - -:::info Solidity contract - -[`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/contracts/LSP6KeyManager/LSP6KeyManager.sol) - -::: - -The **LSP6KeyManager** is a contract that controls a **[LSP0ERC725Account](./lsp0-erc725-account.md)** contract. It comes with pre-defined permissions for addresses that range from setting data to executing, changing owner, etc., as written in the [permissions](../universal-profile/lsp6-key-manager.md#-types-of-permissions) section of the [LSP6-KeyManager Standard](../universal-profile/lsp6-key-manager.md). - -:::warning - -Because of its potential malicious impact on the linked account, the current implementation of the Key Manager disallows the **[DELEGATECALL](../universal-profile/lsp6-key-manager.md#permissions-value)** operation via the `execute(...)` function of the linked ERC725Account. - -::: - -:::note -_LSP6KeyManager contract also contains the methods from the [ERC165 Standard](https://eips.ethereum.org/EIPS/eip-165):_ - -```solidity -function supportsInterface(bytes4 interfaceId) public view returns (bool) -``` - -::: - -## Functions - -### constructor - -```solidity -constructor(address target) -``` - -Links the LSP6KeyManager to the **ERC725** contract deployed at the `target` address. - -#### Parameters: - -| Name | Type | Description | -| :------- | :-------- | :------------------------------------------------- | -| `target` | `address` | The address of the **ERC725** contract to control. | - -### target - -```solidity -function target() external view returns (address) -``` - -Returns the address of the account linked to this Key Manager. - -This can be a contract that implements: - -- [ERC725X](https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#erc725x) only. -- [ERC725Y](https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#erc725y) only. -- any ERC725 based contract (implementing both ERC725X and ERC725Y), like a [ERC725Account](../smart-contracts/lsp0-erc725-account.md). - -#### Returns - -| Name | Type | Description | -| -------- | --------- | --------------------------------- | -| `target` | `address` | the address of the linked account | - -### execute - -```solidity -function execute(bytes memory payload) public payable returns (bytes memory result) -``` - -Executes a payload on the linked **LSP0ERC725Account**. - -This payload must represent the abi-encoded function call of one of the functions on the linked **LSP0ERC725Account**: - -- **[`setData(bytes32,bytes)`](./lsp0-erc725-account.md#setdata)**. -- **[`setDataBatch(bytes32[],bytes[])`](./lsp0-erc725-account.md#setdatabatch)**. -- **[`execute(uint256,address,uint256,bytes)`](./lsp0-erc725-account.md#execute)**. -- **[`transferOwnership(address)`](./lsp0-erc725-account.md#transferownership)**. -- **[`acceptOwnership()`](./lsp0-erc725-account.md#acceptownership)**. - -_Triggers the **[VerifiedCall](#verifiedcall)** event when a call is successfully executed._ - -#### Parameters: - -| Name | Type | Description | -| :-------- | :------ | :-------------------------- | -| `payload` | `bytes` | The payload to be executed. | - -#### Return Values: - -| Name | Type | Description | -| :------- | :------ | :--------------------------------------------------------------------------- | -| `result` | `bytes` | The returned data as ABI-encoded bytes if the call on the account succeeded. | - -### executeBatch - -```solidity -function executeBatch(uint256[] calldata values, bytes[] calldata payloads) public payable returns (bytes memory result) -``` - -Same than [`execute(bytes)`](#execute) but executes a batch of payloads on the linked **LSP0ERC725Account**. - -The payloads parameter must represent an array of abi-encoded function calls of one of the **LSP0ERC725Account** contract functions: - -- **[`setData(bytes32,bytes)`](./lsp0-erc725-account.md#setdata)**. -- **[`setDataBatch(bytes32[],bytes[])`](./lsp0-erc725-account.md#setdatabatch)**. -- **[`execute(uint256,address,uint256,bytes)`](./lsp0-erc725-account.md#execute)**. -- **[`transferOwnership(address)`](./lsp0-erc725-account.md#transferownership)**. -- **[`acceptOwnership()`](./lsp0-erc725-account.md#acceptownership)**. - -_Triggers the **[`VerifiedCall`](#verifiedcall)** event when a call is successfully executed._ - -#### Parameters: - -| Name | Type | Description | -| :--------- | :---------- | :------------------------------------------------- | -| `values` | `uint256[]` | The `msg.value` to be sent for a specific payload. | -| `payloads` | `bytes[]` | The payloads to be executed. | - -#### Return Values: - -| Name | Type | Description | -| :-------- | :-------- | :------------------------------------------------------------------------------- | -| `results` | `bytes[]` | The returned datas as ABI-encoded bytes[] if the calls on the account succeeded. | - -### getNonce - -:::info -More info about **channel** can be found here: **[What are multi-channel nonces](../faq/channel-nonce.md)**\_ -::: - -```solidity -function getNonce( - address signer, - uint256 channel -) public view returns (uint256 nonce) -``` - -Returns the **nonce** that needs to be signed by an allowed controller to be passed into the **[`executeRelayCall(...)`](#executerelaycall)** function. A signer can choose his channel number arbitrarily. - -#### Parameters: - -| Name | Type | Description | -| :-------- | :-------- | :----------------------------------------------------------------------- | -| `signer` | `address` | The address of the signer of the transaction. | -| `channel` | `uint256` | The channel which the signer wants to use for executing the transaction. | - -#### Return Values: - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `nonce` | `uint256` | The current nonce. | - -### executeRelayCall - -:::tip - -If you are looking to learn how to sign and execute relay transactions via the Key Manager, see our Javascript step by step guide [_"Execute Relay Transactions"_](../../guides/key-manager/execute-relay-transactions.md). - -See the LSP6 Standard page for more details on how to [generate a valid signature for Execute Relay Call](../universal-profile/lsp6-key-manager.md#how-to-sign-relay-transactions). - -::: - -```solidity -function executeRelayCall( - bytes memory signature, - uint256 nonce, - uint256 validityTimestamps, - bytes memory _calldata -) public -``` - -Allows anybody to execute a payload on the linked **LSP0ERC725Account**, if they have a signed message from a controller with some permissions. - -_Triggers the **[VerifiedCall](#verifiedcall)** event when a call is successfully executed._ - -#### Parameters: - -| Name | Type | Description | -| :------------------- | :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `signature` | `bytes` | The bytes65 EIP191 signature. | -| `nonce` | `uint256` | The nonce of the address that signed the message. | -| `validityTimestamps` | `uint256` | Two `uint128` timestamps concatenated together that describes when the relay transaction is valid "from" (left `uint128`) and "until" (right `uint128`). | -| `_calldata` | `bytes` | The payload to be executed. | - -#### Return Value: - -| Name | Type | Description | -| :------- | :------ | :------------------------------------------------------------------------------------------------------------------------------- | -| `result` | `bytes` | If the payload on the linked **LSP0ERC725Account** was `ERC725X.execute(...)`, the data returned by the external made by the UP. | - -### executeRelayCallBatch - -```solidity -function executeRelayCallBatch( - bytes[] calldata signatures, - uint256[] calldata nonces, - uint256[] calldata validityTimestamps, - uint256[] calldata values, - bytes[] calldata payloads -) public -``` - -Same as [`executeRelayCall(bytes,uint256,bytes)`](#executerelaycall), but allows anybody to execute a **batch of payloads** on the linked **LSP0ERC725Account** on behalf of other [controllers](../universal-profile/lsp6-key-manager.md), as long as these controllers that signed the `payloads` have some permissions. - -#### Parameters: - -| Name | Type | Description | -| :------------------- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `signatures` | `bytes[]` | An array of bytes65 EIP191 signatures. | -| `nonces` | `uint256[]` | An array of nonces of the addresses that signed the messages. | -| `validityTimestamps` | `uint256[]` | An array of two `uint128` concatenated timestamps that describe when the relay transaction is valid "from" (left `uint128`) and "until" (right `uint128`). | -| `values` | `uint256[]` | An array of values to be sent sent for each payload. | -| `payloads` | `bytes[]` | An array of payloads to be executed. | - -#### Return Values: - -| Name | Type | Description | -| :-------- | :-------- | :-------------------------------------------------------------------------------------------------------------------------------------- | -| `results` | `bytes[]` | For each payload on the linked **LSP0ERC725Account** that was `ERC725X.execute(...)`, the data returned by the external made by the UP. | - -### isValidSignature - -```solidity -function isValidSignature( - bytes32 hash, - bytes memory signature -) public view returns (bytes4 magicValue) -``` - -Checks if a signature was signed by a controller having at least the **[SIGN](../universal-profile/lsp6-key-manager.md/#permission-values)** permission for this KeyManager, otherwise it will return the failure value. - -#### Parameters: - -| Name | Type | Description | -| :---------- | :-------- | :---------------------------------------------------- | -| `hash` | `bytes32` | The hash of the data signed on the behalf of address. | -| `signature` | `bytes` | The Owner's signature(s) of the data. | - -#### Return Values: - -| Name | Type | Description | -| :----------- | :------- | :--------------------------------------------------------------------- | -| `magicValue` | `bytes4` | The magicValue either `0x1626ba7e` on success or `0xffffffff` failure. | - -## Events - -### VerifiedCall - -```solidity -event VerifiedCall( - address indexed signer, - uint256 indexed value, - bytes4 indexed selector -); -``` - -_Fired when a transaction was successfully executed from the **[execute](#execute)** or **[executeRelayCall](#executerelaycall)** function._ - -#### Values: - -| Name | Type | Description | -| :--------- | :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `signer` | `address` | The controller that executed the payload (either directly via [`execute(...)](#execute) or indirectly via meta transaction using [`executeRelayCall(...)`](#executerelaycall)). | -| `value` | `uint256` | The amount to be sent with the payload. | -| `selector` | `bytes4` | The bytes4 selector of the function executed on the linked [`target()`](#target). | - -## References - -- [LUKSO Standards Proposals: LSP6 - Key Manager (Standard Specification, GitHub)](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md) -- [LSP6 KeyManager: Solidity implementations (GitHub)](https://github.com/lukso-network/lsp-universalprofile-smart-contracts/tree/develop/contracts/LSP6KeyManager) diff --git a/docs/standards/universal-profile/lsp6-key-manager.md b/docs/standards/universal-profile/lsp6-key-manager.md index c0ab793935..b829afb7d3 100644 --- a/docs/standards/universal-profile/lsp6-key-manager.md +++ b/docs/standards/universal-profile/lsp6-key-manager.md @@ -59,7 +59,7 @@ Click on the toggles below to **learn more about the features enabled by each pe

The `CHANGEOWNER` permission enables to change the owner of the linked ERC725Account. -Using this permission, you can easily upgrade the [`LSP6KeyManager`](../smart-contracts/lsp6-key-manager.md) attached to the Account by transferring ownership to a new Key Manager. +Using this permission, you can easily upgrade the [`LSP6KeyManager`](../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md) attached to the Account by transferring ownership to a new Key Manager.
@@ -775,8 +775,8 @@ As a result, this provide context for the Dapp on which data they can operate on There are 3 ways to interact with the ERC725Account linked with the Key Manager. -- **direct execution**: the controller is the caller (`msg.sender`) and sends a **payload** to the Key Manager directly (= abi-encoded function call on the linked ERC725Account) to the KeyManager via [`execute(...)`](../smart-contracts/lsp6-key-manager.md#execute). -- **relay execution**: a controller **A** signs a payload and an executor `address` **B** (_e.g. a relay service_) executes the payload on behalf of the signer via [`executeRelayCall(...)`](../smart-contracts/lsp6-key-manager.md#executerelaycall). +- **direct execution**: the controller is the caller (`msg.sender`) and sends a **payload** to the Key Manager directly (= abi-encoded function call on the linked ERC725Account) to the KeyManager via [`execute(...)`](../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md#execute). +- **relay execution**: a controller **A** signs a payload and an executor `address` **B** (_e.g. a relay service_) executes the payload on behalf of the signer via [`executeRelayCall(...)`](../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md#executerelaycall). - **LSP20-CallVerification execution**: Interaction with the ERC725Account can be done directly, in accordance with the LSP20-CallVerification standard. The LSP6 Key Manager supports this standard, allowing anyone to call the LSP0ERC725Account. If the caller is not the owner of the ERC725Account, the call will be forwarded to the LSP20 functions of the Key Manager. These functions will verify the necessary permissions and emit the relevant event. The main difference between direct vs relay vs LSP20-CallVerification execution is that with direct execution, the controller address is the actual address making the request + paying the gas cost of the execution. With relay execution, a signer address (a controller) can interact with the ERC725Account without paying a gas fee. And with LSP20-CallVerification execution, calls can be made directly to the ERC725Account, with permissions verified by the LSP20 functions of the Key Manager. @@ -815,7 +815,7 @@ To obtain a valid signature that can be used by anyone to execute a relayed tran - 1. the **payload** (an abi-encoded function call) to be executed on the linked account. - 2. the **chain id** of the blockchain where the `payload` will be executed. - - 3. the address of the [`LSP6KeyManager`](../../standards/smart-contracts/lsp6-key-manager.md) smart contract where the **payload** will be executed. + - 3. the address of the [`LSP6KeyManager`](../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md) smart contract where the **payload** will be executed. d. the Key Manager **nonce** of the controller. - 4. the `validityTimestamps`, composed of 2 x `uint128` concatenated together, where: @@ -827,7 +827,7 @@ To obtain a valid signature that can be used by anyone to execute a relayed tran 3. Then you must get the `keccak256` hash of this data. -4. After that you can sign the data to obtain a valid signature ready to be used via [`executeRelayCall(...)`](../smart-contracts/lsp6-key-manager.md#executerelaycall). +4. After that you can sign the data to obtain a valid signature ready to be used via [`executeRelayCall(...)`](../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md#executerelaycall). #### Details diff --git a/docs/tools/lsp-factoryjs/classes/universal-profile.md b/docs/tools/lsp-factoryjs/classes/universal-profile.md index f37ad9d233..f06bbcde0b 100644 --- a/docs/tools/lsp-factoryjs/classes/universal-profile.md +++ b/docs/tools/lsp-factoryjs/classes/universal-profile.md @@ -43,10 +43,10 @@ Read more about configuring Universal Profile smart contracts deployment [here]( Object containing profile properties set during Universal Profile deployment. -| Name | Type | Description | -| :------------------------------------------------------------------------------- | :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [`controllerAddresses`](../deployment/universal-profile#controller-addresses) | Array | A list of public addresses which will have all [LSP6 permissions](../../../standards/smart-contracts/lsp6-key-manager.md) except `DELEGATECALL` set on the Universal Profile contract during deployment. | -| [`lsp3Profile`](../deployment/universal-profile#adding-lsp3-metadata) (optional) | String \| Object | [LSP3 Profile metadata](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-3-UniversalProfile-Metadata.md) which will be uploaded and set during deployment. | +| Name | Type | Description | +| :------------------------------------------------------------------------------- | :--------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [`controllerAddresses`](../deployment/universal-profile#controller-addresses) | Array | A list of public addresses which will have all [LSP6 permissions](../../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md) except `DELEGATECALL` set on the Universal Profile contract during deployment. | +| [`lsp3Profile`](../deployment/universal-profile#adding-lsp3-metadata) (optional) | String \| Object | [LSP3 Profile metadata](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-3-UniversalProfile-Metadata.md) which will be uploaded and set during deployment. | #### 2. `options` - Object (optional) @@ -174,7 +174,7 @@ await lspFactory.UniversalProfile.deploy( console.log(contracts); }, }, - } + }, ); /** @@ -508,7 +508,7 @@ await UniversalProfile.uploadProfileData( }, { ipfsGateway: 'https://ipfs.infura.io', - } + }, ); /** @@ -540,7 +540,7 @@ await UniversalProfile.uploadProfileData( port: 5001, protocol: 'https', }, - } + }, ); /** diff --git a/docusaurus.config.js b/docusaurus.config.js index eaead89ebd..fd637bc292 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -55,7 +55,7 @@ module.exports = { }, { from: '/contracts/key-manager', - to: '/standards/smart-contracts/lsp6-key-manager', + to: '/contracts/contracts/LSP6KeyManager', }, { from: '/contracts/digital-asset', @@ -110,6 +110,10 @@ module.exports = { from: '/standards/smart-contracts/lsp8-identifiable-digital-asset', to: '/contracts/contracts/LSP8IdentifiableDigitalAsset', }, + { + from: '/contracts/smart-contracts/lsp6-key-manager', + to: '/contracts/contracts/LSP6KeyManager', + }, ], }, ], From 7c606f643f0aea1c98325013dbf9d88cdc3a6d97 Mon Sep 17 00:00:00 2001 From: b00ste Date: Mon, 10 Jul 2023 16:17:37 +0300 Subject: [PATCH 12/12] Add LSP14 auto-generated ABI docs --- .../LSP14Ownable2Step/LSP14Ownable2Step.md | 519 ++++++++++++++++++ docs/guides/key-manager/upgrade-lsp6.md | 4 +- .../generic-standards/lsp14-ownable-2-step.md | 8 +- .../smart-contracts/lsp14-ownable-2-step.md | 158 ------ .../universal-profile/lsp0-erc725account.md | 2 +- .../standards/universal-profile/lsp9-vault.md | 6 +- docusaurus.config.js | 4 + 7 files changed, 533 insertions(+), 168 deletions(-) create mode 100644 docs/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md delete mode 100644 docs/standards/smart-contracts/lsp14-ownable-2-step.md diff --git a/docs/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md b/docs/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md new file mode 100644 index 0000000000..eea9030bd7 --- /dev/null +++ b/docs/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md @@ -0,0 +1,519 @@ +# LSP14Ownable2Step + +:::info Soldity contract + +[`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) + +::: + +> LSP14Ownable2Step + +This contract is a modified version of the [`OwnableUnset.sol`] implementation, where transferring and renouncing ownership works as a 2-step process. This can be used as a confirmation mechanism to prevent potential mistakes when transferring ownership of the contract, where the control of the contract could be lost forever. + +## Methods + +### RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY + +:::note Links + +- Specification details in [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#renounce_ownership_confirmation_delay) +- Solidity implementation in [**LSP14Ownable2Step**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY()` +- Function selector: `0xead3fbdf` + +::: + +```solidity +function RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY() + external + view + returns (uint256); +``` + +The number of block that MUST pass before one is able to confirm renouncing ownership. + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------------- | +| `0` | `uint256` | Number of blocks. | + +### RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD + +:::note Links + +- Specification details in [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#renounce_ownership_confirmation_period) +- Solidity implementation in [**LSP14Ownable2Step**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD()` +- Function selector: `0x01bfba61` + +::: + +```solidity +function RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD() + external + view + returns (uint256); +``` + +The number of blocks during which one can renounce ownership. + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------------- | +| `0` | `uint256` | Number of blocks. | + +### acceptOwnership + +:::note Links + +- Specification details in [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#acceptownership) +- Solidity implementation in [**LSP14Ownable2Step**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Function signature: `acceptOwnership()` +- Function selector: `0x79ba5097` + +::: + +```solidity +function acceptOwnership() external nonpayable; +``` + +_`msg.sender` is accepting ownership of contract: `address(this)`._ + +Transfer ownership of the contract from the current [`owner()`](#owner) to the [`pendingOwner()`](#pendingowner). Once this function is called: + +- The current [`owner()`](#owner) will loose access to the functions restricted to the [`owner()`](#owner) only. + +- The [`pendingOwner()`](#pendingowner) will gain access to the functions restricted to the [`owner()`](#owner) only. + +
+ +**Requirements:** + +- This function can only be called by the [`pendingOwner()`](#pendingowner). + +
+ +### owner + +:::note Links + +- Specification details in [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#owner) +- Solidity implementation in [**LSP14Ownable2Step**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Function signature: `owner()` +- Function selector: `0x8da5cb5b` + +::: + +```solidity +function owner() external view returns (address); +``` + +Returns the address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------- | +| `0` | `address` | - | + +### pendingOwner + +:::note Links + +- Specification details in [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#pendingowner) +- Solidity implementation in [**LSP14Ownable2Step**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Function signature: `pendingOwner()` +- Function selector: `0xe30c3978` + +::: + +:::info + +If no ownership transfer is in progress, the pendingOwner will be `address(0).`. + +::: + +```solidity +function pendingOwner() external view returns (address); +``` + +The address that ownership of the contract is transferred to. This address may use [`acceptOwnership()`](#acceptownership) to gain ownership of the contract. + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------- | +| `0` | `address` | - | + +### renounceOwnership + +:::note Links + +- Specification details in [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#renounceownership) +- Solidity implementation in [**LSP14Ownable2Step**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Function signature: `renounceOwnership()` +- Function selector: `0x715018a6` + +::: + +:::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. + +::: + +```solidity +function renounceOwnership() external nonpayable; +``` + +_`msg.sender` is renouncing ownership of contract: `address(this)`._ + +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. + +### transferOwnership + +:::note Links + +- Specification details in [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#transferownership) +- Solidity implementation in [**LSP14Ownable2Step**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Function signature: `transferOwnership(address)` +- Function selector: `0xf2fde38b` + +::: + +```solidity +function transferOwnership(address newOwner) external nonpayable; +``` + +_Transfer ownership initiated by `newOwner`._ + +Initiate the process of transferring ownership of the contract by setting the new owner as the pending owner. If the new owner is a contract that supports + implements LSP1, this will also attempt to notify the new owner that ownership has been transferred to them by calling the [`universalReceiver()`](#universalreceiver) function on the `newOwner` contract. + +
+ +**Requirements:** + +- `newOwner` cannot accept ownership of the contract in the same transaction. + +
+ +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ----------------------------- | +| `newOwner` | `address` | The address of the new owner. | + +## Events + +### OwnershipRenounced + +:::note Links + +- Specification details in [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#ownershiprenounced) +- Solidity implementation in [**LSP14Ownable2Step**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Event signature: `OwnershipRenounced()` +- Event hash: `0xd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce` + +::: + +```solidity +event OwnershipRenounced(); +``` + +_Ownership renouncement complete._ + +Emitted when the ownership of the contract has been renounced. + +### OwnershipTransferStarted + +:::note Links + +- Specification details in [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#ownershiptransferstarted) +- Solidity implementation in [**LSP14Ownable2Step**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Event signature: `OwnershipTransferStarted(address,address)` +- Event hash: `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700` + +::: + +```solidity +event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); +``` + +_Ownership transfer initiated. From: `previousOwner`. To: `newOwner`._ + +Emitted when starting the [`transferOwnership(..)`](#transferownership) 2-step process. + +#### Parameters + +| Name | Type | Description | +| ----------------------------- | :-------: | --------------------------------- | +| `previousOwner` **`indexed`** | `address` | The address of the previous owner | +| `newOwner` **`indexed`** | `address` | The address of the new owner | + +### OwnershipTransferred + +:::note Links + +- Specification details in [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#ownershiptransferred) +- Solidity implementation in [**LSP14Ownable2Step**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Event signature: `OwnershipTransferred(address,address)` +- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` + +::: + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); +``` + +_Ownership transfering from: `previousOwner` to `newOwner`._ + +Emitted when ownership is tranferred. + +#### Parameters + +| Name | Type | Description | +| ----------------------------- | :-------: | ---------------------------------- | +| `previousOwner` **`indexed`** | `address` | The address of the previous owner. | +| `newOwner` **`indexed`** | `address` | The address of the new owner. | + +### RenounceOwnershipStarted + +:::note Links + +- Specification details in [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#renounceownershipstarted) +- Solidity implementation in [**LSP14Ownable2Step**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Event signature: `RenounceOwnershipStarted()` +- Event hash: `0x81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e7` + +::: + +```solidity +event RenounceOwnershipStarted(); +``` + +_Ownership renouncement initiated._ + +Emitted when starting the [`renounceOwnership(..)`](#renounceownership) 2-step process. + +## Errors + +### CannotTransferOwnershipToSelf + +:::note Links + +- Specification details in [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#cannottransferownershiptoself) +- Solidity implementation in [**LSP14Ownable2Step**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Error signature: `CannotTransferOwnershipToSelf()` +- Error hash: `0x43b248cd` + +::: + +```solidity +error CannotTransferOwnershipToSelf(); +``` + +_Cannot transfer ownerhsip to yourself._ + +Reverts when trying to transfer ownership to the `address(this)` + +### NotInRenounceOwnershipInterval + +:::note Links + +- Specification details in [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#notinrenounceownershipinterval) +- Solidity implementation in [**LSP14Ownable2Step**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Error signature: `NotInRenounceOwnershipInterval(uint256,uint256)` +- Error hash: `0x8b9bf507` + +::: + +```solidity +error NotInRenounceOwnershipInterval( + uint256 renounceOwnershipStart, + uint256 renounceOwnershipEnd +); +``` + +_Cannot confirm ownership renouncement yet. The ownership renouncement is allowed from: `renounceOwnershipStart` until: `renounceOwnershipEnd`._ + +Reverts when trying to renounce ownership before the initial confirmation delay + +#### Parameters + +| Name | Type | Description | +| ------------------------ | :-------: | ------------------------------------------------------------------------------- | +| `renounceOwnershipStart` | `uint256` | The start of the period when you one can confirm the renouncement of ownership. | +| `renounceOwnershipEnd` | `uint256` | The end of the period when you one can confirm the renouncement of ownership. | + + + + + +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md +[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md +[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md +[LSP-3-UniversalProfile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md +[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md +[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md +[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md +[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md +[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md +[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md +[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md +[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md +[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md +[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md +[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md +[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md +[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md +[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md + + + +[ERC725]: https://docs.lukso.tech/standards/lsp-background/erc725 +[UniversalProfile]: https://docs.lukso.tech/standards/universal-profile/introduction +[LSP0ERC725Account]: https://docs.lukso.tech/standards/universal-profile/lsp0-erc725account +[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver +[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/generic-standards/lsp1-universal-receiver-delegate +[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/generic-standards/lsp2-json-schema +[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/nft-2.0/LSP4-Digital-Asset-Metadata +[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp5-received-assets +[LSP6KeyManager]: https://docs.lukso.tech/standards/universal-profile/lsp6-key-manager +[LSP7DigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP7-Digital-Asset +[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/nft-2.0/LSP8-Identifiable-Digital-Asset +[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/universal-profile/lsp10-received-vaults +[LSP14Ownable2Step]: https://docs.lukso.tech/standards/generic-standards/lsp14-ownable-2-step +[LSP17ContractExtension]: https://docs.lukso.tech/standards/generic-standards/lsp17-contract-extension +[LSP20CallVerification]: https://docs.lukso.tech/standards/generic-standards/lsp20-call-verification + + + +[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725.sol +[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Init.sol +[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725InitAbstract +[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725X.sol +[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInit.sol +[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XInitAbstract.sol +[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/interfaces/IERC725Y.sol +[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInit.sol +[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YInitAbstract.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/ERC165.sol +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/proxy/utils/Initializable.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/EnumerableSet.sol +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YCore.sol +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XCore.sol +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/custom/OwnableUnset.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol + + + +[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Utils.sol +[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP0ERC725Account/LSP0Constants.sol +[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInitAbstract.sol +[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfile.sol +[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/UniversalProfileInit.sol +[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Utils.sol +[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Constants.sol +[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP1UniversalReceiver/LSP1Errors.sol +[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/ontracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +[`LSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +[`ILSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Utils.sol +[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Constants.sol +[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/ILSP6KeyManager.sol +[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Errors.sol +[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol +[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManager.sol +[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +[`LSP7DigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +[`LSP7CompatibleERC20InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +[`LSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +[`LSP7CompatibleERC20MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +[`LSP7CompatibleERC20Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Errors.sol +[`LSP7CompatibleERC20MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +[`ILSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP7DigitalAsset/LSP7Constants.sol +[`LSP8IdentifiableDigitalAssetCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +[`LSP8CompatibleERC721InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +[`LSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +[`ILSP8CompatibleERC721.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +[`LSP8CompatibleERC721MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.s +[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +[`LSP8CompatibleERC721Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +[`LSP8CompatibleERC721MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.s +[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Constants.sol +[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP14Ownable2Step/LSP14Errors.sol +[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extendable.sol +[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Extension.sol +[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Constants.sol +[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Errors.sol +[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP17ContractExtension/LSP17Utils.sol +[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20CallVerification.sol +[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/ILSP20CallVerifier.sol +[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Constants.sol +[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP20CallVerification/LSP20Errors.sol +[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Utils.sol +[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP5ReceivedAssets/LSP5Constants.sol +[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Utils.sol +[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/contracts/LSP10ReceivedVaults/LSP10Constants.sol + + diff --git a/docs/guides/key-manager/upgrade-lsp6.md b/docs/guides/key-manager/upgrade-lsp6.md index cc36eb0d17..62fc37bd0b 100644 --- a/docs/guides/key-manager/upgrade-lsp6.md +++ b/docs/guides/key-manager/upgrade-lsp6.md @@ -188,7 +188,7 @@ const newKeyManager = await new ethers.ContractFactory( ### Step 5.1 - Transfer Ownership to your new Key Manager -Create a calldata for the [`transferOwnership(address)`](../../standards/smart-contracts/lsp14-ownable-2-step.md#transferownership) function and shift the ownership of your Universal Profile from your current LSP6 Key Manager. +Create a calldata for the [`transferOwnership(address)`](../../contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md#transferownership) function and shift the ownership of your Universal Profile from your current LSP6 Key Manager. @@ -218,7 +218,7 @@ await universalProfile ### Step 5.2 - Accept Ownership from your new Key Manager -Create a calldata for the [`acceptOwnership()`](../../standards/smart-contracts/lsp14-ownable-2-step.md#acceptownership) function and take the ownership of your Universal Profile from your new LSP6 Key Manager. +Create a calldata for the [`acceptOwnership()`](../../contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md#acceptownership) function and take the ownership of your Universal Profile from your new LSP6 Key Manager. diff --git a/docs/standards/generic-standards/lsp14-ownable-2-step.md b/docs/standards/generic-standards/lsp14-ownable-2-step.md index 5669290b31..76c6f8b246 100644 --- a/docs/standards/generic-standards/lsp14-ownable-2-step.md +++ b/docs/standards/generic-standards/lsp14-ownable-2-step.md @@ -38,11 +38,11 @@ In addition, this standard defines hooks that call the **[universalReceiver(...) The control of the contract is fully transferred _once the new owner has accepted the new ownership_. The 2 steps of ownership transfer are described below: -1. The previous owner transfers ownership to a new owner via the [`transferOwnership(...)`](../smart-contracts/lsp14-ownable-2-step.md#transferownership) function. +1. The previous owner transfers ownership to a new owner via the [`transferOwnership(...)`](../../contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md#transferownership) function. ![Transfer Ownership](/img/standards/lsp14/transfer-ownership.jpeg) -2. The new owner claims ownership of the contract by calling the [`acceptOwnership()`](../smart-contracts/lsp14-ownable-2-step.md#acceptownership)` function. +2. The new owner claims ownership of the contract by calling the [`acceptOwnership()`](../../contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md #acceptownership)` function. ![Accept Ownership](/img/standards/lsp14/accept-ownership.jpeg) @@ -69,8 +69,8 @@ Each hook is executed whenever the _new owner confirms the process of tranferrin The control of the contract is refully renounced _once the owner of the contract confirmes the ownership renouncement_. The 2 steps of ownership renouncement are described below: -1. The owner initiates the process of ownerhsip renouncement via the ['renounceOwnership()'](../smart-contracts/lsp14-ownable-2-step.md#renounceownership) function. +1. The owner initiates the process of ownerhsip renouncement via the ['renounceOwnership()'](../../contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md#renounceownership) function. -2. After waiting for 200 blocks to pass from the intiation of the ownership renouncement process the owner has a window of 200 block for confirming the renouncement via ['renounceOwnership()'](../smart-contracts/lsp14-ownable-2-step.md#renounceownership). If the owner doesn't confirm in that window of time, the process cannot be confirmed and the owner must start again if it was intended to renounce ownership. +2. After waiting for 200 blocks to pass from the intiation of the ownership renouncement process the owner has a window of 200 block for confirming the renouncement via ['renounceOwnership()'](../../contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md#renounceownership). If the owner doesn't confirm in that window of time, the process cannot be confirmed and the owner must start again if it was intended to renounce ownership. ![Renounce Ownership](/img/standards/lsp14/renounce-ownership.jpeg) diff --git a/docs/standards/smart-contracts/lsp14-ownable-2-step.md b/docs/standards/smart-contracts/lsp14-ownable-2-step.md deleted file mode 100644 index 627a9ccf3e..0000000000 --- a/docs/standards/smart-contracts/lsp14-ownable-2-step.md +++ /dev/null @@ -1,158 +0,0 @@ ---- -title: LSP14Ownable2Step -sidebar_position: 12 ---- - -# LSP14Ownable2Step - -:::info Solidity contract - -[`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - -::: - -The **LSP14Ownable2Step** contract is an implementation of the **[LSP14-Ownable-2-Step Standard](#)**. - -This contract can be **inherited** whenever one wants to make his contract **owned** by an EOA or by another contract. This contract contains all the necessary methods for **managing the ownership** of a contract, **`tranferOwnership(...)`**, **`acceptOwnership(...)`** and **`renounceOwnership(...)`**. - ---- - -## Functions - -### owner - -```solidity -function owner() public view returns (address owner) -``` - -Returns the address of the current contract owner. - -#### Return Values: - -| Name | Type | Description | -| :------ | :-------- | :--------------------------------- | -| `owner` | `address` | The current owner of the contract. | - -### pendingOwner - -```solidity -function pendingOwner() public view returns (address) -``` - -Return the address of the pending owner that was initiated by [`transferOwnership(address)`](#transferownership). - -> **NB:** if no ownership transfer is in progress, the `pendingOwner` MUST be `address(0)`. - -#### Return Values: - -| Name | Type | Description | -| :------------- | :-------- | :------------------------------- | -| `pendingOwner` | `address` | The address of the pending owner | - -### transferOwnership - -```solidity -function transferOwnership(address newOwner) public -``` - -Initiate an ownership transfer by setting the `newOwner` as `pendingOwner`. - -Requirements: - -- Can only be called by the current owner. -- The `newOwner` to be set as the `pendingOwner` cannot be `address(this)`. - -#### Parameters: - -| Name | Type | Description | -| :--------- | :-------- | :------------------------------------ | -| `newOwner` | `address` | The address to set as `pendingOwner`. | - -### acceptOwnership - -```solidity -function acceptOwnership() public -``` - -Transfers ownership of the contract to the `pendingOwner` address. Can only be called by the `pendingOwner`. - -_Triggers the **[OwnershipTransferred](#ownershiptransferred)** event once the new owner has claimed ownership._ - -### renounceOwnership - -```solidity -function renounceOwnership() public -``` - -Since renouncing ownership is a sensitive operation, it is done as a two step process by calling `renounceOwnership(..)` twice. First to initiate the process, second as a confirmation. - -The current block number is saved as a part of initiation because the following behaviour is wanted: - -- The first 100 blocks after the saved block is the pending period, if you call `renounceOwnership(..)` during this period, the transaction will be reverted. -- the following 100 blocks is the period when you can confirm the renouncement of the contract by calling `renounceOwnership(..)` the second time. - -_Triggers the **[RenounceOwnershipStarted](#RenounceOwnershipStarted)** event in the first call._ - -_Triggers the **[OwnershipTransferred](#ownershiptransferred)** and **[OwnershipRenounced](#ownershiprenounced)** events after successfully renouncing ownership._ - -:::warning -Leaves the contract without an owner. Once ownership of the contract is renounced, it won't be possible to call the functions restricted to the owner only. -::: - -## Events - -### OwnershipTransferStarted - -```solidity -event OwnershipTransferred( - address indexed currentOwner, - address indexed newOwner, -) -``` - -_**MUST** be fired when the **[`transferOwnership(...)`](#transferownership)** function is successfully initiated._ - -#### Values: - -| Name | Type | Description | -| :------------- | :-------- | :--------------------------------------- | -| `currentOwner` | `address` | The current owner of the contract. | -| `newOwner` | `address` | The potential new owner of the contract. | - -### OwnershipTransferred - -```solidity -event OwnershipTransferred( - address indexed previousOwner, - address indexed newOwner, -) -``` - -_**MUST** be fired when the **[`transferOwnership(...)`](#transferownership)** function is successfully executed._ - -#### Values: - -| Name | Type | Description | -| :-------------- | :-------- | :---------------------------------- | -| `previousOwner` | `address` | The previous owner of the contract. | -| `newOwner` | `address` | The new owner of the contract. | - -### RenounceOwnershipStarted - -```solidity -event RenounceOwnershipStarted() -``` - -_**MUST** be fired when the **[`renounceOwnership()`](#renounceownership)** process is initiated._ - -### OwnershipRenounced - -```solidity -event OwnershipRenounced() -``` - -_**MUST** be fired when the **[`renounceOwnership()`](#renounceownership)** process is confirmed._ - -## References - -- [Solidity implementations (GitHub)](https://github.com/lukso-network/lsp-universalprofile-smart-contracts/tree/develop/contracts) diff --git a/docs/standards/universal-profile/lsp0-erc725account.md b/docs/standards/universal-profile/lsp0-erc725account.md index 681fbc4468..66a69c2c75 100644 --- a/docs/standards/universal-profile/lsp0-erc725account.md +++ b/docs/standards/universal-profile/lsp0-erc725account.md @@ -188,7 +188,7 @@ The **UniversalReceiverDelegate** contracts **provides optional interactions** t See the **[LSP14 - Ownable2Step](../generic-standards/lsp14-ownable-2-step.md)** standard for more information. -Check the [**LSP14 functions**](../smart-contracts/lsp14-ownable-2-step.md) allowing 2 step ownership transfers. +Check the [**LSP14 functions**](../../contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md) allowing 2 step ownership transfers. Check the **javascript** guides to know [**How to transferOwnership of a Profile**](../../guides/key-manager/upgrade-lsp6.md). diff --git a/docs/standards/universal-profile/lsp9-vault.md b/docs/standards/universal-profile/lsp9-vault.md index a4a5614cfe..4974fff72e 100644 --- a/docs/standards/universal-profile/lsp9-vault.md +++ b/docs/standards/universal-profile/lsp9-vault.md @@ -102,9 +102,9 @@ See the **[LSP14 - Ownable2Step](../generic-standards/lsp14-ownable-2-step.md)** This standard allows for the **LSP9 - Vault** contract's ownership to be controlled by an EOA or by another contract, by implementing **3 essential methods**: -- [`transferOwnership()`](../smart-contracts/lsp14-ownable-2-step.md#transferownership) -- [`acceptOwnership()`](../smart-contracts/lsp14-ownable-2-step.md#acceptownership) -- [`renounceOwnership()`](../smart-contracts/lsp14-ownable-2-step.md#renounceownership) +- [`transferOwnership()`](../../contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md) +- [`acceptOwnership()`](../../contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md) +- [`renounceOwnership()`](../../contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md) ### Flow diff --git a/docusaurus.config.js b/docusaurus.config.js index eaead89ebd..501bbd8bed 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -110,6 +110,10 @@ module.exports = { from: '/standards/smart-contracts/lsp8-identifiable-digital-asset', to: '/contracts/contracts/LSP8IdentifiableDigitalAsset', }, + { + from: '/standards/smart-contracts/lsp14-ownable-2-step', + to: '/contracts/contracts/LSP14Ownable2Step', + }, ], }, ],