diff --git a/docs/contracts/_interface_ids_table.mdx b/docs/contracts/_interface_ids_table.mdx index b5de77d4ad..afbc03a90a 100644 --- a/docs/contracts/_interface_ids_table.mdx +++ b/docs/contracts/_interface_ids_table.mdx @@ -4,9 +4,9 @@ | **ERC1271** | `0x1626ba7e` | Standard Signature Validation Method for Contracts. | | **ERC725X** | `0x7545acac` | General executor. | | **ERC725Y** | `0x629aa694` | General Data key-value store. | -| **LSP0ERC725Account** | `0x3e89ad98` | Interface of the LSP0 - ERC725Account standard, an account based smart contract that represents an identity on-chain. | +| **LSP0ERC725Account** | `0x24871b3d` | Interface of the [LSP-0-ERC725Account] standard, an account based smart contract that represents an identity on-chain. | | **LSP1UniversalReceiver** | `0x6bb56a14` | Interface of the LSP1 - Universal Receiver standard, an entry function for a contract to receive arbitrary information. | -| **LSP6KeyManager** | `0x38bb3cdb` | Interface of the LSP6 - Key Manager standard, a contract acting as a controller of an ERC725 Account using predfined permissions. | +| **LSP6KeyManager** | `0x627ca5d3` | Interface of the LSP6 - Key Manager standard, a contract acting as a controller of an ERC725 Account using predfined permissions. | | **LSP7DigitalAsset** | `0xda1f85e4` | Interface of the LSP7 - Digital Asset standard, a fungible digital asset. | | **LSP8IdentifiableDigitalAsset** | `0x622e7a01` | Interface of the LSP8 - Identifiable Digital Asset standard, a non-fungible digital asset. | | **LSP9Vault** | `0x28af17e6` | Interface of LSP9 - Vault standard, a blockchain vault that can hold assets and interact with other smart contracts. | @@ -16,5 +16,4 @@ | **LSP17Extension** | `0xcee78b40` | Module to create a contract that can act as an extension. | | **LSP20CallVerification** | `0x1a0eb6a5` | Implementation of a contract calling the verification functions according to LSP20 - Call Verification standard. | | **LSP20CallVerifier** | `0x480c0ec2` | Interface for the LSP20 Call Verification standard, a set of functions intended to perform verifications on behalf of another contract. | - -[eip173]: https://eips.ethereum.org/EIPS/eip-173 +| **LSP25ExecuteRelayCall** | `0x5ac79908` | | diff --git a/docs/contracts/_links.md b/docs/contracts/_links.md index 6d27ef70ba..42dca5ef52 100644 --- a/docs/contracts/_links.md +++ b/docs/contracts/_links.md @@ -1,3 +1,4 @@ + diff --git a/docs/contracts/contracts/ERC725/ERC725.md b/docs/contracts/contracts/ERC725/ERC725.md index 6baa9353e7..13ee244734 100644 --- a/docs/contracts/contracts/ERC725/ERC725.md +++ b/docs/contracts/contracts/ERC725/ERC725.md @@ -1,8 +1,16 @@ + + + # ERC725 -:::info Solidity contract +:::info Standard Specifications + +[`ERC-725`](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md) + +::: +:::info Solidity implementation -[`ERC725.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +[`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) ::: @@ -10,14 +18,17 @@ Bundle ERC725X and ERC725Y together into one smart contract. This implementation does not have by default a `receive() external payable {}` or `fallback() external payable {}` function. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### constructor -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#constructor) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#constructor) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) ::: @@ -43,12 +54,14 @@ Deploy a new ERC725 contract with the provided `initialOwner` as the contract [` | -------------- | :-------: | -------------------------- | | `initialOwner` | `address` | the owner of the contract. | +
+ ### execute -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#execute) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#execute) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Function signature: `execute(uint256,address,uint256,bytes)` - Function selector: `0x44c028fe` @@ -108,12 +121,14 @@ Generic executor function to: | ---- | :-----: | ----------- | | `0` | `bytes` | - | +
+ ### executeBatch -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#executebatch) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#executebatch) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Function signature: `executeBatch(uint256[],address[],uint256[],bytes[])` - Function selector: `0x31858452` @@ -166,12 +181,14 @@ Batch executor function that behaves the same as [`execute`](#execute) but allow | ---- | :-------: | ----------- | | `0` | `bytes[]` | - | +
+ ### getData -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#getdata) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#getdata) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -197,12 +214,14 @@ Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey | ----------- | :-----: | ---------------------------------------------------- | | `dataValue` | `bytes` | The bytes value stored under the specified data key. | +
+ ### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#getdatabatch) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#getdatabatch) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -230,12 +249,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### owner -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#owner) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#owner) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -253,12 +274,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#renounceownership) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#renounceownership) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -270,12 +293,14 @@ 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. +
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#setdata) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#setdata) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` @@ -318,12 +343,14 @@ Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data | `dataKey` | `bytes32` | The data key for which to set a new value. | | `dataValue` | `bytes` | The new bytes value to set. | +
+ ### setDataBatch -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#setdatabatch) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#setdatabatch) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` @@ -366,12 +393,14 @@ Batch data setting function that behaves the same as [`setData`](#setdata) but a | `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. | | `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +
+ ### supportsInterface -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#supportsinterface) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#supportsinterface) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -395,12 +424,14 @@ See [`IERC165-supportsInterface`](#ierc165-supportsinterface). | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### transferOwnership -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#transferownership) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#transferownership) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -418,18 +449,264 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | ---- +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_execute + +```solidity +function _execute( + uint256 operationType, + address target, + uint256 value, + bytes data +) internal nonpayable returns (bytes); +``` + +check the `operationType` provided and perform the associated low-level opcode after checking for requirements (see [`execute`](#execute)). + +
+ +### \_executeBatch + +```solidity +function _executeBatch( + uint256[] operationsType, + address[] targets, + uint256[] values, + bytes[] datas +) internal nonpayable returns (bytes[]); +``` + +check each `operationType` provided in the batch and perform the associated low-level opcode after checking for requirements (see [`executeBatch`](#executebatch)). + +
+ +### \_executeCall + +```solidity +function _executeCall( + address target, + uint256 value, + bytes data +) internal nonpayable returns (bytes result); +``` + +Perform low-level call (operation type = 0) + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------------- | +| `target` | `address` | The address on which call is executed | +| `value` | `uint256` | The value to be sent with the call | +| `data` | `bytes` | The data to be sent with the call | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | ---------------------- | +| `result` | `bytes` | The data from the call | + +
+ +### \_executeStaticCall + +```solidity +function _executeStaticCall( + address target, + bytes data +) internal nonpayable returns (bytes result); +``` + +Perform low-level staticcall (operation type = 3) + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------------------- | +| `target` | `address` | The address on which staticcall is executed | +| `data` | `bytes` | The data to be sent with the staticcall | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | ------------------------------------- | +| `result` | `bytes` | The data returned from the staticcall | + +
+ +### \_executeDelegateCall + +```solidity +function _executeDelegateCall( + address target, + bytes data +) internal nonpayable returns (bytes result); +``` + +Perform low-level delegatecall (operation type = 4) + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | --------------------------------------------- | +| `target` | `address` | The address on which delegatecall is executed | +| `data` | `bytes` | The data to be sent with the delegatecall | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | --------------------------------------- | +| `result` | `bytes` | The data returned from the delegatecall | + +
+ +### \_deployCreate + +```solidity +function _deployCreate( + uint256 value, + bytes creationCode +) internal nonpayable returns (bytes newContract); +``` + +Deploy a contract using the `CREATE` opcode (operation type = 1) + +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | ---------------------------------------------------------------------------------- | +| `value` | `uint256` | The value to be sent to the contract created | +| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) | + +#### Returns + +| Name | Type | Description | +| ------------- | :-----: | -------------------------------------------- | +| `newContract` | `bytes` | The address of the contract created as bytes | + +
+ +### \_deployCreate2 + +```solidity +function _deployCreate2( + uint256 value, + bytes creationCode +) internal nonpayable returns (bytes newContract); +``` + +Deploy a contract using the `CREATE2` opcode (operation type = 2) + +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | ----------------------------------------------------------------------------------------------------- | +| `value` | `uint256` | The value to be sent to the contract created | +| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) and a bytes32 salt | + +#### Returns + +| Name | Type | Description | +| ------------- | :-----: | -------------------------------------------- | +| `newContract` | `bytes` | The address of the contract created as bytes | + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +Read the value stored under a specific `dataKey` inside the underlying ERC725Y storage, +represented as a mapping of `bytes32` data keys mapped to their `bytes` data values. + +```solidity +mapping(bytes32 => bytes) _store +``` + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | ----------------------------------------------------------------------- | +| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. | + +#### Returns + +| Name | Type | Description | +| ----------- | :-----: | ----------------------------------------------------------------------------- | +| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. | + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +Write a `dataValue` to the underlying ERC725Y storage, represented as a mapping of +`bytes32` data keys mapped to their `bytes` data values. + +```solidity +mapping(bytes32 => bytes) _store +``` + +
+ +**Emitted events:** + +- [`DataChanged`](#datachanged) event emitted after a successful `setData` call. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | ------------------------------------------------------------------------------- | +| `dataKey` | `bytes32` | A bytes32 data key to write the associated `bytes` value to the store. | +| `dataValue` | `bytes` | The `bytes` value to associate with the given `dataKey` in the ERC725Y storage. | + +
## Events ### ContractCreated -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#contractcreated) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#contractcreated) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Event signature: `ContractCreated(uint256,address,uint256,bytes32)` -- Event hash: `0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3` +- Event topic hash: `0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3` ::: @@ -439,7 +716,7 @@ event ContractCreated(uint256 indexed operationType, address indexed contractAdd _Deployed new contract at address `contractAddress` and funded with `value` wei (deployed using opcode: `operationType`)._ -Emitted when a new contract was created and deployed. +Emitted whenever a contract is created #### Parameters @@ -450,14 +727,16 @@ Emitted when a new contract was created and deployed. | `value` **`indexed`** | `uint256` | The amount of native tokens (in Wei) sent to fund the created contract on deployment. | | `salt` | `bytes32` | The salt used to deterministically deploy the contract (`CREATE2` only). If `CREATE` opcode is used, the salt value will be `bytes32(0)`. | +
+ ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#datachanged) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#datachanged) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -476,14 +755,16 @@ Emitted when data at a specific `dataKey` was changed to a new value `dataValue` | `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | | `dataValue` | `bytes` | The value to set for the given data key. | +
+ ### Executed -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#executed) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#executed) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Event signature: `Executed(uint256,address,uint256,bytes4)` -- Event hash: `0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e` +- Event topic hash: `0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e` ::: @@ -504,14 +785,16 @@ Emitted when calling an address `target` (EOA or contract) with `value`. | `value` **`indexed`** | `uint256` | The amount of native tokens transferred along the call (in Wei). | | `selector` | `bytes4` | The first 4 bytes (= function selector) of the data sent with the call. | +
+ ### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#ownershiptransferred) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#ownershiptransferred) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -526,16 +809,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | ---- +
## Errors ### ERC725X_ContractDeploymentFailed -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#erc725x_contractdeploymentfailed) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_contractdeploymentfailed) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Error signature: `ERC725X_ContractDeploymentFailed()` - Error hash: `0x0b07489b` @@ -547,12 +830,14 @@ error ERC725X_ContractDeploymentFailed(); Reverts when contract deployment failed via [`execute`](#execute) or [`executeBatch`](#executebatch) functions, This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`). +
+ ### ERC725X_CreateOperationsRequireEmptyRecipientAddress -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#erc725x_createoperationsrequireemptyrecipientaddress) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_createoperationsrequireemptyrecipientaddress) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Error signature: `ERC725X_CreateOperationsRequireEmptyRecipientAddress()` - Error hash: `0x3041824a` @@ -564,12 +849,14 @@ error ERC725X_CreateOperationsRequireEmptyRecipientAddress(); Reverts when passing a `to` address that is not `address(0)` (= address zero) while deploying a contract via [`execute`](#execute) or [`executeBatch`](#executebatch) functions. This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`). +
+ ### ERC725X_ExecuteParametersEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#erc725x_executeparametersemptyarray) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_executeparametersemptyarray) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Error signature: `ERC725X_ExecuteParametersEmptyArray()` - Error hash: `0xe9ad2b5f` @@ -581,12 +868,14 @@ error ERC725X_ExecuteParametersEmptyArray(); Reverts when one of the array parameter provided to the [`executeBatch`](#executebatch) function is an empty array. +
+ ### ERC725X_ExecuteParametersLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#erc725x_executeparameterslengthmismatch) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_executeparameterslengthmismatch) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Error signature: `ERC725X_ExecuteParametersLengthMismatch()` - Error hash: `0x3ff55f4d` @@ -598,12 +887,14 @@ error ERC725X_ExecuteParametersLengthMismatch(); Reverts when there is not the same number of elements in the `operationTypes`, `targets` addresses, `values`, and `datas` array parameters provided when calling the [`executeBatch`](#executebatch) function. +
+ ### ERC725X_InsufficientBalance -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#erc725x_insufficientbalance) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_insufficientbalance) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Error signature: `ERC725X_InsufficientBalance(uint256,uint256)` - Error hash: `0x0df9a8f8` @@ -617,17 +908,19 @@ Reverts when trying to send more native tokens `value` than available in current #### Parameters -| Name | Type | Description | -| --------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `balance` | `uint256` | The balance of native tokens of the ERC725X smart contract. | -| `value` | `uint256` | The amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` that is greater than the contract's `balance`. | +| Name | Type | Description | +| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- | +| `balance` | `uint256` | The balance of native tokens of the ERC725X smart contract. | +| `value` | `uint256` | The amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` that is greater than the contract's `balance`. | + +
### ERC725X_MsgValueDisallowedInDelegateCall -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#erc725x_msgvaluedisallowedindelegatecall) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_msgvaluedisallowedindelegatecall) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Error signature: `ERC725X_MsgValueDisallowedInDelegateCall()` - Error hash: `0x5ac83135` @@ -639,12 +932,14 @@ error ERC725X_MsgValueDisallowedInDelegateCall(); Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `delegatecall` (`operationType == 4`). Sending native tokens via `staticcall` is not allowed because `msg.value` is persisting. +
+ ### ERC725X_MsgValueDisallowedInStaticCall -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#erc725x_msgvaluedisallowedinstaticcall) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_msgvaluedisallowedinstaticcall) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Error signature: `ERC725X_MsgValueDisallowedInStaticCall()` - Error hash: `0x72f2bc6a` @@ -656,12 +951,14 @@ error ERC725X_MsgValueDisallowedInStaticCall(); Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `staticcall` (`operationType == 3`). Sending native tokens via `staticcall` is not allowed because it is a state changing operation. +
+ ### ERC725X_NoContractBytecodeProvided -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#erc725x_nocontractbytecodeprovided) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_nocontractbytecodeprovided) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Error signature: `ERC725X_NoContractBytecodeProvided()` - Error hash: `0xb81cd8d9` @@ -673,12 +970,14 @@ error ERC725X_NoContractBytecodeProvided(); Reverts when no contract bytecode was provided as parameter when trying to deploy a contract via [`execute`](#execute) or [`executeBatch`](#executebatch). This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`). +
+ ### ERC725X_UnknownOperationType -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#erc725x_unknownoperationtype) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_unknownoperationtype) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Error signature: `ERC725X_UnknownOperationType(uint256)` - Error hash: `0x7583b3bc` @@ -696,12 +995,14 @@ Reverts when the `operationTypeProvided` is none of the default operation types | ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------ | | `operationTypeProvided` | `uint256` | The unrecognised operation type number provided to `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`. | +
+ ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -713,12 +1014,14 @@ error ERC725Y_DataKeysValuesEmptyArray(); Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array. +
+ ### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -730,12 +1033,14 @@ error ERC725Y_DataKeysValuesLengthMismatch(); Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. +
+ ### ERC725Y_MsgValueDisallowed -:::note Links +:::note References -- Specification details in [**LSP-725-undefined**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-725-undefined.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**ERC725**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/ERC725) +- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -747,6 +1052,8 @@ error ERC725Y_MsgValueDisallowed(); Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function. +
+ diff --git a/docs/contracts/contracts/LSP0ERC725Account/LSP0ERC725Account.md b/docs/contracts/contracts/LSP0ERC725Account/LSP0ERC725Account.md index 3fd166128a..98951db2a0 100644 --- a/docs/contracts/contracts/LSP0ERC725Account/LSP0ERC725Account.md +++ b/docs/contracts/contracts/LSP0ERC725Account/LSP0ERC725Account.md @@ -1,12 +1,20 @@ + + + # LSP0ERC725Account -:::info Soldity contract +:::info Standard Specifications + +[`LSP-0-ERC725Account`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md) + +::: +:::info Solidity implementation [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) ::: -> Deployable Implementation of LSP0-ERC725Account Standard https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md +> Deployable Implementation of [LSP-0-ERC725Account] Standard. A smart contract account including basic functionalities such as: @@ -14,26 +22,29 @@ A smart contract account including basic functionalities such as: - Executing several operation on other addresses including creating contracts using [ERC-725X] -- Storing data in a generic way using [ERC-725Y] +- A generic data key-value store using [ERC-725Y] - Validating signatures using [ERC-1271] - Receiving notification and react on them using [LSP-1-UniversalReceiver] -- Secure ownership management using [LSP-14-Ownable2Step] +- Safer ownership management through 2-steps transfer using [LSP-14-Ownable2Step] - Extending the account with new functions and interfaceIds of future standards using [LSP-17-ContractExtension] -- Verifying calls on the owner to allow unified and standard interaction with the account using [LSP-20-CallVerification] +- Verifying calls on the owner to make it easier to interact with the account directly using [LSP-20-CallVerification] + +## Public Methods -## Methods +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### constructor -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#constructor) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#constructor) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) ::: @@ -41,7 +52,7 @@ A smart contract account including basic functionalities such as: constructor(address initialOwner); ``` -_Deploying an LSP0ERC725Account with owner set to: `initialOwner`_ +_Deploying a LSP0ERC725Account contract with owner set to address `initialOwner`._ Set `initialOwner` as the contract owner. The `constructor` also allows funding the contract on deployment. @@ -50,7 +61,7 @@ Set `initialOwner` as the contract owner. The `constructor` also allows funding **Emitted events:** - [`ValueReceived`](#valuereceived) event when funding the contract on deployment. -- [`OwnershipTransferred`](#ownershiptransferred) event when `initialOwner` is set. +- [`OwnershipTransferred`](#ownershiptransferred) event when `initialOwner` is set as the contract [`owner`](#owner). @@ -60,21 +71,25 @@ Set `initialOwner` as the contract owner. The `constructor` also allows funding | -------------- | :-------: | -------------------------- | | `initialOwner` | `address` | The owner of the contract. | +
+ ### fallback -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#fallback) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#fallback) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) ::: ```solidity -fallback() external payable; +fallback(bytes calldata callData) external payable returns (bytes memory); ``` -_Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively, forwarding the function call to the extension address mapped to the function being called._ +_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._ +Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively, +forwarding the function call to the extension address mapped to the function being called. This function is executed when: - Sending data of length less than 4 bytes to the contract. @@ -99,12 +114,14 @@ This function is executed when: +
+ ### receive -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#receive) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#receive) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) ::: @@ -126,12 +143,14 @@ Executed: +
+ ### RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#renounce_ownership_confirmation_delay) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#renounce_ownership_confirmation_delay) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY()` - Function selector: `0xead3fbdf` @@ -150,12 +169,14 @@ function RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY() | ---- | :-------: | ----------- | | `0` | `uint256` | - | +
+ ### RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#renounce_ownership_confirmation_period) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#renounce_ownership_confirmation_period) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD()` - Function selector: `0x01bfba61` @@ -174,12 +195,14 @@ function RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD() | ---- | :-------: | ----------- | | `0` | `uint256` | - | +
+ ### acceptOwnership -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#acceptownership) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#acceptownership) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `acceptOwnership()` - Function selector: `0x79ba5097` @@ -207,12 +230,14 @@ Transfer ownership of the contract from the current [`owner()`](#owner) to the [ +
+ ### batchCalls -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#batchcalls) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#batchcalls) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `batchCalls(bytes[])` - Function selector: `0x6963d438` @@ -228,6 +253,8 @@ It's not possible to send value along the functions call due to the use of ` function batchCalls(bytes[] data) external nonpayable returns (bytes[] results); ``` +_Executing the following batch of abi-encoded function calls on the contract: `data`._ + Allows a caller to batch different function calls in one call. Perform a `delegatecall` on self, to call different functions with preserving the context. #### Parameters @@ -240,14 +267,16 @@ Allows a caller to batch different function calls in one call. Perform a `delega | Name | Type | Description | | --------- | :-------: | ---------------------------------------------------------------- | -| `results` | `bytes[]` | An array of abi-encoded returned data by the executed functions. | +| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. | + +
### execute -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#execute) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#execute) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `execute(uint256,address,uint256,bytes)` - Function selector: `0x44c028fe` @@ -287,8 +316,8 @@ Generic executor function to: **Emitted events:** -- [`Executed`](#executed) event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). (each iteration) -- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2) (each iteration) +- [`Executed`](#executed) event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). +- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2). - [`ValueReceived`](#valuereceived) event when receiving native tokens. @@ -308,12 +337,14 @@ Generic executor function to: | ---- | :-----: | ----------- | | `0` | `bytes` | - | +
+ ### executeBatch -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#executebatch) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#executebatch) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `executeBatch(uint256[],address[],uint256[],bytes[])` - Function selector: `0x31858452` @@ -369,12 +400,14 @@ Batch executor function that behaves the same as [`execute`](#execute) but allow | ---- | :-------: | ----------- | | `0` | `bytes[]` | - | +
+ ### getData -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#getdata) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#getdata) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -400,12 +433,14 @@ Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey | ----------- | :-----: | ---------------------------------------------------- | | `dataValue` | `bytes` | The bytes value stored under the specified data key. | +
+ ### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#getdatabatch) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#getdatabatch) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -433,12 +468,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### isValidSignature -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#isvalidsignature) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#isvalidsignature) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `isValidSignature(bytes32,bytes)` - Function selector: `0x1626ba7e` @@ -480,12 +517,14 @@ Handles two cases: | ------------ | :------: | ----------------------------------------------------------------- | | `magicValue` | `bytes4` | A `bytes4` value that indicates if the signature is valid or not. | +
+ ### owner -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#owner) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#owner) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -503,12 +542,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### pendingOwner -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#pendingowner) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#pendingowner) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `pendingOwner()` - Function selector: `0xe30c3978` @@ -532,12 +573,14 @@ The address that ownership of the contract is transferred to. This address may u | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#renounceownership) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#renounceownership) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -553,13 +596,13 @@ Leaves the contract without an owner. Once ownership of the contract has been re function renounceOwnership() external nonpayable; ``` -_`msg.sender` is renouncing ownership of contract: `address(this)`._ +_`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. +2. The second call is used as a confirmation and will leave the contract without an owner.
@@ -569,12 +612,14 @@ Renounce ownership of the contract in a 2-step process.
+
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#setdata) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#setdata) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` @@ -612,12 +657,14 @@ Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data | `dataKey` | `bytes32` | The data key for which to set a new value. | | `dataValue` | `bytes` | The new bytes value to set. | +
+ ### setDataBatch -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#setdatabatch) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#setdatabatch) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` @@ -655,12 +702,14 @@ Batch data setting function that behaves the same as [`setData`](#setdata) but a | `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. | | `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +
+ ### supportsInterface -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#supportsinterface) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#supportsinterface) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -670,28 +719,30 @@ Batch data setting function that behaves the same as [`setData`](#setdata) but a function supportsInterface(bytes4 interfaceId) external view returns (bool); ``` -_Achieves the goal of [ERC-165] to detect supported interfaces and [LSP-17-ContractExtension] by checking if the interfaceId being queried is supported on another linked extension._ +_Checking if this contract supports the interface defined by the `bytes4` interface ID `interfaceId`._ -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 [LSP-17-ContractExtension], and checks if the extension implements the interface defined by `interfaceId`. +Achieves the goal of [ERC-165] to detect supported interfaces and [LSP-17-ContractExtension] by checking if the interfaceId being queried is supported on another linked extension. If the contract doesn't support the `interfaceId`, it forwards the call to the `supportsInterface` extension according to [LSP-17-ContractExtension], and checks if the extension implements the interface defined by `interfaceId`. #### Parameters -| Name | Type | Description | -| ------------- | :------: | ----------- | -| `interfaceId` | `bytes4` | - | +| Name | Type | Description | +| ------------- | :------: | ------------------------------------------------------ | +| `interfaceId` | `bytes4` | The interface ID to check if the contract supports it. | #### Returns -| Name | Type | Description | -| ---- | :----: | ----------- | -| `0` | `bool` | - | +| Name | Type | Description | +| ---- | :----: | --------------------------------------------------------------------------------------------- | +| `0` | `bool` | `true` if this contract implements the interface defined by `interfaceId`, `false` otherwise. | + +
### transferOwnership -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#transferownership) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#transferownership) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -721,12 +772,14 @@ Initiate the process of transferring ownership of the contract by setting the ne | ----------------- | :-------: | ----------- | | `pendingNewOwner` | `address` | - | +
+ ### universalReceiver -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#universalreceiver) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#universalreceiver) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Function signature: `universalReceiver(bytes32,bytes)` - Function selector: `0x6bb56a14` @@ -739,9 +792,9 @@ function universalReceiver( ) external payable returns (bytes returnedValues); ``` -_Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The 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._ +_Notifying the contract by calling its `universalReceiver` function with the following informations: typeId: `typeId`; data: `data`._ -The function performs the following steps: +Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps: 1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]. @@ -760,7 +813,7 @@ The function performs the following steps: **Emitted events:** - [`ValueReceived`](#valuereceived) when receiving native tokens. -- [`UniversalReceiver`](#universalreceiver) event. +- [`UniversalReceiver`](#universalreceiver) event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called. @@ -777,16 +830,399 @@ The function performs the following steps: | ---------------- | :-----: | ------------------------------------------------------------------------------------------------------- | | `returnedValues` | `bytes` | The ABI encoded return value of the LSP1UniversalReceiverDelegate call and the LSP1TypeIdDelegate call. | +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_execute + +```solidity +function _execute( + uint256 operationType, + address target, + uint256 value, + bytes data +) internal nonpayable returns (bytes); +``` + +check the `operationType` provided and perform the associated low-level opcode after checking for requirements (see [`execute`](#execute)). + +
+ +### \_executeBatch + +```solidity +function _executeBatch( + uint256[] operationsType, + address[] targets, + uint256[] values, + bytes[] datas +) internal nonpayable returns (bytes[]); +``` + +check each `operationType` provided in the batch and perform the associated low-level opcode after checking for requirements (see [`executeBatch`](#executebatch)). + +
+ +### \_executeCall + +```solidity +function _executeCall( + address target, + uint256 value, + bytes data +) internal nonpayable returns (bytes result); +``` + +Perform low-level call (operation type = 0) + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------------- | +| `target` | `address` | The address on which call is executed | +| `value` | `uint256` | The value to be sent with the call | +| `data` | `bytes` | The data to be sent with the call | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | ---------------------- | +| `result` | `bytes` | The data from the call | + +
+ +### \_executeStaticCall + +```solidity +function _executeStaticCall( + address target, + bytes data +) internal nonpayable returns (bytes result); +``` + +Perform low-level staticcall (operation type = 3) + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------------------- | +| `target` | `address` | The address on which staticcall is executed | +| `data` | `bytes` | The data to be sent with the staticcall | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | ------------------------------------- | +| `result` | `bytes` | The data returned from the staticcall | + +
+ +### \_executeDelegateCall + +```solidity +function _executeDelegateCall( + address target, + bytes data +) internal nonpayable returns (bytes result); +``` + +Perform low-level delegatecall (operation type = 4) + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | --------------------------------------------- | +| `target` | `address` | The address on which delegatecall is executed | +| `data` | `bytes` | The data to be sent with the delegatecall | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | --------------------------------------- | +| `result` | `bytes` | The data returned from the delegatecall | + +
+ +### \_deployCreate + +```solidity +function _deployCreate( + uint256 value, + bytes creationCode +) internal nonpayable returns (bytes newContract); +``` + +Deploy a contract using the `CREATE` opcode (operation type = 1) + +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | ---------------------------------------------------------------------------------- | +| `value` | `uint256` | The value to be sent to the contract created | +| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) | + +#### Returns + +| Name | Type | Description | +| ------------- | :-----: | -------------------------------------------- | +| `newContract` | `bytes` | The address of the contract created as bytes | + +
+ +### \_deployCreate2 + +```solidity +function _deployCreate2( + uint256 value, + bytes creationCode +) internal nonpayable returns (bytes newContract); +``` + +Deploy a contract using the `CREATE2` opcode (operation type = 2) + +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | ----------------------------------------------------------------------------------------------------- | +| `value` | `uint256` | The value to be sent to the contract created | +| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) and a bytes32 salt | + +#### Returns + +| Name | Type | Description | +| ------------- | :-----: | -------------------------------------------- | +| `newContract` | `bytes` | The address of the contract created as bytes | + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +Read the value stored under a specific `dataKey` inside the underlying ERC725Y storage, +represented as a mapping of `bytes32` data keys mapped to their `bytes` data values. + +```solidity +mapping(bytes32 => bytes) _store +``` + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | ----------------------------------------------------------------------- | +| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. | + +#### Returns + +| Name | Type | Description | +| ----------- | :-----: | ----------------------------------------------------------------------------- | +| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. | + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +This function overrides the [`ERC725YCore`](#erc725ycore) internal [`_setData`](#_setdata) function to optimize gas usage by emitting only the first 256 bytes of the `dataValue`. + +
+ +**Emitted events:** + +- [`DataChanged`](#datachanged) event with only the first 256 bytes of [`dataValue`](#datavalue). + +
+ +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | -------------------------------------- | +| `dataKey` | `bytes32` | The key to store the data value under. | +| `dataValue` | `bytes` | The data value to be stored. | + +
+ +### \_transferOwnership + +```solidity +function _transferOwnership(address newOwner) internal nonpayable; +``` + +Set the pending owner of the contract and cancel any renounce ownership process that was previously started. + +
+ +**Requirements:** + +- `newOwner` cannot be the address of the contract itself. + +
+ +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ------------------------------------- | +| `newOwner` | `address` | The address of the new pending owner. | + +
+ +### \_acceptOwnership + +```solidity +function _acceptOwnership() internal nonpayable; +``` + +Set the pending owner of the contract as the new owner. + +
+ +### \_renounceOwnership + +```solidity +function _renounceOwnership() internal nonpayable; +``` + +Initiate or confirm the process of renouncing ownership after a specific delay of blocks have passed. + +
+ +### \_supportsInterfaceInERC165Extension + +```solidity +function _supportsInterfaceInERC165Extension( + bytes4 interfaceId +) internal view returns (bool); +``` + +Returns whether the interfaceId being checked is supported in the extension of the +[`supportsInterface`](#supportsinterface) selector. +To be used by extendable contracts wishing to extend the ERC165 interfaceIds originally +supported by reading whether the interfaceId queried is supported in the `supportsInterface` +extension if the extension is set, if not it returns false. + +
+ +### \_getExtension + +```solidity +function _getExtension(bytes4 functionSelector) internal view returns (address); +``` + +Returns the extension address stored under the following data key: + +- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (Check [LSP2-ERC725YJSONSchema] for encoding the data key). + +- If no extension is stored, returns the address(0). + +
+ +### \_fallbackLSP17Extendable + +```solidity +function _fallbackLSP17Extendable( + bytes callData +) internal nonpayable returns (bytes); +``` + +Forwards the call to an extension mapped to a function selector. +Calls [`_getExtension`](#_getextension) to get the address of the extension mapped to the function selector being called on the account. If there is no extension, the `address(0)` will be returned. +Reverts if there is no extension for the function being called, except for the bytes4(0) function selector, which passes even if there is no extension for it. +If there is an extension for the function selector being called, it calls the extension with the CALL opcode, passing the `msg.data` appended with the 20 bytes of the `msg.sender` and 32 bytes of the `msg.value` + +
+ +### \_verifyCall + +```solidity +function _verifyCall( + address logicVerifier +) internal nonpayable returns (bool verifyAfter); +``` + +Calls [`lsp20VerifyCall`](#lsp20verifycall) function on the logicVerifier. +Reverts in case the value returned does not match the magic value (lsp20VerifyCall selector) +Returns whether a verification after the execution should happen based on the last byte of the magicValue + +
+ +### \_verifyCallResult + +```solidity +function _verifyCallResult( + address logicVerifier, + bytes callResult +) internal nonpayable; +``` + +Calls [`lsp20VerifyCallResult`](#lsp20verifycallresult) function on the logicVerifier. +Reverts in case the value returned does not match the magic value (lsp20VerifyCallResult selector) + +
+ +### \_validateCall + +```solidity +function _validateCall( + bool postCall, + bool success, + bytes returnedData +) internal pure; +``` + +
+ +### \_revertWithLSP20DefaultError + +```solidity +function _revertWithLSP20DefaultError( + bool postCall, + bytes returnedData +) internal pure; +``` + +
+ ## Events ### ContractCreated -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#contractcreated) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#contractcreated) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Event signature: `ContractCreated(uint256,address,uint256,bytes32)` -- Event hash: `0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3` +- Event topic hash: `0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3` ::: @@ -807,14 +1243,16 @@ Emitted when a new contract was created and deployed. | `value` **`indexed`** | `uint256` | The amount of native tokens (in Wei) sent to fund the created contract on deployment. | | `salt` | `bytes32` | The salt used to deterministically deploy the contract (`CREATE2` only). If `CREATE` opcode is used, the salt value will be `bytes32(0)`. | +
+ ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#datachanged) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#datachanged) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -833,14 +1271,16 @@ Emitted when data at a specific `dataKey` was changed to a new value `dataValue` | `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | | `dataValue` | `bytes` | The value to set for the given data key. | +
+ ### Executed -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#executed) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#executed) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Event signature: `Executed(uint256,address,uint256,bytes4)` -- Event hash: `0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e` +- Event topic hash: `0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e` ::: @@ -861,14 +1301,16 @@ Emitted when calling an address `target` (EOA or contract) with `value`. | `value` **`indexed`** | `uint256` | The amount of native tokens transferred along the call (in Wei). | | `selector` | `bytes4` | The first 4 bytes (= function selector) of the data sent with the call. | +
+ ### OwnershipRenounced -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#ownershiprenounced) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#ownershiprenounced) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Event signature: `OwnershipRenounced()` -- Event hash: `0xd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce` +- Event topic hash: `0xd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce` ::: @@ -876,18 +1318,20 @@ Emitted when calling an address `target` (EOA or contract) with `value`. event OwnershipRenounced(); ``` -_Ownership renouncement complete._ +_Successfully renounced ownership of the contract. This contract is now owned by anyone, it's owner is `address(0)`._ Emitted when the ownership of the contract has been renounced. +
+ ### OwnershipTransferStarted -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#ownershiptransferstarted) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#ownershiptransferstarted) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Event signature: `OwnershipTransferStarted(address,address)` -- Event hash: `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700` +- Event topic hash: `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700` ::: @@ -895,9 +1339,9 @@ Emitted when the ownership of the contract has been renounced. event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); ``` -_Ownership transfer initiated. From: `previousOwner`. To: `newOwner`._ +_The transfer of ownership of the contract was initiated. Pending new owner set to: `newOwner`._ -Emitted when starting the [`transferOwnership(..)`](#transferownership) 2-step process. +Emitted when [`transferOwnership(..)`](#transferownership) was called and the first step of transferring ownership completed successfully which leads to [`pendingOwner`](#pendingowner) being updated. #### Parameters @@ -906,14 +1350,16 @@ Emitted when starting the [`transferOwnership(..)`](#transferownership) 2-step p | `previousOwner` **`indexed`** | `address` | The address of the previous owner. | | `newOwner` **`indexed`** | `address` | The address of the new owner. | +
+ ### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#ownershiptransferred) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#ownershiptransferred) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -928,14 +1374,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | +
+ ### RenounceOwnershipStarted -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#renounceownershipstarted) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#renounceownershipstarted) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Event signature: `RenounceOwnershipStarted()` -- Event hash: `0x81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e7` +- Event topic hash: `0x81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e7` ::: @@ -947,14 +1395,16 @@ _Ownership renouncement initiated._ Emitted when starting the [`renounceOwnership(..)`](#renounceownership) 2-step process. +
+ ### UniversalReceiver -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#universalreceiver) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#universalreceiver) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Event signature: `UniversalReceiver(address,uint256,bytes32,bytes,bytes)` -- Event hash: `0x9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c2` +- Event topic hash: `0x9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c2` ::: @@ -962,26 +1412,32 @@ Emitted when starting the [`renounceOwnership(..)`](#renounceownership) 2-step p event UniversalReceiver(address indexed from, uint256 indexed value, bytes32 indexed typeId, bytes receivedData, bytes returnedValue); ``` -_Emitted when the universalReceiver function is succesfully executed_ +\*Address `from` called the `universalReceiver(...)` function while sending `value` LYX. Notification type (typeId): `typeId` + +- Data received: `receivedData`.\* + +Emitted when the [`universalReceiver`](#universalreceiver) function was called with a specific `typeId` and some `receivedData` s #### 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 | +| Name | Type | Description | +| ---------------------- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `from` **`indexed`** | `address` | The address of the EOA or smart contract that called the {universalReceiver(...)} function. | +| `value` **`indexed`** | `uint256` | The amount sent to the {universalReceiver(...)} function. | +| `typeId` **`indexed`** | `bytes32` | A `bytes32` unique identifier (= _"hook"_)that describe the type of notification, information or transaction received by the contract. Can be related to a specific standard or a hook. | +| `receivedData` | `bytes` | Any arbitrary data that was sent to the {universalReceiver(...)} function. | +| `returnedValue` | `bytes` | The value returned by the {universalReceiver(...)} function. | + +
### ValueReceived -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#valuereceived) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#valuereceived) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Event signature: `ValueReceived(address,uint256)` -- Event hash: `0x7e71433ddf847725166244795048ecf3e3f9f35628254ecbf736056664233493` +- Event topic hash: `0x7e71433ddf847725166244795048ecf3e3f9f35628254ecbf736056664233493` ::: @@ -989,25 +1445,27 @@ _Emitted when the universalReceiver function is succesfully executed_ event ValueReceived(address indexed sender, uint256 indexed value); ``` -_`value` tokens received from `sender`._ +_`value` native tokens received from `sender`._ -Emitted when receiving native tokens +Emitted when receiving native tokens. #### Parameters -| Name | Type | Description | -| ---------------------- | :-------: | ------------------------------------ | -| `sender` **`indexed`** | `address` | The address of the sender | -| `value` **`indexed`** | `uint256` | The amount of native tokens received | +| Name | Type | Description | +| ---------------------- | :-------: | ---------------------------------------------------------- | +| `sender` **`indexed`** | `address` | The address that sent some native tokens to this contract. | +| `value` **`indexed`** | `uint256` | The amount of native tokens received. | + +
## Errors ### CannotTransferOwnershipToSelf -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#cannottransferownershiptoself) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#cannottransferownershiptoself) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `CannotTransferOwnershipToSelf()` - Error hash: `0x43b248cd` @@ -1017,16 +1475,18 @@ Emitted when receiving native tokens error CannotTransferOwnershipToSelf(); ``` -_Cannot transfer ownerhsip to yourself._ +_Cannot transfer ownership to the address of the contract itself._ -Reverts when trying to transfer ownership to the `address(this)` +Reverts when trying to transfer ownership to the `address(this)`. + +
### ERC725X_ContractDeploymentFailed -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_contractdeploymentfailed) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_contractdeploymentfailed) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `ERC725X_ContractDeploymentFailed()` - Error hash: `0x0b07489b` @@ -1038,12 +1498,14 @@ error ERC725X_ContractDeploymentFailed(); Reverts when contract deployment failed via [`execute`](#execute) or [`executeBatch`](#executebatch) functions, This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`). +
+ ### ERC725X_CreateOperationsRequireEmptyRecipientAddress -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_createoperationsrequireemptyrecipientaddress) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_createoperationsrequireemptyrecipientaddress) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `ERC725X_CreateOperationsRequireEmptyRecipientAddress()` - Error hash: `0x3041824a` @@ -1055,12 +1517,14 @@ error ERC725X_CreateOperationsRequireEmptyRecipientAddress(); Reverts when passing a `to` address that is not `address(0)` (= address zero) while deploying a contract via [`execute`](#execute) or [`executeBatch`](#executebatch) functions. This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`). +
+ ### ERC725X_ExecuteParametersEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_executeparametersemptyarray) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_executeparametersemptyarray) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `ERC725X_ExecuteParametersEmptyArray()` - Error hash: `0xe9ad2b5f` @@ -1072,12 +1536,14 @@ error ERC725X_ExecuteParametersEmptyArray(); Reverts when one of the array parameter provided to the [`executeBatch`](#executebatch) function is an empty array. +
+ ### ERC725X_ExecuteParametersLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_executeparameterslengthmismatch) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_executeparameterslengthmismatch) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `ERC725X_ExecuteParametersLengthMismatch()` - Error hash: `0x3ff55f4d` @@ -1089,12 +1555,14 @@ error ERC725X_ExecuteParametersLengthMismatch(); Reverts when there is not the same number of elements in the `operationTypes`, `targets` addresses, `values`, and `datas` array parameters provided when calling the [`executeBatch`](#executebatch) function. +
+ ### ERC725X_InsufficientBalance -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_insufficientbalance) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_insufficientbalance) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `ERC725X_InsufficientBalance(uint256,uint256)` - Error hash: `0x0df9a8f8` @@ -1108,17 +1576,19 @@ Reverts when trying to send more native tokens `value` than available in current #### Parameters -| Name | Type | Description | -| --------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `balance` | `uint256` | The balance of native tokens of the ERC725X smart contract. | -| `value` | `uint256` | The amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` that is greater than the contract's `balance`. | +| Name | Type | Description | +| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- | +| `balance` | `uint256` | The balance of native tokens of the ERC725X smart contract. | +| `value` | `uint256` | The amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` that is greater than the contract's `balance`. | + +
### ERC725X_MsgValueDisallowedInDelegateCall -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_msgvaluedisallowedindelegatecall) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_msgvaluedisallowedindelegatecall) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `ERC725X_MsgValueDisallowedInDelegateCall()` - Error hash: `0x5ac83135` @@ -1130,12 +1600,14 @@ error ERC725X_MsgValueDisallowedInDelegateCall(); Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `delegatecall` (`operationType == 4`). Sending native tokens via `staticcall` is not allowed because `msg.value` is persisting. +
+ ### ERC725X_MsgValueDisallowedInStaticCall -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_msgvaluedisallowedinstaticcall) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_msgvaluedisallowedinstaticcall) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `ERC725X_MsgValueDisallowedInStaticCall()` - Error hash: `0x72f2bc6a` @@ -1147,12 +1619,14 @@ error ERC725X_MsgValueDisallowedInStaticCall(); Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `staticcall` (`operationType == 3`). Sending native tokens via `staticcall` is not allowed because it is a state changing operation. +
+ ### ERC725X_NoContractBytecodeProvided -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_nocontractbytecodeprovided) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_nocontractbytecodeprovided) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `ERC725X_NoContractBytecodeProvided()` - Error hash: `0xb81cd8d9` @@ -1164,12 +1638,14 @@ error ERC725X_NoContractBytecodeProvided(); Reverts when no contract bytecode was provided as parameter when trying to deploy a contract via [`execute`](#execute) or [`executeBatch`](#executebatch). This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`). +
+ ### ERC725X_UnknownOperationType -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_unknownoperationtype) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725x_unknownoperationtype) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `ERC725X_UnknownOperationType(uint256)` - Error hash: `0x7583b3bc` @@ -1187,12 +1663,14 @@ Reverts when the `operationTypeProvided` is none of the default operation types | ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------ | | `operationTypeProvided` | `uint256` | The unrecognised operation type number provided to `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`. | +
+ ### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -1204,12 +1682,35 @@ error ERC725Y_DataKeysValuesLengthMismatch(); Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. +
+ +### LSP14MustAcceptOwnershipInSeparateTransaction + +:::note References + +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#lsp14mustacceptownershipinseparatetransaction) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Error signature: `LSP14MustAcceptOwnershipInSeparateTransaction()` +- Error hash: `0x5758dd07` + +::: + +```solidity +error LSP14MustAcceptOwnershipInSeparateTransaction(); +``` + +_Cannot accept ownership in the same transaction with [`transferOwnership(...)`](#transferownership)._ + +Reverts when pending owner accept ownership in the same transaction of transferring ownership. + +
+ ### LSP20CallingVerifierFailed -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#lsp20callingverifierfailed) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#lsp20callingverifierfailed) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `LSP20CallingVerifierFailed(bool)` - Error hash: `0x8c6a8ae3` @@ -1227,12 +1728,14 @@ reverts when the call to the owner fail with no revert reason | ---------- | :----: | ---------------------------------------------------- | | `postCall` | `bool` | True if the execution call was done, False otherwise | +
+ ### LSP20InvalidMagicValue -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#lsp20invalidmagicvalue) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#lsp20invalidmagicvalue) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `LSP20InvalidMagicValue(bool,bytes)` - Error hash: `0xd088ec40` @@ -1251,12 +1754,14 @@ reverts when the call to the owner does not return the magic value | `postCall` | `bool` | True if the execution call was done, False otherwise | | `returnedData` | `bytes` | The data returned by the call to the logic verifier | +
+ ### NoExtensionFoundForFunctionSelector -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#noextensionfoundforfunctionselector) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#noextensionfoundforfunctionselector) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `NoExtensionFoundForFunctionSelector(bytes4)` - Error hash: `0xbb370b2b` @@ -1274,12 +1779,14 @@ reverts when there is no extension for the function selector being called with | ------------------ | :------: | ----------- | | `functionSelector` | `bytes4` | - | +
+ ### NotInRenounceOwnershipInterval -:::note Links +:::note References -- Specification details in [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#notinrenounceownershipinterval) -- Solidity implementation in [**LSP0ERC725Account**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) +- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-0-ERC725Account.md#notinrenounceownershipinterval) +- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP0ERC725Account/LSP0ERC725Account.sol) - Error signature: `NotInRenounceOwnershipInterval(uint256,uint256)` - Error hash: `0x8b9bf507` @@ -1294,14 +1801,16 @@ error NotInRenounceOwnershipInterval( _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 +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. | +| Name | Type | Description | +| ------------------------ | :-------: | ----------------------------------------------------------------------- | +| `renounceOwnershipStart` | `uint256` | The start timestamp when one can confirm the renouncement of ownership. | +| `renounceOwnershipEnd` | `uint256` | The end timestamp when one can confirm the renouncement of ownership. | + +
diff --git a/docs/contracts/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.md b/docs/contracts/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.md new file mode 100644 index 0000000000..59056ac3a3 --- /dev/null +++ b/docs/contracts/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.md @@ -0,0 +1,1156 @@ + + + +# LSP11BasicSocialRecovery + +:::info Standard Specifications + +[`LSP-11-BasicSocialRecovery`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md) + +::: +:::info Solidity implementation + +[`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) + +::: + +> Implementation of LSP11 - Basic Social Recovery standard + +Sets permission for a controller address after a recovery process to interact with an ERC725 contract via the LSP6KeyManager + +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. + +### constructor + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#constructor) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) + +::: + +```solidity +constructor(address _owner, address target_); +``` + +_Sets the target and the owner addresses_ + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | -------------------------------------------- | +| `_owner` | `address` | The owner of the LSP11 contract | +| `target_` | `address` | The address of the ER725 contract to recover | + +
+ +### addGuardian + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#addguardian) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Function signature: `addGuardian(address)` +- Function selector: `0xa526d83b` + +::: + +```solidity +function addGuardian(address newGuardian) external nonpayable; +``` + +Adds a guardian of the targetCan be called only by the owner + +#### Parameters + +| Name | Type | Description | +| ------------- | :-------: | -------------------------------- | +| `newGuardian` | `address` | The address to add as a guardian | + +
+ +### getGuardianChoice + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#getguardianchoice) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Function signature: `getGuardianChoice(address)` +- Function selector: `0xf6a22f02` + +::: + +```solidity +function getGuardianChoice(address guardian) external view returns (address); +``` + +Returns the address of a controller that a `guardian` selected for in order to recover the target + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ------------------------------------------------ | +| `guardian` | `address` | the address of a guardian to query his selection | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ------------------------------------ | +| `0` | `address` | the address that `guardian` selected | + +
+ +### getGuardians + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#getguardians) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Function signature: `getGuardians()` +- Function selector: `0x0665f04b` + +::: + +```solidity +function getGuardians() external view returns (address[]); +``` + +Returns the addresses of all guardians The guardians will select an address to be added as a controller key for the linked `target` if he reaches the guardian threshold and provide the correct string that produce the secretHash + +#### Returns + +| Name | Type | Description | +| ---- | :---------: | ----------- | +| `0` | `address[]` | - | + +
+ +### getGuardiansThreshold + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#getguardiansthreshold) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Function signature: `getGuardiansThreshold()` +- Function selector: `0x187c5348` + +::: + +```solidity +function getGuardiansThreshold() external view returns (uint256); +``` + +Returns the guardian threshold The guardian threshold represents the minimum number of selection by guardians required for an address to start a recovery process + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------- | +| `0` | `uint256` | - | + +
+ +### getRecoveryCounter + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#getrecoverycounter) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Function signature: `getRecoveryCounter()` +- Function selector: `0xf79c8b77` + +::: + +```solidity +function getRecoveryCounter() external view returns (uint256); +``` + +Returns the current recovery counter When a recovery process is successfully finished the recovery counter is incremented + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------- | +| `0` | `uint256` | - | + +
+ +### getRecoverySecretHash + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#getrecoverysecrethash) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Function signature: `getRecoverySecretHash()` +- Function selector: `0x8f9083bb` + +::: + +```solidity +function getRecoverySecretHash() external view returns (bytes32); +``` + +Returns the recovery secret hash + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------- | +| `0` | `bytes32` | - | + +
+ +### isGuardian + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#isguardian) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Function signature: `isGuardian(address)` +- Function selector: `0x0c68ba21` + +::: + +```solidity +function isGuardian(address _address) external view returns (bool); +``` + +Returns TRUE if the address provided is a guardian, FALSE otherwise + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | -------------------- | +| `_address` | `address` | The address to query | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | ----------- | +| `0` | `bool` | - | + +
+ +### owner + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#owner) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.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` | - | + +
+ +### recoverOwnership + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#recoverownership) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Function signature: `recoverOwnership(address,string,bytes32)` +- Function selector: `0xae8481b2` + +::: + +```solidity +function recoverOwnership( + address recoverer, + string plainSecret, + bytes32 newSecretHash +) external nonpayable; +``` + +Recovers the ownership permissions of an address in the linked target and increment the recover counter Requirements + +- the address of the recoverer must have a selection equal or higher than the threshold defined in `getGuardiansThreshold(...)` + +- must have provided the right `plainSecret` that produces the secret Hash + +#### Parameters + +| Name | Type | Description | +| --------------- | :-------: | -------------------------------------------- | +| `recoverer` | `address` | The address of the recoverer | +| `plainSecret` | `string` | The secret word that produce the secret Hash | +| `newSecretHash` | `bytes32` | - | + +
+ +### removeGuardian + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#removeguardian) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Function signature: `removeGuardian(address)` +- Function selector: `0x71404156` + +::: + +```solidity +function removeGuardian(address existingGuardian) external nonpayable; +``` + +Removes a guardian of the targetCan be called only by the owner + +#### Parameters + +| Name | Type | Description | +| ------------------ | :-------: | ----------- | +| `existingGuardian` | `address` | - | + +
+ +### renounceOwnership + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#renounceownership) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.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. + +
+ +### selectNewController + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#selectnewcontroller) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Function signature: `selectNewController(address)` +- Function selector: `0xaa7806d6` + +::: + +```solidity +function selectNewController(address addressSelected) external nonpayable; +``` + +select an address to be a potentiel controller address if he reaches the guardian threshold and provide the correct secret string Requirements: + +- only guardians can select an address + +#### Parameters + +| Name | Type | Description | +| ----------------- | :-------: | ------------------------------------ | +| `addressSelected` | `address` | The address selected by the guardian | + +
+ +### setGuardiansThreshold + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#setguardiansthreshold) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Function signature: `setGuardiansThreshold(uint256)` +- Function selector: `0x6bfed20b` + +::: + +```solidity +function setGuardiansThreshold(uint256 newThreshold) external nonpayable; +``` + +Sets the minimum number of selection by the guardians required so that an address can recover ownershipCan be called only by the owner + +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | ----------- | +| `newThreshold` | `uint256` | - | + +
+ +### setRecoverySecretHash + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#setrecoverysecrethash) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Function signature: `setRecoverySecretHash(bytes32)` +- Function selector: `0xf799e38d` + +::: + +```solidity +function setRecoverySecretHash( + bytes32 newRecoverSecretHash +) external nonpayable; +``` + +Throws if hash provided is bytes32(0) + +#### Parameters + +| Name | Type | Description | +| ---------------------- | :-------: | ------------------------------------------------------------------------------- | +| `newRecoverSecretHash` | `bytes32` | The hash of the secret string Requirements: - `secretHash` cannot be bytes32(0) | + +
+ +### supportsInterface + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#supportsinterface) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.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 References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#target) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Function signature: `target()` +- Function selector: `0xd4b83992` + +::: + +```solidity +function target() external view returns (address); +``` + +The address of an ERC725 contract where we want to recover and set permissions for a controller address + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------- | +| `0` | `address` | - | + +
+ +### transferOwnership + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#transferownership) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.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` | - | + +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_validateRequirements + +```solidity +function _validateRequirements( + address recoverer, + uint256 currentRecoveryCounter, + string plainSecret, + bytes32 newHash, + address[] guardians +) internal view; +``` + +The number of guardians should be reasonable, as the validation method +is using a loop to check the selection of each guardian +Throws if: + +- The address trying to recover didn't reach the guardiansThreshold + +- The new hash being set is bytes32(0) + +- The secret word provided is incorrect + +
+ +### \_cleanStorage + +```solidity +function _cleanStorage( + uint256 recoveryCounter, + uint256 guardiansLength, + address[] guardians +) internal nonpayable; +``` + +Remove the guardians choice after a successfull recovery process +To avoid keeping unnecessary state + +
+ +## Events + +### GuardianAdded + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#guardianadded) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Event signature: `GuardianAdded(address)` +- Event topic hash: `0x038596bb31e2e7d3d9f184d4c98b310103f6d7f5830e5eec32bffe6f1728f969` + +::: + +```solidity +event GuardianAdded(address indexed newGuardian); +``` + +_Emitted when setting a new guardian for the target_ + +#### Parameters + +| Name | Type | Description | +| --------------------------- | :-------: | --------------------------------- | +| `newGuardian` **`indexed`** | `address` | The address of the added guardian | + +
+ +### GuardianRemoved + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#guardianremoved) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Event signature: `GuardianRemoved(address)` +- Event topic hash: `0xb8107d0c6b40be480ce3172ee66ba6d64b71f6b1685a851340036e6e2e3e3c52` + +::: + +```solidity +event GuardianRemoved(address indexed removedGuardian); +``` + +_Emitted when removing an existing guardian for the target_ + +#### Parameters + +| Name | Type | Description | +| ------------------------------- | :-------: | ----------------------------------- | +| `removedGuardian` **`indexed`** | `address` | The address of the guardian removed | + +
+ +### GuardiansThresholdChanged + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#guardiansthresholdchanged) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Event signature: `GuardiansThresholdChanged(uint256)` +- Event topic hash: `0x7146d20a2c7b7c75c203774c9f241b61698fac43a4a81ccd828f0d8162392790` + +::: + +```solidity +event GuardiansThresholdChanged(uint256 indexed guardianThreshold); +``` + +_Emitted when changing the guardian threshold_ + +#### Parameters + +| Name | Type | Description | +| --------------------------------- | :-------: | ----------------------------------------------------------------------------------------------- | +| `guardianThreshold` **`indexed`** | `uint256` | The minimum number of selection by guardians needed by a controller to start a recovery process | + +
+ +### OwnershipTransferred + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#ownershiptransferred) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Event signature: `OwnershipTransferred(address,address)` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` + +::: + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------------- | :-------: | ----------- | +| `previousOwner` **`indexed`** | `address` | - | +| `newOwner` **`indexed`** | `address` | - | + +
+ +### RecoveryProcessSuccessful + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#recoveryprocesssuccessful) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Event signature: `RecoveryProcessSuccessful(uint256,address,bytes32,address[])` +- Event topic hash: `0xf4ff8803d6b43af46d48c200977209829c2f42f19f27eda1c89dbf26a28009cd` + +::: + +```solidity +event RecoveryProcessSuccessful(uint256 indexed recoveryCounter, address indexed newController, bytes32 indexed newSecretHash, address[] guardians); +``` + +_Emitted when the recovery process is finished by the controller who reached the guardian threshold and submitted the string that produce the secretHash_ + +#### Parameters + +| Name | Type | Description | +| ------------------------------- | :---------: | -------------------------------------------------------------------------- | +| `recoveryCounter` **`indexed`** | `uint256` | The current recovery process | +| `newController` **`indexed`** | `address` | The address of the new controller controlling the target by the KeyManager | +| `newSecretHash` **`indexed`** | `bytes32` | - | +| `guardians` | `address[]` | The array of addresses containing the guardians of the target | + +
+ +### SecretHashChanged + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#secrethashchanged) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Event signature: `SecretHashChanged(bytes32)` +- Event topic hash: `0x2e8c5419a62207ade549fe0b66c1c85c16f5e1ed654815dee3a3f3ac41770df3` + +::: + +```solidity +event SecretHashChanged(bytes32 indexed secretHash); +``` + +_Emitted when changing the secret hash_ + +#### Parameters + +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------- | +| `secretHash` **`indexed`** | `bytes32` | The secret hash used to finish the recovery process | + +
+ +### SelectedNewController + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#selectednewcontroller) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Event signature: `SelectedNewController(uint256,address,address)` +- Event topic hash: `0xe43f3c1093c69ab76b2cf6246090acb2f8eab7f19ba9942dfc8b8ec446e3a3de` + +::: + +```solidity +event SelectedNewController(uint256 indexed recoveryCounter, address indexed guardian, address indexed addressSelected); +``` + +_Emitted when a guardian select a new potentiel controller address for the target_ + +#### Parameters + +| Name | Type | Description | +| ------------------------------- | :-------: | ------------------------------------ | +| `recoveryCounter` **`indexed`** | `uint256` | The current recovery process counter | +| `guardian` **`indexed`** | `address` | The address of the guardian | +| `addressSelected` **`indexed`** | `address` | The address selected by the guardian | + +
+ +## Errors + +### AddressZeroNotAllowed + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#addresszeronotallowed) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Error signature: `AddressZeroNotAllowed()` +- Error hash: `0x0855380c` + +::: + +```solidity +error AddressZeroNotAllowed(); +``` + +reverts when the address zero calls `recoverOwnership(..)` function + +
+ +### CallerIsNotGuardian + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#callerisnotguardian) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Error signature: `CallerIsNotGuardian(address)` +- Error hash: `0x5560e16d` + +::: + +```solidity +error CallerIsNotGuardian(address caller); +``` + +reverts when the caller is not a guardian + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ----------- | +| `caller` | `address` | - | + +
+ +### GuardianAlreadyExist + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#guardianalreadyexist) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Error signature: `GuardianAlreadyExist(address)` +- Error hash: `0xd52858db` + +::: + +```solidity +error GuardianAlreadyExist(address addressToAdd); +``` + +reverts when adding an already existing guardian + +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | ----------- | +| `addressToAdd` | `address` | - | + +
+ +### GuardianDoNotExist + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#guardiandonotexist) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Error signature: `GuardianDoNotExist(address)` +- Error hash: `0x3d8e524e` + +::: + +```solidity +error GuardianDoNotExist(address addressToRemove); +``` + +reverts when removing a non-existing guardian + +#### Parameters + +| Name | Type | Description | +| ----------------- | :-------: | ----------- | +| `addressToRemove` | `address` | - | + +
+ +### GuardiansNumberCannotGoBelowThreshold + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#guardiansnumbercannotgobelowthreshold) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Error signature: `GuardiansNumberCannotGoBelowThreshold(uint256)` +- Error hash: `0x27113777` + +::: + +```solidity +error GuardiansNumberCannotGoBelowThreshold(uint256 guardianThreshold); +``` + +reverts when removing a guardian and the threshold is equal to the number of guardians + +#### Parameters + +| Name | Type | Description | +| ------------------- | :-------: | ----------- | +| `guardianThreshold` | `uint256` | - | + +
+ +### SecretHashCannotBeZero + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#secrethashcannotbezero) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Error signature: `SecretHashCannotBeZero()` +- Error hash: `0x7f617002` + +::: + +```solidity +error SecretHashCannotBeZero(); +``` + +reverts when the secret hash provided is equal to bytes32(0) + +
+ +### ThresholdCannotBeHigherThanGuardiansNumber + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#thresholdcannotbehigherthanguardiansnumber) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Error signature: `ThresholdCannotBeHigherThanGuardiansNumber(uint256,uint256)` +- Error hash: `0xe3db80bd` + +::: + +```solidity +error ThresholdCannotBeHigherThanGuardiansNumber( + uint256 thresholdGiven, + uint256 guardianNumber +); +``` + +reverts when setting the guardians threshold to a number higher than the guardians number + +#### Parameters + +| Name | Type | Description | +| ---------------- | :-------: | ----------- | +| `thresholdGiven` | `uint256` | - | +| `guardianNumber` | `uint256` | - | + +
+ +### ThresholdNotReachedForRecoverer + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#thresholdnotreachedforrecoverer) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Error signature: `ThresholdNotReachedForRecoverer(address,uint256,uint256)` +- Error hash: `0xf78f0507` + +::: + +```solidity +error ThresholdNotReachedForRecoverer( + address recoverer, + uint256 selections, + uint256 guardiansThreshold +); +``` + +reverts when `recoverOwnership(..)` is called with a recoverer that didn't reach the guardians threshold + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | ------------------------------------------------ | +| `recoverer` | `address` | The address of the recoverer | +| `selections` | `uint256` | The number of selections that the recoverer have | +| `guardiansThreshold` | `uint256` | The minimum number of selection needed | + +
+ +### WrongPlainSecret + +:::note References + +- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-11-BasicSocialRecovery.md#wrongplainsecret) +- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol) +- Error signature: `WrongPlainSecret()` +- Error hash: `0x6fa723c3` + +::: + +```solidity +error WrongPlainSecret(); +``` + +reverts when the plain secret produce a different hash than the secret hash originally set + +
+ + + + + + + +[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 +[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 +[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 +[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 +[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 +[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 +[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X +[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[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 + + + +[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 + + + +[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership +[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership +[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership + + + +[`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 +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md b/docs/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md index 0abe1001a0..8b9de0ceef 100644 --- a/docs/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md +++ b/docs/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.md @@ -1,23 +1,34 @@ + + + # LSP14Ownable2Step -:::info Soldity contract +:::info Standard Specifications + +[`LSP-14-Ownable2Step`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md) + +::: +:::info Solidity implementation -[`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +[`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/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. +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. (_e.g: providing the wrong address as a parameter to the function, transferring ownership to an EOA for which the user lost its private key, etc..._) + +## Public Methods -## Methods +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY -:::note Links +:::note References -- 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) +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#renounce_ownership_confirmation_delay) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY()` - Function selector: `0xead3fbdf` @@ -38,12 +49,14 @@ The number of block that MUST pass before one is able to confirm renouncing owne | ---- | :-------: | ----------------- | | `0` | `uint256` | Number of blocks. | +
+ ### RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD -:::note Links +:::note References -- 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) +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#renounce_ownership_confirmation_period) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD()` - Function selector: `0x01bfba61` @@ -64,12 +77,14 @@ The number of blocks during which one can renounce ownership. | ---- | :-------: | ----------------- | | `0` | `uint256` | Number of blocks. | +
+ ### acceptOwnership -:::note Links +:::note References -- 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) +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#acceptownership) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - Function signature: `acceptOwnership()` - Function selector: `0x79ba5097` @@ -95,12 +110,14 @@ Transfer ownership of the contract from the current [`owner()`](#owner) to the [ +
+ ### owner -:::note Links +:::note References -- 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) +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#owner) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -118,12 +135,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### pendingOwner -:::note Links +:::note References -- 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) +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#pendingowner) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - Function signature: `pendingOwner()` - Function selector: `0xe30c3978` @@ -147,12 +166,14 @@ The address that ownership of the contract is transferred to. This address may u | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- 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) +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#renounceownership) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -160,7 +181,7 @@ The address that ownership of the contract is transferred to. This address may u :::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. +Leaves the contract without an owner. Once ownership of the contract has been renounced, any function that is restricted to be called only by the owner will be permanently inaccessible, making these functions not callable anymore and unusable. ::: @@ -168,20 +189,22 @@ Leaves the contract without an owner. Once ownership of the contract has been re function renounceOwnership() external nonpayable; ``` -_`msg.sender` is renouncing ownership of contract: `address(this)`._ +_`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. +2. The second call is used as a confirmation and will leave the contract without an owner. + +
### transferOwnership -:::note Links +:::note References -- 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) +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#transferownership) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -199,7 +222,7 @@ Initiate the process of transferring ownership of the contract by setting the ne **Requirements:** -- `newOwner` cannot accept ownership of the contract in the same transaction. +- `newOwner` cannot accept ownership of the contract in the same transaction. (For instance, via a callback from its [`universalReceiver(...)`](#universalreceiver) function). @@ -209,16 +232,89 @@ Initiate the process of transferring ownership of the contract by setting the ne | ---------- | :-------: | ----------------------------- | | `newOwner` | `address` | The address of the new owner. | +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_transferOwnership + +```solidity +function _transferOwnership(address newOwner) internal nonpayable; +``` + +Set the pending owner of the contract and cancel any renounce ownership process that was previously started. + +
+ +**Requirements:** + +- `newOwner` cannot be the address of the contract itself. + +
+ +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ------------------------------------- | +| `newOwner` | `address` | The address of the new pending owner. | + +
+ +### \_acceptOwnership + +```solidity +function _acceptOwnership() internal nonpayable; +``` + +Set the pending owner of the contract as the new owner. + +
+ +### \_renounceOwnership + +```solidity +function _renounceOwnership() internal nonpayable; +``` + +Initiate or confirm the process of renouncing ownership after a specific delay of blocks have passed. + +
+ ## Events ### OwnershipRenounced -:::note Links +:::note References -- 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) +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#ownershiprenounced) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - Event signature: `OwnershipRenounced()` -- Event hash: `0xd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce` +- Event topic hash: `0xd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce` ::: @@ -226,18 +322,20 @@ Initiate the process of transferring ownership of the contract by setting the ne event OwnershipRenounced(); ``` -_Ownership renouncement complete._ +_Successfully renounced ownership of the contract. This contract is now owned by anyone, it's owner is `address(0)`._ Emitted when the ownership of the contract has been renounced. +
+ ### OwnershipTransferStarted -:::note Links +:::note References -- 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) +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#ownershiptransferstarted) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - Event signature: `OwnershipTransferStarted(address,address)` -- Event hash: `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700` +- Event topic hash: `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700` ::: @@ -245,25 +343,27 @@ Emitted when the ownership of the contract has been renounced. event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); ``` -_Ownership transfer initiated. From: `previousOwner`. To: `newOwner`._ +_The transfer of ownership of the contract was initiated. Pending new owner set to: `newOwner`._ -Emitted when starting the [`transferOwnership(..)`](#transferownership) 2-step process. +Emitted when [`transferOwnership(..)`](#transferownership) was called and the first step of transferring ownership completed successfully which leads to [`pendingOwner`](#pendingowner) being updated. #### Parameters -| Name | Type | Description | -| ----------------------------- | :-------: | --------------------------------- | -| `previousOwner` **`indexed`** | `address` | The address of the previous owner | -| `newOwner` **`indexed`** | `address` | The address of the new owner | +| Name | Type | Description | +| ----------------------------- | :-------: | ---------------------------------- | +| `previousOwner` **`indexed`** | `address` | The address of the previous owner. | +| `newOwner` **`indexed`** | `address` | The address of the new owner. | + +
### OwnershipTransferred -:::note Links +:::note References -- 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) +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#ownershiptransferred) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -271,25 +371,23 @@ Emitted when starting the [`transferOwnership(..)`](#transferownership) 2-step p 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. | +| Name | Type | Description | +| ----------------------------- | :-------: | ----------- | +| `previousOwner` **`indexed`** | `address` | - | +| `newOwner` **`indexed`** | `address` | - | + +
### RenounceOwnershipStarted -:::note Links +:::note References -- 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) +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#renounceownershipstarted) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - Event signature: `RenounceOwnershipStarted()` -- Event hash: `0x81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e7` +- Event topic hash: `0x81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e7` ::: @@ -301,14 +399,16 @@ _Ownership renouncement initiated._ Emitted when starting the [`renounceOwnership(..)`](#renounceownership) 2-step process. +
+ ## Errors ### CannotTransferOwnershipToSelf -:::note Links +:::note References -- 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) +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#cannottransferownershiptoself) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - Error signature: `CannotTransferOwnershipToSelf()` - Error hash: `0x43b248cd` @@ -318,16 +418,39 @@ Emitted when starting the [`renounceOwnership(..)`](#renounceownership) 2-step p error CannotTransferOwnershipToSelf(); ``` -_Cannot transfer ownerhsip to yourself._ +_Cannot transfer ownership to the address of the contract itself._ + +Reverts when trying to transfer ownership to the `address(this)`. + +
+ +### LSP14MustAcceptOwnershipInSeparateTransaction + +:::note References + +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#lsp14mustacceptownershipinseparatetransaction) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) +- Error signature: `LSP14MustAcceptOwnershipInSeparateTransaction()` +- Error hash: `0x5758dd07` + +::: + +```solidity +error LSP14MustAcceptOwnershipInSeparateTransaction(); +``` + +_Cannot accept ownership in the same transaction with [`transferOwnership(...)`](#transferownership)._ -Reverts when trying to transfer ownership to the `address(this)` +Reverts when pending owner accept ownership in the same transaction of transferring ownership. + +
### NotInRenounceOwnershipInterval -:::note Links +:::note References -- 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) +- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-14-Ownable2Step.md#notinrenounceownershipinterval) +- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol) - Error signature: `NotInRenounceOwnershipInterval(uint256,uint256)` - Error hash: `0x8b9bf507` @@ -342,14 +465,16 @@ error NotInRenounceOwnershipInterval( _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 +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. | +| Name | Type | Description | +| ------------------------ | :-------: | ----------------------------------------------------------------------- | +| `renounceOwnershipStart` | `uint256` | The start timestamp when one can confirm the renouncement of ownership. | +| `renounceOwnershipEnd` | `uint256` | The end timestamp when one can confirm the renouncement of ownership. | + +
diff --git a/docs/contracts/contracts/LSP17ContractExtension/LSP17Extendable.md b/docs/contracts/contracts/LSP17ContractExtension/LSP17Extendable.md new file mode 100644 index 0000000000..8a8305a80a --- /dev/null +++ b/docs/contracts/contracts/LSP17ContractExtension/LSP17Extendable.md @@ -0,0 +1,304 @@ + + + +# LSP17Extendable + +:::info Standard Specifications + +[`LSP-17-ContractExtension`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-17-ContractExtension.md) + +::: +:::info Solidity implementation + +[`LSP17Extendable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP17ContractExtension/LSP17Extendable.sol) + +::: + +> Module to add more functionalities to a contract using extensions. + +Implementation of the `fallback(...)` logic according to LSP17 + +- Contract Extension standard. This module can be inherited to extend the functionality of the parent contract when calling a function that doesn't exist on the parent contract via forwarding the call to an extension mapped to the function selector being called, set originally by the parent contract + +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. + +### supportsInterface + +:::note References + +- Specification details: [**LSP-17-ContractExtension**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-17-ContractExtension.md#supportsinterface) +- Solidity implementation: [`LSP17Extendable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP17ContractExtension/LSP17Extendable.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` | - | + +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_supportsInterfaceInERC165Extension + +```solidity +function _supportsInterfaceInERC165Extension( + bytes4 interfaceId +) internal view returns (bool); +``` + +Returns whether the interfaceId being checked is supported in the extension of the +[`supportsInterface`](#supportsinterface) selector. +To be used by extendable contracts wishing to extend the ERC165 interfaceIds originally +supported by reading whether the interfaceId queried is supported in the `supportsInterface` +extension if the extension is set, if not it returns false. + +
+ +### \_getExtension + +```solidity +function _getExtension(bytes4 functionSelector) internal view returns (address); +``` + +Returns the extension mapped to a specific function selector +If no extension was found, return the address(0) +To be overrided. +Up to the implementor contract to return an extension based on a function selector + +
+ +### \_fallbackLSP17Extendable + +```solidity +function _fallbackLSP17Extendable( + bytes callData +) internal nonpayable returns (bytes); +``` + +Forwards the call to an extension mapped to a function selector. +Calls [`_getExtension`](#_getextension) to get the address of the extension mapped to the function selector being +called on the account. If there is no extension, the address(0) will be returned. +Reverts if there is no extension for the function being called. +If there is an extension for the function selector being called, it calls the extension with the +CALL opcode, passing the [`msg.data`](#msg.data) appended with the 20 bytes of the [`msg.sender`](#msg.sender) and +32 bytes of the [`msg.value`](#msg.value) +Because the function uses assembly [`return()/revert()`](#return) to terminate the call, it cannot be +called before other codes in fallback(). +Otherwise, the codes after \_fallbackLSP17Extendable() may never be reached. + +
+ + + + + + + +[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 +[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 +[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 +[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 +[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 +[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 +[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X +[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[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 + + + +[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 + + + +[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership +[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership +[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership + + + +[`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 +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP17ContractExtension/LSP17Extension.md b/docs/contracts/contracts/LSP17ContractExtension/LSP17Extension.md new file mode 100644 index 0000000000..2d2d273b56 --- /dev/null +++ b/docs/contracts/contracts/LSP17ContractExtension/LSP17Extension.md @@ -0,0 +1,283 @@ + + + +# LSP17Extension + +:::info Standard Specifications + +[`LSP-17-ContractExtension`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-17-ContractExtension.md) + +::: +:::info Solidity implementation + +[`LSP17Extension.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP17ContractExtension/LSP17Extension.sol) + +::: + +> Module to create a contract that can act as an extension. + +Implementation of the extension logic according to LSP17ContractExtension. This module can be inherited to provide context of the msg variable related to the extendable contract + +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. + +### supportsInterface + +:::note References + +- Specification details: [**LSP-17-ContractExtension**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-17-ContractExtension.md#supportsinterface) +- Solidity implementation: [`LSP17Extension.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP17ContractExtension/LSP17Extension.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` | - | + +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_extendableMsgData + +```solidity +function _extendableMsgData() internal view returns (bytes); +``` + +Returns the original msg.data passed to the extendable contract +without the appended msg.sender and msg.value + +
+ +### \_extendableMsgSender + +```solidity +function _extendableMsgSender() internal view returns (address); +``` + +Returns the original msg.sender calling the extendable contract + +
+ +### \_extendableMsgValue + +```solidity +function _extendableMsgValue() internal view returns (uint256); +``` + +Returns the original msg.value sent to the extendable contract + +
+ + + + + + + +[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 +[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 +[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 +[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 +[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 +[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 +[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X +[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[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 + + + +[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 + + + +[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership +[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership +[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership + + + +[`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 +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md b/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md index acbbd0b043..04af77971f 100644 --- a/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md +++ b/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md @@ -1,3 +1,6 @@ + + + # LSP1UniversalReceiverDelegateUP :::info Standard Specifications @@ -5,9 +8,9 @@ [`LSP-1-UniversalReceiver`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md) ::: -:::info Soldity implementation +:::info Solidity implementation -[`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +[`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) ::: @@ -19,14 +22,17 @@ The [`LSP1UniversalReceiverDelegateUP`](#lsp1universalreceiverdelegateup) follow - 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 +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### supportsInterface -:::note Links +:::note References -- 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) +- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#supportsinterface) +- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -36,9 +42,7 @@ The [`LSP1UniversalReceiverDelegateUP`](#lsp1universalreceiverdelegateup) follow 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`. +See [`IERC165-supportsInterface`](#ierc165-supportsinterface). #### Parameters @@ -52,500 +56,250 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### universalReceiver -:::note Links +:::note References -- 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) +- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#universalreceiver) +- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) - Function signature: `universalReceiver(bytes32,)` - Function selector: `0x534e72c8` ::: -```solidity -function universalReceiver( - bytes32 typeId, - bytes -) external payable returns (bytes result); -``` +:::info -_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._ +- If some issues occured with generating the `dataKeys` or `dataValues` the `returnedMessage` will be an error message, otherwise it will be empty. +- If an error occured when trying to use `setDataBatch(dataKeys,dataValues)`, it will return the raw error data back to the caller. -The function performs the following steps: +::: + +:::caution Warning -1. Query the ERC725Y storage with the data key `[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]`. +When the data stored in the ERC725Y storage of the LSP0 contract is corrupted (\_e.g: ([LSP-5-ReceivedAssets]'s Array length not 16 bytes long, the token received is already registered in `LSP5ReceivetAssets[]`, the token being sent is not sent as full balance, etc...), the function call will still pass and return (**not revert!**) and not modify any data key on the storage of the [LSP-0-ERC725Account]. -- 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. +```solidity +function universalReceiver( + bytes32 typeId, + bytes +) external payable returns (bytes); +``` -2. Query the ERC725Y storage with the data key `[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY] + `. (Check [LSP2-ERC725YJSONSchema] for encoding the data key) +_Reacted on received notification with `typeId`._ -- If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. +1. Writes the data keys of the received [LSP-7-DigitalAsset], [LSP-8-IdentifiableDigitalAsset] and [LSP-9-Vault] contract addresses into the account storage according to the [LSP-5-ReceivedAssets] and [LSP-10-ReceivedVaults] Standard. -- 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. The data keys representing an asset/vault are cleared when the asset/vault is no longer owned by the account.
-**Emitted events:** +**Requirements:** -- [`ValueReceived`](#valuereceived) when receiving native tokens. -- [`UniversalReceiver`](#universalreceiver) event. +- This contract should be allowed to use the [`setDataBatch(...)`](#setdatabatch) function in order to update the LSP5 and LSP10 Data Keys. +- Cannot accept native tokens
#### Parameters -| Name | Type | Description | -| -------- | :-------: | -------------------------- | -| `typeId` | `bytes32` | The type of call received. | -| `_1` | `bytes` | - | +| Name | Type | Description | +| -------- | :-------: | ---------------------------------------------- | +| `typeId` | `bytes32` | Unique identifier for a specific notification. | +| `_1` | `bytes` | - | #### Returns -| Name | Type | Description | -| -------- | :-----: | ----------- | -| `result` | `bytes` | - | +| Name | Type | Description | +| ---- | :-----: | ---------------------------------------- | +| `0` | `bytes` | The result of the reaction for `typeId`. | -## Events +
-### UniversalReceiver +## Internal Methods -:::note Links +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. -- 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` +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. -::: +### \_tokenSender ```solidity -event UniversalReceiver(address indexed from, uint256 indexed value, bytes32 indexed typeId, bytes receivedData, bytes returnedValue); +function _tokenSender(address notifier) internal nonpayable returns (bytes); ``` -_`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. +Handler for LSP7 and LSP8 token sender type id. #### 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 +| Name | Type | Description | +| ---------- | :-------: | ------------------------------- | +| `notifier` | `address` | The LSP7 or LSP8 token address. | -- 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` +
-::: +### \_tokenRecipient ```solidity -error CannotRegisterEOAsAsAssets(address caller); +function _tokenRecipient( + address notifier, + bytes4 interfaceId +) internal nonpayable returns (bytes); ``` -_EOA: `caller` cannot be registered as an asset._ - -Reverts when EOA calls the [`universalReceiver(..)`](#universalreceiver) function with an asset/vault typeId. +Handler for LSP7 and LSP8 token recipient type id. #### Parameters -| Name | Type | Description | -| -------- | :-------: | ---------------------- | -| `caller` | `address` | The address of the EOA | +| Name | Type | Description | +| ------------- | :-------: | ------------------------------- | +| `notifier` | `address` | The LSP7 or LSP8 token address. | +| `interfaceId` | `bytes4` | The LSP7 or LSP8 interface id. | -### 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` - -::: +### \_vaultSender ```solidity -error InvalidLSP10ReceivedVaultsArrayLength( - bytes invalidValueStored, - uint256 invalidValueLength -); +function _vaultSender(address notifier) internal nonpayable returns (bytes); ``` -_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) +Handler for LSP9 vault sender type id. #### 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 +| Name | Type | Description | +| ---------- | :-------: | ----------------------- | +| `notifier` | `address` | The LSP9 vault address. | -- 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` +
-::: +### \_vaultRecipient ```solidity -error InvalidLSP5ReceivedAssetsArrayLength( - bytes invalidValueStored, - uint256 invalidValueLength -); +function _vaultRecipient(address notifier) internal nonpayable returns (bytes); ``` -_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) +Handler for LSP9 vault recipient type id. #### 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). | +| Name | Type | Description | +| ---------- | :-------: | ----------------------- | +| `notifier` | `address` | The LSP9 vault address. | + +
-### MaxLSP10VaultsCountReached +### \_setDataBatchWithoutReverting -:::note Links +:::info -- 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` +If an the low-level transaction revert, the returned data will be forwarded. Th contract that uses this function can use the `Address` library to revert with the revert reason. ::: ```solidity -error MaxLSP10VaultsCountReached(address notRegisteredVault); +function _setDataBatchWithoutReverting( + bytes32[] dataKeys, + bytes[] dataValues +) internal nonpayable returns (bytes); ``` -_Limit reached. Cannot register more vaults. Failed to register: `notRegisteredVault`._ - -Reverts when the `LSP10Vaults[]` array reaches its maximum limit (`max(uint128)`). +Calls `bytes4(keccak256(setDataBatch(bytes32[],bytes[])))` without checking for `bool success`, but it returns all the data back. #### Parameters -| Name | Type | Description | -| -------------------- | :-------: | ------------------------------------------------------ | -| `notRegisteredVault` | `address` | The address of the vault that could not be registered. | +| Name | Type | Description | +| ------------ | :---------: | ---------------------- | +| `dataKeys` | `bytes32[]` | Data Keys to be set. | +| `dataValues` | `bytes[]` | Data Values to be set. | + +
+ +## Events -### MaxLSP5ReceivedAssetsCountReached +### UniversalReceiver -:::note Links +:::note References -- 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` +- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#universalreceiver) +- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Event signature: `UniversalReceiver(address,uint256,bytes32,bytes,bytes)` +- Event topic hash: `0x9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c2` ::: ```solidity -error MaxLSP5ReceivedAssetsCountReached(address notRegisteredAsset); +event UniversalReceiver(address indexed from, uint256 indexed value, bytes32 indexed typeId, bytes receivedData, bytes returnedValue); ``` -_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 +\*Address `from` called the `universalReceiver(...)` function while sending `value` LYX. Notification type (typeId): `typeId` -:::note Links +- Data received: `receivedData`.\* -- 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` +Emitted when the [`universalReceiver`](#universalreceiver) function was called with a specific `typeId` and some `receivedData` s -::: +#### Parameters -```solidity -error NativeTokensNotAccepted(); -``` +| Name | Type | Description | +| ---------------------- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `from` **`indexed`** | `address` | The address of the EOA or smart contract that called the {universalReceiver(...)} function. | +| `value` **`indexed`** | `uint256` | The amount sent to the {universalReceiver(...)} function. | +| `typeId` **`indexed`** | `bytes32` | A `bytes32` unique identifier (= _"hook"_)that describe the type of notification, information or transaction received by the contract. Can be related to a specific standard or a hook. | +| `receivedData` | `bytes` | Any arbitrary data that was sent to the {universalReceiver(...)} function. | +| `returnedValue` | `bytes` | The value returned by the {universalReceiver(...)} function. | -_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. +## Errors -### ReceivedAssetsIndexSuperiorToUint128 +### CannotRegisterEOAsAsAssets -:::note Links +:::note References -- 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` +- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#cannotregistereoasasassets) +- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Error signature: `CannotRegisterEOAsAsAssets(address)` +- Error hash: `0xa5295345` ::: ```solidity -error ReceivedAssetsIndexSuperiorToUint128(uint256 index); +error CannotRegisterEOAsAsAssets(address caller); ``` -_Asset index stored under the `ReceivedAssetsMap` Data Key is invalid. Invalid index: `index`._ +_EOA: `caller` cannot be registered as an asset._ -Reverts when the received assets index is superior to `uint128`. +Reverts when EOA calls the [`universalReceiver(..)`](#universalreceiver) function with an asset/vault typeId. #### Parameters -| Name | Type | Description | -| ------- | :-------: | -------------------------- | -| `index` | `uint256` | The received assets index. | +| Name | Type | Description | +| -------- | :-------: | ---------------------- | +| `caller` | `address` | The address of the EOA | -### VaultIndexSuperiorToUint128 +
-:::note Links +### NativeTokensNotAccepted -- 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` +:::note References + +- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#nativetokensnotaccepted) +- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol) +- Error signature: `NativeTokensNotAccepted()` +- Error hash: `0x114b721a` ::: ```solidity -error VaultIndexSuperiorToUint128(uint256 index); +error NativeTokensNotAccepted(); ``` -_Vault index stored under the `ReceivedVaultsMap` Data Key is invalid. Invalid index: `index`._ - -Reverts when the vault index is superior to `uint128`. +_Cannot send native tokens to [`universalReceiver(...)`](#universalreceiver) function of the delegated contract._ -#### Parameters +Reverts when the [`universalReceiver`](#universalreceiver) function in the LSP1 Universal Receiver Delegate contract is called while sending some native tokens along the call (`msg.value` different than `0`) -| Name | Type | Description | -| ------- | :-------: | ---------------- | -| `index` | `uint256` | The vault index. | - - - - - - - -[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 -[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 -[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 -[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 -[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 -[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 -[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X -[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y -[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md -[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[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 - - - -[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 - - - -[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership -[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership -[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership - - - -[`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 -[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol -[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 -[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol -[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll -[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol - - - -[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol -[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol -[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol -[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol -[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol -[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so -[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol -[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md b/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md index 50c7bb6039..ddedeaae36 100644 --- a/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md +++ b/docs/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.md @@ -1,3 +1,6 @@ + + + # LSP1UniversalReceiverDelegateVault :::info Standard Specifications @@ -5,9 +8,9 @@ [`LSP-1-UniversalReceiver`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md) ::: -:::info Soldity implementation +:::info Solidity implementation -[`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) +[`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) ::: @@ -17,14 +20,17 @@ The [`LSP1UniversalReceiverDelegateVault`](#lsp1universalreceiverdelegatevault) - 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 +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### supportsInterface -:::note Links +:::note References -- 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) +- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#supportsinterface) +- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -34,9 +40,7 @@ The [`LSP1UniversalReceiverDelegateVault`](#lsp1universalreceiverdelegatevault) 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`. +See [`IERC165-supportsInterface`](#ierc165-supportsinterface). #### Parameters @@ -50,192 +54,198 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### universalReceiver -:::note Links +:::note References -- 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) +- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#universalreceiver) +- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) - Function signature: `universalReceiver(bytes32,)` - Function selector: `0x534e72c8` ::: +:::info + +- If some issues occured with generating the `dataKeys` or `dataValues` the `returnedMessage` will be an error message, otherwise it will be empty. +- If an error occured when trying to use `setDataBatch(dataKeys,dataValues)`, it will return the raw error data back to the caller. + +::: + ```solidity function universalReceiver( bytes32 typeId, bytes -) external payable returns (bytes result); +) external payable returns (bytes); ``` -_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: +_Reacted on received notification with `typeId`._ -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. +Handles two cases: Writes the received [LSP-7-DigitalAsset] or [LSP-8-IdentifiableDigitalAsset] assets into the vault storage according to the [LSP-5-ReceivedAssets] standard.
-**Emitted events:** +**Requirements:** -- [`ValueReceived`](#valuereceived) when receiving native tokens. -- [`UniversalReceiver`](#universalreceiver) event. +- Cannot accept native tokens.
#### Parameters -| Name | Type | Description | -| -------- | :-------: | -------------------------- | -| `typeId` | `bytes32` | The type of call received. | -| `_1` | `bytes` | - | +| Name | Type | Description | +| -------- | :-------: | ---------------------------------------------- | +| `typeId` | `bytes32` | Unique identifier for a specific notification. | +| `_1` | `bytes` | - | #### Returns -| Name | Type | Description | -| -------- | :-----: | ----------- | -| `result` | `bytes` | - | +| Name | Type | Description | +| ---- | :-----: | ---------------------------------------- | +| `0` | `bytes` | The result of the reaction for `typeId`. | -## Events +
-### UniversalReceiver +## Internal Methods -:::note Links +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. -- 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` +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. -::: +### \_tokenSender ```solidity -event UniversalReceiver(address indexed from, uint256 indexed value, bytes32 indexed typeId, bytes receivedData, bytes returnedValue); +function _tokenSender(address notifier) internal nonpayable returns (bytes); ``` -_`from` sent `value` native tokens and a notification using `typeId` and `receivedData`._ +Handler for LSP7 and LSP8 token sender type id. + +#### Parameters -The event is emitted when `universalReceiver(...)` reacted successfully on all of the following inputs: +| Name | Type | Description | +| ---------- | :-------: | ------------------------------- | +| `notifier` | `address` | The LSP7 or LSP8 token address. | -- A valid notifier: `from` +
-- A valid amount of native tokens are sent: `value` +### \_tokenRecipient -- A supported type ID: `typeId` +```solidity +function _tokenRecipient( + address notifier, + bytes4 interfaceId +) internal nonpayable returns (bytes); +``` -- Arbitrary data which may or may not be used: `receivedData` And returned a valid result: `returnedValue` based on the inputs. +Handler for LSP7 and LSP8 token recipient type id. #### 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. | +| Name | Type | Description | +| ------------- | :-------: | ------------------------------- | +| `notifier` | `address` | The LSP7 or LSP8 token address. | +| `interfaceId` | `bytes4` | The LSP7 or LSP8 interface id. | -## Errors +
-### CannotRegisterEOAsAsAssets +### \_setDataBatchWithoutReverting -:::note Links +:::info -- 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` +If an the low-level transaction revert, the returned data will be forwarded. Th contract that uses this function can use the `Address` library to revert with the revert reason. ::: ```solidity -error CannotRegisterEOAsAsAssets(address caller); +function _setDataBatchWithoutReverting( + bytes32[] dataKeys, + bytes[] dataValues +) internal nonpayable returns (bytes); ``` -_EOA: `caller` cannot be registered as an asset._ - -Reverts when EOA calls the [`universalReceiver(..)`](#universalreceiver) function with an asset/vault typeId. +Calls `bytes4(keccak256(setDataBatch(bytes32[],bytes[])))` without checking for `bool succes`, but it returns all the data back. #### Parameters -| Name | Type | Description | -| -------- | :-------: | ---------------------- | -| `caller` | `address` | The address of the EOA | +| Name | Type | Description | +| ------------ | :---------: | ---------------------- | +| `dataKeys` | `bytes32[]` | Data Keys to be set. | +| `dataValues` | `bytes[]` | Data Values to be set. | -### InvalidLSP5ReceivedAssetsArrayLength +
-:::note Links +## Events -- 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` +### UniversalReceiver + +:::note References + +- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#universalreceiver) +- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) +- Event signature: `UniversalReceiver(address,uint256,bytes32,bytes,bytes)` +- Event topic hash: `0x9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c2` ::: ```solidity -error InvalidLSP5ReceivedAssetsArrayLength( - bytes invalidValueStored, - uint256 invalidValueLength -); +event UniversalReceiver(address indexed from, uint256 indexed value, bytes32 indexed typeId, bytes receivedData, bytes returnedValue); ``` -_The data stored under `LSP5ReceivedAssets[]` Data Key is invalid. Value storred: `invalidValueStored`. Value length: `invalidValueLength`._ +\*Address `from` called the `universalReceiver(...)` function while sending `value` LYX. Notification type (typeId): `typeId` -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: +- Data received: `receivedData`.\* -- 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) +Emitted when the [`universalReceiver`](#universalreceiver) function was called with a specific `typeId` and some `receivedData` s #### 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). | +| Name | Type | Description | +| ---------------------- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `from` **`indexed`** | `address` | The address of the EOA or smart contract that called the {universalReceiver(...)} function. | +| `value` **`indexed`** | `uint256` | The amount sent to the {universalReceiver(...)} function. | +| `typeId` **`indexed`** | `bytes32` | A `bytes32` unique identifier (= _"hook"_)that describe the type of notification, information or transaction received by the contract. Can be related to a specific standard or a hook. | +| `receivedData` | `bytes` | Any arbitrary data that was sent to the {universalReceiver(...)} function. | +| `returnedValue` | `bytes` | The value returned by the {universalReceiver(...)} function. | -### MaxLSP5ReceivedAssetsCountReached +
-:::note Links +## Errors -- 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` +### CannotRegisterEOAsAsAssets + +:::note References + +- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#cannotregistereoasasassets) +- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) +- Error signature: `CannotRegisterEOAsAsAssets(address)` +- Error hash: `0xa5295345` ::: ```solidity -error MaxLSP5ReceivedAssetsCountReached(address notRegisteredAsset); +error CannotRegisterEOAsAsAssets(address caller); ``` -_Limit reached. Cannot register more assets. Failed to register: `notRegisteredAsset`._ +_EOA: `caller` cannot be registered as an asset._ -Reverts when the `LSP5ReceivedAssets[]` array reaches its maximum limit (`max(uint128)`). +Reverts when EOA calls the [`universalReceiver(..)`](#universalreceiver) function with an asset/vault typeId. #### Parameters -| Name | Type | Description | -| -------------------- | :-------: | ------------------------------------------------------ | -| `notRegisteredAsset` | `address` | The address of the asset that could not be registered. | +| Name | Type | Description | +| -------- | :-------: | ---------------------- | +| `caller` | `address` | The address of the EOA | + +
### NativeTokensNotAccepted -:::note Links +:::note References -- 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) +- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#nativetokensnotaccepted) +- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol) - Error signature: `NativeTokensNotAccepted()` - Error hash: `0x114b721a` @@ -247,220 +257,6 @@ 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 +Reverts when the [`universalReceiver`](#universalreceiver) function in the LSP1 Universal Receiver Delegate contract is called while sending some native tokens along the call (`msg.value` different than `0`) -| Name | Type | Description | -| ------- | :-------: | -------------------------- | -| `index` | `uint256` | The received assets index. | - - - - - - - -[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 -[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 -[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 -[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 -[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 -[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 -[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X -[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y -[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md -[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[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 - - - -[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 - - - -[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership -[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership -[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership - - - -[`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 -[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol -[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 -[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol -[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll -[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol - - - -[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol -[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol -[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol -[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol -[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol -[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so -[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol -[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP20CallVerification/LSP20CallVerification.md b/docs/contracts/contracts/LSP20CallVerification/LSP20CallVerification.md new file mode 100644 index 0000000000..1ecf08daa8 --- /dev/null +++ b/docs/contracts/contracts/LSP20CallVerification/LSP20CallVerification.md @@ -0,0 +1,267 @@ + + + +# LSP20CallVerification + +:::info Standard Specifications + +[`LSP-20-CallVerification`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-20-CallVerification.md) + +::: +:::info Solidity implementation + +[`LSP20CallVerification.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP20CallVerification/LSP20CallVerification.sol) + +::: + +> Implementation of a contract calling the verification functions according to LSP20 - Call Verification standard. + +Module to be inherited used to verify the execution of functions according to a verifier address. Verification can happen before or after execution based on a magicValue. + +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_verifyCall + +```solidity +function _verifyCall( + address logicVerifier +) internal nonpayable returns (bool verifyAfter); +``` + +Calls [`lsp20VerifyCall`](#lsp20verifycall) function on the logicVerifier. +Reverts in case the value returned does not match the magic value (lsp20VerifyCall selector) +Returns whether a verification after the execution should happen based on the last byte of the magicValue + +
+ +### \_verifyCallResult + +```solidity +function _verifyCallResult( + address logicVerifier, + bytes callResult +) internal nonpayable; +``` + +Calls [`lsp20VerifyCallResult`](#lsp20verifycallresult) function on the logicVerifier. +Reverts in case the value returned does not match the magic value (lsp20VerifyCallResult selector) + +
+ +### \_validateCall + +```solidity +function _validateCall( + bool postCall, + bool success, + bytes returnedData +) internal pure; +``` + +
+ +### \_revertWithLSP20DefaultError + +```solidity +function _revertWithLSP20DefaultError( + bool postCall, + bytes returnedData +) internal pure; +``` + +
+ + + + + + + +[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 +[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 +[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 +[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 +[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 +[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 +[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X +[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[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 + + + +[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 + + + +[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership +[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership +[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership + + + +[`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 +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP23LinkedContractsDeployment/IPostDeploymentModule.md b/docs/contracts/contracts/LSP23LinkedContractsDeployment/IPostDeploymentModule.md index 1850eeeaf9..a9a7872f6c 100644 --- a/docs/contracts/contracts/LSP23LinkedContractsDeployment/IPostDeploymentModule.md +++ b/docs/contracts/contracts/LSP23LinkedContractsDeployment/IPostDeploymentModule.md @@ -46,8 +46,199 @@ Executes post-deployment logic for the primary and secondary contracts. | Name | Type | Description | | -------------------------------- | :-------: | -------------------------------------------------------- | -| `primaryContract` | `address` | Address of the deployed primary contract. | -| `secondaryContract` | `address` | Address of the deployed secondary contract. | +| `primaryContract` | `address` | The address of the deployed primary contract. | +| `secondaryContract` | `address` | The address of the deployed secondary contract. | | `calldataToPostDeploymentModule` | `bytes` | Calldata to be passed for the post-deployment execution. |
+ + + + + + + +[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 +[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 +[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 +[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 +[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 +[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 +[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X +[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[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 + + + +[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 + + + +[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership +[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership +[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership + + + +[`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 +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP23LinkedContractsDeployment/LSP23LinkedContractsFactory.md b/docs/contracts/contracts/LSP23LinkedContractsDeployment/LSP23LinkedContractsFactory.md index a40a8e15ac..69e663de11 100644 --- a/docs/contracts/contracts/LSP23LinkedContractsDeployment/LSP23LinkedContractsFactory.md +++ b/docs/contracts/contracts/LSP23LinkedContractsDeployment/LSP23LinkedContractsFactory.md @@ -254,16 +254,18 @@ function _generatePrimaryContractProxySalt(struct ILSP23LinkedContractsFactory.P event DeployedContracts(address indexed primaryContract, address indexed secondaryContract, ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment, ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment, address postDeploymentModule, bytes postDeploymentModuleCalldata); ``` +Emitted when a primary and secondary contract are deployed. + #### Parameters -| Name | Type | Description | -| --------------------------------- | :--------------------------------------------------------: | ----------- | -| `primaryContract` **`indexed`** | `address` | - | -| `secondaryContract` **`indexed`** | `address` | - | -| `primaryContractDeployment` | `ILSP23LinkedContractsFactory.PrimaryContractDeployment` | - | -| `secondaryContractDeployment` | `ILSP23LinkedContractsFactory.SecondaryContractDeployment` | - | -| `postDeploymentModule` | `address` | - | -| `postDeploymentModuleCalldata` | `bytes` | - | +| Name | Type | Description | +| --------------------------------- | :--------------------------------------------------------: | ------------------------------------------------------ | +| `primaryContract` **`indexed`** | `address` | Address of the deployed primary contract. | +| `secondaryContract` **`indexed`** | `address` | Address of the deployed secondary contract. | +| `primaryContractDeployment` | `ILSP23LinkedContractsFactory.PrimaryContractDeployment` | Parameters used for the primary contract deployment. | +| `secondaryContractDeployment` | `ILSP23LinkedContractsFactory.SecondaryContractDeployment` | Parameters used for the secondary contract deployment. | +| `postDeploymentModule` | `address` | Address of the post-deployment module. | +| `postDeploymentModuleCalldata` | `bytes` | Calldata passed to the post-deployment module. |
@@ -282,16 +284,18 @@ event DeployedContracts(address indexed primaryContract, address indexed seconda event DeployedERC1167Proxies(address indexed primaryContract, address indexed secondaryContract, ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit, ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit, address postDeploymentModule, bytes postDeploymentModuleCalldata); ``` +Emitted when proxies of a primary and secondary contract are deployed. + #### Parameters -| Name | Type | Description | -| --------------------------------- | :------------------------------------------------------------: | ----------- | -| `primaryContract` **`indexed`** | `address` | - | -| `secondaryContract` **`indexed`** | `address` | - | -| `primaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit` | - | -| `secondaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit` | - | -| `postDeploymentModule` | `address` | - | -| `postDeploymentModuleCalldata` | `bytes` | - | +| Name | Type | Description | +| --------------------------------- | :------------------------------------------------------------: | ------------------------------------------------------------ | +| `primaryContract` **`indexed`** | `address` | Address of the deployed primary contract proxy. | +| `secondaryContract` **`indexed`** | `address` | Address of the deployed secondary contract proxy. | +| `primaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit` | Parameters used for the primary contract proxy deployment. | +| `secondaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit` | Parameters used for the secondary contract proxy deployment. | +| `postDeploymentModule` | `address` | Address of the post-deployment module. | +| `postDeploymentModuleCalldata` | `bytes` | Calldata passed to the post-deployment module. |
@@ -371,3 +375,194 @@ Reverts when the deployment & intialisation of the secondary contract has failed | `errorData` | `bytes` | Potentially information about why the deployment & intialisation have failed. |
+ + + + + + + +[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 +[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 +[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 +[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 +[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 +[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 +[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X +[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[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 + + + +[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 + + + +[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership +[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership +[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership + + + +[`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 +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.md b/docs/contracts/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.md new file mode 100644 index 0000000000..a083fd9a16 --- /dev/null +++ b/docs/contracts/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.md @@ -0,0 +1,338 @@ + + + +# LSP25MultiChannelNonce + +:::info Standard Specifications + +[`LSP-25-ExecuteRelayCall`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-25-ExecuteRelayCall.md) + +::: +:::info Solidity implementation + +[`LSP25MultiChannelNonce.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol) + +::: + +> Implementation of the multi channel nonce and the signature verification defined in the LSP25 standard. + +This contract can be used as a backbone for other smart contracts to implement meta-transactions via the LSP25 Execute Relay Call interface. It contains a storage of nonces for signer addresses across various channel IDs, enabling these signers to submit signed transactions that order-independant. (transactions that do not need to be submitted one after the other in a specific order). Finally, it contains internal functions to verify signatures for specific calldata according the signature format specified in the LSP25 standard. + +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_getNonce + +```solidity +function _getNonce( + address from, + uint128 channelId +) internal view returns (uint256 idx); +``` + +Read the nonce for a `from` address on a specific `channelId`. +This will return an `idx`, which is the concatenation of two `uint128` as follow: + +1. the `channelId` where the nonce was queried for. + +2. the actual nonce of the given `channelId`. + For example, if on `channelId` number `5`, the latest nonce is `1`, the `idx` returned by this function will be: + +``` +// in decimals = 1701411834604692317316873037158841057281 +idx = 0x0000000000000000000000000000000500000000000000000000000000000001 +``` + +This idx can be described as follow: + +``` + channelId => 5 nonce in this channel => 1 + v------------------------------v-------------------------------v +0x0000000000000000000000000000000500000000000000000000000000000001 +``` + +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | ------------------------------------------ | +| `from` | `address` | The address to read the nonce for. | +| `channelId` | `uint128` | The channel in which to extract the nonce. | + +#### Returns + +| Name | Type | Description | +| ----- | :-------: | ---------------------------------------------------------------------------------------------------------------------- | +| `idx` | `uint256` | The idx composed of two `uint128`: the channelId + nonce in channel concatenated together in a single `uint256` value. | + +
+ +### \_recoverSignerFromLSP25Signature + +```solidity +function _recoverSignerFromLSP25Signature( + bytes signature, + uint256 nonce, + uint256 validityTimestamps, + uint256 msgValue, + bytes callData +) internal view returns (address); +``` + +Recover the address of the signer that generated a `signature` using the parameters provided `nonce`, `validityTimestamps`, `msgValue` and `callData`. +The address of the signer will be recovered using the LSP25 signature format. + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------- | +| `signature` | `bytes` | A 65 bytes long signature generated according to the signature format specified in the LSP25 standard. | +| `nonce` | `uint256` | The nonce that the signer used to generate the `signature`. | +| `validityTimestamps` | `uint256` | The validity timestamp that the signer used to generate the signature (See {\_verifyValidityTimestamps} to learn more). | +| `msgValue` | `uint256` | The amount of native tokens intended to be sent for the relay transaction. | +| `callData` | `bytes` | The calldata to execute as a relay transaction that the signer signed for. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | -------------------------------------------------------- | +| `0` | `address` | The address that signed, recovered from the `signature`. | + +
+ +### \_verifyValidityTimestamps + +```solidity +function _verifyValidityTimestamps(uint256 validityTimestamps) internal view; +``` + +Verify that the current timestamp is within the date and time range provided by `validityTimestamps`. + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- | +| `validityTimestamps` | `uint256` | Two `uint128` concatenated together, where the left-most `uint128` represent the timestamp from which the transaction can be executed, | + +
+ +### \_isValidNonce + +```solidity +function _isValidNonce(address from, uint256 idx) internal view returns (bool); +``` + +Verify that the nonce `_idx` for `_from` (obtained via [`getNonce`](#getnonce)) is valid in its channel ID. +The "idx" is a 256bits (unsigned) integer, where: + +- the 128 leftmost bits = channelId + +- and the 128 rightmost bits = nonce within the channel + +#### Parameters + +| Name | Type | Description | +| ------ | :-------: | ---------------------------------------------------------------------------- | +| `from` | `address` | The signer's address. | +| `idx` | `uint256` | The concatenation of the `channelId` + `nonce` within a specific channel ID. | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | ------------------------------------------------------------------------ | +| `0` | `bool` | true if the nonce is the latest nonce for the `signer`, false otherwise. | + +
+ + + + + + + +[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 +[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 +[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 +[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 +[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 +[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 +[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X +[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[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 + + + +[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 + + + +[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership +[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership +[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership + + + +[`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 +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.md b/docs/contracts/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.md new file mode 100644 index 0000000000..6bcdb9c46f --- /dev/null +++ b/docs/contracts/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.md @@ -0,0 +1,637 @@ + + + +# LSP4Compatibility + +:::info Standard Specifications + +[`LSP-4-DigitalAssetMetadata`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md) + +::: +:::info Solidity implementation + +[`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol) + +::: + +> LSP4Compatibility + +LSP4 extension, for compatibility with clients & tools that expect ERC20/721. + +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. + +### getData + +:::note References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#getdata) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.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 References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#getdatabatch) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.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 | + +
+ +### name + +:::note References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#name) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol) +- Function signature: `name()` +- Function selector: `0x06fdde03` + +::: + +```solidity +function name() external view returns (string); +``` + +Returns the name of the token. + +#### Returns + +| Name | Type | Description | +| ---- | :------: | --------------------- | +| `0` | `string` | The name of the token | + +
+ +### owner + +:::note References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#owner) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.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 References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#renounceownership) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.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. + +
+ +### setData + +:::note References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#setdata) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.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 References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#setdatabatch) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.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 References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#supportsinterface) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.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` | - | + +
+ +### symbol + +:::note References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#symbol) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol) +- Function signature: `symbol()` +- Function selector: `0x95d89b41` + +::: + +```solidity +function symbol() external view returns (string); +``` + +Returns the symbol of the token, usually a shorter version of the name. + +#### Returns + +| Name | Type | Description | +| ---- | :------: | ----------------------- | +| `0` | `string` | The symbol of the token | + +
+ +### transferOwnership + +:::note References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#transferownership) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.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` | - | + +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +
+ +## Events + +### DataChanged + +:::note References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#datachanged) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol) +- Event signature: `DataChanged(bytes32,bytes)` +- Event topic 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` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
+ +### OwnershipTransferred + +:::note References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#ownershiptransferred) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol) +- Event signature: `OwnershipTransferred(address,address)` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` + +::: + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------------- | :-------: | ----------- | +| `previousOwner` **`indexed`** | `address` | - | +| `newOwner` **`indexed`** | `address` | - | + +
+ +## Errors + +### ERC725Y_DataKeysValuesEmptyArray + +:::note References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.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 References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.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 References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP4Compatibility.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol) +- Error signature: `ERC725Y_MsgValueDisallowed()` +- Error hash: `0xf36ba737` + +::: + +```solidity +error ERC725Y_MsgValueDisallowed(); +``` + +reverts when sending value to the `setData(..)` functions + +
+ + + + + + + +[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 +[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 +[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 +[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 +[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 +[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 +[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X +[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y +[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md +[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 +[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 + + + +[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 +[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 + + + +[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership +[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership +[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership + + + +[`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 +[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol +[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 +[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol +[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll +[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol + + + +[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol +[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol +[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol +[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol +[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol +[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so +[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol +[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md b/docs/contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md index 57e7dedc43..d87dc273fd 100644 --- a/docs/contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md +++ b/docs/contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md @@ -1,6 +1,14 @@ + + + # LSP4DigitalAssetMetadata -:::info Solidity contract +:::info Standard Specifications + +[`LSP-4-DigitalAssetMetadata`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md) + +::: +:::info Solidity implementation [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) @@ -10,14 +18,17 @@ Standard Implementation of the LSP4 standard. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### getData -:::note Links +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#getdata) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#getdata) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -41,12 +52,14 @@ _Gets singular data at a given `dataKey`_ | ----------- | :-----: | -------------------------- | | `dataValue` | `bytes` | The data stored at the key | +
+ ### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#getdatabatch) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#getdatabatch) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -72,12 +85,14 @@ _Gets array of data for multiple given keys_ | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### owner -:::note Links +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#owner) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#owner) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -95,12 +110,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#renounceownership) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#renounceownership) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -112,12 +129,14 @@ 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. +
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#setdata) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#setdata) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` @@ -136,12 +155,14 @@ _Sets singular data for a given `dataKey`_ | `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 +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#setdatabatch) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#setdatabatch) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` @@ -162,12 +183,14 @@ Sets array of data for multiple given `dataKeys` SHOULD only be callable by the | `dataKeys` | `bytes32[]` | The array of data keys for values to set | | `dataValues` | `bytes[]` | The array of values to set | +
+ ### supportsInterface -:::note Links +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#supportsinterface) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#supportsinterface) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -191,12 +214,14 @@ See [`IERC165-supportsInterface`](#ierc165-supportsinterface). | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### transferOwnership -:::note Links +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#transferownership) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#transferownership) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -214,18 +239,63 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | ---- +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +Save gas by emitting the [`DataChanged`](#datachanged) event with only the first 256 bytes of dataValue + +
## Events ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#datachanged) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#datachanged) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -237,19 +307,21 @@ _Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | ----------- | -| `dataKey` **`indexed`** | `bytes32` | - | -| `dataValue` | `bytes` | - | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#ownershiptransferred) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#ownershiptransferred) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -264,16 +336,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | ---- +
## Errors ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -285,12 +357,14 @@ error ERC725Y_DataKeysValuesEmptyArray(); reverts when one of the array parameter provided to `setDataBatch` is an empty array +
+ ### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -302,12 +376,14 @@ 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 +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -319,12 +395,14 @@ error ERC725Y_MsgValueDisallowed(); reverts when sending value to the `setData(..)` functions +
+ ### LSP4TokenNameNotEditable -:::note Links +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#lsp4tokennamenoteditable) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -336,12 +414,14 @@ 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 +:::note References -- Specification details in [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#lsp4tokensymbolnoteditable) -- Solidity implementation in [**LSP4DigitalAssetMetadata**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -353,6 +433,8 @@ 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. +
+ diff --git a/docs/contracts/contracts/LSP6KeyManager/LSP6KeyManager.md b/docs/contracts/contracts/LSP6KeyManager/LSP6KeyManager.md index 09bd921475..186d05e99c 100644 --- a/docs/contracts/contracts/LSP6KeyManager/LSP6KeyManager.md +++ b/docs/contracts/contracts/LSP6KeyManager/LSP6KeyManager.md @@ -1,8 +1,16 @@ + + + # LSP6KeyManager -:::info Solidity contract +:::info Standard Specifications + +[`LSP-6-KeyManager`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md) + +::: +:::info Solidity implementation -[`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol) +[`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) ::: @@ -10,14 +18,17 @@ All the permissions can be set on the ERC725 Account using `setData(bytes32,bytes)` or `setData(bytes32[],bytes[])`. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### constructor -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#constructor) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) ::: @@ -25,7 +36,7 @@ All the permissions can be set on the ERC725 Account using `setData(bytes32,byte constructor(address target_); ``` -_Deploying a LSP6KeyManager linked to contract at address `target_`.\_ +_Deploying a LSP6KeyManager linked to the 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. @@ -35,12 +46,14 @@ Deploy a Key Manager and set the `target_` address in the contract storage, maki | --------- | :-------: | ------------------------------------------------------------------------ | | `target_` | `address` | The address of the contract to control and forward calldata payloads to. | +
+ ### execute -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#execute) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Function signature: `execute(bytes)` - Function selector: `0x09c5eabe` @@ -50,15 +63,15 @@ Deploy a Key Manager and set the `target_` address in the contract storage, maki function execute(bytes payload) external payable returns (bytes); ``` -_execute the following payload on the linked contract: `payload`_ +_Executing 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. +Execute A `payload` on the linked [`target`](#target) contract 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. +- [`PermissionsVerified`](#permissionsverified) event when the permissions related to `payload` have been verified successfully.
@@ -66,20 +79,22 @@ execute a `payload` on the linked [`target`](#target) after having verified the | Name | Type | Description | | --------- | :-----: | ---------------------------------------------------------------- | -| `payload` | `bytes` | the abi-encoded function call to execute on the linked {target}. | +| `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}. | +| `0` | `bytes` | The abi-decoded data returned by the function called on the linked {target}. | + +
### executeBatch -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#executebatch) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Function signature: `executeBatch(uint256[],bytes[])` - Function selector: `0xbf0176ff` @@ -92,13 +107,19 @@ function executeBatch( ) external payable returns (bytes[]); ``` +\*Executing the following batch of payloads and sensind on the linked contract. + +- payloads: `payloads` + +- values transferred for each payload: `values`\* + 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. +- [`PermissionsVerified`](#permissionsverified) event for each permissions related to each `payload` that have been verified successfully.
@@ -111,16 +132,18 @@ Same as [`execute`](#execute) but execute a batch of payloads (abi-encoded funct #### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------------------------------------------------------------- | -| `0` | `bytes[]` | An array of abi-decoded of return data returned by the functions called on the linked {target}. | +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------------------------------------------------- | +| `0` | `bytes[]` | An array of abi-decoded data returned by the functions called on the linked {target}. | + +
### executeRelayCall -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#executerelaycall) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Function signature: `executeRelayCall(bytes,uint256,uint256,bytes)` - Function selector: `0x4c8a4e74` @@ -141,37 +164,41 @@ function executeRelayCall( ) 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. +_Executing the following payload given the nonce `nonce` and signature `signature`. Payload: `payload`_ + +Allows any address (executor) to execute a payload (= abi-encoded function call), given they have a valid signature from a signer address and a valid `nonce` for this signer. The signature MUST be generated according to the signature format defined by the LSP25 standard. The signer that generated the `signature` MUST be a controller with some permissions on the linked [`target`](#target). The `payload` will be executed on the [`target`](#target) contract once the LSP25 signature and the permissions of the signer have been verified.
**Emitted events:** -- [`VerifiedCall`](#verifiedcall) event when the permissions related to `payload` have been verified successfully. +- [`PermissionsVerified`](#permissionsverified) 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}. | +| Name | Type | Description | +| -------------------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `signature` | `bytes` | A 65 bytes long signature for a meta transaction according to LSP25. | +| `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. | #### Returns -| Name | Type | Description | -| ---- | :-----: | ---------------------------------------------------------------------- | -| `0` | `bytes` | the data being returned by the function called on the linked {target}. | +| Name | Type | Description | +| ---- | :-----: | ------------------------------------------------- | +| `0` | `bytes` | The data being returned by the function executed. | + +
### executeRelayCallBatch -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#executerelaycallbatch) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Function signature: `executeRelayCallBatch(bytes[],uint256[],uint256[],uint256[],bytes[])` - Function selector: `0xa20856a5` @@ -187,7 +214,9 @@ function executeRelayCallBatch( ) 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. +_Executing a batch of relay calls (= meta-transactions)._ + +Same as [`executeRelayCall`](#executerelaycall) but execute a batch of signed calldata payloads (abi-encoded function calls) in a single transaction. The `signatures` can be from multiple controllers, not necessarely the same controller, as long as each of these controllers that signed have the right permissions related to the calldata `payload` they signed.
@@ -200,34 +229,39 @@ Same as [`executeRelayCall`](#executerelaycall) but execute a batch of signed ca #### 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}. | +| Name | Type | Description | +| -------------------- | :---------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `signatures` | `bytes[]` | An array of 65 bytes long signatures for meta transactions according to LSP25. | +| `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 be executed successively. | #### Returns -| Name | Type | Description | -| ---- | :-------: | -------------------------------------------------------------------------------------------- | -| `0` | `bytes[]` | An array of abi-decoded return data returned by the functions called on the linked {target}. | +| Name | Type | Description | +| ---- | :-------: | ---------------------------------------------------------------- | +| `0` | `bytes[]` | An array of abi-decoded data returned by the functions executed. | + +
### getNonce -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#getnonce) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Function signature: `getNonce(address,uint128)` - Function selector: `0xb44581d9` ::: -:::info +:::tip Hint + +A signer can choose its channel number arbitrarily. The recommended practice is to: -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). +- use `channelId == 0` for transactions for which the ordering of execution matters.abi _Example: you have two transactions A and B, and transaction A must be executed first and complete successfully before transaction B should be executed)._ +- use any other `channelId` number for transactions that you want to be order independant (out-of-order execution, execution _"in parallel"_). \_Example: you have two transactions A and B. You want transaction B to be executed a) without having to wait for transaction A to complete, or b) regardless if transaction A completed successfully or not. ::: @@ -238,29 +272,31 @@ function getNonce( ) external view returns (uint256); ``` -_Get latest nonce for `from` in channel ID: `channelId`._ +_Reading the latest nonce of address `from` in the channel ID `channelId`._ -Get the nonce for a specific controller `from` address that can be used for signing relay transaction. +Get the nonce for a specific `from` address that can be used for signing relay transactions via [`executeRelayCall`](#executerelaycall). #### 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. | +| `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` | +| Name | Type | Description | +| ---- | :-------: | -------------------------------------------- | +| `0` | `uint256` | The current nonce on a specific `channelId`. | + +
### isValidSignature -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#isvalidsignature) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Function signature: `isValidSignature(bytes32,bytes)` - Function selector: `0x1626ba7e` @@ -288,12 +324,14 @@ Checks if a signature was signed by a controller that has the permission `SIGN`. | ------------ | :------: | ---------------------------------------------------- | | `magicValue` | `bytes4` | `0x1626ba7e` on success, or `0xffffffff` on failure. | +
+ ### lsp20VerifyCall -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#lsp20verifycall) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Function signature: `lsp20VerifyCall(address,uint256,bytes)` - Function selector: `0x9bf04b11` @@ -321,12 +359,14 @@ function lsp20VerifyCall( | ---- | :------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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 +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#,)) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Function signature: `,)` - Function selector: `0x9f47dbd3` @@ -352,12 +392,14 @@ function lsp20VerifyCallResult( | ---- | :------: | ---------------------------------------------------------------------------------------------- | | `0` | `bytes4` | MUST return the lsp20VerifyCallResult function selector if the call to the function is allowed | +
+ ### supportsInterface -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#supportsinterface) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -381,12 +423,14 @@ See [`IERC165-supportsInterface`](#ierc165-supportsinterface). | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### target -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#target) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Function signature: `target()` - Function selector: `0xd4b83992` @@ -396,80 +440,800 @@ See [`IERC165-supportsInterface`](#ierc165-supportsinterface). function target() external view returns (address); ``` -Get the address of the contract linked to this Key Manager. +Get The address of the contract linked to this Key Manager. + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ---------------------------------- | +| `0` | `address` | The address of the linked contract | + +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_verifyCanSetData + +```solidity +function _verifyCanSetData( + address controlledContract, + address controllerAddress, + bytes32 controllerPermissions, + bytes32 inputDataKey, + bytes inputDataValue +) internal view; +``` + +verify if the `controllerAddress` has the permissions required to set a data key on the ERC725Y storage of the `controlledContract`. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | -------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is set. | +| `controllerAddress` | `address` | the address of the controller who wants to set the data key. | +| `controllerPermissions` | `bytes32` | the permissions of the controller address. | +| `inputDataKey` | `bytes32` | the data key to set on the `controlledContract`. | +| `inputDataValue` | `bytes` | the data value to set for the `inputDataKey`. | + +
+ +### \_verifyCanSetData + +```solidity +function _verifyCanSetData( + address controlledContract, + address controller, + bytes32 permissions, + bytes32[] inputDataKeys, + bytes[] inputDataValues +) internal view; +``` + +verify if the `controllerAddress` has the permissions required to set an array of data keys on the ERC725Y storage of the `controlledContract`. + +#### Parameters + +| Name | Type | Description | +| -------------------- | :---------: | -------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is set. | +| `controller` | `address` | the address of the controller who wants to set the data key. | +| `permissions` | `bytes32` | the permissions of the controller address. | +| `inputDataKeys` | `bytes32[]` | an array of data keys to set on the `controlledContract`. | +| `inputDataValues` | `bytes[]` | an array of data values to set for the `inputDataKeys`. | + +
+ +### \_getPermissionRequiredToSetDataKey + +```solidity +function _getPermissionRequiredToSetDataKey( + address controlledContract, + bytes32 controllerPermissions, + bytes32 inputDataKey, + bytes inputDataValue +) internal view returns (bytes32); +``` + +retrieve the permission required based on the data key to be set on the `controlledContract`. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. | +| `controllerPermissions` | `bytes32` | - | +| `inputDataKey` | `bytes32` | the data key to set on the `controlledContract`. Can be related to LSP6 Permissions, LSP1 Delegate or LSP17 Extensions. | +| `inputDataValue` | `bytes` | the data value to set for the `inputDataKey`. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------------------------------------------ | +| `0` | `bytes32` | the permission required to set the `inputDataKey` on the `controlledContract`. | + +
+ +### \_getPermissionToSetPermissionsArray + +```solidity +function _getPermissionToSetPermissionsArray( + address controlledContract, + bytes32 inputDataKey, + bytes inputDataValue, + bool hasBothAddControllerAndEditPermissions +) internal view returns (bytes32); +``` + +retrieve the permission required to update the `AddressPermissions[]` array data key defined in LSP6. + +#### Parameters + +| Name | Type | Description | +| ---------------------------------------- | :-------: | ----------------------------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. | +| `inputDataKey` | `bytes32` | either `AddressPermissions[]` (array length) or `AddressPermissions[index]` (array index) | +| `inputDataValue` | `bytes` | the updated value for the `inputDataKey`. MUST be: | +| `hasBothAddControllerAndEditPermissions` | `bool` | - | #### Returns | Name | Type | Description | | ---- | :-------: | --------------------------------- | -| `0` | `address` | the address of the linked account | +| `0` | `bytes32` | either ADD or CHANGE PERMISSIONS. | ---- +
-## Events +### \_getPermissionToSetControllerPermissions + +```solidity +function _getPermissionToSetControllerPermissions( + address controlledContract, + bytes32 inputPermissionDataKey +) internal view returns (bytes32); +``` + +retrieve the permission required to set permissions for a controller address. + +#### Parameters + +| Name | Type | Description | +| ------------------------ | :-------: | ------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. | +| `inputPermissionDataKey` | `bytes32` | `AddressPermissions:Permissions:`. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | --------------------------------- | +| `0` | `bytes32` | either ADD or CHANGE PERMISSIONS. | + +
+ +### \_getPermissionToSetAllowedCalls + +```solidity +function _getPermissionToSetAllowedCalls( + address controlledContract, + bytes32 dataKey, + bytes dataValue, + bool hasBothAddControllerAndEditPermissions +) internal view returns (bytes32); +``` + +retrieve the permission required to set some AllowedCalls for a controller. + +#### Parameters + +| Name | Type | Description | +| ---------------------------------------- | :-------: | ------------------------------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. | +| `dataKey` | `bytes32` | `AddressPermissions:AllowedCalls:`. | +| `dataValue` | `bytes` | the updated value for the `dataKey`. MUST be a bytes28[CompactBytesArray] of Allowed Calls. | +| `hasBothAddControllerAndEditPermissions` | `bool` | - | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | --------------------------------- | +| `0` | `bytes32` | either ADD or CHANGE PERMISSIONS. | + +
+ +### \_getPermissionToSetAllowedERC725YDataKeys + +```solidity +function _getPermissionToSetAllowedERC725YDataKeys( + address controlledContract, + bytes32 dataKey, + bytes dataValue, + bool hasBothAddControllerAndEditPermissions +) internal view returns (bytes32); +``` + +retrieve the permission required to set some Allowed ERC725Y Data Keys for a controller. + +#### Parameters + +| Name | Type | Description | +| ---------------------------------------- | :-------: | ----------------------------------------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. | +| `dataKey` | `bytes32` | or `AddressPermissions:AllowedERC725YDataKeys:`. | +| `dataValue` | `bytes` | the updated value for the `dataKey`. MUST be a bytes[CompactBytesArray] of Allowed ERC725Y Data Keys. | +| `hasBothAddControllerAndEditPermissions` | `bool` | - | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | --------------------------------- | +| `0` | `bytes32` | either ADD or CHANGE PERMISSIONS. | + +
+ +### \_getPermissionToSetLSP1Delegate + +```solidity +function _getPermissionToSetLSP1Delegate( + address controlledContract, + bytes32 lsp1DelegateDataKey +) internal view returns (bytes32); +``` + +retrieve the permission required to either add or change the address +of a LSP1 Universal Receiver Delegate stored under a specific LSP1 data key. + +#### Parameters + +| Name | Type | Description | +| --------------------- | :-------: | -------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. | +| `lsp1DelegateDataKey` | `bytes32` | either the data key for the default `LSP1UniversalReceiverDelegate`, | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------------------------------------------- | +| `0` | `bytes32` | either ADD or CHANGE UNIVERSALRECEIVERDELEGATE. | + +
+ +### \_getPermissionToSetLSP17Extension + +```solidity +function _getPermissionToSetLSP17Extension( + address controlledContract, + bytes32 lsp17ExtensionDataKey +) internal view returns (bytes32); +``` + +Verify if `controller` has the required permissions to either add or change the address +of an LSP0 Extension stored under a specific LSP17Extension data key + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. | +| `lsp17ExtensionDataKey` | `bytes32` | the dataKey to set with `_LSP17_EXTENSION_PREFIX` as prefix. | + +
+ +### \_verifyAllowedERC725YSingleKey + +```solidity +function _verifyAllowedERC725YSingleKey( + address controllerAddress, + bytes32 inputDataKey, + bytes allowedERC725YDataKeysCompacted +) internal pure; +``` + +Verify if the `inputKey` is present in the list of `allowedERC725KeysCompacted` for the `controllerAddress`. + +#### Parameters + +| Name | Type | Description | +| --------------------------------- | :-------: | ----------------------------------------------------------------------------------------- | +| `controllerAddress` | `address` | the address of the controller. | +| `inputDataKey` | `bytes32` | the data key to verify against the allowed ERC725Y Data Keys for the `controllerAddress`. | +| `allowedERC725YDataKeysCompacted` | `bytes` | a CompactBytesArray of allowed ERC725Y Data Keys for the `controllerAddress`. | + +
+ +### \_verifyAllowedERC725YDataKeys + +```solidity +function _verifyAllowedERC725YDataKeys( + address controllerAddress, + bytes32[] inputDataKeys, + bytes allowedERC725YDataKeysCompacted, + bool[] validatedInputKeysList, + uint256 allowedDataKeysFound +) internal pure; +``` + +Verify if all the `inputDataKeys` are present in the list of `allowedERC725KeysCompacted` of the `controllerAddress`. + +#### Parameters + +| Name | Type | Description | +| --------------------------------- | :---------: | ---------------------------------------------------------------------------------------------------------------------------- | +| `controllerAddress` | `address` | the address of the controller. | +| `inputDataKeys` | `bytes32[]` | the data keys to verify against the allowed ERC725Y Data Keys of the `controllerAddress`. | +| `allowedERC725YDataKeysCompacted` | `bytes` | a CompactBytesArray of allowed ERC725Y Data Keys of the `controllerAddress`. | +| `validatedInputKeysList` | `bool[]` | an array of booleans to store the result of the verification of each data keys checked. | +| `allowedDataKeysFound` | `uint256` | the number of data keys that were previously validated for other permissions like `ADDCONTROLLER`, `EDITPERMISSIONS`, etc... | + +
+ +### \_requirePermissions + +```solidity +function _requirePermissions( + address controller, + bytes32 addressPermissions, + bytes32 permissionRequired +) internal pure; +``` + +Check if the `controller` has the `permissionRequired` among its permission listed in `controllerPermissions` +If not, this function will revert with the error `NotAuthorised` and the name of the permission missing by the controller. + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | --------------------------------- | +| `controller` | `address` | the caller address | +| `addressPermissions` | `bytes32` | the caller's permissions BitArray | +| `permissionRequired` | `bytes32` | the required permission | + +
+ +### \_verifyCanExecute + +```solidity +function _verifyCanExecute( + address controlledContract, + address controller, + bytes32 permissions, + uint256 operationType, + address to, + uint256 value, + bytes data +) internal view; +``` + +verify if `controllerAddress` has the required permissions to interact with other addresses using the controlledContract. + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | -------------------------------------------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725 contract where the payload is executed and where the permissions are verified. | +| `controller` | `address` | the address who want to run the execute function on the ERC725Account. | +| `permissions` | `bytes32` | the permissions of the controller address. | +| `operationType` | `uint256` | - | +| `to` | `address` | - | +| `value` | `uint256` | - | +| `data` | `bytes` | - | + +
+ +### \_verifyCanDeployContract + +```solidity +function _verifyCanDeployContract( + address controller, + bytes32 permissions, + bool isFundingContract +) internal view; +``` + +
+ +### \_verifyCanStaticCall + +```solidity +function _verifyCanStaticCall( + address controlledContract, + address controller, + bytes32 permissions, + address to, + uint256 value, + bytes data +) internal view; +``` + +
+ +### \_verifyCanCall + +```solidity +function _verifyCanCall( + address controlledContract, + address controller, + bytes32 permissions, + address to, + uint256 value, + bytes data +) internal view; +``` + +
+ +### \_verifyAllowedCall + +```solidity +function _verifyAllowedCall( + address controlledContract, + address controllerAddress, + uint256 operationType, + address to, + uint256 value, + bytes data +) internal view; +``` + +
+ +### \_extractCallType + +```solidity +function _extractCallType( + uint256 operationType, + uint256 value, + bool isEmptyCall +) internal pure returns (bytes4 requiredCallTypes); +``` + +extract the bytes4 representation of a single bit for the type of call according to the `operationType` + +#### Parameters + +| Name | Type | Description | +| --------------- | :-------: | -------------------------------------------- | +| `operationType` | `uint256` | 0 = CALL, 3 = STATICCALL or 3 = DELEGATECALL | +| `value` | `uint256` | - | +| `isEmptyCall` | `bool` | - | + +#### Returns + +| Name | Type | Description | +| ------------------- | :------: | --------------------------------------------------------- | +| `requiredCallTypes` | `bytes4` | a bytes4 value containing a single 1 bit for the callType | + +
+ +### \_isAllowedAddress + +```solidity +function _isAllowedAddress( + bytes allowedCall, + address to +) internal pure returns (bool); +``` + +
+ +### \_isAllowedStandard + +```solidity +function _isAllowedStandard( + bytes allowedCall, + address to +) internal view returns (bool); +``` + +
+ +### \_isAllowedFunction + +```solidity +function _isAllowedFunction( + bytes allowedCall, + bytes4 requiredFunction +) internal pure returns (bool); +``` + +
+ +### \_isAllowedCallType + +```solidity +function _isAllowedCallType( + bytes allowedCall, + bytes4 requiredCallTypes +) internal pure returns (bool); +``` + +
+ +### \_verifyOwnershipPermissions + +```solidity +function _verifyOwnershipPermissions( + address controllerAddress, + bytes32 controllerPermissions +) internal pure; +``` + +
+ +### \_getNonce + +```solidity +function _getNonce( + address from, + uint128 channelId +) internal view returns (uint256 idx); +``` + +Read the nonce for a `from` address on a specific `channelId`. +This will return an `idx`, which is the concatenation of two `uint128` as follow: + +1. the `channelId` where the nonce was queried for. + +2. the actual nonce of the given `channelId`. + For example, if on `channelId` number `5`, the latest nonce is `1`, the `idx` returned by this function will be: + +``` +// in decimals = 1701411834604692317316873037158841057281 +idx = 0x0000000000000000000000000000000500000000000000000000000000000001 +``` + +This idx can be described as follow: + +``` + channelId => 5 nonce in this channel => 1 + v------------------------------v-------------------------------v +0x0000000000000000000000000000000500000000000000000000000000000001 +``` + +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | ------------------------------------------ | +| `from` | `address` | The address to read the nonce for. | +| `channelId` | `uint128` | The channel in which to extract the nonce. | + +#### Returns + +| Name | Type | Description | +| ----- | :-------: | ---------------------------------------------------------------------------------------------------------------------- | +| `idx` | `uint256` | The idx composed of two `uint128`: the channelId + nonce in channel concatenated together in a single `uint256` value. | + +
+ +### \_recoverSignerFromLSP25Signature + +```solidity +function _recoverSignerFromLSP25Signature( + bytes signature, + uint256 nonce, + uint256 validityTimestamps, + uint256 msgValue, + bytes callData +) internal view returns (address); +``` + +Recover the address of the signer that generated a `signature` using the parameters provided `nonce`, `validityTimestamps`, `msgValue` and `callData`. +The address of the signer will be recovered using the LSP25 signature format. + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------- | +| `signature` | `bytes` | A 65 bytes long signature generated according to the signature format specified in the LSP25 standard. | +| `nonce` | `uint256` | The nonce that the signer used to generate the `signature`. | +| `validityTimestamps` | `uint256` | The validity timestamp that the signer used to generate the signature (See {\_verifyValidityTimestamps} to learn more). | +| `msgValue` | `uint256` | The amount of native tokens intended to be sent for the relay transaction. | +| `callData` | `bytes` | The calldata to execute as a relay transaction that the signer signed for. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | -------------------------------------------------------- | +| `0` | `address` | The address that signed, recovered from the `signature`. | + +
+ +### \_verifyValidityTimestamps + +```solidity +function _verifyValidityTimestamps(uint256 validityTimestamps) internal view; +``` + +Verify that the current timestamp is within the date and time range provided by `validityTimestamps`. + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- | +| `validityTimestamps` | `uint256` | Two `uint128` concatenated together, where the left-most `uint128` represent the timestamp from which the transaction can be executed, | + +
+ +### \_isValidNonce + +```solidity +function _isValidNonce(address from, uint256 idx) internal view returns (bool); +``` + +Verify that the nonce `_idx` for `_from` (obtained via [`getNonce`](#getnonce)) is valid in its channel ID. +The "idx" is a 256bits (unsigned) integer, where: + +- the 128 leftmost bits = channelId + +- and the 128 rightmost bits = nonce within the channel + +#### Parameters + +| Name | Type | Description | +| ------ | :-------: | ---------------------------------------------------------------------------- | +| `from` | `address` | The signer's address. | +| `idx` | `uint256` | The concatenation of the `channelId` + `nonce` within a specific channel ID. | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | ------------------------------------------------------------------------ | +| `0` | `bool` | true if the nonce is the latest nonce for the `signer`, false otherwise. | + +
+ +### \_execute + +```solidity +function _execute( + uint256 msgValue, + bytes payload +) internal nonpayable returns (bytes); +``` -### VerifiedCall +
-:::note Links +### \_executeRelayCall -- 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` +:::caution Warning + +Be aware that this function can also throw an error if the `callData` was signed incorrectly (not conforming to the signature format defined in the LSP25 standard). +This is because the contract cannot distinguish if the data is signed correctly or not. Instead, it will recover an incorrect signer address from the signature +and throw an {InvalidRelayNonce} error with the incorrect signer address as the first parameter. ::: ```solidity -event VerifiedCall(address indexed signer, uint256 indexed value, bytes4 indexed selector); +function _executeRelayCall( + bytes signature, + uint256 nonce, + uint256 validityTimestamps, + uint256 msgValue, + bytes payload +) internal nonpayable returns (bytes); ``` -Emitted when the LSP6KeyManager contract verified the permissions of the `signer` successfully. +Validate that the `nonce` given for the `signature` signed and the `payload` to execute is valid +and conform to the signature format according to the LSP25 standard. #### 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} | +| Name | Type | Description | +| -------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- | +| `signature` | `bytes` | A valid signature for a signer, generated according to the signature format specified in the LSP25 standard. | +| `nonce` | `uint256` | The nonce that the signer used to generate the `signature`. | +| `validityTimestamps` | `uint256` | Two `uint128` concatenated together, where the left-most `uint128` represent the timestamp from which the transaction can be executed, | +| `msgValue` | `uint256` | - | +| `payload` | `bytes` | The abi-encoded function call to execute. | ---- +
-## Errors +### \_executePayload + +```solidity +function _executePayload( + uint256 msgValue, + bytes payload +) internal nonpayable returns (bytes); +``` + +_Execute the `payload` passed to `execute(...)` or `executeRelayCall(...)`_ + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ------------------------------------------------------------------ | +| `msgValue` | `uint256` | - | +| `payload` | `bytes` | The abi-encoded function call to execute on the {target} contract. | + +#### Returns + +| Name | Type | Description | +| ---- | :-----: | ------------------------------------------------------------------------- | +| `0` | `bytes` | bytes The data returned by the call made to the linked {target} contract. | + +
+ +### \_verifyPermissions + +```solidity +function _verifyPermissions( + address from, + uint256 msgValue, + bytes payload +) internal view; +``` + +Verify if the `from` address is allowed to execute the `payload` on the [`target`](#target) contract linked to this Key Manager. + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ------------------------------------------------------------------- | +| `from` | `address` | Either the caller of {execute} or the signer of {executeRelayCall}. | +| `msgValue` | `uint256` | - | +| `payload` | `bytes` | The abi-encoded function call to execute on the {target} contract. | + +
+ +### \_setupLSP6ReentrancyGuard + +```solidity +function _setupLSP6ReentrancyGuard() internal nonpayable; +``` + +Initialise \_reentrancyStatus to \_NOT_ENTERED. + +
+ +### \_nonReentrantBefore + +```solidity +function _nonReentrantBefore( + bool isSetData, + address from +) internal nonpayable returns (bool isReentrantCall); +``` + +Update the status from `_NON_ENTERED` to `_ENTERED` and checks if +the status is `_ENTERED` in order to revert the call unless the caller has the REENTRANCY permission +Used in the beginning of the `nonReentrant` modifier, before the method execution starts. + +
+ +### \_nonReentrantAfter + +```solidity +function _nonReentrantAfter() internal nonpayable; +``` + +Resets the status to `_NOT_ENTERED` +Used in the end of the `nonReentrant` modifier after the method execution is terminated + +
+ +## Events -### AddressPermissionArrayIndexValueNotAnAddress +### PermissionsVerified -:::note Links +:::note References -- 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` +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#permissionsverified) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Event signature: `PermissionsVerified(address,uint256,bytes4)` +- Event topic hash: `0xc0a62328f6bf5e3172bb1fcb2019f54b2c523b6a48e3513a2298fbf0150b781e` ::: ```solidity -error AddressPermissionArrayIndexValueNotAnAddress( - bytes32 dataKey, - bytes invalidValue -); +event PermissionsVerified(address indexed signer, uint256 indexed value, bytes4 indexed selector); ``` -Reverts when trying to set a value that is not 20 bytes long (not an `address`) under the `AddressPermissions[index]` data key. +_Verified the permissions of `signer` for calling function `selector` on the linked account and sending `value` of native token._ + +Emitted when the LSP6KeyManager contract verified the permissions of the `signer` successfully. #### 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]`. | +| 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 ### BatchExecuteParamsLengthMismatch -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#batchexecuteparamslengthmismatch) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `BatchExecuteParamsLengthMismatch()` - Error hash: `0x55a187db` @@ -479,14 +1243,18 @@ Reverts when trying to set a value that is not 20 bytes long (not an `address`) error BatchExecuteParamsLengthMismatch(); ``` +_The array parameters provided to the function `executeBatch(...)` do not have the same number of elements. (Different array param's length)._ + 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 +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#batchexecuterelaycallparamslengthmismatch) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `BatchExecuteRelayCallParamsLengthMismatch()` - Error hash: `0xb4d50d21` @@ -496,14 +1264,18 @@ Reverts when the array parameters `uint256[] value` and `bytes[] payload` have d error BatchExecuteRelayCallParamsLengthMismatch(); ``` -Reverts when providing array parameters of different sizes to `executeRelayCall(bytes[],uint256[],bytes[])` +_The array parameters provided to the function `executeRelayCallBatch(...)` do not have the same number of elements. (Different array param's length)._ + +Reverts when providing array parameters of different sizes to `executeRelayCallBatch(bytes[],uint256[],bytes[])` + +
### CallingKeyManagerNotAllowed -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#callingkeymanagernotallowed) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `CallingKeyManagerNotAllowed()` - Error hash: `0xa431b236` @@ -513,14 +1285,18 @@ Reverts when providing array parameters of different sizes to `executeRelayCall( error CallingKeyManagerNotAllowed(); ``` +_Calling the Key Manager address for this transaction is disallowed._ + Reverts when calling the KeyManager through `execute(uint256,address,uint256,bytes)`. +
+ ### CannotSendValueToSetData -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#cannotsendvaluetosetdata) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `CannotSendValueToSetData()` - Error hash: `0x59a529fc` @@ -530,14 +1306,18 @@ Reverts when calling the KeyManager through `execute(uint256,address,uint256,byt 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. +_Cannot sent native tokens while setting data._ + +Reverts when calling the `setData(byte32,bytes)` or `setData(bytes32[],bytes[]) functions on the linked [`target`](#target) while sending value. + +
### DelegateCallDisallowedViaKeyManager -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#delegatecalldisallowedviakeymanager) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `DelegateCallDisallowedViaKeyManager()` - Error hash: `0x80d6ebae` @@ -547,14 +1327,18 @@ Reverts when trying to call to the `setData(byte32,bytes)` or `setData(bytes32[] error DelegateCallDisallowedViaKeyManager(); ``` +_Performing DELEGATE CALLS via the Key Manager is currently disallowed._ + 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 +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -566,12 +1350,42 @@ 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. +
+ +### InvalidDataValuesForDataKeys + +:::note References + +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invaliddatavaluesfordatakeys) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `InvalidDataValuesForDataKeys(bytes32,bytes)` +- Error hash: `0x1fa41397` + +::: + +```solidity +error InvalidDataValuesForDataKeys(bytes32 dataKey, bytes dataValue); +``` + +_Data value: `dataValue` length is different from the required length for the data key which is set._ + +Reverts when the data value length is not one of the required lengths for the specific data key. + +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | ----------------------------------------------------------- | +| `dataKey` | `bytes32` | The data key that has a required length for the data value. | +| `dataValue` | `bytes` | The data value that has an invalid length. | + +
+ ### InvalidERC725Function -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invaliderc725function) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `InvalidERC725Function(bytes4)` - Error hash: `0x2ba8851c` @@ -581,6 +1395,8 @@ reverts when there is not the same number of elements in the lists of data keys error InvalidERC725Function(bytes4 invalidFunction); ``` +_The Key Manager could not verify the calldata of the transaction because it could not recognise the function being called. Invalid function selector: `invalidFunction`._ + Reverts when trying to call a function on the linked [`target`](#target), that is not any of the following: - `setData(bytes32,bytes)` (ERC725Y) @@ -595,16 +1411,18 @@ Reverts when trying to call a function on the linked [`target`](#target), that i #### 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. | +| Name | Type | Description | +| ----------------- | :------: | ---------------------------------------------------------------------------------------------------------------- | +| `invalidFunction` | `bytes4` | The `bytes4` selector of the function that was attempted to be called on the linked {target} but not recognised. | + +
### InvalidEncodedAllowedCalls -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invalidencodedallowedcalls) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `InvalidEncodedAllowedCalls(bytes)` - Error hash: `0x187e77ab` @@ -614,6 +1432,8 @@ Reverts when trying to call a function on the linked [`target`](#target), that i error InvalidEncodedAllowedCalls(bytes allowedCallsValue); ``` +_Could not decode the Allowed Calls. Value = `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 @@ -622,12 +1442,14 @@ Reverts when `allowedCallsValue` is not properly encoded as a `(bytes4,address,b | ------------------- | :-----: | ----------------------------------------------------------------------------------------------------------------- | | `allowedCallsValue` | `bytes` | The list of allowedCalls that are not encoded correctly as a `(bytes4,address,bytes4,bytes4)[CompactBytesArray]`. | +
+ ### InvalidEncodedAllowedERC725YDataKeys -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invalidencodedallowederc725ydatakeys) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `InvalidEncodedAllowedERC725YDataKeys(bytes,string)` - Error hash: `0xae6cbd37` @@ -637,21 +1459,25 @@ Reverts when `allowedCallsValue` is not properly encoded as a `(bytes4,address,b 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). +_Error when reading the Allowed ERC725Y Data Keys. Reason: `context`, Allowed ERC725Y Data Keys value read: `value`._ + +Reverts when `value` is not encoded properly as a `bytes32[CompactBytesArray]`. The `context` string provides context on when this error occurred (\_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. | +| `context` | `string` | A brief description of where the error occurred. | + +
### InvalidLSP6Target -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invalidlsp6target) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `InvalidLSP6Target()` - Error hash: `0xfc854579` @@ -661,14 +1487,18 @@ Reverts when `value` is not encoded properly as a `bytes32[CompactBytesArray]`. error InvalidLSP6Target(); ``` +_Invalid address supplied to link this Key Manager to (`address(0)`)._ + Reverts when the address provided to set as the [`target`](#target) linked to this KeyManager is invalid (_e.g. `address(0)`_). +
+ ### InvalidPayload -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invalidpayload) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `InvalidPayload(bytes)` - Error hash: `0x3621bbcc` @@ -678,7 +1508,9 @@ Reverts when the address provided to set as the [`target`](#target) linked to th error InvalidPayload(bytes payload); ``` -Reverst when the payload is invalid. +_Invalid calldata payload sent._ + +Reverts when the payload is invalid. #### Parameters @@ -686,12 +1518,14 @@ Reverst when the payload is invalid. | --------- | :-----: | ----------- | | `payload` | `bytes` | - | +
+ ### InvalidRelayNonce -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invalidrelaynonce) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `InvalidRelayNonce(address,uint256,bytes)` - Error hash: `0xc9bd9eb9` @@ -701,22 +1535,26 @@ Reverst when the payload is invalid. error InvalidRelayNonce(address signer, uint256 invalidNonce, bytes signature); ``` +_The relay call failed because an invalid nonce was provided for the address `signer` that signed the execute relay call. Invalid nonce: `invalidNonce`, signature of signer: `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 | +| 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 +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#invalidwhitelistedcall) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `InvalidWhitelistedCall(address)` - Error hash: `0x6fd203c5` @@ -726,20 +1564,45 @@ Reverts when the `signer` address retrieved from the `signature` has an invalid 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. +_Invalid allowed calls (`0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff`) set for address `from`. Could not perform external call._ + +Reverts when a `from` address has _"any whitelisted call"_ as allowed call set. This revert happens during the verification of the permissions of the address for its allowed calls. 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. | +| Name | Type | Description | +| ------ | :-------: | ---------------------------------------------------------------------- | +| `from` | `address` | The controller address that has _"any allowed calls"_ whitelisted set. | + +
+ +### KeyManagerCannotBeSetAsExtensionForLSP20Functions + +:::note References + +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#keymanagercannotbesetasextensionforlsp20functions) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) +- Error signature: `KeyManagerCannotBeSetAsExtensionForLSP20Functions()` +- Error hash: `0x4a9fa8cf` + +::: + +```solidity +error KeyManagerCannotBeSetAsExtensionForLSP20Functions(); +``` + +_Key Manager cannot be used as an LSP17 extension for LSP20 functions._ + +Reverts when the address of the Key Manager is being set as extensions for lsp20 functions + +
### LSP6BatchExcessiveValueSent -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#lsp6batchexcessivevaluesent) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `LSP6BatchExcessiveValueSent(uint256,uint256)` - Error hash: `0xa51868b6` @@ -749,6 +1612,8 @@ Reverts when verifying the permissions of a `from` address for its allowed calls error LSP6BatchExcessiveValueSent(uint256 totalValues, uint256 msgValue); ``` +_Too much funds sent to forward each amount in the batch. No amount of native tokens should stay in the Key Manager._ + 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[]) @@ -762,12 +1627,14 @@ This error occurs when there was too much funds sent to the batch functions `exe | `totalValues` | `uint256` | - | | `msgValue` | `uint256` | - | +
+ ### LSP6BatchInsufficientValueSent -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#lsp6batchinsufficientvaluesent) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `LSP6BatchInsufficientValueSent(uint256,uint256)` - Error hash: `0x30a324ac` @@ -777,6 +1644,8 @@ This error occurs when there was too much funds sent to the batch functions `exe error LSP6BatchInsufficientValueSent(uint256 totalValues, uint256 msgValue); ``` +_Not enough funds sent to forward each amount in the batch._ + 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 @@ -786,12 +1655,14 @@ This error occurs when there was not enough funds sent to the batch functions `e | `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 +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#nocallsallowed) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `NoCallsAllowed(address)` - Error hash: `0x6cb60587` @@ -801,6 +1672,8 @@ This error occurs when there was not enough funds sent to the batch functions `e error NoCallsAllowed(address from); ``` +_The address `from` is not authorised to use the linked account contract to make external calls, because it has no Allowed Calls set._ + Reverts when the `from` address has no `AllowedCalls` set and cannot interact with any address using the linked [`target`](#target). #### Parameters @@ -809,12 +1682,14 @@ Reverts when the `from` address has no `AllowedCalls` set and cannot interact wi | ------ | :-------: | ------------------------------------- | | `from` | `address` | The address that has no AllowedCalls. | +
+ ### NoERC725YDataKeysAllowed -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#noerc725ydatakeysallowed) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `NoERC725YDataKeysAllowed(address)` - Error hash: `0xed7fa509` @@ -824,6 +1699,8 @@ Reverts when the `from` address has no `AllowedCalls` set and cannot interact wi error NoERC725YDataKeysAllowed(address from); ``` +_The address `from` is not authorised to set data, because it has no ERC725Y Data Key allowed._ + 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 @@ -832,12 +1709,14 @@ Reverts when the `from` address has no AllowedERC725YDataKeys set and cannot set | ------ | :-------: | ----------------------------------------------------- | | `from` | `address` | The address that has no `AllowedERC725YDataKeys` set. | +
+ ### NoPermissionsSet -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#nopermissionsset) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `NoPermissionsSet(address)` - Error hash: `0xf292052a` @@ -847,6 +1726,8 @@ Reverts when the `from` address has no AllowedERC725YDataKeys set and cannot set error NoPermissionsSet(address from); ``` +_The address `from` does not have any permission set on the contract linked to the Key Manager._ + Reverts when address `from` does not have any permissions set on the account linked to this Key Manager #### Parameters @@ -855,12 +1736,14 @@ Reverts when address `from` does not have any permissions set on the account lin | ------ | :-------: | ------------------------------------------ | | `from` | `address` | the address that does not have permissions | +
+ ### NotAllowedCall -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#notallowedcall) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `NotAllowedCall(address,address,bytes4)` - Error hash: `0x45147bce` @@ -870,22 +1753,26 @@ Reverts when address `from` does not have any permissions set on the account lin error NotAllowedCall(address from, address to, bytes4 selector); ``` +_The address `from` is not authorised to call the function `selector` on the `to` address._ + 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 | +| Name | Type | Description | +| ---------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `from` | `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 +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#notallowederc725ydatakey) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `NotAllowedERC725YDataKey(address,bytes32)` - Error hash: `0x557ae079` @@ -895,6 +1782,8 @@ Reverts when `from` is not authorised to call the `execute(uint256,address,uint2 error NotAllowedERC725YDataKey(address from, bytes32 disallowedKey); ``` +_The address `from` is not authorised to set the data key `disallowedKey` on the contract linked to the Key Manager._ + Reverts when address `from` is not authorised to set the key `disallowedKey` on the linked [`target`](#target). #### Parameters @@ -904,12 +1793,14 @@ Reverts when address `from` is not authorised to set the key `disallowedKey` on | `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 +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#notauthorised) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `NotAuthorised(address,string)` - Error hash: `0x3bdad6e6` @@ -919,6 +1810,8 @@ Reverts when address `from` is not authorised to set the key `disallowedKey` on error NotAuthorised(address from, string permission); ``` +_The address `from` is not authorised to `permission` on the contract linked to the Key Manager._ + Reverts when address `from` is not authorised and does not have `permission` on the linked [`target`](#target) #### Parameters @@ -928,12 +1821,14 @@ Reverts when address `from` is not authorised and does not have `permission` on | `from` | `address` | address The address that was not authorised. | | `permission` | `string` | permission The permission required (\_e.g: `SETDATA`, `CALL`, `TRANSFERVALUE`) | +
+ ### NotRecognisedPermissionKey -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#notrecognisedpermissionkey) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `NotRecognisedPermissionKey(bytes32)` - Error hash: `0x0f7d735b` @@ -943,7 +1838,9 @@ Reverts when address `from` is not authorised and does not have `permission` on 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 +_The data key `dataKey` starts with `AddressPermissions` prefix but is none of the permission data keys defined in LSP6._ + +Reverts when `dataKey` is a `bytes32` value that does not adhere to any of the permission data keys defined by the LSP6 standard #### Parameters @@ -951,12 +1848,14 @@ Reverts when `dataKey` is a bytes32 value that does not adhere to any of the per | --------- | :-------: | ------------------------------------------------------------------------------ | | `dataKey` | `bytes32` | The dataKey that does not match any of the standard LSP6 permission data keys. | +
+ ### RelayCallBeforeStartTime -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#relaycallbeforestarttime) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `RelayCallBeforeStartTime()` - Error hash: `0x00de4b8a` @@ -966,14 +1865,18 @@ Reverts when `dataKey` is a bytes32 value that does not adhere to any of the per error RelayCallBeforeStartTime(); ``` -Reverts when the start timestamp provided to [`executeRelayCall`](#executerelaycall) function is bigger than the current timestamp. +_Relay call not valid yet._ + +Reverts when the relay call is cannot yet bet executed. This mean that the starting timestamp provided to [`executeRelayCall`](#executerelaycall) function is bigger than the current timestamp. + +
### RelayCallExpired -:::note Links +:::note References -- 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) +- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md#relaycallexpired) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6KeyManager.sol) - Error signature: `RelayCallExpired()` - Error hash: `0x5c53a98c` @@ -983,8 +1886,12 @@ Reverts when the start timestamp provided to [`executeRelayCall`](#executerelayc error RelayCallExpired(); ``` +_Relay call expired (deadline passed)._ + Reverts when the period to execute the relay call has expired. +
+ diff --git a/docs/contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md b/docs/contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md index aece6f16d3..0699a49bf0 100644 --- a/docs/contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md +++ b/docs/contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md @@ -1,6 +1,14 @@ + + + # LSP7DigitalAsset -:::info Solidity contract +:::info Standard Specifications + +[`LSP-7-DigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md) + +::: +:::info Solidity implementation [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) @@ -10,14 +18,17 @@ Minting and transferring are supplied with a `uint256` amount. 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 +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### authorizeOperator -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `authorizeOperator(address,uint256)` - Function selector: `0x47980aa3` @@ -36,7 +47,7 @@ function authorizeOperator( ) external nonpayable; ``` -Sets the `amount` of tokens that an `operator` has access from the caller's balance (allowance). See [`authorizedAmountFor`](#authorizedamountfor). +Sets an `amount` of tokens that an `operator` has access from the caller's balance (allowance). See [`authorizedAmountFor`](#authorizedamountfor). #### Parameters @@ -45,14 +56,14 @@ Sets the `amount` of tokens that an `operator` has access from the caller's bala | `operator` | `address` | The address to authorize as an operator. | | `amount` | `uint256` | The allowance amount of tokens operator has access to. | -<br/> +
### authorizedAmountFor -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `authorizedAmountFor(address,address)` - Function selector: `0x65aeaa95` @@ -69,25 +80,25 @@ Get the amount of tokens `operator` address has access to from `tokenOwner`. Ope #### Parameters -| Name | Type | Description | -| ------------ | :-------: | -------------------------------------------------------------- | -| `operator` | `address` | The operator's address to query the authorized amount for. | -| `tokenOwner` | `address` | The token owner that `operator` has allowance on. | +| Name | Type | Description | +| ------------ | :-------: | ---------------------------------------------------------- | +| `operator` | `address` | The operator's address to query the authorized amount for. | +| `tokenOwner` | `address` | The token owner that `operator` has allowance on. | #### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------------------------------------------------------------- | -| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. | +| Name | Type | Description | +| ---- | :-------: | --------------------------------------------------------------------------------------- | +| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. | -<br/> +
### balanceOf -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#balanceof) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#balanceof) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -109,16 +120,16 @@ Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [ | Name | Type | Description | | ---- | :-------: | ------------------------------------------- | -| `0` | `uint256` | The number of tokens owned by `tokenOwner`. | +| `0` | `uint256` | The amount of tokens owned by `tokenOwner`. | -<br/> +
### decimals -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decimals) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decimals) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `decimals()` - Function selector: `0x313ce567` @@ -136,14 +147,14 @@ Returns the number of decimals used to get its user representation. If the asset | ---- | :-----: | ----------------------------------------------------------------------- | | `0` | `uint8` | the number of decimals. If `0` is returned, the asset is non-divisible. | -<br/> +
### decreaseAllowance -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `decreaseAllowance(address,uint256)` - Function selector: `0xa457c2d7` @@ -186,19 +197,19 @@ Atomically decreases the allowance granted to `operator` by the caller. This is #### Parameters -| Name | Type | Description | -| ------------------- | :-------: | ---------------------------------------------------------- | -| `operator` | `address` | the operator to decrease allowance for `msg.sender` | -| `substractedAmount` | `uint256` | the amount to decrease by in the operator's allowance. | +| Name | Type | Description | +| ------------------- | :-------: | ------------------------------------------------------ | +| `operator` | `address` | the operator to decrease allowance for `msg.sender` | +| `substractedAmount` | `uint256` | the amount to decrease by in the operator's allowance. | -<br/> +
### getData -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdata) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdata) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -222,14 +233,14 @@ _Gets singular data at a given `dataKey`_ | ----------- | :-----: | -------------------------- | | `dataValue` | `bytes` | The data stored at the key | -<br/> +
### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -255,14 +266,14 @@ _Gets array of data for multiple given keys_ | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | -<br/> +
### increaseAllowance -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `increaseAllowance(address,uint256)` - Function selector: `0x39509351` @@ -304,19 +315,19 @@ Atomically increases the allowance granted to `operator` by the caller. This is #### Parameters -| Name | Type | Description | -| ------------- | :-------: | --------------------------------------------------------------------------- | -| `operator` | `address` | the operator to increase the allowance for `msg.sender` | -| `addedAmount` | `uint256` | the additional amount to add on top of the current operator's allowance | +| Name | Type | Description | +| ------------- | :-------: | ----------------------------------------------------------------------- | +| `operator` | `address` | the operator to increase the allowance for `msg.sender` | +| `addedAmount` | `uint256` | the additional amount to add on top of the current operator's allowance | -<br/> +
### owner -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#owner) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#owner) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -334,14 +345,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | -<br/> +
### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#renounceownership) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#renounceownership) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -353,14 +364,14 @@ 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. -<br/> +
### revokeOperator -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `revokeOperator(address)` - Function selector: `0xfad8b32a` @@ -370,7 +381,7 @@ Leaves the contract without owner. It will not be possible to call `onlyOwner` f function revokeOperator(address operator) external nonpayable; ``` -Removes the `operator` address as an operator of callers tokens. See [`authorizedAmountFor`](#authorizedamountfor). +Removes the `operator` address as an operator of callers tokens, disallowing it to send any amount of tokens on behalf of the token owner (the caller of the function `msg.sender`). See also [`authorizedAmountFor`](#authorizedamountfor). #### Parameters @@ -378,14 +389,14 @@ Removes the `operator` address as an operator of callers tokens. See [`authorize | ---------- | :-------: | ------------------------------------- | | `operator` | `address` | The address to revoke as an operator. | -<br/> +
### setData -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdata) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdata) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` @@ -404,14 +415,14 @@ _Sets singular data for a given `dataKey`_ | `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. | -<br/> +
### setDataBatch -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` @@ -432,14 +443,14 @@ Sets array of data for multiple given `dataKeys` SHOULD only be callable by the | `dataKeys` | `bytes32[]` | The array of data keys for values to set | | `dataValues` | `bytes[]` | The array of values to set | -<br/> +
### supportsInterface -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -463,14 +474,14 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | -<br/> +
### totalSupply -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#totalsupply) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#totalsupply) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -480,7 +491,7 @@ Returns true if this contract implements the interface defined by `interfaceId`. function totalSupply() external view returns (uint256); ``` -Returns the number of existing tokens that has been minted in this contract. +Returns the number of existing tokens that have been minted in this contract. #### Returns @@ -488,14 +499,14 @@ Returns the number of existing tokens that has been minted in this contract. | ---- | :-------: | ------------------------------ | | `0` | `uint256` | The number of existing tokens. | -<br/> +
### transfer -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `transfer(address,address,uint256,bool,bytes)` - Function selector: `0x760d9bba` @@ -511,7 +522,7 @@ function transfer( ) external nonpayable; ``` -Transfers an `amount` of tokens from the `from` address to the `to` address and notify both sender and recipients via the LSP1 [`universalReceiver(...)`](#`universalreceiver) function. +Transfers an `amount` of tokens from the `from` address to the `to` address and notify both sender and recipients via the LSP1 [`universalReceiver(...)`](#`universalreceiver) function. If the tokens are transferred by an operator on behalf of a token holder, the allowance for the operator will be decreased by `amount` once the token transfer has been completed (See [`authorizedAmountFor`](#authorizedamountfor)). #### Parameters @@ -521,16 +532,16 @@ Transfers an `amount` of tokens from the `from` address to the `to` address and | `to` | `address` | The recipient address. | | `amount` | `uint256` | The amount of tokens to transfer. | | `allowNonLSP1Recipient` | `bool` | When set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. | -| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses. | +| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses. | -<br/> +
### transferBatch -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferbatch) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferbatch) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])` - Function selector: `0x2d7667c9` @@ -554,18 +565,18 @@ Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the | ----------------------- | :---------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `from` | `address[]` | An array of sending addresses. | | `to` | `address[]` | An array of receiving addresses. | -| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. | +| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. | | `allowNonLSP1Recipient` | `bool[]` | For each transfer, when set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. | | `data` | `bytes[]` | An array of additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | -<br/> +
### transferOwnership -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferownership) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferownership) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -583,20 +594,255 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | -<br/> +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` ---- +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +Save gas by emitting the [`DataChanged`](#datachanged) event with only the first 256 bytes of dataValue + +
+ +### \_updateOperator + +```solidity +function _updateOperator( + address tokenOwner, + address operator, + uint256 amount +) internal nonpayable; +``` + +Changes token `amount` the `operator` has access to from `tokenOwner` tokens. +If the amount is zero then the operator is being revoked, otherwise the operator amount is being modified. + +
+ +### \_mint + +```solidity +function _mint( + address to, + uint256 amount, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Mints `amount` of tokens and transfers it to `to`. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as `from`. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- | +| `to` | `address` | the address to mint tokens for. | +| `amount` | `uint256` | the amount of tokens to mint. | +| `allowNonLSP1Recipient` | `bool` | a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | +| `data` | `bytes` | Additional data the caller wants included in the emitted {Transfer} event, and sent in the LSP1 hook to the `to` address. | + +
+ +### \_burn + +:::tip Hint + +In dApps, you can know which address is burning tokens by listening for the `Transfer` event and filter with the zero address as `to`. + +::: + +```solidity +function _burn(address from, uint256 amount, bytes data) internal nonpayable; +``` + +Burns (= destroys) `amount` of tokens, decrease the `from` balance. This is done by sending them to the zero address. +Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver) +function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as the `to` address + +
+ +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | the address to burn tokens from its balance. | +| `amount` | `uint256` | the amount of tokens to burn. | +| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. | + +
+ +### \_transfer + +```solidity +function _transfer( + address from, + address to, + uint256 amount, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Transfer tokens from `from` to `to` by decreasing the balance of `from` by `-amount` and increasing the balance +of `to` by `+amount`. +Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver) +function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | the address to decrease the balance. | +| `to` | `address` | the address to increase the balance. | +| `amount` | `uint256` | the amount of tokens to transfer from `from` to `to`. | +| `allowNonLSP1Recipient` | `bool` | a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | +| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. | + +
+ +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer( + address from, + address to, + uint256 amount +) internal nonpayable; +``` + +Hook that is called before any token transfer, including minting and burning. +Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function. + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------- | +| `from` | `address` | The sender address | +| `to` | `address` | The recipient address | +| `amount` | `uint256` | The amount of token to transfer | + +
+ +### \_notifyTokenSender + +```solidity +function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; +``` + +Attempt to notify the token sender `from` about the `amount` of tokens being transferred. +This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSSENDER` as typeId, if `from` is a contract that supports the LSP1 interface. +If `from` is an EOA or a contract that does not support the LSP1 interface, nothing will happen and no notification will be sent. + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | -------------------------------------------------------------------------- | +| `from` | `address` | The address to call the {universalReceiver} function on. | +| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. | + +
+ +### \_notifyTokenReceiver + +```solidity +function _notifyTokenReceiver( + address to, + bool allowNonLSP1Recipient, + bytes lsp1Data +) internal nonpayable; +``` + +Attempt to notify the token receiver `to` about the `amount` tokens being received. +This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSRECIPIENT` as typeId, if `to` is a contract that supports the LSP1 interface. +If `to` is is an EOA or a contract that does not support the LSP1 interface, the behaviour will depend on the `allowNonLSP1Recipient` boolean flag. + +- if `allowNonLSP1Recipient` is set to `true`, nothing will happen and no notification will be sent. + +- if `allowNonLSP1Recipient` is set to `false, the transaction will revert. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | --------------------------------------------------------------------------------------------------- | +| `to` | `address` | The address to call the {universalReceiver} function on. | +| `allowNonLSP1Recipient` | `bool` | a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | +| `lsp1Data` | `bytes` | the data to be sent to the `to` address in the `universalReceiver(...)` call. | + +
## Events ### AuthorizedOperator -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedoperator) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedoperator) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Event signature: `AuthorizedOperator(address,address,uint256)` -- Event hash: `0xd66aff874162a96578e919097b6f6d153dfd89a5cec41bb331fdb0c4aec16e2c` +- Event topic hash: `0xd66aff874162a96578e919097b6f6d153dfd89a5cec41bb331fdb0c4aec16e2c` ::: @@ -604,24 +850,26 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c event AuthorizedOperator(address indexed operator, address indexed tokenOwner, uint256 indexed amount); ``` +Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`. + #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ----------- | -| `operator` **`indexed`** | `address` | - | -| `tokenOwner` **`indexed`** | `address` | - | -| `amount` **`indexed`** | `uint256` | - | +| Name | Type | Description | +| -------------------------- | :-------: | ----------------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address authorized as an operator. | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | +| `amount` **`indexed`** | `uint256` | The amount of tokens `operator` address has access to from `tokenOwner` | -<br/> +
### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#datachanged) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#datachanged) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -633,21 +881,21 @@ _Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | ----------- | -| `dataKey` **`indexed`** | `bytes32` | - | -| `dataValue` | `bytes` | - | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | -<br/> +
### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -662,16 +910,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | -<br/> +
### RevokedOperator -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokedoperator) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokedoperator) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Event signature: `RevokedOperator(address,address)` -- Event hash: `0x50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa1` +- Event topic hash: `0x50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa1` ::: @@ -679,23 +927,25 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn event RevokedOperator(address indexed operator, address indexed tokenOwner); ``` +Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on its behalf. + #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ----------- | -| `operator` **`indexed`** | `address` | - | -| `tokenOwner` **`indexed`** | `address` | - | +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address revoked from the operator array ({getOperatorsOf}). | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | -<br/> +
### Transfer -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Event signature: `Transfer(address,address,address,uint256,bool,bytes)` -- Event hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` +- Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` ::: @@ -703,28 +953,29 @@ event RevokedOperator(address indexed operator, address indexed tokenOwner); event Transfer(address indexed operator, address indexed from, address indexed to, uint256 amount, bool allowNonLSP1Recipient, bytes data); ``` +Emitted when `tokenId` token is transferred from the `from` to the `to` address. + #### Parameters -| Name | Type | Description | -| ------------------------ | :-------: | ----------- | -| `operator` **`indexed`** | `address` | - | -| `from` **`indexed`** | `address` | - | -| `to` **`indexed`** | `address` | - | -| `amount` | `uint256` | - | -| `allowNonLSP1Recipient` | `bool` | - | -| `data` | `bytes` | - | +| Name | Type | Description | +| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address of operator that sent the `tokenId` | +| `from` **`indexed`** | `address` | The previous owner of the `tokenId` | +| `to` **`indexed`** | `address` | The new owner of `tokenId` | +| `amount` | `uint256` | The amount of tokens transferred. | +| `allowNonLSP1Recipient` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. | +| `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. | -<br/> -<hr/> +
## Errors ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -736,14 +987,14 @@ error ERC725Y_DataKeysValuesEmptyArray(); reverts when one of the array parameter provided to `setDataBatch` is an empty array -<br/> +
### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -755,14 +1006,14 @@ 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. -<br/> +
### ERC725Y_MsgValueDisallowed -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -774,14 +1025,14 @@ error ERC725Y_MsgValueDisallowed(); reverts when sending value to the `setData(..)` functions -<br/> +
### LSP4TokenNameNotEditable -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -793,14 +1044,14 @@ 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. -<br/> +
### LSP4TokenSymbolNotEditable -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -812,14 +1063,14 @@ 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. -<br/> +
### LSP7AmountExceedsAuthorizedAmount -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)` - Error hash: `0xf3a6b691` @@ -845,14 +1096,14 @@ reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than t | `operator` | `address` | - | | `amount` | `uint256` | - | -<br/> +
### LSP7AmountExceedsBalance -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)` - Error hash: `0x08d47949` @@ -876,14 +1127,14 @@ reverts when sending an `amount` of tokens larger than the current `balance` of | `tokenOwner` | `address` | - | | `amount` | `uint256` | - | -<br/> +
### LSP7CannotSendToSelf -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendtoself) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendtoself) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `LSP7CannotSendToSelf()` - Error hash: `0xb9afb000` @@ -895,14 +1146,14 @@ error LSP7CannotSendToSelf(); reverts when specifying the same address for `from` or `to` in a token transfer. -<br/> +
### LSP7CannotSendWithAddressZero -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `LSP7CannotSendWithAddressZero()` - Error hash: `0xd2d5ec30` @@ -920,14 +1171,14 @@ reverts when trying to: - transfer tokens from or to the zero address. -<br/> +
### LSP7CannotUseAddressZeroAsOperator -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `LSP7CannotUseAddressZeroAsOperator()` - Error hash: `0x6355e766` @@ -939,14 +1190,14 @@ error LSP7CannotUseAddressZeroAsOperator(); reverts when trying to set the zero address as an operator. -<br/> +
### LSP7DecreasedAllowanceBelowZero -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `LSP7DecreasedAllowanceBelowZero()` - Error hash: `0x0ef76c35` @@ -958,14 +1209,14 @@ error LSP7DecreasedAllowanceBelowZero(); Reverts when trying to decrease an operator's allowance to more than its current allowance. -<br/> +
### LSP7InvalidTransferBatch -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `LSP7InvalidTransferBatch()` - Error hash: `0x263eee8d` @@ -977,14 +1228,14 @@ error LSP7InvalidTransferBatch(); reverts when the array parameters used in [`transferBatch`](#transferbatch) have different lengths. -<br/> +
### LSP7NotifyTokenReceiverContractMissingLSP1Interface -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0xa608fbb6` @@ -1004,14 +1255,14 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | -<br/> +
### LSP7NotifyTokenReceiverIsEOA -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `LSP7NotifyTokenReceiverIsEOA(address)` - Error hash: `0x26c247f4` @@ -1029,14 +1280,14 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | -<br/> +
### LSP7TokenOwnerCannotBeOperator -:::note Links +:::note References -- Specification details in [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator) -- Solidity implementation in [**LSP7DigitalAsset**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) - Error signature: `LSP7TokenOwnerCannotBeOperator()` - Error hash: `0xdab75047` @@ -1048,7 +1299,7 @@ error LSP7TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. -<br/> +
diff --git a/docs/contracts/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.md b/docs/contracts/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.md index 55740f5dc7..21e7e45a58 100644 --- a/docs/contracts/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.md +++ b/docs/contracts/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.md @@ -1,21 +1,32 @@ + + + # LSP7Burnable -:::info Solidity contract +:::info Standard Specifications + +[`LSP-7-DigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md) + +::: +:::info Solidity implementation -[`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +[`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) ::: > LSP7 token extension that allows token holders to destroy both their own tokens and those that they have an allowance for as an operator. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### authorizeOperator -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#authorizeoperator) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `authorizeOperator(address,uint256)` - Function selector: `0x47980aa3` @@ -43,12 +54,14 @@ Sets an `amount` of tokens that an `operator` has access from the caller's balan | `operator` | `address` | The address to authorize as an operator. | | `amount` | `uint256` | The allowance amount of tokens operator has access to. | +
+ ### authorizedAmountFor -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#authorizedamountfor) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `authorizedAmountFor(address,address)` - Function selector: `0x65aeaa95` @@ -65,23 +78,25 @@ Get the amount of tokens `operator` address has access to from `tokenOwner`. Ope #### Parameters -| Name | Type | Description | -| ------------ | :-------: | -------------------------------------------------------------- | -| `operator` | `address` | The operator's address to query the authorized amount for. | -| `tokenOwner` | `address` | The token owner that `operator` has allowance on. | +| Name | Type | Description | +| ------------ | :-------: | ---------------------------------------------------------- | +| `operator` | `address` | The operator's address to query the authorized amount for. | +| `tokenOwner` | `address` | The token owner that `operator` has allowance on. | #### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------------------------------------------------------------- | -| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. | +| Name | Type | Description | +| ---- | :-------: | --------------------------------------------------------------------------------------- | +| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. | + +
### balanceOf -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#balanceof) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#balanceof) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -105,12 +120,14 @@ Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [ | ---- | :-------: | ------------------------------------------- | | `0` | `uint256` | The amount of tokens owned by `tokenOwner`. | +
+ ### burn -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#burn) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#burn) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `burn(address,uint256,bytes)` - Function selector: `0x44d17187` @@ -130,12 +147,14 @@ See internal [`_burn`](#_burn) function for details. | `amount` | `uint256` | - | | `data` | `bytes` | - | +
+ ### decimals -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#decimals) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decimals) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `decimals()` - Function selector: `0x313ce567` @@ -153,12 +172,14 @@ Returns the number of decimals used to get its user representation. If the asset | ---- | :-----: | ----------------------------------------------------------------------- | | `0` | `uint8` | the number of decimals. If `0` is returned, the asset is non-divisible. | +
+ ### decreaseAllowance -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#decreaseallowance) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `decreaseAllowance(address,uint256)` - Function selector: `0xa457c2d7` @@ -201,17 +222,19 @@ Atomically decreases the allowance granted to `operator` by the caller. This is #### Parameters -| Name | Type | Description | -| ------------------- | :-------: | ---------------------------------------------------------- | -| `operator` | `address` | the operator to decrease allowance for `msg.sender` | -| `substractedAmount` | `uint256` | the amount to decrease by in the operator's allowance. | +| Name | Type | Description | +| ------------------- | :-------: | ------------------------------------------------------ | +| `operator` | `address` | the operator to decrease allowance for `msg.sender` | +| `substractedAmount` | `uint256` | the amount to decrease by in the operator's allowance. | + +
### getData -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#getdata) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdata) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -221,28 +244,28 @@ Atomically decreases the allowance granted to `operator` by the caller. This is function getData(bytes32 dataKey) external view returns (bytes dataValue); ``` -_Reading the ERC725Y storage for data key `dataKey` returned the following value: `dataValue`._ - -Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`. +_Gets singular data at a given `dataKey`_ #### Parameters -| Name | Type | Description | -| --------- | :-------: | --------------------------------------------- | -| `dataKey` | `bytes32` | The data key for which to retrieve the value. | +| Name | Type | Description | +| --------- | :-------: | ------------------------------- | +| `dataKey` | `bytes32` | The key which value to retrieve | #### Returns -| Name | Type | Description | -| ----------- | :-----: | ---------------------------------------------------- | -| `dataValue` | `bytes` | The bytes value stored under the specified data key. | +| Name | Type | Description | +| ----------- | :-----: | -------------------------- | +| `dataValue` | `bytes` | The data stored at the key | + +
### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#getdatabatch) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -254,9 +277,7 @@ function getDataBatch( ) external view returns (bytes[] dataValues); ``` -_Reading the ERC725Y storage for data keys `dataKeys` returned the following values: `dataValues`._ - -Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`. +_Gets array of data for multiple given keys_ #### Parameters @@ -270,12 +291,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### increaseAllowance -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#increaseallowance) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `increaseAllowance(address,uint256)` - Function selector: `0x39509351` @@ -317,17 +340,19 @@ Atomically increases the allowance granted to `operator` by the caller. This is #### Parameters -| Name | Type | Description | -| ------------- | :-------: | --------------------------------------------------------------------------- | -| `operator` | `address` | the operator to increase the allowance for `msg.sender` | -| `addedAmount` | `uint256` | the additional amount to add on top of the current operator's allowance | +| Name | Type | Description | +| ------------- | :-------: | ----------------------------------------------------------------------- | +| `operator` | `address` | the operator to increase the allowance for `msg.sender` | +| `addedAmount` | `uint256` | the additional amount to add on top of the current operator's allowance | + +
### owner -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#owner) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#owner) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -345,12 +370,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#renounceownership) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#renounceownership) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -362,12 +389,14 @@ 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 +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#revokeoperator) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `revokeOperator(address)` - Function selector: `0xfad8b32a` @@ -385,108 +414,68 @@ Removes the `operator` address as an operator of callers tokens, disallowing it | ---------- | :-------: | ------------------------------------- | | `operator` | `address` | The address to revoke as an operator. | +
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#setdata) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdata) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setData(bytes32 dataKey, bytes dataValue) external payable; ``` -_Setting the following data key value pair in the ERC725Y storage. Data key: `dataKey`, data value: `dataValue`. _ - -Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner). - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event. - -
+_Sets singular data for a given `dataKey`_ #### Parameters -| Name | Type | Description | -| ----------- | :-------: | ------------------------------------------ | -| `dataKey` | `bytes32` | The data key for which to set a new value. | -| `dataValue` | `bytes` | The new bytes value to set. | +| 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 +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#setdatabatch) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; ``` -_Setting the following data key value pairs in the ERC725Y storage. Data keys: `dataKeys`, data values: `dataValues`. _ - -Batch data setting function that behaves the same as [`setData`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner) of the contract. - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event **for each data key/value pair set**. +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[]` | An array of data keys to set bytes values for. | -| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +| 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 +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#supportsinterface) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -510,12 +499,14 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### totalSupply -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#totalsupply) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#totalsupply) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -533,12 +524,14 @@ Returns the number of existing tokens that have been minted in this contract. | ---- | :-------: | ------------------------------ | | `0` | `uint256` | The number of existing tokens. | +
+ ### transfer -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#transfer) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `transfer(address,address,uint256,bool,bytes)` - Function selector: `0x760d9bba` @@ -566,12 +559,14 @@ Transfers an `amount` of tokens from the `from` address to the `to` address and | `allowNonLSP1Recipient` | `bool` | When set to `true`, the `to` address CAN be any address. 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 +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#transferbatch) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferbatch) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])` - Function selector: `0x2d7667c9` @@ -595,16 +590,18 @@ Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the | ----------------------- | :---------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `from` | `address[]` | An array of sending addresses. | | `to` | `address[]` | An array of receiving addresses. | -| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. | +| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. | | `allowNonLSP1Recipient` | `bool[]` | For each transfer, when set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. | | `data` | `bytes[]` | An array of additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | +
+ ### transferOwnership -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#transferownership) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferownership) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -622,18 +619,255 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | ---- +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +Save gas by emitting the [`DataChanged`](#datachanged) event with only the first 256 bytes of dataValue + +
+ +### \_updateOperator + +```solidity +function _updateOperator( + address tokenOwner, + address operator, + uint256 amount +) internal nonpayable; +``` + +Changes token `amount` the `operator` has access to from `tokenOwner` tokens. +If the amount is zero then the operator is being revoked, otherwise the operator amount is being modified. + +
+ +### \_mint + +```solidity +function _mint( + address to, + uint256 amount, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Mints `amount` of tokens and transfers it to `to`. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as `from`. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- | +| `to` | `address` | the address to mint tokens for. | +| `amount` | `uint256` | the amount of tokens to mint. | +| `allowNonLSP1Recipient` | `bool` | a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | +| `data` | `bytes` | Additional data the caller wants included in the emitted {Transfer} event, and sent in the LSP1 hook to the `to` address. | + +
+ +### \_burn + +:::tip Hint + +In dApps, you can know which address is burning tokens by listening for the `Transfer` event and filter with the zero address as `to`. + +::: + +```solidity +function _burn(address from, uint256 amount, bytes data) internal nonpayable; +``` + +Burns (= destroys) `amount` of tokens, decrease the `from` balance. This is done by sending them to the zero address. +Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver) +function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as the `to` address + +
+ +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | the address to burn tokens from its balance. | +| `amount` | `uint256` | the amount of tokens to burn. | +| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. | + +
+ +### \_transfer + +```solidity +function _transfer( + address from, + address to, + uint256 amount, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Transfer tokens from `from` to `to` by decreasing the balance of `from` by `-amount` and increasing the balance +of `to` by `+amount`. +Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver) +function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | the address to decrease the balance. | +| `to` | `address` | the address to increase the balance. | +| `amount` | `uint256` | the amount of tokens to transfer from `from` to `to`. | +| `allowNonLSP1Recipient` | `bool` | a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | +| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. | + +
+ +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer( + address from, + address to, + uint256 amount +) internal nonpayable; +``` + +Hook that is called before any token transfer, including minting and burning. +Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function. + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------- | +| `from` | `address` | The sender address | +| `to` | `address` | The recipient address | +| `amount` | `uint256` | The amount of token to transfer | + +
+ +### \_notifyTokenSender + +```solidity +function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; +``` + +Attempt to notify the token sender `from` about the `amount` of tokens being transferred. +This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSSENDER` as typeId, if `from` is a contract that supports the LSP1 interface. +If `from` is an EOA or a contract that does not support the LSP1 interface, nothing will happen and no notification will be sent. + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | -------------------------------------------------------------------------- | +| `from` | `address` | The address to call the {universalReceiver} function on. | +| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. | + +
+ +### \_notifyTokenReceiver + +```solidity +function _notifyTokenReceiver( + address to, + bool allowNonLSP1Recipient, + bytes lsp1Data +) internal nonpayable; +``` + +Attempt to notify the token receiver `to` about the `amount` tokens being received. +This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSRECIPIENT` as typeId, if `to` is a contract that supports the LSP1 interface. +If `to` is is an EOA or a contract that does not support the LSP1 interface, the behaviour will depend on the `allowNonLSP1Recipient` boolean flag. + +- if `allowNonLSP1Recipient` is set to `true`, nothing will happen and no notification will be sent. + +- if `allowNonLSP1Recipient` is set to `false, the transaction will revert. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | --------------------------------------------------------------------------------------------------- | +| `to` | `address` | The address to call the {universalReceiver} function on. | +| `allowNonLSP1Recipient` | `bool` | a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | +| `lsp1Data` | `bytes` | the data to be sent to the `to` address in the `universalReceiver(...)` call. | + +
## Events ### AuthorizedOperator -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#authorizedoperator) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedoperator) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Event signature: `AuthorizedOperator(address,address,uint256)` -- Event hash: `0xd66aff874162a96578e919097b6f6d153dfd89a5cec41bb331fdb0c4aec16e2c` +- Event topic hash: `0xd66aff874162a96578e919097b6f6d153dfd89a5cec41bb331fdb0c4aec16e2c` ::: @@ -641,24 +875,26 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c event AuthorizedOperator(address indexed operator, address indexed tokenOwner, uint256 indexed amount); ``` -Emitted when `tokenOwner` enables `operator` for `amount` tokens. +Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`. #### Parameters | Name | Type | Description | | -------------------------- | :-------: | ----------------------------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address authorized as an operator | -| `tokenOwner` **`indexed`** | `address` | The token owner | +| `operator` **`indexed`** | `address` | The address authorized as an operator. | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | | `amount` **`indexed`** | `uint256` | The amount of tokens `operator` address has access to from `tokenOwner` | +
+ ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#datachanged) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#datachanged) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -666,25 +902,25 @@ Emitted when `tokenOwner` enables `operator` for `amount` tokens. event DataChanged(bytes32 indexed dataKey, bytes dataValue); ``` -_The following data key/value pair has been changed in the ERC725Y storage: Data key: `dataKey`, data value: `dataValue`._ - -Emitted when data at a specific `dataKey` was changed to a new value `dataValue`. +_Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | -------------------------------------------- | -| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | -| `dataValue` | `bytes` | The value to set for the given data key. | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#ownershiptransferred) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -699,14 +935,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | +
+ ### RevokedOperator -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#revokedoperator) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokedoperator) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Event signature: `RevokedOperator(address,address)` -- Event hash: `0x50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa1` +- Event topic hash: `0x50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa1` ::: @@ -714,23 +952,25 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn event RevokedOperator(address indexed operator, address indexed tokenOwner); ``` -Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [`authorizedAmountFor(...)`](#`authorizedamountfor) to `0`. +Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on its behalf. #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ---------------------------------- | -| `operator` **`indexed`** | `address` | The address revoked from operating | -| `tokenOwner` **`indexed`** | `address` | The token owner | +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address revoked from the operator array ({getOperatorsOf}). | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | + +
### Transfer -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#transfer) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Event signature: `Transfer(address,address,address,uint256,bool,bytes)` -- Event hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` +- Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` ::: @@ -738,29 +978,29 @@ Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [` event Transfer(address indexed operator, address indexed from, address indexed to, uint256 amount, bool allowNonLSP1Recipient, bytes data); ``` -Emitted when the `from` transferred successfully `amount` of tokens to `to`. +Emitted when `tokenId` token is transferred from the `from` to the `to` address. #### Parameters -| Name | Type | Description | -| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address of the operator that executed the transfer. | -| `from` **`indexed`** | `address` | The address which tokens were sent from (balance decreased by `-amount`). | -| `to` **`indexed`** | `address` | The address that received the tokens (balance increased by `+amount`). | -| `amount` | `uint256` | The amount of tokens transferred. | -| `allowNonLSP1Recipient` | `bool` | if the transferred enforced the `to` recipient address to be a contract that implements the LSP1 standard or not. | -| `data` | `bytes` | Any additional data included by the caller during the transfer, and sent in the LSP1 hooks to the `from` and `to` addresses. | +| Name | Type | Description | +| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address of operator that sent the `tokenId` | +| `from` **`indexed`** | `address` | The previous owner of the `tokenId` | +| `to` **`indexed`** | `address` | The new owner of `tokenId` | +| `amount` | `uint256` | The amount of tokens transferred. | +| `allowNonLSP1Recipient` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. | +| `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. | ---- +
## Errors ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -770,14 +1010,16 @@ Emitted when the `from` transferred successfully `amount` of tokens to `to`. error ERC725Y_DataKeysValuesEmptyArray(); ``` -Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array. +reverts when one of the array parameter provided to `setDataBatch` is an empty array + +
### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -787,14 +1029,16 @@ Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabat error ERC725Y_DataKeysValuesLengthMismatch(); ``` -Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. +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 +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -804,14 +1048,16 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat error ERC725Y_MsgValueDisallowed(); ``` -Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function. +reverts when sending value to the `setData(..)` functions + +
### LSP4TokenNameNotEditable -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#lsp4tokennamenoteditable) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -823,12 +1069,14 @@ 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 +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#lsp4tokensymbolnoteditable) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -840,12 +1088,14 @@ 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. +
+ ### LSP7AmountExceedsAuthorizedAmount -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#lsp7amountexceedsauthorizedamount) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)` - Error hash: `0xf3a6b691` @@ -871,12 +1121,14 @@ reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than t | `operator` | `address` | - | | `amount` | `uint256` | - | +
+ ### LSP7AmountExceedsBalance -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#lsp7amountexceedsbalance) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)` - Error hash: `0x08d47949` @@ -900,12 +1152,14 @@ reverts when sending an `amount` of tokens larger than the current `balance` of | `tokenOwner` | `address` | - | | `amount` | `uint256` | - | +
+ ### LSP7CannotSendToSelf -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#lsp7cannotsendtoself) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendtoself) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `LSP7CannotSendToSelf()` - Error hash: `0xb9afb000` @@ -917,12 +1171,14 @@ error LSP7CannotSendToSelf(); reverts when specifying the same address for `from` or `to` in a token transfer. +
+ ### LSP7CannotSendWithAddressZero -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#lsp7cannotsendwithaddresszero) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `LSP7CannotSendWithAddressZero()` - Error hash: `0xd2d5ec30` @@ -940,12 +1196,14 @@ reverts when trying to: - transfer tokens from or to the zero address. +
+ ### LSP7CannotUseAddressZeroAsOperator -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#lsp7cannotuseaddresszeroasoperator) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `LSP7CannotUseAddressZeroAsOperator()` - Error hash: `0x6355e766` @@ -957,12 +1215,14 @@ error LSP7CannotUseAddressZeroAsOperator(); reverts when trying to set the zero address as an operator. +
+ ### LSP7DecreasedAllowanceBelowZero -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#lsp7decreasedallowancebelowzero) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `LSP7DecreasedAllowanceBelowZero()` - Error hash: `0x0ef76c35` @@ -974,12 +1234,14 @@ error LSP7DecreasedAllowanceBelowZero(); Reverts when trying to decrease an operator's allowance to more than its current allowance. +
+ ### LSP7InvalidTransferBatch -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#lsp7invalidtransferbatch) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `LSP7InvalidTransferBatch()` - Error hash: `0x263eee8d` @@ -991,12 +1253,14 @@ error LSP7InvalidTransferBatch(); reverts when the array parameters used in [`transferBatch`](#transferbatch) have different lengths. +
+ ### LSP7NotifyTokenReceiverContractMissingLSP1Interface -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#lsp7notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0xa608fbb6` @@ -1016,12 +1280,14 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP7NotifyTokenReceiverIsEOA -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#lsp7notifytokenreceiveriseoa) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `LSP7NotifyTokenReceiverIsEOA(address)` - Error hash: `0x26c247f4` @@ -1039,12 +1305,14 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP7TokenOwnerCannotBeOperator -:::note Links +:::note References -- Specification details in [**LSP-7-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Burnable.md#lsp7tokenownercannotbeoperator) -- Solidity implementation in [**LSP7Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Burnable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) - Error signature: `LSP7TokenOwnerCannotBeOperator()` - Error hash: `0xdab75047` @@ -1056,193 +1324,4 @@ error LSP7TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. - - - - - - -[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 -[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 -[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 -[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 -[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 -[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 -[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X -[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y -[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md -[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[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 - - - -[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 - - - -[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership -[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership -[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership - - - -[`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 -[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol -[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 -[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol -[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll -[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol - - - -[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol -[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol -[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol -[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol -[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol -[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so -[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol -[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.md b/docs/contracts/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.md index 2821fc2eae..ecef50df36 100644 --- a/docs/contracts/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.md +++ b/docs/contracts/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.md @@ -1,21 +1,32 @@ + + + # LSP7CappedSupply -:::info Solidity contract +:::info Standard Specifications + +[`LSP-7-DigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md) + +::: +:::info Solidity implementation -[`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +[`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) ::: LSP7 token extension to add a max token supply cap. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### authorizeOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#authorizeoperator) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `authorizeOperator(address,uint256)` - Function selector: `0x47980aa3` @@ -43,12 +54,14 @@ Sets an `amount` of tokens that an `operator` has access from the caller's balan | `operator` | `address` | The address to authorize as an operator. | | `amount` | `uint256` | The allowance amount of tokens operator has access to. | +
+ ### authorizedAmountFor -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#authorizedamountfor) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `authorizedAmountFor(address,address)` - Function selector: `0x65aeaa95` @@ -65,23 +78,25 @@ Get the amount of tokens `operator` address has access to from `tokenOwner`. Ope #### Parameters -| Name | Type | Description | -| ------------ | :-------: | -------------------------------------------------------------- | -| `operator` | `address` | The operator's address to query the authorized amount for. | -| `tokenOwner` | `address` | The token owner that `operator` has allowance on. | +| Name | Type | Description | +| ------------ | :-------: | ---------------------------------------------------------- | +| `operator` | `address` | The operator's address to query the authorized amount for. | +| `tokenOwner` | `address` | The token owner that `operator` has allowance on. | #### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------------------------------------------------------------- | -| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. | +| Name | Type | Description | +| ---- | :-------: | --------------------------------------------------------------------------------------- | +| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. | + +
### balanceOf -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#balanceof) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#balanceof) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -105,12 +120,14 @@ Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [ | ---- | :-------: | ------------------------------------------- | | `0` | `uint256` | The amount of tokens owned by `tokenOwner`. | +
+ ### decimals -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#decimals) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decimals) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `decimals()` - Function selector: `0x313ce567` @@ -128,12 +145,14 @@ Returns the number of decimals used to get its user representation. If the asset | ---- | :-----: | ----------------------------------------------------------------------- | | `0` | `uint8` | the number of decimals. If `0` is returned, the asset is non-divisible. | +
+ ### decreaseAllowance -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#decreaseallowance) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `decreaseAllowance(address,uint256)` - Function selector: `0xa457c2d7` @@ -176,17 +195,19 @@ Atomically decreases the allowance granted to `operator` by the caller. This is #### Parameters -| Name | Type | Description | -| ------------------- | :-------: | ---------------------------------------------------------- | -| `operator` | `address` | the operator to decrease allowance for `msg.sender` | -| `substractedAmount` | `uint256` | the amount to decrease by in the operator's allowance. | +| Name | Type | Description | +| ------------------- | :-------: | ------------------------------------------------------ | +| `operator` | `address` | the operator to decrease allowance for `msg.sender` | +| `substractedAmount` | `uint256` | the amount to decrease by in the operator's allowance. | + +
### getData -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#getdata) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdata) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -196,28 +217,28 @@ Atomically decreases the allowance granted to `operator` by the caller. This is function getData(bytes32 dataKey) external view returns (bytes dataValue); ``` -_Reading the ERC725Y storage for data key `dataKey` returned the following value: `dataValue`._ - -Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`. +_Gets singular data at a given `dataKey`_ #### Parameters -| Name | Type | Description | -| --------- | :-------: | --------------------------------------------- | -| `dataKey` | `bytes32` | The data key for which to retrieve the value. | +| Name | Type | Description | +| --------- | :-------: | ------------------------------- | +| `dataKey` | `bytes32` | The key which value to retrieve | #### Returns -| Name | Type | Description | -| ----------- | :-----: | ---------------------------------------------------- | -| `dataValue` | `bytes` | The bytes value stored under the specified data key. | +| Name | Type | Description | +| ----------- | :-----: | -------------------------- | +| `dataValue` | `bytes` | The data stored at the key | + +
### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#getdatabatch) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -229,9 +250,7 @@ function getDataBatch( ) external view returns (bytes[] dataValues); ``` -_Reading the ERC725Y storage for data keys `dataKeys` returned the following values: `dataValues`._ - -Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`. +_Gets array of data for multiple given keys_ #### Parameters @@ -245,12 +264,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### increaseAllowance -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#increaseallowance) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `increaseAllowance(address,uint256)` - Function selector: `0x39509351` @@ -292,17 +313,19 @@ Atomically increases the allowance granted to `operator` by the caller. This is #### Parameters -| Name | Type | Description | -| ------------- | :-------: | --------------------------------------------------------------------------- | -| `operator` | `address` | the operator to increase the allowance for `msg.sender` | -| `addedAmount` | `uint256` | the additional amount to add on top of the current operator's allowance | +| Name | Type | Description | +| ------------- | :-------: | ----------------------------------------------------------------------- | +| `operator` | `address` | the operator to increase the allowance for `msg.sender` | +| `addedAmount` | `uint256` | the additional amount to add on top of the current operator's allowance | + +
### owner -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#owner) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#owner) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -320,12 +343,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#renounceownership) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#renounceownership) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -337,12 +362,14 @@ 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 +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#revokeoperator) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `revokeOperator(address)` - Function selector: `0xfad8b32a` @@ -360,108 +387,68 @@ Removes the `operator` address as an operator of callers tokens, disallowing it | ---------- | :-------: | ------------------------------------- | | `operator` | `address` | The address to revoke as an operator. | +
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#setdata) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdata) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setData(bytes32 dataKey, bytes dataValue) external payable; ``` -_Setting the following data key value pair in the ERC725Y storage. Data key: `dataKey`, data value: `dataValue`. _ - -Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner). - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event. - -
+_Sets singular data for a given `dataKey`_ #### Parameters -| Name | Type | Description | -| ----------- | :-------: | ------------------------------------------ | -| `dataKey` | `bytes32` | The data key for which to set a new value. | -| `dataValue` | `bytes` | The new bytes value to set. | +| 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 +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#setdatabatch) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; ``` -_Setting the following data key value pairs in the ERC725Y storage. Data keys: `dataKeys`, data values: `dataValues`. _ - -Batch data setting function that behaves the same as [`setData`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner) of the contract. - -
- -
- -**Emitted events:** +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 -- [`DataChanged`](#datachanged) event **for each data key/value pair set**. - -
+0. Emits a [`DataChanged`](#datachanged) event. #### Parameters -| Name | Type | Description | -| ------------ | :---------: | ---------------------------------------------------- | -| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. | -| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +| 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 +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#supportsinterface) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -485,12 +472,14 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### tokenSupplyCap -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#tokensupplycap) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#tokensupplycap) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `tokenSupplyCap()` - Function selector: `0x52058d8a` @@ -510,12 +499,14 @@ Get the maximum number of tokens that can exist to circulate. Once [`totalSupply | ---- | :-------: | ------------------------------------------------------------ | | `0` | `uint256` | The maximum number of tokens that can exist in the contract. | +
+ ### totalSupply -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#totalsupply) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#totalsupply) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -533,12 +524,14 @@ Returns the number of existing tokens that have been minted in this contract. | ---- | :-------: | ------------------------------ | | `0` | `uint256` | The number of existing tokens. | +
+ ### transfer -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#transfer) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `transfer(address,address,uint256,bool,bytes)` - Function selector: `0x760d9bba` @@ -566,12 +559,14 @@ Transfers an `amount` of tokens from the `from` address to the `to` address and | `allowNonLSP1Recipient` | `bool` | When set to `true`, the `to` address CAN be any address. 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 +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#transferbatch) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferbatch) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])` - Function selector: `0x2d7667c9` @@ -595,16 +590,18 @@ Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the | ----------------------- | :---------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `from` | `address[]` | An array of sending addresses. | | `to` | `address[]` | An array of receiving addresses. | -| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. | +| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. | | `allowNonLSP1Recipient` | `bool[]` | For each transfer, when set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. | | `data` | `bytes[]` | An array of additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | +
+ ### transferOwnership -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#transferownership) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferownership) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -622,18 +619,239 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | ---- +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +Save gas by emitting the [`DataChanged`](#datachanged) event with only the first 256 bytes of dataValue + +
+ +### \_updateOperator + +```solidity +function _updateOperator( + address tokenOwner, + address operator, + uint256 amount +) internal nonpayable; +``` + +Changes token `amount` the `operator` has access to from `tokenOwner` tokens. +If the amount is zero then the operator is being revoked, otherwise the operator amount is being modified. + +
+ +### \_mint + +```solidity +function _mint( + address to, + uint256 amount, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Same as [`_mint`](#_mint) but allows to mint only if the [`totalSupply`](#totalsupply) does not exceed the [`tokenSupplyCap`](#tokensupplycap) +after `amount` of tokens have been minted. + +
+ +### \_burn + +:::tip Hint + +In dApps, you can know which address is burning tokens by listening for the `Transfer` event and filter with the zero address as `to`. + +::: + +```solidity +function _burn(address from, uint256 amount, bytes data) internal nonpayable; +``` + +Burns (= destroys) `amount` of tokens, decrease the `from` balance. This is done by sending them to the zero address. +Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver) +function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as the `to` address + +
+ +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | the address to burn tokens from its balance. | +| `amount` | `uint256` | the amount of tokens to burn. | +| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. | + +
+ +### \_transfer + +```solidity +function _transfer( + address from, + address to, + uint256 amount, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Transfer tokens from `from` to `to` by decreasing the balance of `from` by `-amount` and increasing the balance +of `to` by `+amount`. +Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver) +function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | the address to decrease the balance. | +| `to` | `address` | the address to increase the balance. | +| `amount` | `uint256` | the amount of tokens to transfer from `from` to `to`. | +| `allowNonLSP1Recipient` | `bool` | a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | +| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. | + +
+ +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer( + address from, + address to, + uint256 amount +) internal nonpayable; +``` + +Hook that is called before any token transfer, including minting and burning. +Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function. + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------- | +| `from` | `address` | The sender address | +| `to` | `address` | The recipient address | +| `amount` | `uint256` | The amount of token to transfer | + +
+ +### \_notifyTokenSender + +```solidity +function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; +``` + +Attempt to notify the token sender `from` about the `amount` of tokens being transferred. +This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSSENDER` as typeId, if `from` is a contract that supports the LSP1 interface. +If `from` is an EOA or a contract that does not support the LSP1 interface, nothing will happen and no notification will be sent. + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | -------------------------------------------------------------------------- | +| `from` | `address` | The address to call the {universalReceiver} function on. | +| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. | + +
+ +### \_notifyTokenReceiver + +```solidity +function _notifyTokenReceiver( + address to, + bool allowNonLSP1Recipient, + bytes lsp1Data +) internal nonpayable; +``` + +Attempt to notify the token receiver `to` about the `amount` tokens being received. +This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSRECIPIENT` as typeId, if `to` is a contract that supports the LSP1 interface. +If `to` is is an EOA or a contract that does not support the LSP1 interface, the behaviour will depend on the `allowNonLSP1Recipient` boolean flag. + +- if `allowNonLSP1Recipient` is set to `true`, nothing will happen and no notification will be sent. + +- if `allowNonLSP1Recipient` is set to `false, the transaction will revert. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | --------------------------------------------------------------------------------------------------- | +| `to` | `address` | The address to call the {universalReceiver} function on. | +| `allowNonLSP1Recipient` | `bool` | a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | +| `lsp1Data` | `bytes` | the data to be sent to the `to` address in the `universalReceiver(...)` call. | + +
## Events ### AuthorizedOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#authorizedoperator) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedoperator) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Event signature: `AuthorizedOperator(address,address,uint256)` -- Event hash: `0xd66aff874162a96578e919097b6f6d153dfd89a5cec41bb331fdb0c4aec16e2c` +- Event topic hash: `0xd66aff874162a96578e919097b6f6d153dfd89a5cec41bb331fdb0c4aec16e2c` ::: @@ -641,24 +859,26 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c event AuthorizedOperator(address indexed operator, address indexed tokenOwner, uint256 indexed amount); ``` -Emitted when `tokenOwner` enables `operator` for `amount` tokens. +Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`. #### Parameters | Name | Type | Description | | -------------------------- | :-------: | ----------------------------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address authorized as an operator | -| `tokenOwner` **`indexed`** | `address` | The token owner | +| `operator` **`indexed`** | `address` | The address authorized as an operator. | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | | `amount` **`indexed`** | `uint256` | The amount of tokens `operator` address has access to from `tokenOwner` | +
+ ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#datachanged) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#datachanged) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -666,25 +886,25 @@ Emitted when `tokenOwner` enables `operator` for `amount` tokens. event DataChanged(bytes32 indexed dataKey, bytes dataValue); ``` -_The following data key/value pair has been changed in the ERC725Y storage: Data key: `dataKey`, data value: `dataValue`._ - -Emitted when data at a specific `dataKey` was changed to a new value `dataValue`. +_Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | -------------------------------------------- | -| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | -| `dataValue` | `bytes` | The value to set for the given data key. | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#ownershiptransferred) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -699,14 +919,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | +
+ ### RevokedOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#revokedoperator) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokedoperator) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Event signature: `RevokedOperator(address,address)` -- Event hash: `0x50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa1` +- Event topic hash: `0x50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa1` ::: @@ -714,23 +936,25 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn event RevokedOperator(address indexed operator, address indexed tokenOwner); ``` -Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [`authorizedAmountFor(...)`](#`authorizedamountfor) to `0`. +Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on its behalf. #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ---------------------------------- | -| `operator` **`indexed`** | `address` | The address revoked from operating | -| `tokenOwner` **`indexed`** | `address` | The token owner | +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address revoked from the operator array ({getOperatorsOf}). | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | + +
### Transfer -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#transfer) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Event signature: `Transfer(address,address,address,uint256,bool,bytes)` -- Event hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` +- Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` ::: @@ -738,29 +962,29 @@ Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [` event Transfer(address indexed operator, address indexed from, address indexed to, uint256 amount, bool allowNonLSP1Recipient, bytes data); ``` -Emitted when the `from` transferred successfully `amount` of tokens to `to`. +Emitted when `tokenId` token is transferred from the `from` to the `to` address. #### Parameters -| Name | Type | Description | -| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address of the operator that executed the transfer. | -| `from` **`indexed`** | `address` | The address which tokens were sent from (balance decreased by `-amount`). | -| `to` **`indexed`** | `address` | The address that received the tokens (balance increased by `+amount`). | -| `amount` | `uint256` | The amount of tokens transferred. | -| `allowNonLSP1Recipient` | `bool` | if the transferred enforced the `to` recipient address to be a contract that implements the LSP1 standard or not. | -| `data` | `bytes` | Any additional data included by the caller during the transfer, and sent in the LSP1 hooks to the `from` and `to` addresses. | +| Name | Type | Description | +| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address of operator that sent the `tokenId` | +| `from` **`indexed`** | `address` | The previous owner of the `tokenId` | +| `to` **`indexed`** | `address` | The new owner of `tokenId` | +| `amount` | `uint256` | The amount of tokens transferred. | +| `allowNonLSP1Recipient` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. | +| `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. | ---- +
## Errors ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -770,14 +994,16 @@ Emitted when the `from` transferred successfully `amount` of tokens to `to`. error ERC725Y_DataKeysValuesEmptyArray(); ``` -Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array. +reverts when one of the array parameter provided to `setDataBatch` is an empty array + +
### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -787,14 +1013,16 @@ Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabat error ERC725Y_DataKeysValuesLengthMismatch(); ``` -Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. +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 +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -804,14 +1032,16 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat error ERC725Y_MsgValueDisallowed(); ``` -Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function. +reverts when sending value to the `setData(..)` functions + +
### LSP4TokenNameNotEditable -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp4tokennamenoteditable) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -823,12 +1053,14 @@ 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 +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp4tokensymbolnoteditable) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -840,12 +1072,14 @@ 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. +
+ ### LSP7AmountExceedsAuthorizedAmount -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp7amountexceedsauthorizedamount) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)` - Error hash: `0xf3a6b691` @@ -871,12 +1105,14 @@ reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than t | `operator` | `address` | - | | `amount` | `uint256` | - | +
+ ### LSP7AmountExceedsBalance -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp7amountexceedsbalance) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)` - Error hash: `0x08d47949` @@ -900,12 +1136,14 @@ reverts when sending an `amount` of tokens larger than the current `balance` of | `tokenOwner` | `address` | - | | `amount` | `uint256` | - | +
+ ### LSP7CannotSendToSelf -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp7cannotsendtoself) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendtoself) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7CannotSendToSelf()` - Error hash: `0xb9afb000` @@ -917,12 +1155,14 @@ error LSP7CannotSendToSelf(); reverts when specifying the same address for `from` or `to` in a token transfer. +
+ ### LSP7CannotSendWithAddressZero -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp7cannotsendwithaddresszero) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7CannotSendWithAddressZero()` - Error hash: `0xd2d5ec30` @@ -940,12 +1180,14 @@ reverts when trying to: - transfer tokens from or to the zero address. +
+ ### LSP7CannotUseAddressZeroAsOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp7cannotuseaddresszeroasoperator) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7CannotUseAddressZeroAsOperator()` - Error hash: `0x6355e766` @@ -957,12 +1199,14 @@ error LSP7CannotUseAddressZeroAsOperator(); reverts when trying to set the zero address as an operator. +
+ ### LSP7CappedSupplyCannotMintOverCap -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp7cappedsupplycannotmintovercap) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cappedsupplycannotmintovercap) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7CappedSupplyCannotMintOverCap()` - Error hash: `0xeacbf0d1` @@ -976,12 +1220,14 @@ _Cannot mint anymore as total supply reached the maximum cap._ Reverts when trying to mint tokens but the [`totalSupply`](#totalsupply) has reached the maximum [`tokenSupplyCap`](#tokensupplycap). +
+ ### LSP7CappedSupplyRequired -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp7cappedsupplyrequired) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cappedsupplyrequired) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7CappedSupplyRequired()` - Error hash: `0xacf1d8c5` @@ -995,12 +1241,14 @@ _The `tokenSupplyCap` must be set and cannot be `0`._ Reverts when setting `0` for the [`tokenSupplyCap`](#tokensupplycap). The max token supply MUST be set to a number greater than 0. +
+ ### LSP7DecreasedAllowanceBelowZero -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp7decreasedallowancebelowzero) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7DecreasedAllowanceBelowZero()` - Error hash: `0x0ef76c35` @@ -1012,12 +1260,14 @@ error LSP7DecreasedAllowanceBelowZero(); Reverts when trying to decrease an operator's allowance to more than its current allowance. +
+ ### LSP7InvalidTransferBatch -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp7invalidtransferbatch) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7InvalidTransferBatch()` - Error hash: `0x263eee8d` @@ -1029,12 +1279,14 @@ error LSP7InvalidTransferBatch(); reverts when the array parameters used in [`transferBatch`](#transferbatch) have different lengths. +
+ ### LSP7NotifyTokenReceiverContractMissingLSP1Interface -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp7notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0xa608fbb6` @@ -1054,12 +1306,14 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP7NotifyTokenReceiverIsEOA -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp7notifytokenreceiveriseoa) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7NotifyTokenReceiverIsEOA(address)` - Error hash: `0x26c247f4` @@ -1077,12 +1331,14 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP7TokenOwnerCannotBeOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CappedSupply.md#lsp7tokenownercannotbeoperator) -- Solidity implementation in [**LSP7CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CappedSupply) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7TokenOwnerCannotBeOperator()` - Error hash: `0xdab75047` @@ -1094,193 +1350,4 @@ error LSP7TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. - - - - - - -[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 -[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 -[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 -[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 -[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 -[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 -[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X -[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y -[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md -[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[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 - - - -[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 - - - -[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership -[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership -[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership - - - -[`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 -[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol -[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 -[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol -[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll -[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol - - - -[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol -[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol -[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol -[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol -[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol -[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so -[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol -[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.md b/docs/contracts/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.md index 14de0eb1bd..4481ef0219 100644 --- a/docs/contracts/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.md +++ b/docs/contracts/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.md @@ -1,21 +1,32 @@ + + + # LSP7CompatibleERC20 -:::info Solidity contract +:::info Standard Specifications + +[`LSP-7-DigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md) + +::: +:::info Solidity implementation -[`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +[`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) ::: LSP7 extension, for compatibility for clients / tools that expect ERC20. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### allowance -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#allowance) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#allowance) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `allowance(address,address)` - Function selector: `0xdd62ed3e` @@ -41,12 +52,14 @@ function allowance( | ---- | :-------: | ----------- | | `0` | `uint256` | - | +
+ ### approve -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#approve) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#approve) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `approve(address,uint256)` - Function selector: `0x095ea7b3` @@ -72,12 +85,14 @@ function approve( | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### authorizeOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#authorizeoperator) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `authorizeOperator(address,uint256)` - Function selector: `0x47980aa3` @@ -105,12 +120,14 @@ Sets an `amount` of tokens that an `operator` has access from the caller's balan | `operator` | `address` | The address to authorize as an operator. | | `amount` | `uint256` | The allowance amount of tokens operator has access to. | +
+ ### authorizedAmountFor -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#authorizedamountfor) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `authorizedAmountFor(address,address)` - Function selector: `0x65aeaa95` @@ -127,23 +144,25 @@ Get the amount of tokens `operator` address has access to from `tokenOwner`. Ope #### Parameters -| Name | Type | Description | -| ------------ | :-------: | -------------------------------------------------------------- | -| `operator` | `address` | The operator's address to query the authorized amount for. | -| `tokenOwner` | `address` | The token owner that `operator` has allowance on. | +| Name | Type | Description | +| ------------ | :-------: | ---------------------------------------------------------- | +| `operator` | `address` | The operator's address to query the authorized amount for. | +| `tokenOwner` | `address` | The token owner that `operator` has allowance on. | #### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------------------------------------------------------------- | -| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. | +| Name | Type | Description | +| ---- | :-------: | --------------------------------------------------------------------------------------- | +| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. | + +
### balanceOf -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#balanceof) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#balanceof) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -167,12 +186,14 @@ Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [ | ---- | :-------: | ------------------------------------------- | | `0` | `uint256` | The amount of tokens owned by `tokenOwner`. | +
+ ### decimals -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#decimals) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decimals) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `decimals()` - Function selector: `0x313ce567` @@ -190,12 +211,14 @@ Returns the number of decimals used to get its user representation. If the asset | ---- | :-----: | ----------------------------------------------------------------------- | | `0` | `uint8` | the number of decimals. If `0` is returned, the asset is non-divisible. | +
+ ### decreaseAllowance -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#decreaseallowance) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `decreaseAllowance(address,uint256)` - Function selector: `0xa457c2d7` @@ -238,17 +261,19 @@ Atomically decreases the allowance granted to `operator` by the caller. This is #### Parameters -| Name | Type | Description | -| ------------------- | :-------: | ---------------------------------------------------------- | -| `operator` | `address` | the operator to decrease allowance for `msg.sender` | -| `substractedAmount` | `uint256` | the amount to decrease by in the operator's allowance. | +| Name | Type | Description | +| ------------------- | :-------: | ------------------------------------------------------ | +| `operator` | `address` | the operator to decrease allowance for `msg.sender` | +| `substractedAmount` | `uint256` | the amount to decrease by in the operator's allowance. | + +
### getData -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#getdata) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdata) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -258,28 +283,28 @@ Atomically decreases the allowance granted to `operator` by the caller. This is function getData(bytes32 dataKey) external view returns (bytes dataValue); ``` -_Reading the ERC725Y storage for data key `dataKey` returned the following value: `dataValue`._ - -Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`. +_Gets singular data at a given `dataKey`_ #### Parameters -| Name | Type | Description | -| --------- | :-------: | --------------------------------------------- | -| `dataKey` | `bytes32` | The data key for which to retrieve the value. | +| Name | Type | Description | +| --------- | :-------: | ------------------------------- | +| `dataKey` | `bytes32` | The key which value to retrieve | #### Returns -| Name | Type | Description | -| ----------- | :-----: | ---------------------------------------------------- | -| `dataValue` | `bytes` | The bytes value stored under the specified data key. | +| Name | Type | Description | +| ----------- | :-----: | -------------------------- | +| `dataValue` | `bytes` | The data stored at the key | + +
### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#getdatabatch) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -291,9 +316,7 @@ function getDataBatch( ) external view returns (bytes[] dataValues); ``` -_Reading the ERC725Y storage for data keys `dataKeys` returned the following values: `dataValues`._ - -Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`. +_Gets array of data for multiple given keys_ #### Parameters @@ -307,12 +330,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### increaseAllowance -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#increaseallowance) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `increaseAllowance(address,uint256)` - Function selector: `0x39509351` @@ -354,17 +379,19 @@ Atomically increases the allowance granted to `operator` by the caller. This is #### Parameters -| Name | Type | Description | -| ------------- | :-------: | --------------------------------------------------------------------------- | -| `operator` | `address` | the operator to increase the allowance for `msg.sender` | -| `addedAmount` | `uint256` | the additional amount to add on top of the current operator's allowance | +| Name | Type | Description | +| ------------- | :-------: | ----------------------------------------------------------------------- | +| `operator` | `address` | the operator to increase the allowance for `msg.sender` | +| `addedAmount` | `uint256` | the additional amount to add on top of the current operator's allowance | + +
### name -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#name) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#name) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `name()` - Function selector: `0x06fdde03` @@ -382,12 +409,14 @@ Returns the name of the token. | ---- | :------: | --------------------- | | `0` | `string` | The name of the token | +
+ ### owner -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#owner) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#owner) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -405,12 +434,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#renounceownership) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#renounceownership) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -422,12 +453,14 @@ 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 +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#revokeoperator) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `revokeOperator(address)` - Function selector: `0xfad8b32a` @@ -445,108 +478,68 @@ Removes the `operator` address as an operator of callers tokens, disallowing it | ---------- | :-------: | ------------------------------------- | | `operator` | `address` | The address to revoke as an operator. | +
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#setdata) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdata) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setData(bytes32 dataKey, bytes dataValue) external payable; ``` -_Setting the following data key value pair in the ERC725Y storage. Data key: `dataKey`, data value: `dataValue`. _ - -Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner). - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event. - -
+_Sets singular data for a given `dataKey`_ #### Parameters -| Name | Type | Description | -| ----------- | :-------: | ------------------------------------------ | -| `dataKey` | `bytes32` | The data key for which to set a new value. | -| `dataValue` | `bytes` | The new bytes value to set. | +| 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 +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#setdatabatch) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; ``` -_Setting the following data key value pairs in the ERC725Y storage. Data keys: `dataKeys`, data values: `dataValues`. _ +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 -Batch data setting function that behaves the same as [`setData`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner) of the contract. - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event **for each data key/value pair set**. - -
+0. Emits a [`DataChanged`](#datachanged) event. #### Parameters -| Name | Type | Description | -| ------------ | :---------: | ---------------------------------------------------- | -| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. | -| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +| 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 +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#supportsinterface) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -570,12 +563,14 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### symbol -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#symbol) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#symbol) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `symbol()` - Function selector: `0x95d89b41` @@ -593,12 +588,14 @@ Returns the symbol of the token, usually a shorter version of the name. | ---- | :------: | ----------------------- | | `0` | `string` | The symbol of the token | +
+ ### totalSupply -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#totalsupply) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#totalsupply) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -616,12 +613,14 @@ Returns the number of existing tokens that have been minted in this contract. | ---- | :-------: | ------------------------------ | | `0` | `uint256` | The number of existing tokens. | +
+ ### transfer -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#transfer) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `transfer(address,address,uint256,bool,bytes)` - Function selector: `0x760d9bba` @@ -649,12 +648,14 @@ Transfers an `amount` of tokens from the `from` address to the `to` address and | `allowNonLSP1Recipient` | `bool` | When set to `true`, the `to` address CAN be any address. 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. | +
+ ### transfer -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#transfer) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `transfer(address,uint256)` - Function selector: `0xa9059cbb` @@ -686,12 +687,14 @@ function transfer( | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### transferBatch -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#transferbatch) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferbatch) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])` - Function selector: `0x2d7667c9` @@ -715,16 +718,18 @@ Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the | ----------------------- | :---------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `from` | `address[]` | An array of sending addresses. | | `to` | `address[]` | An array of receiving addresses. | -| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. | +| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. | | `allowNonLSP1Recipient` | `bool[]` | For each transfer, when set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. | | `data` | `bytes[]` | An array of additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | +
+ ### transferFrom -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#transferfrom) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferfrom) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `transferFrom(address,address,uint256)` - Function selector: `0x23b872dd` @@ -758,12 +763,14 @@ function transferFrom( | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### transferOwnership -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#transferownership) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferownership) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -781,18 +788,178 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | ---- +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 key, bytes value) internal nonpayable; +``` + +
+ +### \_updateOperator + +```solidity +function _updateOperator( + address tokenOwner, + address operator, + uint256 amount +) internal nonpayable; +``` + +
+ +### \_mint + +```solidity +function _mint( + address to, + uint256 amount, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +
+ +### \_burn + +```solidity +function _burn(address from, uint256 amount, bytes data) internal nonpayable; +``` + +
+ +### \_transfer + +```solidity +function _transfer( + address from, + address to, + uint256 amount, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +
+ +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer( + address from, + address to, + uint256 amount +) internal nonpayable; +``` + +Hook that is called before any token transfer, including minting and burning. +Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function. + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------- | +| `from` | `address` | The sender address | +| `to` | `address` | The recipient address | +| `amount` | `uint256` | The amount of token to transfer | + +
+ +### \_notifyTokenSender + +```solidity +function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; +``` + +Attempt to notify the token sender `from` about the `amount` of tokens being transferred. +This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSSENDER` as typeId, if `from` is a contract that supports the LSP1 interface. +If `from` is an EOA or a contract that does not support the LSP1 interface, nothing will happen and no notification will be sent. + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | -------------------------------------------------------------------------- | +| `from` | `address` | The address to call the {universalReceiver} function on. | +| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. | + +
+ +### \_notifyTokenReceiver + +```solidity +function _notifyTokenReceiver( + address to, + bool allowNonLSP1Recipient, + bytes lsp1Data +) internal nonpayable; +``` + +Attempt to notify the token receiver `to` about the `amount` tokens being received. +This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSRECIPIENT` as typeId, if `to` is a contract that supports the LSP1 interface. +If `to` is is an EOA or a contract that does not support the LSP1 interface, the behaviour will depend on the `allowNonLSP1Recipient` boolean flag. + +- if `allowNonLSP1Recipient` is set to `true`, nothing will happen and no notification will be sent. + +- if `allowNonLSP1Recipient` is set to `false, the transaction will revert. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | --------------------------------------------------------------------------------------------------- | +| `to` | `address` | The address to call the {universalReceiver} function on. | +| `allowNonLSP1Recipient` | `bool` | a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | +| `lsp1Data` | `bytes` | the data to be sent to the `to` address in the `universalReceiver(...)` call. | + +
## Events ### Approval -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#approval) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#approval) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Event signature: `Approval(address,address,uint256)` -- Event hash: `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` +- Event topic hash: `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` ::: @@ -800,24 +967,26 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c event Approval(address indexed owner, address indexed spender, uint256 value); ``` -ERC20 `Approval` event emitted when `owner` enables `spender` for `value` tokens. To provide compatibility with indexing ERC20 events. +ERC721 `Approval` event emitted when `owner` enables `operator` for `tokenId`. To provide compatibility with indexing ERC721 events. #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | --------------------------------------------------------- | -| `owner` **`indexed`** | `address` | The account giving approval | -| `spender` **`indexed`** | `address` | The account receiving approval | -| `value` | `uint256` | The amount of tokens `spender` has access to from `owner` | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------ | +| `owner` **`indexed`** | `address` | The address of the owner of the `tokenId`. | +| `spender` **`indexed`** | `address` | - | +| `value` | `uint256` | - | + +
### AuthorizedOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#authorizedoperator) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedoperator) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Event signature: `AuthorizedOperator(address,address,uint256)` -- Event hash: `0xd66aff874162a96578e919097b6f6d153dfd89a5cec41bb331fdb0c4aec16e2c` +- Event topic hash: `0xd66aff874162a96578e919097b6f6d153dfd89a5cec41bb331fdb0c4aec16e2c` ::: @@ -825,24 +994,26 @@ ERC20 `Approval` event emitted when `owner` enables `spender` for `value` tokens event AuthorizedOperator(address indexed operator, address indexed tokenOwner, uint256 indexed amount); ``` -Emitted when `tokenOwner` enables `operator` for `amount` tokens. +Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`. #### Parameters | Name | Type | Description | | -------------------------- | :-------: | ----------------------------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address authorized as an operator | -| `tokenOwner` **`indexed`** | `address` | The token owner | +| `operator` **`indexed`** | `address` | The address authorized as an operator. | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | | `amount` **`indexed`** | `uint256` | The amount of tokens `operator` address has access to from `tokenOwner` | +
+ ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#datachanged) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#datachanged) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -850,25 +1021,25 @@ Emitted when `tokenOwner` enables `operator` for `amount` tokens. event DataChanged(bytes32 indexed dataKey, bytes dataValue); ``` -_The following data key/value pair has been changed in the ERC725Y storage: Data key: `dataKey`, data value: `dataValue`._ - -Emitted when data at a specific `dataKey` was changed to a new value `dataValue`. +_Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | -------------------------------------------- | -| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | -| `dataValue` | `bytes` | The value to set for the given data key. | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#ownershiptransferred) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -883,14 +1054,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | +
+ ### RevokedOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#revokedoperator) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokedoperator) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Event signature: `RevokedOperator(address,address)` -- Event hash: `0x50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa1` +- Event topic hash: `0x50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa1` ::: @@ -898,23 +1071,25 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn event RevokedOperator(address indexed operator, address indexed tokenOwner); ``` -Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [`authorizedAmountFor(...)`](#`authorizedamountfor) to `0`. +Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on its behalf. #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ---------------------------------- | -| `operator` **`indexed`** | `address` | The address revoked from operating | -| `tokenOwner` **`indexed`** | `address` | The token owner | +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address revoked from the operator array ({getOperatorsOf}). | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | + +
### Transfer -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#transfer) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Event signature: `Transfer(address,address,address,uint256,bool,bytes)` -- Event hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` +- Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` ::: @@ -922,29 +1097,29 @@ Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [` event Transfer(address indexed operator, address indexed from, address indexed to, uint256 amount, bool allowNonLSP1Recipient, bytes data); ``` -Emitted when the `from` transferred successfully `amount` of tokens to `to`. +Emitted when `tokenId` token is transferred from the `from` to the `to` address. #### Parameters -| Name | Type | Description | -| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address of the operator that executed the transfer. | -| `from` **`indexed`** | `address` | The address which tokens were sent from (balance decreased by `-amount`). | -| `to` **`indexed`** | `address` | The address that received the tokens (balance increased by `+amount`). | -| `amount` | `uint256` | The amount of tokens transferred. | -| `allowNonLSP1Recipient` | `bool` | if the transferred enforced the `to` recipient address to be a contract that implements the LSP1 standard or not. | -| `data` | `bytes` | Any additional data included by the caller during the transfer, and sent in the LSP1 hooks to the `from` and `to` addresses. | +| Name | Type | Description | +| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address of operator that sent the `tokenId` | +| `from` **`indexed`** | `address` | The previous owner of the `tokenId` | +| `to` **`indexed`** | `address` | The new owner of `tokenId` | +| `amount` | `uint256` | The amount of tokens transferred. | +| `allowNonLSP1Recipient` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. | +| `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. | ---- +
## Errors ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -954,14 +1129,16 @@ Emitted when the `from` transferred successfully `amount` of tokens to `to`. error ERC725Y_DataKeysValuesEmptyArray(); ``` -Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array. +reverts when one of the array parameter provided to `setDataBatch` is an empty array + +
### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -971,14 +1148,16 @@ Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabat error ERC725Y_DataKeysValuesLengthMismatch(); ``` -Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. +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 +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -988,14 +1167,16 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat error ERC725Y_MsgValueDisallowed(); ``` -Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function. +reverts when sending value to the `setData(..)` functions + +
### LSP4TokenNameNotEditable -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#lsp4tokennamenoteditable) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -1007,12 +1188,14 @@ 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 +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#lsp4tokensymbolnoteditable) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -1024,12 +1207,14 @@ 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. +
+ ### LSP7AmountExceedsAuthorizedAmount -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#lsp7amountexceedsauthorizedamount) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)` - Error hash: `0xf3a6b691` @@ -1055,12 +1240,14 @@ reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than t | `operator` | `address` | - | | `amount` | `uint256` | - | +
+ ### LSP7AmountExceedsBalance -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#lsp7amountexceedsbalance) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)` - Error hash: `0x08d47949` @@ -1084,12 +1271,14 @@ reverts when sending an `amount` of tokens larger than the current `balance` of | `tokenOwner` | `address` | - | | `amount` | `uint256` | - | +
+ ### LSP7CannotSendToSelf -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#lsp7cannotsendtoself) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendtoself) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `LSP7CannotSendToSelf()` - Error hash: `0xb9afb000` @@ -1101,12 +1290,14 @@ error LSP7CannotSendToSelf(); reverts when specifying the same address for `from` or `to` in a token transfer. +
+ ### LSP7CannotSendWithAddressZero -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#lsp7cannotsendwithaddresszero) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `LSP7CannotSendWithAddressZero()` - Error hash: `0xd2d5ec30` @@ -1124,12 +1315,14 @@ reverts when trying to: - transfer tokens from or to the zero address. +
+ ### LSP7CannotUseAddressZeroAsOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#lsp7cannotuseaddresszeroasoperator) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `LSP7CannotUseAddressZeroAsOperator()` - Error hash: `0x6355e766` @@ -1141,12 +1334,14 @@ error LSP7CannotUseAddressZeroAsOperator(); reverts when trying to set the zero address as an operator. +
+ ### LSP7DecreasedAllowanceBelowZero -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#lsp7decreasedallowancebelowzero) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `LSP7DecreasedAllowanceBelowZero()` - Error hash: `0x0ef76c35` @@ -1158,12 +1353,14 @@ error LSP7DecreasedAllowanceBelowZero(); Reverts when trying to decrease an operator's allowance to more than its current allowance. +
+ ### LSP7InvalidTransferBatch -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#lsp7invalidtransferbatch) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `LSP7InvalidTransferBatch()` - Error hash: `0x263eee8d` @@ -1175,12 +1372,14 @@ error LSP7InvalidTransferBatch(); reverts when the array parameters used in [`transferBatch`](#transferbatch) have different lengths. +
+ ### LSP7NotifyTokenReceiverContractMissingLSP1Interface -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#lsp7notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0xa608fbb6` @@ -1200,12 +1399,14 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP7NotifyTokenReceiverIsEOA -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#lsp7notifytokenreceiveriseoa) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `LSP7NotifyTokenReceiverIsEOA(address)` - Error hash: `0x26c247f4` @@ -1223,12 +1424,14 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP7TokenOwnerCannotBeOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20.md#lsp7tokenownercannotbeoperator) -- Solidity implementation in [**LSP7CompatibleERC20**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) - Error signature: `LSP7TokenOwnerCannotBeOperator()` - Error hash: `0xdab75047` @@ -1240,193 +1443,4 @@ error LSP7TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. - - - - - - -[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 -[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 -[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 -[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 -[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 -[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 -[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X -[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y -[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md -[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[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 - - - -[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 - - - -[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership -[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership -[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership - - - -[`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 -[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol -[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 -[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol -[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll -[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol - - - -[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol -[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol -[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol -[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol -[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol -[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so -[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol -[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.md b/docs/contracts/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.md index ef8cc37d5b..da6a4cf19b 100644 --- a/docs/contracts/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.md +++ b/docs/contracts/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.md @@ -1,21 +1,32 @@ + + + # LSP7CompatibleERC20Mintable -:::info Solidity contract +:::info Standard Specifications + +[`LSP-7-DigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md) + +::: +:::info Solidity implementation -[`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +[`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) ::: > LSP7CompatibleERC20 deployable preset contract with a public {mint} function callable only by the contract {owner}. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### constructor -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#constructor) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#constructor) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) ::: @@ -23,7 +34,7 @@ constructor(string name_, string symbol_, address newOwner_); ``` -_Deploying a `LSP7CompatibleERC20Mintable` token contract with: token name = `name\_`, token symbol = `symbol\_`, and address `newOwner\_` as the token contract owner._ +_Deploying a `LSP7CompatibleERC20Mintable` token contract with: token name = `name_`, token symbol = `symbol_`, and address `newOwner_` as the token contract owner._ #### Parameters @@ -33,12 +44,14 @@ _Deploying a `LSP7CompatibleERC20Mintable` token contract with: token name = `na | `symbol_` | `string` | The symbol of the token. | | `newOwner_` | `address` | The owner of the token contract. | +
+ ### allowance -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#allowance) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#allowance) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `allowance(address,address)` - Function selector: `0xdd62ed3e` @@ -64,12 +77,14 @@ function allowance( | ---- | :-------: | ----------- | | `0` | `uint256` | - | +
+ ### approve -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#approve) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#approve) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `approve(address,uint256)` - Function selector: `0x095ea7b3` @@ -95,12 +110,14 @@ function approve( | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### authorizeOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#authorizeoperator) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `authorizeOperator(address,uint256)` - Function selector: `0x47980aa3` @@ -128,12 +145,14 @@ Sets an `amount` of tokens that an `operator` has access from the caller's balan | `operator` | `address` | The address to authorize as an operator. | | `amount` | `uint256` | The allowance amount of tokens operator has access to. | +
+ ### authorizedAmountFor -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#authorizedamountfor) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `authorizedAmountFor(address,address)` - Function selector: `0x65aeaa95` @@ -150,23 +169,25 @@ Get the amount of tokens `operator` address has access to from `tokenOwner`. Ope #### Parameters -| Name | Type | Description | -| ------------ | :-------: | -------------------------------------------------------------- | -| `operator` | `address` | The operator's address to query the authorized amount for. | -| `tokenOwner` | `address` | The token owner that `operator` has allowance on. | +| Name | Type | Description | +| ------------ | :-------: | ---------------------------------------------------------- | +| `operator` | `address` | The operator's address to query the authorized amount for. | +| `tokenOwner` | `address` | The token owner that `operator` has allowance on. | #### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------------------------------------------------------------- | -| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. | +| Name | Type | Description | +| ---- | :-------: | --------------------------------------------------------------------------------------- | +| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. | + +
### balanceOf -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#balanceof) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#balanceof) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -190,12 +211,14 @@ Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [ | ---- | :-------: | ------------------------------------------- | | `0` | `uint256` | The amount of tokens owned by `tokenOwner`. | +
+ ### decimals -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#decimals) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decimals) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `decimals()` - Function selector: `0x313ce567` @@ -213,12 +236,14 @@ Returns the number of decimals used to get its user representation. If the asset | ---- | :-----: | ----------------------------------------------------------------------- | | `0` | `uint8` | the number of decimals. If `0` is returned, the asset is non-divisible. | +
+ ### decreaseAllowance -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#decreaseallowance) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `decreaseAllowance(address,uint256)` - Function selector: `0xa457c2d7` @@ -261,17 +286,19 @@ Atomically decreases the allowance granted to `operator` by the caller. This is #### Parameters -| Name | Type | Description | -| ------------------- | :-------: | ---------------------------------------------------------- | -| `operator` | `address` | the operator to decrease allowance for `msg.sender` | -| `substractedAmount` | `uint256` | the amount to decrease by in the operator's allowance. | +| Name | Type | Description | +| ------------------- | :-------: | ------------------------------------------------------ | +| `operator` | `address` | the operator to decrease allowance for `msg.sender` | +| `substractedAmount` | `uint256` | the amount to decrease by in the operator's allowance. | + +
### getData -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#getdata) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdata) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -281,28 +308,28 @@ Atomically decreases the allowance granted to `operator` by the caller. This is function getData(bytes32 dataKey) external view returns (bytes dataValue); ``` -_Reading the ERC725Y storage for data key `dataKey` returned the following value: `dataValue`._ - -Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`. +_Gets singular data at a given `dataKey`_ #### Parameters -| Name | Type | Description | -| --------- | :-------: | --------------------------------------------- | -| `dataKey` | `bytes32` | The data key for which to retrieve the value. | +| Name | Type | Description | +| --------- | :-------: | ------------------------------- | +| `dataKey` | `bytes32` | The key which value to retrieve | #### Returns -| Name | Type | Description | -| ----------- | :-----: | ---------------------------------------------------- | -| `dataValue` | `bytes` | The bytes value stored under the specified data key. | +| Name | Type | Description | +| ----------- | :-----: | -------------------------- | +| `dataValue` | `bytes` | The data stored at the key | + +
### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#getdatabatch) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -314,9 +341,7 @@ function getDataBatch( ) external view returns (bytes[] dataValues); ``` -_Reading the ERC725Y storage for data keys `dataKeys` returned the following values: `dataValues`._ - -Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`. +_Gets array of data for multiple given keys_ #### Parameters @@ -330,12 +355,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### increaseAllowance -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#increaseallowance) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `increaseAllowance(address,uint256)` - Function selector: `0x39509351` @@ -377,17 +404,19 @@ Atomically increases the allowance granted to `operator` by the caller. This is #### Parameters -| Name | Type | Description | -| ------------- | :-------: | --------------------------------------------------------------------------- | -| `operator` | `address` | the operator to increase the allowance for `msg.sender` | -| `addedAmount` | `uint256` | the additional amount to add on top of the current operator's allowance | +| Name | Type | Description | +| ------------- | :-------: | ----------------------------------------------------------------------- | +| `operator` | `address` | the operator to increase the allowance for `msg.sender` | +| `addedAmount` | `uint256` | the additional amount to add on top of the current operator's allowance | + +
### mint -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#mint) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#mint) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `mint(address,uint256,bool,bytes)` - Function selector: `0x7580d920` @@ -413,12 +442,14 @@ Public [`_mint`](#_mint) function only callable by the [`owner`](#owner). | `allowNonLSP1Recipient` | `bool` | - | | `data` | `bytes` | - | +
+ ### name -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#name) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#name) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `name()` - Function selector: `0x06fdde03` @@ -436,12 +467,14 @@ Returns the name of the token. | ---- | :------: | --------------------- | | `0` | `string` | The name of the token | +
+ ### owner -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#owner) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#owner) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -459,12 +492,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#renounceownership) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#renounceownership) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -476,12 +511,14 @@ 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 +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#revokeoperator) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `revokeOperator(address)` - Function selector: `0xfad8b32a` @@ -499,108 +536,68 @@ Removes the `operator` address as an operator of callers tokens, disallowing it | ---------- | :-------: | ------------------------------------- | | `operator` | `address` | The address to revoke as an operator. | +
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#setdata) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdata) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setData(bytes32 dataKey, bytes dataValue) external payable; ``` -_Setting the following data key value pair in the ERC725Y storage. Data key: `dataKey`, data value: `dataValue`. _ - -Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner). - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event. - -
+_Sets singular data for a given `dataKey`_ #### Parameters -| Name | Type | Description | -| ----------- | :-------: | ------------------------------------------ | -| `dataKey` | `bytes32` | The data key for which to set a new value. | -| `dataValue` | `bytes` | The new bytes value to set. | +| 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 +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#setdatabatch) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; ``` -_Setting the following data key value pairs in the ERC725Y storage. Data keys: `dataKeys`, data values: `dataValues`. _ - -Batch data setting function that behaves the same as [`setData`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner) of the contract. - -
+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 -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event **for each data key/value pair set**. - -
+0. Emits a [`DataChanged`](#datachanged) event. #### Parameters -| Name | Type | Description | -| ------------ | :---------: | ---------------------------------------------------- | -| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. | -| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +| 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 +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#supportsinterface) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -624,12 +621,14 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### symbol -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#symbol) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#symbol) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `symbol()` - Function selector: `0x95d89b41` @@ -647,12 +646,14 @@ Returns the symbol of the token, usually a shorter version of the name. | ---- | :------: | ----------------------- | | `0` | `string` | The symbol of the token | +
+ ### totalSupply -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#totalsupply) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#totalsupply) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -670,12 +671,14 @@ Returns the number of existing tokens that have been minted in this contract. | ---- | :-------: | ------------------------------ | | `0` | `uint256` | The number of existing tokens. | +
+ ### transfer -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#transfer) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `transfer(address,address,uint256,bool,bytes)` - Function selector: `0x760d9bba` @@ -703,12 +706,14 @@ Transfers an `amount` of tokens from the `from` address to the `to` address and | `allowNonLSP1Recipient` | `bool` | When set to `true`, the `to` address CAN be any address. 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. | +
+ ### transfer -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#transfer) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `transfer(address,uint256)` - Function selector: `0xa9059cbb` @@ -740,12 +745,14 @@ function transfer( | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### transferBatch -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#transferbatch) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferbatch) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])` - Function selector: `0x2d7667c9` @@ -769,16 +776,18 @@ Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the | ----------------------- | :---------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `from` | `address[]` | An array of sending addresses. | | `to` | `address[]` | An array of receiving addresses. | -| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. | +| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. | | `allowNonLSP1Recipient` | `bool[]` | For each transfer, when set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. | | `data` | `bytes[]` | An array of additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | +
+ ### transferFrom -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#transferfrom) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferfrom) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `transferFrom(address,address,uint256)` - Function selector: `0x23b872dd` @@ -812,12 +821,14 @@ function transferFrom( | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### transferOwnership -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#transferownership) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferownership) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -835,18 +846,178 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | ---- +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 key, bytes value) internal nonpayable; +``` + +
+ +### \_updateOperator + +```solidity +function _updateOperator( + address tokenOwner, + address operator, + uint256 amount +) internal nonpayable; +``` + +
+ +### \_mint + +```solidity +function _mint( + address to, + uint256 amount, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +
+ +### \_burn + +```solidity +function _burn(address from, uint256 amount, bytes data) internal nonpayable; +``` + +
+ +### \_transfer + +```solidity +function _transfer( + address from, + address to, + uint256 amount, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +
+ +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer( + address from, + address to, + uint256 amount +) internal nonpayable; +``` + +Hook that is called before any token transfer, including minting and burning. +Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function. + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------- | +| `from` | `address` | The sender address | +| `to` | `address` | The recipient address | +| `amount` | `uint256` | The amount of token to transfer | + +
+ +### \_notifyTokenSender + +```solidity +function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; +``` + +Attempt to notify the token sender `from` about the `amount` of tokens being transferred. +This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSSENDER` as typeId, if `from` is a contract that supports the LSP1 interface. +If `from` is an EOA or a contract that does not support the LSP1 interface, nothing will happen and no notification will be sent. + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | -------------------------------------------------------------------------- | +| `from` | `address` | The address to call the {universalReceiver} function on. | +| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. | + +
+ +### \_notifyTokenReceiver + +```solidity +function _notifyTokenReceiver( + address to, + bool allowNonLSP1Recipient, + bytes lsp1Data +) internal nonpayable; +``` + +Attempt to notify the token receiver `to` about the `amount` tokens being received. +This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSRECIPIENT` as typeId, if `to` is a contract that supports the LSP1 interface. +If `to` is is an EOA or a contract that does not support the LSP1 interface, the behaviour will depend on the `allowNonLSP1Recipient` boolean flag. + +- if `allowNonLSP1Recipient` is set to `true`, nothing will happen and no notification will be sent. + +- if `allowNonLSP1Recipient` is set to `false, the transaction will revert. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | --------------------------------------------------------------------------------------------------- | +| `to` | `address` | The address to call the {universalReceiver} function on. | +| `allowNonLSP1Recipient` | `bool` | a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | +| `lsp1Data` | `bytes` | the data to be sent to the `to` address in the `universalReceiver(...)` call. | + +
## Events ### Approval -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#approval) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#approval) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Event signature: `Approval(address,address,uint256)` -- Event hash: `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` +- Event topic hash: `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` ::: @@ -854,24 +1025,26 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c event Approval(address indexed owner, address indexed spender, uint256 value); ``` -ERC20 `Approval` event emitted when `owner` enables `spender` for `value` tokens. To provide compatibility with indexing ERC20 events. +ERC721 `Approval` event emitted when `owner` enables `operator` for `tokenId`. To provide compatibility with indexing ERC721 events. #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | --------------------------------------------------------- | -| `owner` **`indexed`** | `address` | The account giving approval | -| `spender` **`indexed`** | `address` | The account receiving approval | -| `value` | `uint256` | The amount of tokens `spender` has access to from `owner` | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------ | +| `owner` **`indexed`** | `address` | The address of the owner of the `tokenId`. | +| `spender` **`indexed`** | `address` | - | +| `value` | `uint256` | - | + +
### AuthorizedOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#authorizedoperator) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedoperator) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Event signature: `AuthorizedOperator(address,address,uint256)` -- Event hash: `0xd66aff874162a96578e919097b6f6d153dfd89a5cec41bb331fdb0c4aec16e2c` +- Event topic hash: `0xd66aff874162a96578e919097b6f6d153dfd89a5cec41bb331fdb0c4aec16e2c` ::: @@ -879,24 +1052,26 @@ ERC20 `Approval` event emitted when `owner` enables `spender` for `value` tokens event AuthorizedOperator(address indexed operator, address indexed tokenOwner, uint256 indexed amount); ``` -Emitted when `tokenOwner` enables `operator` for `amount` tokens. +Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`. #### Parameters | Name | Type | Description | | -------------------------- | :-------: | ----------------------------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address authorized as an operator | -| `tokenOwner` **`indexed`** | `address` | The token owner | +| `operator` **`indexed`** | `address` | The address authorized as an operator. | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | | `amount` **`indexed`** | `uint256` | The amount of tokens `operator` address has access to from `tokenOwner` | +
+ ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#datachanged) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#datachanged) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -904,25 +1079,25 @@ Emitted when `tokenOwner` enables `operator` for `amount` tokens. event DataChanged(bytes32 indexed dataKey, bytes dataValue); ``` -_The following data key/value pair has been changed in the ERC725Y storage: Data key: `dataKey`, data value: `dataValue`._ - -Emitted when data at a specific `dataKey` was changed to a new value `dataValue`. +_Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | -------------------------------------------- | -| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | -| `dataValue` | `bytes` | The value to set for the given data key. | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#ownershiptransferred) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -937,14 +1112,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | +
+ ### RevokedOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#revokedoperator) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokedoperator) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Event signature: `RevokedOperator(address,address)` -- Event hash: `0x50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa1` +- Event topic hash: `0x50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa1` ::: @@ -952,23 +1129,25 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn event RevokedOperator(address indexed operator, address indexed tokenOwner); ``` -Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [`authorizedAmountFor(...)`](#`authorizedamountfor) to `0`. +Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on its behalf. #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ---------------------------------- | -| `operator` **`indexed`** | `address` | The address revoked from operating | -| `tokenOwner` **`indexed`** | `address` | The token owner | +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address revoked from the operator array ({getOperatorsOf}). | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | + +
### Transfer -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#transfer) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Event signature: `Transfer(address,address,address,uint256,bool,bytes)` -- Event hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` +- Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` ::: @@ -976,29 +1155,29 @@ Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [` event Transfer(address indexed operator, address indexed from, address indexed to, uint256 amount, bool allowNonLSP1Recipient, bytes data); ``` -Emitted when the `from` transferred successfully `amount` of tokens to `to`. +Emitted when `tokenId` token is transferred from the `from` to the `to` address. #### Parameters -| Name | Type | Description | -| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address of the operator that executed the transfer. | -| `from` **`indexed`** | `address` | The address which tokens were sent from (balance decreased by `-amount`). | -| `to` **`indexed`** | `address` | The address that received the tokens (balance increased by `+amount`). | -| `amount` | `uint256` | The amount of tokens transferred. | -| `allowNonLSP1Recipient` | `bool` | if the transferred enforced the `to` recipient address to be a contract that implements the LSP1 standard or not. | -| `data` | `bytes` | Any additional data included by the caller during the transfer, and sent in the LSP1 hooks to the `from` and `to` addresses. | +| Name | Type | Description | +| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address of operator that sent the `tokenId` | +| `from` **`indexed`** | `address` | The previous owner of the `tokenId` | +| `to` **`indexed`** | `address` | The new owner of `tokenId` | +| `amount` | `uint256` | The amount of tokens transferred. | +| `allowNonLSP1Recipient` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. | +| `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. | ---- +
## Errors ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -1008,14 +1187,16 @@ Emitted when the `from` transferred successfully `amount` of tokens to `to`. error ERC725Y_DataKeysValuesEmptyArray(); ``` -Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array. +reverts when one of the array parameter provided to `setDataBatch` is an empty array + +
### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -1025,14 +1206,16 @@ Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabat error ERC725Y_DataKeysValuesLengthMismatch(); ``` -Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. +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 +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -1042,14 +1225,16 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat error ERC725Y_MsgValueDisallowed(); ``` -Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function. +reverts when sending value to the `setData(..)` functions + +
### LSP4TokenNameNotEditable -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#lsp4tokennamenoteditable) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -1061,12 +1246,14 @@ 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 +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#lsp4tokensymbolnoteditable) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -1078,12 +1265,14 @@ 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. +
+ ### LSP7AmountExceedsAuthorizedAmount -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#lsp7amountexceedsauthorizedamount) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)` - Error hash: `0xf3a6b691` @@ -1109,12 +1298,14 @@ reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than t | `operator` | `address` | - | | `amount` | `uint256` | - | +
+ ### LSP7AmountExceedsBalance -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#lsp7amountexceedsbalance) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)` - Error hash: `0x08d47949` @@ -1138,12 +1329,14 @@ reverts when sending an `amount` of tokens larger than the current `balance` of | `tokenOwner` | `address` | - | | `amount` | `uint256` | - | +
+ ### LSP7CannotSendToSelf -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#lsp7cannotsendtoself) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendtoself) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `LSP7CannotSendToSelf()` - Error hash: `0xb9afb000` @@ -1155,12 +1348,14 @@ error LSP7CannotSendToSelf(); reverts when specifying the same address for `from` or `to` in a token transfer. +
+ ### LSP7CannotSendWithAddressZero -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#lsp7cannotsendwithaddresszero) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `LSP7CannotSendWithAddressZero()` - Error hash: `0xd2d5ec30` @@ -1178,12 +1373,14 @@ reverts when trying to: - transfer tokens from or to the zero address. +
+ ### LSP7CannotUseAddressZeroAsOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#lsp7cannotuseaddresszeroasoperator) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `LSP7CannotUseAddressZeroAsOperator()` - Error hash: `0x6355e766` @@ -1195,12 +1392,14 @@ error LSP7CannotUseAddressZeroAsOperator(); reverts when trying to set the zero address as an operator. +
+ ### LSP7DecreasedAllowanceBelowZero -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#lsp7decreasedallowancebelowzero) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `LSP7DecreasedAllowanceBelowZero()` - Error hash: `0x0ef76c35` @@ -1212,12 +1411,14 @@ error LSP7DecreasedAllowanceBelowZero(); Reverts when trying to decrease an operator's allowance to more than its current allowance. +
+ ### LSP7InvalidTransferBatch -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#lsp7invalidtransferbatch) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `LSP7InvalidTransferBatch()` - Error hash: `0x263eee8d` @@ -1229,12 +1430,14 @@ error LSP7InvalidTransferBatch(); reverts when the array parameters used in [`transferBatch`](#transferbatch) have different lengths. +
+ ### LSP7NotifyTokenReceiverContractMissingLSP1Interface -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#lsp7notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0xa608fbb6` @@ -1254,12 +1457,14 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP7NotifyTokenReceiverIsEOA -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#lsp7notifytokenreceiveriseoa) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `LSP7NotifyTokenReceiverIsEOA(address)` - Error hash: `0x26c247f4` @@ -1277,12 +1482,14 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP7TokenOwnerCannotBeOperator -:::note Links +:::note References -- Specification details in [**LSP-7-CompatibleERC20Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-CompatibleERC20Mintable.md#lsp7tokenownercannotbeoperator) -- Solidity implementation in [**LSP7CompatibleERC20Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7CompatibleERC20Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) - Error signature: `LSP7TokenOwnerCannotBeOperator()` - Error hash: `0xdab75047` @@ -1294,193 +1501,4 @@ error LSP7TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. - - - - - - -[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 -[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 -[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 -[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 -[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 -[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 -[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X -[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y -[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md -[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[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 - - - -[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 - - - -[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership -[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership -[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership - - - -[`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 -[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol -[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 -[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol -[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll -[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol - - - -[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol -[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol -[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol -[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol -[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol -[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so -[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol -[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md b/docs/contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md index 862e5df091..55493ffa7f 100644 --- a/docs/contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md +++ b/docs/contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md @@ -1,21 +1,32 @@ + + + # LSP7Mintable -:::info Solidity contract +:::info Standard Specifications + +[`LSP-7-DigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md) + +::: +:::info Solidity implementation -[`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +[`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) ::: > LSP7DigitalAsset deployable preset contract with a public {mint} function callable only by the contract {owner}. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### constructor -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#constructor) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#constructor) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) ::: @@ -28,7 +39,7 @@ constructor( ); ``` -_Deploying a `LSP7Mintable` token contract with: token name = `name\_`, token symbol = `symbol\_`, and address `newOwner\_` as the token contract owner._ +_Deploying a `LSP7Mintable` token contract with: token name = `name_`, token symbol = `symbol_`, and address `newOwner_` as the token contract owner._ #### Parameters @@ -39,12 +50,14 @@ _Deploying a `LSP7Mintable` token contract with: token name = `name\_`, token sy | `newOwner_` | `address` | The owner of the token contract. | | `isNonDivisible_` | `bool` | - | +
+ ### authorizeOperator -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#authorizeoperator) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `authorizeOperator(address,uint256)` - Function selector: `0x47980aa3` @@ -72,12 +85,14 @@ Sets an `amount` of tokens that an `operator` has access from the caller's balan | `operator` | `address` | The address to authorize as an operator. | | `amount` | `uint256` | The allowance amount of tokens operator has access to. | +
+ ### authorizedAmountFor -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#authorizedamountfor) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `authorizedAmountFor(address,address)` - Function selector: `0x65aeaa95` @@ -94,23 +109,25 @@ Get the amount of tokens `operator` address has access to from `tokenOwner`. Ope #### Parameters -| Name | Type | Description | -| ------------ | :-------: | -------------------------------------------------------------- | -| `operator` | `address` | The operator's address to query the authorized amount for. | -| `tokenOwner` | `address` | The token owner that `operator` has allowance on. | +| Name | Type | Description | +| ------------ | :-------: | ---------------------------------------------------------- | +| `operator` | `address` | The operator's address to query the authorized amount for. | +| `tokenOwner` | `address` | The token owner that `operator` has allowance on. | #### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------------------------------------------------------------- | -| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. | +| Name | Type | Description | +| ---- | :-------: | --------------------------------------------------------------------------------------- | +| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. | + +
### balanceOf -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#balanceof) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#balanceof) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -134,12 +151,14 @@ Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [ | ---- | :-------: | ------------------------------------------- | | `0` | `uint256` | The amount of tokens owned by `tokenOwner`. | +
+ ### decimals -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#decimals) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decimals) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `decimals()` - Function selector: `0x313ce567` @@ -157,12 +176,14 @@ Returns the number of decimals used to get its user representation. If the asset | ---- | :-----: | ----------------------------------------------------------------------- | | `0` | `uint8` | the number of decimals. If `0` is returned, the asset is non-divisible. | +
+ ### decreaseAllowance -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#decreaseallowance) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `decreaseAllowance(address,uint256)` - Function selector: `0xa457c2d7` @@ -205,17 +226,19 @@ Atomically decreases the allowance granted to `operator` by the caller. This is #### Parameters -| Name | Type | Description | -| ------------------- | :-------: | ---------------------------------------------------------- | -| `operator` | `address` | the operator to decrease allowance for `msg.sender` | -| `substractedAmount` | `uint256` | the amount to decrease by in the operator's allowance. | +| Name | Type | Description | +| ------------------- | :-------: | ------------------------------------------------------ | +| `operator` | `address` | the operator to decrease allowance for `msg.sender` | +| `substractedAmount` | `uint256` | the amount to decrease by in the operator's allowance. | + +
### getData -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#getdata) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdata) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -225,28 +248,28 @@ Atomically decreases the allowance granted to `operator` by the caller. This is function getData(bytes32 dataKey) external view returns (bytes dataValue); ``` -_Reading the ERC725Y storage for data key `dataKey` returned the following value: `dataValue`._ - -Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`. +_Gets singular data at a given `dataKey`_ #### Parameters -| Name | Type | Description | -| --------- | :-------: | --------------------------------------------- | -| `dataKey` | `bytes32` | The data key for which to retrieve the value. | +| Name | Type | Description | +| --------- | :-------: | ------------------------------- | +| `dataKey` | `bytes32` | The key which value to retrieve | #### Returns -| Name | Type | Description | -| ----------- | :-----: | ---------------------------------------------------- | -| `dataValue` | `bytes` | The bytes value stored under the specified data key. | +| Name | Type | Description | +| ----------- | :-----: | -------------------------- | +| `dataValue` | `bytes` | The data stored at the key | + +
### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#getdatabatch) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -258,9 +281,7 @@ function getDataBatch( ) external view returns (bytes[] dataValues); ``` -_Reading the ERC725Y storage for data keys `dataKeys` returned the following values: `dataValues`._ - -Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`. +_Gets array of data for multiple given keys_ #### Parameters @@ -274,12 +295,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### increaseAllowance -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#increaseallowance) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `increaseAllowance(address,uint256)` - Function selector: `0x39509351` @@ -321,17 +344,19 @@ Atomically increases the allowance granted to `operator` by the caller. This is #### Parameters -| Name | Type | Description | -| ------------- | :-------: | --------------------------------------------------------------------------- | -| `operator` | `address` | the operator to increase the allowance for `msg.sender` | -| `addedAmount` | `uint256` | the additional amount to add on top of the current operator's allowance | +| Name | Type | Description | +| ------------- | :-------: | ----------------------------------------------------------------------- | +| `operator` | `address` | the operator to increase the allowance for `msg.sender` | +| `addedAmount` | `uint256` | the additional amount to add on top of the current operator's allowance | + +
### mint -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#mint) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#mint) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `mint(address,uint256,bool,bytes)` - Function selector: `0x7580d920` @@ -357,12 +382,14 @@ Public [`_mint`](#_mint) function only callable by the [`owner`](#owner). | `allowNonLSP1Recipient` | `bool` | - | | `data` | `bytes` | - | +
+ ### owner -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#owner) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#owner) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -380,12 +407,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#renounceownership) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#renounceownership) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -397,12 +426,14 @@ 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 +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#revokeoperator) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `revokeOperator(address)` - Function selector: `0xfad8b32a` @@ -420,108 +451,68 @@ Removes the `operator` address as an operator of callers tokens, disallowing it | ---------- | :-------: | ------------------------------------- | | `operator` | `address` | The address to revoke as an operator. | +
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#setdata) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdata) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setData(bytes32 dataKey, bytes dataValue) external payable; ``` -_Setting the following data key value pair in the ERC725Y storage. Data key: `dataKey`, data value: `dataValue`. _ - -Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner). - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event. - -
+_Sets singular data for a given `dataKey`_ #### Parameters -| Name | Type | Description | -| ----------- | :-------: | ------------------------------------------ | -| `dataKey` | `bytes32` | The data key for which to set a new value. | -| `dataValue` | `bytes` | The new bytes value to set. | +| 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 +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#setdatabatch) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; ``` -_Setting the following data key value pairs in the ERC725Y storage. Data keys: `dataKeys`, data values: `dataValues`. _ - -Batch data setting function that behaves the same as [`setData`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner) of the contract. - -
- -
- -**Emitted events:** +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 -- [`DataChanged`](#datachanged) event **for each data key/value pair set**. - -
+0. Emits a [`DataChanged`](#datachanged) event. #### Parameters -| Name | Type | Description | -| ------------ | :---------: | ---------------------------------------------------- | -| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. | -| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +| 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 +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#supportsinterface) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -545,12 +536,14 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### totalSupply -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#totalsupply) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#totalsupply) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -568,12 +561,14 @@ Returns the number of existing tokens that have been minted in this contract. | ---- | :-------: | ------------------------------ | | `0` | `uint256` | The number of existing tokens. | +
+ ### transfer -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#transfer) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `transfer(address,address,uint256,bool,bytes)` - Function selector: `0x760d9bba` @@ -601,12 +596,14 @@ Transfers an `amount` of tokens from the `from` address to the `to` address and | `allowNonLSP1Recipient` | `bool` | When set to `true`, the `to` address CAN be any address. 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 +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#transferbatch) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferbatch) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])` - Function selector: `0x2d7667c9` @@ -630,16 +627,18 @@ Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the | ----------------------- | :---------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `from` | `address[]` | An array of sending addresses. | | `to` | `address[]` | An array of receiving addresses. | -| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. | +| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. | | `allowNonLSP1Recipient` | `bool[]` | For each transfer, when set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. | | `data` | `bytes[]` | An array of additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | +
+ ### transferOwnership -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#transferownership) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferownership) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -657,18 +656,255 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | ---- +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +Save gas by emitting the [`DataChanged`](#datachanged) event with only the first 256 bytes of dataValue + +
+ +### \_updateOperator + +```solidity +function _updateOperator( + address tokenOwner, + address operator, + uint256 amount +) internal nonpayable; +``` + +Changes token `amount` the `operator` has access to from `tokenOwner` tokens. +If the amount is zero then the operator is being revoked, otherwise the operator amount is being modified. + +
+ +### \_mint + +```solidity +function _mint( + address to, + uint256 amount, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Mints `amount` of tokens and transfers it to `to`. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as `from`. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- | +| `to` | `address` | the address to mint tokens for. | +| `amount` | `uint256` | the amount of tokens to mint. | +| `allowNonLSP1Recipient` | `bool` | a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | +| `data` | `bytes` | Additional data the caller wants included in the emitted {Transfer} event, and sent in the LSP1 hook to the `to` address. | + +
+ +### \_burn + +:::tip Hint + +In dApps, you can know which address is burning tokens by listening for the `Transfer` event and filter with the zero address as `to`. + +::: + +```solidity +function _burn(address from, uint256 amount, bytes data) internal nonpayable; +``` + +Burns (= destroys) `amount` of tokens, decrease the `from` balance. This is done by sending them to the zero address. +Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver) +function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as the `to` address + +
+ +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | the address to burn tokens from its balance. | +| `amount` | `uint256` | the amount of tokens to burn. | +| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. | + +
+ +### \_transfer + +```solidity +function _transfer( + address from, + address to, + uint256 amount, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Transfer tokens from `from` to `to` by decreasing the balance of `from` by `-amount` and increasing the balance +of `to` by `+amount`. +Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver) +function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | the address to decrease the balance. | +| `to` | `address` | the address to increase the balance. | +| `amount` | `uint256` | the amount of tokens to transfer from `from` to `to`. | +| `allowNonLSP1Recipient` | `bool` | a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | +| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. | + +
+ +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer( + address from, + address to, + uint256 amount +) internal nonpayable; +``` + +Hook that is called before any token transfer, including minting and burning. +Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function. + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------- | +| `from` | `address` | The sender address | +| `to` | `address` | The recipient address | +| `amount` | `uint256` | The amount of token to transfer | + +
+ +### \_notifyTokenSender + +```solidity +function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; +``` + +Attempt to notify the token sender `from` about the `amount` of tokens being transferred. +This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSSENDER` as typeId, if `from` is a contract that supports the LSP1 interface. +If `from` is an EOA or a contract that does not support the LSP1 interface, nothing will happen and no notification will be sent. + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | -------------------------------------------------------------------------- | +| `from` | `address` | The address to call the {universalReceiver} function on. | +| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. | + +
+ +### \_notifyTokenReceiver + +```solidity +function _notifyTokenReceiver( + address to, + bool allowNonLSP1Recipient, + bytes lsp1Data +) internal nonpayable; +``` + +Attempt to notify the token receiver `to` about the `amount` tokens being received. +This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSRECIPIENT` as typeId, if `to` is a contract that supports the LSP1 interface. +If `to` is is an EOA or a contract that does not support the LSP1 interface, the behaviour will depend on the `allowNonLSP1Recipient` boolean flag. + +- if `allowNonLSP1Recipient` is set to `true`, nothing will happen and no notification will be sent. + +- if `allowNonLSP1Recipient` is set to `false, the transaction will revert. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | --------------------------------------------------------------------------------------------------- | +| `to` | `address` | The address to call the {universalReceiver} function on. | +| `allowNonLSP1Recipient` | `bool` | a boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | +| `lsp1Data` | `bytes` | the data to be sent to the `to` address in the `universalReceiver(...)` call. | + +
## Events ### AuthorizedOperator -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#authorizedoperator) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedoperator) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Event signature: `AuthorizedOperator(address,address,uint256)` -- Event hash: `0xd66aff874162a96578e919097b6f6d153dfd89a5cec41bb331fdb0c4aec16e2c` +- Event topic hash: `0xd66aff874162a96578e919097b6f6d153dfd89a5cec41bb331fdb0c4aec16e2c` ::: @@ -676,24 +912,26 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c event AuthorizedOperator(address indexed operator, address indexed tokenOwner, uint256 indexed amount); ``` -Emitted when `tokenOwner` enables `operator` for `amount` tokens. +Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`. #### Parameters | Name | Type | Description | | -------------------------- | :-------: | ----------------------------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address authorized as an operator | -| `tokenOwner` **`indexed`** | `address` | The token owner | +| `operator` **`indexed`** | `address` | The address authorized as an operator. | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | | `amount` **`indexed`** | `uint256` | The amount of tokens `operator` address has access to from `tokenOwner` | +
+ ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#datachanged) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#datachanged) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -701,25 +939,25 @@ Emitted when `tokenOwner` enables `operator` for `amount` tokens. event DataChanged(bytes32 indexed dataKey, bytes dataValue); ``` -_The following data key/value pair has been changed in the ERC725Y storage: Data key: `dataKey`, data value: `dataValue`._ - -Emitted when data at a specific `dataKey` was changed to a new value `dataValue`. +_Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | -------------------------------------------- | -| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | -| `dataValue` | `bytes` | The value to set for the given data key. | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#ownershiptransferred) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -734,14 +972,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | +
+ ### RevokedOperator -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#revokedoperator) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokedoperator) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Event signature: `RevokedOperator(address,address)` -- Event hash: `0x50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa1` +- Event topic hash: `0x50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa1` ::: @@ -749,23 +989,25 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn event RevokedOperator(address indexed operator, address indexed tokenOwner); ``` -Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [`authorizedAmountFor(...)`](#`authorizedamountfor) to `0`. +Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on its behalf. #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ---------------------------------- | -| `operator` **`indexed`** | `address` | The address revoked from operating | -| `tokenOwner` **`indexed`** | `address` | The token owner | +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address revoked from the operator array ({getOperatorsOf}). | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | + +
### Transfer -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#transfer) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Event signature: `Transfer(address,address,address,uint256,bool,bytes)` -- Event hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` +- Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` ::: @@ -773,29 +1015,29 @@ Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [` event Transfer(address indexed operator, address indexed from, address indexed to, uint256 amount, bool allowNonLSP1Recipient, bytes data); ``` -Emitted when the `from` transferred successfully `amount` of tokens to `to`. +Emitted when `tokenId` token is transferred from the `from` to the `to` address. #### Parameters -| Name | Type | Description | -| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address of the operator that executed the transfer. | -| `from` **`indexed`** | `address` | The address which tokens were sent from (balance decreased by `-amount`). | -| `to` **`indexed`** | `address` | The address that received the tokens (balance increased by `+amount`). | -| `amount` | `uint256` | The amount of tokens transferred. | -| `allowNonLSP1Recipient` | `bool` | if the transferred enforced the `to` recipient address to be a contract that implements the LSP1 standard or not. | -| `data` | `bytes` | Any additional data included by the caller during the transfer, and sent in the LSP1 hooks to the `from` and `to` addresses. | +| Name | Type | Description | +| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address of operator that sent the `tokenId` | +| `from` **`indexed`** | `address` | The previous owner of the `tokenId` | +| `to` **`indexed`** | `address` | The new owner of `tokenId` | +| `amount` | `uint256` | The amount of tokens transferred. | +| `allowNonLSP1Recipient` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. | +| `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. | ---- +
## Errors ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -805,14 +1047,16 @@ Emitted when the `from` transferred successfully `amount` of tokens to `to`. error ERC725Y_DataKeysValuesEmptyArray(); ``` -Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array. +reverts when one of the array parameter provided to `setDataBatch` is an empty array + +
### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -822,14 +1066,16 @@ Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabat error ERC725Y_DataKeysValuesLengthMismatch(); ``` -Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. +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 +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -839,14 +1085,16 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat error ERC725Y_MsgValueDisallowed(); ``` -Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function. +reverts when sending value to the `setData(..)` functions + +
### LSP4TokenNameNotEditable -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#lsp4tokennamenoteditable) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -858,12 +1106,14 @@ 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 +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#lsp4tokensymbolnoteditable) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -875,12 +1125,14 @@ 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. +
+ ### LSP7AmountExceedsAuthorizedAmount -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#lsp7amountexceedsauthorizedamount) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)` - Error hash: `0xf3a6b691` @@ -906,12 +1158,14 @@ reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than t | `operator` | `address` | - | | `amount` | `uint256` | - | +
+ ### LSP7AmountExceedsBalance -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#lsp7amountexceedsbalance) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)` - Error hash: `0x08d47949` @@ -935,12 +1189,14 @@ reverts when sending an `amount` of tokens larger than the current `balance` of | `tokenOwner` | `address` | - | | `amount` | `uint256` | - | +
+ ### LSP7CannotSendToSelf -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#lsp7cannotsendtoself) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendtoself) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `LSP7CannotSendToSelf()` - Error hash: `0xb9afb000` @@ -952,12 +1208,14 @@ error LSP7CannotSendToSelf(); reverts when specifying the same address for `from` or `to` in a token transfer. +
+ ### LSP7CannotSendWithAddressZero -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#lsp7cannotsendwithaddresszero) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `LSP7CannotSendWithAddressZero()` - Error hash: `0xd2d5ec30` @@ -975,12 +1233,14 @@ reverts when trying to: - transfer tokens from or to the zero address. +
+ ### LSP7CannotUseAddressZeroAsOperator -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#lsp7cannotuseaddresszeroasoperator) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `LSP7CannotUseAddressZeroAsOperator()` - Error hash: `0x6355e766` @@ -992,12 +1252,14 @@ error LSP7CannotUseAddressZeroAsOperator(); reverts when trying to set the zero address as an operator. +
+ ### LSP7DecreasedAllowanceBelowZero -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#lsp7decreasedallowancebelowzero) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `LSP7DecreasedAllowanceBelowZero()` - Error hash: `0x0ef76c35` @@ -1009,12 +1271,14 @@ error LSP7DecreasedAllowanceBelowZero(); Reverts when trying to decrease an operator's allowance to more than its current allowance. +
+ ### LSP7InvalidTransferBatch -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#lsp7invalidtransferbatch) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `LSP7InvalidTransferBatch()` - Error hash: `0x263eee8d` @@ -1026,12 +1290,14 @@ error LSP7InvalidTransferBatch(); reverts when the array parameters used in [`transferBatch`](#transferbatch) have different lengths. +
+ ### LSP7NotifyTokenReceiverContractMissingLSP1Interface -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#lsp7notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0xa608fbb6` @@ -1051,12 +1317,14 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP7NotifyTokenReceiverIsEOA -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#lsp7notifytokenreceiveriseoa) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `LSP7NotifyTokenReceiverIsEOA(address)` - Error hash: `0x26c247f4` @@ -1074,12 +1342,14 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP7TokenOwnerCannotBeOperator -:::note Links +:::note References -- Specification details in [**LSP-7-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-Mintable.md#lsp7tokenownercannotbeoperator) -- Solidity implementation in [**LSP7Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7Mintable) +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - Error signature: `LSP7TokenOwnerCannotBeOperator()` - Error hash: `0xdab75047` @@ -1091,193 +1361,4 @@ error LSP7TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. - - - - - - -[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 -[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 -[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 -[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 -[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 -[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 -[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X -[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y -[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md -[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[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 - - - -[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 - - - -[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership -[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership -[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership - - - -[`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 -[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol -[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 -[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol -[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll -[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol - - - -[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol -[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol -[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol -[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol -[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol -[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so -[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol -[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md index 65c964d37c..7859e15143 100644 --- a/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md +++ b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md @@ -1,6 +1,14 @@ + + + # LSP8IdentifiableDigitalAsset -:::info Solidity contract +:::info Standard Specifications + +[`LSP-8-IdentifiableDigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md) + +::: +:::info Solidity implementation [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) @@ -8,16 +16,19 @@ > 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). +Standard implementation contract of the LSP8 standard. Minting and transferring are done by providing 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 +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### authorizeOperator -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizeoperator) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `authorizeOperator(address,bytes32)` - Function selector: `0xcf5182ba` @@ -39,12 +50,14 @@ Allow an `operator` address to transfer or burn a specific `tokenId` on behalf o | `operator` | `address` | The address to authorize as an operator. | | `tokenId` | `bytes32` | The token ID operator has access to.. | +
+ ### balanceOf -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#balanceof) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -68,12 +81,14 @@ Get the number of token IDs owned by `tokenOwner`. | ---- | :-------: | ----------------------------------------------------- | | `0` | `uint256` | The total number of token IDs that `tokenOwner` owns. | +
+ ### getData -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdata) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -97,12 +112,14 @@ _Gets singular data at a given `dataKey`_ | ----------- | :-----: | -------------------------- | | `dataValue` | `bytes` | The data stored at the key | +
+ ### getDataBatch -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatch) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -128,12 +145,14 @@ _Gets array of data for multiple given keys_ | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### getOperatorsOf -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getoperatorsof) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `getOperatorsOf(bytes32)` - Function selector: `0x49a6078d` @@ -157,12 +176,14 @@ Returns all `operator` addresses that are allowed to transfer or burn a specific | ---- | :---------: | ------------------------------------------------------------------------------------------------------------ | | `0` | `address[]` | An array of operators allowed to transfer or burn a specific `tokenId`. Requirements - `tokenId` must exist. | +
+ ### isOperatorFor -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isoperatorfor) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `isOperatorFor(address,bytes32)` - Function selector: `0x2a3654a4` @@ -190,12 +211,14 @@ Returns whether `operator` address is an operator for a given `tokenId`. | ---- | :----: | --------------------------------------------------------------------- | | `0` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. | +
+ ### owner -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#owner) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -213,12 +236,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#renounceownership) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -230,12 +255,14 @@ 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 +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokeoperator) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `revokeOperator(address,bytes32)` - Function selector: `0x0b0c6d82` @@ -254,12 +281,14 @@ Remove access of `operator` for a given `tokenId`, disallowing it to transfer `t | `operator` | `address` | The address to revoke as an operator. | | `tokenId` | `bytes32` | The tokenId `operator` is revoked from operating on. | +
+ ### setData -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdata) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` @@ -278,12 +307,14 @@ _Sets singular data for a given `dataKey`_ | `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 +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatch) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` @@ -304,12 +335,14 @@ Sets array of data for multiple given `dataKeys` SHOULD only be callable by the | `dataKeys` | `bytes32[]` | The array of data keys for values to set | | `dataValues` | `bytes[]` | The array of values to set | +
+ ### supportsInterface -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#supportsinterface) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -333,12 +366,14 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### tokenIdsOf -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenidsof) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `tokenIdsOf(address)` - Function selector: `0xa3b261f2` @@ -362,12 +397,14 @@ Returns the list of token IDs that the `tokenOwner` address owns. | ---- | :---------: | ------------------------------------------------------- | | `0` | `bytes32[]` | An array of `bytes32[] tokenIds` owned by `tokenOwner`. | +
+ ### tokenOwnerOf -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenownerof) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `tokenOwnerOf(bytes32)` - Function selector: `0x217b2270` @@ -391,12 +428,14 @@ Returns the list of `tokenIds` for the `tokenOwner` address. | ---- | :-------: | ----------------------------------------- | | `0` | `address` | The owner address of the given `tokenId`. | +
+ ### totalSupply -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#totalsupply) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -414,12 +453,14 @@ Returns the number of existing tokens that have been minted in this contract. | ---- | :-------: | ------------------------------ | | `0` | `uint256` | The number of existing tokens. | +
+ ### transfer -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](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` @@ -447,12 +488,14 @@ Transfer a given `tokenId` token from the `from` address to the `to` address. If | `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 +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferbatch) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](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` @@ -480,12 +523,14 @@ Transfers multiple tokens at once based on the arrays of `from`, `to` and `token | `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 +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferownership) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -503,18 +548,300 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | ---- +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +Save gas by emitting the [`DataChanged`](#datachanged) event with only the first 256 bytes of dataValue + +
+ +### \_isOperatorOrOwner + +```solidity +function _isOperatorOrOwner( + address caller, + bytes32 tokenId +) internal view returns (bool); +``` + +verifies if the `caller` is operator or owner for the `tokenId` + +#### Returns + +| Name | Type | Description | +| ---- | :----: | -------------------------------------------- | +| `0` | `bool` | true if `caller` is either operator or owner | + +
+ +### \_revokeOperator + +```solidity +function _revokeOperator( + address operator, + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +removes `operator` from the list of operators for the `tokenId` + +
+ +### \_clearOperators + +```solidity +function _clearOperators( + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +revoke all the current operators for a specific `tokenId` token which belongs to `tokenOwner`. + +#### Parameters + +| Name | Type | Description | +| ------------ | :-------: | ------------------------------------------------- | +| `tokenOwner` | `address` | The address that is the owner of the `tokenId`. | +| `tokenId` | `bytes32` | The token to remove the associated operators for. | + +
+ +### \_exists + +```solidity +function _exists(bytes32 tokenId) internal view returns (bool); +``` + +Returns whether `tokenId` exists. +Tokens start existing when they are minted ([`_mint`](#_mint)), and stop existing when they are burned ([`_burn`](#_burn)). + +
+ +### \_existsOrError + +```solidity +function _existsOrError(bytes32 tokenId) internal view; +``` + +When `tokenId` does not exist then revert with an error. + +
+ +### \_mint + +```solidity +function _mint( + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Create `tokenId` by minting it and transfers it to `to`. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as `from` address. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- | +| `to` | `address` | @param tokenId The token ID to create (= mint). | +| `tokenId` | `bytes32` | The token ID to create (= mint). | +| `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. | +| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hook of the `to` address. | + +
+ +### \_burn + +:::tip Hint + +In dApps, you can know which addresses are burning tokens by listening for the `Transfer` event and filter with the zero address as `to`. + +::: + +```solidity +function _burn(bytes32 tokenId, bytes data) internal nonpayable; +``` + +Burn a specific `tokenId`, removing the `tokenId` from the [`tokenIdsOf`](#tokenidsof) the caller and decreasing its [`balanceOf`](#balanceof) by -1. +This will also clear all the operators allowed to transfer the `tokenId`. +The owner of the `tokenId` will be notified about the `tokenId` being transferred through its LSP1 [`universalReceiver`](#universalreceiver) +function, if it is a contract that supports the LSP1 interface. Its [`universalReceiver`](#universalreceiver) function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before burning `tokenId` and updating the balances. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as the `to` address. + +
+ +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | --------------------------------------------------------------------------------------------------------------------------- | +| `tokenId` | `bytes32` | The token to burn. | +| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the LSP1 hook on the token owner's address. | + +
+ +### \_transfer + +:::danger + +This internal function does not check if the sender is authorized or not to operate on the `tokenId`. + +::: + +```solidity +function _transfer( + address from, + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Change the owner of the `tokenId` from `from` to `to`. +Both the sender and recipient will be notified of the `tokenId` being transferred through their LSP1 [`universalReceiver`](#universalreceiver) +function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before changing the owner of `tokenId`. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | The sender address. | +| `to` | `address` | @param tokenId The token to transfer. | +| `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 the LSP1 standard. | +| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | + +
+ +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer( + address from, + address to, + bytes32 tokenId +) internal nonpayable; +``` + +Hook that is called before any token transfer, including minting and burning. + +- Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function. + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | -------------------------------------- | +| `from` | `address` | The sender address | +| `to` | `address` | @param tokenId The tokenId to transfer | +| `tokenId` | `bytes32` | The tokenId to transfer | + +
+ +### \_notifyTokenSender + +```solidity +function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; +``` + +An attempt is made to notify the token sender about the `tokenId` changing owners using +LSP1 interface. + +
+ +### \_notifyTokenReceiver + +```solidity +function _notifyTokenReceiver( + address to, + bool allowNonLSP1Recipient, + bytes lsp1Data +) internal nonpayable; +``` + +An attempt is made to notify the token receiver about the `tokenId` changing owners +using LSP1 interface. When allowNonLSP1Recipient is FALSE the token receiver MUST support LSP1. +The receiver may revert when the token being sent is not wanted. + +
## Events ### AuthorizedOperator -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizedoperator) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Event signature: `AuthorizedOperator(address,address,bytes32)` -- Event hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` +- Event topic hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` ::: @@ -522,22 +849,26 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c event AuthorizedOperator(address indexed operator, address indexed tokenOwner, bytes32 indexed tokenId); ``` +Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`. + #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ----------- | -| `operator` **`indexed`** | `address` | - | -| `tokenOwner` **`indexed`** | `address` | - | -| `tokenId` **`indexed`** | `bytes32` | - | +| Name | Type | Description | +| -------------------------- | :-------: | -------------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address authorized as an operator. | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | +| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` address has access on behalf of `tokenOwner`. | + +
### DataChanged -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#datachanged) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -549,19 +880,21 @@ _Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | ----------- | -| `dataKey` **`indexed`** | `bytes32` | - | -| `dataValue` | `bytes` | - | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
### OwnershipTransferred -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownershiptransferred) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -576,14 +909,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | +
+ ### RevokedOperator -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokedoperator) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Event signature: `RevokedOperator(address,address,bytes32)` -- Event hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` +- Event topic hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` ::: @@ -591,22 +926,26 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn event RevokedOperator(address indexed operator, address indexed tokenOwner, bytes32 indexed tokenId); ``` +Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on its behalf. + #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ----------- | -| `operator` **`indexed`** | `address` | - | -| `tokenOwner` **`indexed`** | `address` | - | -| `tokenId` **`indexed`** | `bytes32` | - | +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address revoked from the operator array ({getOperatorsOf}). | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | +| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. | + +
### Transfer -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](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` +- Event topic hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` ::: @@ -614,27 +953,29 @@ event RevokedOperator(address indexed operator, address indexed tokenOwner, byte event Transfer(address operator, address indexed from, address indexed to, bytes32 indexed tokenId, bool allowNonLSP1Recipient, bytes data); ``` +Emitted when `tokenId` token is transferred from the `from` to the `to` address. + #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | ----------- | -| `operator` | `address` | - | -| `from` **`indexed`** | `address` | - | -| `to` **`indexed`** | `address` | - | -| `tokenId` **`indexed`** | `bytes32` | - | -| `allowNonLSP1Recipient` | `bool` | - | -| `data` | `bytes` | - | +| Name | Type | Description | +| ----------------------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------- | +| `operator` | `address` | The address of operator that sent the `tokenId` | +| `from` **`indexed`** | `address` | The previous owner of the `tokenId` | +| `to` **`indexed`** | `address` | The new owner of `tokenId` | +| `tokenId` **`indexed`** | `bytes32` | The tokenId that was transferred | +| `allowNonLSP1Recipient` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. | +| `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. | ---- +
## Errors ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -646,12 +987,14 @@ error ERC725Y_DataKeysValuesEmptyArray(); reverts when one of the array parameter provided to `setDataBatch` is an empty array +
+ ### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -663,12 +1006,14 @@ 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 +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -680,12 +1025,14 @@ error ERC725Y_MsgValueDisallowed(); reverts when sending value to the `setData(..)` functions +
+ ### LSP4TokenNameNotEditable -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -697,12 +1044,14 @@ 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 +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -714,12 +1063,14 @@ 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 +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoaddresszero) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP8CannotSendToAddressZero()` - Error hash: `0x24ecef4d` @@ -731,12 +1082,14 @@ error LSP8CannotSendToAddressZero(); reverts when trying to send token to the zero address. +
+ ### LSP8CannotSendToSelf -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoself) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP8CannotSendToSelf()` - Error hash: `0x5d67d6c1` @@ -748,12 +1101,14 @@ error LSP8CannotSendToSelf(); reverts when specifying the same address for `from` and `to` in a token transfer. +
+ ### LSP8CannotUseAddressZeroAsOperator -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotuseaddresszeroasoperator) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP8CannotUseAddressZeroAsOperator()` - Error hash: `0x9577b8b3` @@ -765,12 +1120,14 @@ error LSP8CannotUseAddressZeroAsOperator(); reverts when trying to set the zero address as an operator. +
+ ### LSP8InvalidTransferBatch -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8invalidtransferbatch) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP8InvalidTransferBatch()` - Error hash: `0x93a83119` @@ -782,12 +1139,14 @@ error LSP8InvalidTransferBatch(); reverts when the parameters used for `transferBatch` have different lengths. +
+ ### LSP8NonExistentTokenId -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistenttokenid) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP8NonExistentTokenId(bytes32)` - Error hash: `0xae8f9a36` @@ -805,12 +1164,14 @@ reverts when `tokenId` has not been minted. | --------- | :-------: | ----------- | | `tokenId` | `bytes32` | - | +
+ ### LSP8NonExistingOperator -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistingoperator) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP8NonExistingOperator(address,bytes32)` - Error hash: `0x4aa31a8c` @@ -829,12 +1190,14 @@ reverts when `operator` is not an operator for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8NotTokenOperator -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenoperator) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP8NotTokenOperator(bytes32,address)` - Error hash: `0x1294d2a9` @@ -853,12 +1216,14 @@ reverts when `caller` is not an allowed operator for `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotTokenOwner -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenowner) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP8NotTokenOwner(address,bytes32,address)` - Error hash: `0x5b271ea2` @@ -878,12 +1243,14 @@ reverts when `caller` is not the `tokenOwner` of the `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotifyTokenReceiverContractMissingLSP1Interface -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP8NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0x4349776d` @@ -903,12 +1270,14 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8NotifyTokenReceiverIsEOA -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceiveriseoa) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP8NotifyTokenReceiverIsEOA(address)` - Error hash: `0x03173137` @@ -926,12 +1295,14 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8OperatorAlreadyAuthorized -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8operatoralreadyauthorized) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP8OperatorAlreadyAuthorized(address,bytes32)` - Error hash: `0xa7626b68` @@ -950,12 +1321,14 @@ reverts when `operator` is already authorized for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8TokenOwnerCannotBeOperator -:::note Links +:::note References -- 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) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownercannotbeoperator) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) - Error signature: `LSP8TokenOwnerCannotBeOperator()` - Error hash: `0x89fdad62` @@ -967,6 +1340,8 @@ error LSP8TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. +
+ diff --git a/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.md b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.md index 4b24db1afe..3131adbfdb 100644 --- a/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.md +++ b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.md @@ -1,21 +1,32 @@ + + + # LSP8Burnable -:::info Solidity contract +:::info Standard Specifications -[`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +[`LSP-8-IdentifiableDigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md) + +::: +:::info Solidity implementation + +[`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) ::: LSP8 token extension that allows token holders to destroy both their own tokens and those that they have an allowance for as an operator. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### authorizeOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#authorizeoperator) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizeoperator) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `authorizeOperator(address,bytes32)` - Function selector: `0xcf5182ba` @@ -37,12 +48,14 @@ Allow an `operator` address to transfer or burn a specific `tokenId` on behalf o | `operator` | `address` | The address to authorize as an operator. | | `tokenId` | `bytes32` | The token ID operator has access to.. | +
+ ### balanceOf -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#balanceof) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#balanceof) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -66,12 +79,14 @@ Get the number of token IDs owned by `tokenOwner`. | ---- | :-------: | ----------------------------------------------------- | | `0` | `uint256` | The total number of token IDs that `tokenOwner` owns. | +
+ ### burn -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#burn) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#burn) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `burn(bytes32,bytes)` - Function selector: `0x6c79b70b` @@ -81,21 +96,25 @@ Get the number of token IDs owned by `tokenOwner`. function burn(bytes32 tokenId, bytes data) external nonpayable; ``` +_Burning tokenId `tokenId`. This tokenId will not be recoverable! (additional data sent: `data`)._ + See internal [`_burn`](#_burn) function for details. #### Parameters -| Name | Type | Description | -| --------- | :-------: | ----------- | -| `tokenId` | `bytes32` | - | -| `data` | `bytes` | - | +| Name | Type | Description | +| --------- | :-------: | -------------------------------------------------------- | +| `tokenId` | `bytes32` | The tokenId to burn. | +| `data` | `bytes` | Any extra data to be sent alongside burning the tokenId. | + +
### getData -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#getdata) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdata) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -105,28 +124,28 @@ See internal [`_burn`](#_burn) function for details. function getData(bytes32 dataKey) external view returns (bytes dataValue); ``` -_Reading the ERC725Y storage for data key `dataKey` returned the following value: `dataValue`._ - -Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`. +_Gets singular data at a given `dataKey`_ #### Parameters -| Name | Type | Description | -| --------- | :-------: | --------------------------------------------- | -| `dataKey` | `bytes32` | The data key for which to retrieve the value. | +| Name | Type | Description | +| --------- | :-------: | ------------------------------- | +| `dataKey` | `bytes32` | The key which value to retrieve | #### Returns -| Name | Type | Description | -| ----------- | :-----: | ---------------------------------------------------- | -| `dataValue` | `bytes` | The bytes value stored under the specified data key. | +| Name | Type | Description | +| ----------- | :-----: | -------------------------- | +| `dataValue` | `bytes` | The data stored at the key | + +
### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#getdatabatch) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatch) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -138,9 +157,7 @@ function getDataBatch( ) external view returns (bytes[] dataValues); ``` -_Reading the ERC725Y storage for data keys `dataKeys` returned the following values: `dataValues`._ - -Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`. +_Gets array of data for multiple given keys_ #### Parameters @@ -154,12 +171,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### getOperatorsOf -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#getoperatorsof) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getoperatorsof) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `getOperatorsOf(bytes32)` - Function selector: `0x49a6078d` @@ -183,12 +202,14 @@ Returns all `operator` addresses that are allowed to transfer or burn a specific | ---- | :---------: | ------------------------------------------------------------------------------------------------------------ | | `0` | `address[]` | An array of operators allowed to transfer or burn a specific `tokenId`. Requirements - `tokenId` must exist. | +
+ ### isOperatorFor -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#isoperatorfor) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isoperatorfor) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `isOperatorFor(address,bytes32)` - Function selector: `0x2a3654a4` @@ -216,12 +237,58 @@ Returns whether `operator` address is an operator for a given `tokenId`. | ---- | :----: | --------------------------------------------------------------------- | | `0` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. | +
+ +### owner + +:::note References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#owner) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.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 References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#renounceownership) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.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 +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#revokeoperator) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokeoperator) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `revokeOperator(address,bytes32)` - Function selector: `0x0b0c6d82` @@ -240,12 +307,14 @@ Remove access of `operator` for a given `tokenId`, disallowing it to transfer `t | `operator` | `address` | The address to revoke as an operator. | | `tokenId` | `bytes32` | The tokenId `operator` is revoked from operating on. | +
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#setdata) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdata) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` @@ -255,23 +324,23 @@ Remove access of `operator` for a given `tokenId`, disallowing it to transfer `t function setData(bytes32 dataKey, bytes dataValue) external payable; ``` -_Setting the following data key value pair in the ERC725Y storage. Data key: `dataKey`, data value: `dataValue`. _ - -Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data. +_Sets singular data for a given `dataKey`_ #### Parameters -| Name | Type | Description | -| ----------- | :-------: | ------------------------------------------ | -| `dataKey` | `bytes32` | The data key for which to set a new value. | -| `dataValue` | `bytes` | The new bytes value to set. | +| 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 +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#setdatabatch) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatch) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` @@ -281,23 +350,25 @@ Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; ``` -_Setting the following data key value pairs in the ERC725Y storage. Data keys: `dataKeys`, data values: `dataValues`. _ +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 -Batch data setting function that behaves the same as [`setData`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction. +0. Emits a [`DataChanged`](#datachanged) event. #### Parameters -| Name | Type | Description | -| ------------ | :---------: | ---------------------------------------------------- | -| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. | -| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +| 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 +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#supportsinterface) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#supportsinterface) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -321,12 +392,14 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### tokenIdsOf -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#tokenidsof) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenidsof) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `tokenIdsOf(address)` - Function selector: `0xa3b261f2` @@ -350,12 +423,14 @@ Returns the list of token IDs that the `tokenOwner` address owns. | ---- | :---------: | ------------------------------------------------------- | | `0` | `bytes32[]` | An array of `bytes32[] tokenIds` owned by `tokenOwner`. | +
+ ### tokenOwnerOf -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#tokenownerof) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenownerof) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `tokenOwnerOf(bytes32)` - Function selector: `0x217b2270` @@ -379,12 +454,14 @@ Returns the list of `tokenIds` for the `tokenOwner` address. | ---- | :-------: | ----------------------------------------- | | `0` | `address` | The owner address of the given `tokenId`. | +
+ ### totalSupply -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#totalsupply) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#totalsupply) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -402,12 +479,14 @@ Returns the number of existing tokens that have been minted in this contract. | ---- | :-------: | ------------------------------ | | `0` | `uint256` | The number of existing tokens. | +
+ ### transfer -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#transfer) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `transfer(address,address,bytes32,bool,bytes)` - Function selector: `0x511b6952` @@ -435,12 +514,14 @@ Transfer a given `tokenId` token from the `from` address to the `to` address. If | `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 +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#transferbatch) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferbatch) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Function signature: `transferBatch(address[],address[],bytes32[],bool[],bytes[])` - Function selector: `0x7e87632c` @@ -468,18 +549,325 @@ Transfers multiple tokens at once based on the arrays of `from`, `to` and `token | `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 References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferownership) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.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` | - | + +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +Save gas by emitting the [`DataChanged`](#datachanged) event with only the first 256 bytes of dataValue + +
+ +### \_isOperatorOrOwner + +```solidity +function _isOperatorOrOwner( + address caller, + bytes32 tokenId +) internal view returns (bool); +``` + +verifies if the `caller` is operator or owner for the `tokenId` + +#### Returns + +| Name | Type | Description | +| ---- | :----: | -------------------------------------------- | +| `0` | `bool` | true if `caller` is either operator or owner | + +
+ +### \_revokeOperator + +```solidity +function _revokeOperator( + address operator, + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +removes `operator` from the list of operators for the `tokenId` + +
+ +### \_clearOperators + +```solidity +function _clearOperators( + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +revoke all the current operators for a specific `tokenId` token which belongs to `tokenOwner`. + +#### Parameters + +| Name | Type | Description | +| ------------ | :-------: | ------------------------------------------------- | +| `tokenOwner` | `address` | The address that is the owner of the `tokenId`. | +| `tokenId` | `bytes32` | The token to remove the associated operators for. | + +
+ +### \_exists + +```solidity +function _exists(bytes32 tokenId) internal view returns (bool); +``` + +Returns whether `tokenId` exists. +Tokens start existing when they are minted ([`_mint`](#_mint)), and stop existing when they are burned ([`_burn`](#_burn)). + +
+ +### \_existsOrError + +```solidity +function _existsOrError(bytes32 tokenId) internal view; +``` + +When `tokenId` does not exist then revert with an error. + +
+ +### \_mint + +```solidity +function _mint( + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Create `tokenId` by minting it and transfers it to `to`. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as `from` address. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- | +| `to` | `address` | @param tokenId The token ID to create (= mint). | +| `tokenId` | `bytes32` | The token ID to create (= mint). | +| `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. | +| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hook of the `to` address. | + +
+ +### \_burn + +:::tip Hint + +In dApps, you can know which addresses are burning tokens by listening for the `Transfer` event and filter with the zero address as `to`. + +::: + +```solidity +function _burn(bytes32 tokenId, bytes data) internal nonpayable; +``` + +Burn a specific `tokenId`, removing the `tokenId` from the [`tokenIdsOf`](#tokenidsof) the caller and decreasing its [`balanceOf`](#balanceof) by -1. +This will also clear all the operators allowed to transfer the `tokenId`. +The owner of the `tokenId` will be notified about the `tokenId` being transferred through its LSP1 [`universalReceiver`](#universalreceiver) +function, if it is a contract that supports the LSP1 interface. Its [`universalReceiver`](#universalreceiver) function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before burning `tokenId` and updating the balances. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as the `to` address. + +
+ +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | --------------------------------------------------------------------------------------------------------------------------- | +| `tokenId` | `bytes32` | The token to burn. | +| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the LSP1 hook on the token owner's address. | + +
+ +### \_transfer + +:::danger + +This internal function does not check if the sender is authorized or not to operate on the `tokenId`. + +::: + +```solidity +function _transfer( + address from, + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Change the owner of the `tokenId` from `from` to `to`. +Both the sender and recipient will be notified of the `tokenId` being transferred through their LSP1 [`universalReceiver`](#universalreceiver) +function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before changing the owner of `tokenId`. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | The sender address. | +| `to` | `address` | @param tokenId The token to transfer. | +| `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 the LSP1 standard. | +| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | + +
+ +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer( + address from, + address to, + bytes32 tokenId +) internal nonpayable; +``` + +Hook that is called before any token transfer, including minting and burning. + +- Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function. + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | -------------------------------------- | +| `from` | `address` | The sender address | +| `to` | `address` | @param tokenId The tokenId to transfer | +| `tokenId` | `bytes32` | The tokenId to transfer | + +
+ +### \_notifyTokenSender + +```solidity +function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; +``` + +An attempt is made to notify the token sender about the `tokenId` changing owners using +LSP1 interface. + +
+ +### \_notifyTokenReceiver + +```solidity +function _notifyTokenReceiver( + address to, + bool allowNonLSP1Recipient, + bytes lsp1Data +) internal nonpayable; +``` + +An attempt is made to notify the token receiver about the `tokenId` changing owners +using LSP1 interface. When allowNonLSP1Recipient is FALSE the token receiver MUST support LSP1. +The receiver may revert when the token being sent is not wanted. + +
## Events ### AuthorizedOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#authorizedoperator) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizedoperator) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Event signature: `AuthorizedOperator(address,address,bytes32)` -- Event hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` +- Event topic hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` ::: @@ -487,7 +875,7 @@ Transfers multiple tokens at once based on the arrays of `from`, `to` and `token event AuthorizedOperator(address indexed operator, address indexed tokenOwner, bytes32 indexed tokenId); ``` -Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on its behalf. +Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`. #### Parameters @@ -497,14 +885,16 @@ Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on it | `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | | `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` address has access on behalf of `tokenOwner`. | +
+ ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#datachanged) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#datachanged) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -512,25 +902,49 @@ Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on it event DataChanged(bytes32 indexed dataKey, bytes dataValue); ``` -_The following data key/value pair has been changed in the ERC725Y storage: Data key: `dataKey`, data value: `dataValue`._ +_Emitted when data at a key is changed_ + +#### Parameters -Emitted when data at a specific `dataKey` was changed to a new value `dataValue`. +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
+ +### OwnershipTransferred + +:::note References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownershiptransferred) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) +- Event signature: `OwnershipTransferred(address,address)` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` + +::: + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); +``` #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | -------------------------------------------- | -| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | -| `dataValue` | `bytes` | The value to set for the given data key. | +| Name | Type | Description | +| ----------------------------- | :-------: | ----------- | +| `previousOwner` **`indexed`** | `address` | - | +| `newOwner` **`indexed`** | `address` | - | + +
### RevokedOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#revokedoperator) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokedoperator) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Event signature: `RevokedOperator(address,address,bytes32)` -- Event hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` +- Event topic hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` ::: @@ -542,20 +956,22 @@ Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on i #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ---------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address revoked as an operator. | -| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | -| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. | +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address revoked from the operator array ({getOperatorsOf}). | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | +| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. | + +
### Transfer -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#transfer) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Event signature: `Transfer(address,address,address,bytes32,bool,bytes)` -- Event hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` +- Event topic hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` ::: @@ -576,16 +992,111 @@ Emitted when `tokenId` token is transferred from the `from` to the `to` address. | `allowNonLSP1Recipient` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. | | `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. | ---- +
## Errors +### ERC725Y_DataKeysValuesEmptyArray + +:::note References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.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 References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.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 References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) +- Error signature: `ERC725Y_MsgValueDisallowed()` +- Error hash: `0xf36ba737` + +::: + +```solidity +error ERC725Y_MsgValueDisallowed(); +``` + +reverts when sending value to the `setData(..)` functions + +
+ +### LSP4TokenNameNotEditable + +:::note References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.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 References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.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 +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#lsp8cannotsendtoaddresszero) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoaddresszero) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Error signature: `LSP8CannotSendToAddressZero()` - Error hash: `0x24ecef4d` @@ -597,12 +1108,14 @@ error LSP8CannotSendToAddressZero(); reverts when trying to send token to the zero address. +
+ ### LSP8CannotSendToSelf -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#lsp8cannotsendtoself) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoself) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Error signature: `LSP8CannotSendToSelf()` - Error hash: `0x5d67d6c1` @@ -614,12 +1127,14 @@ error LSP8CannotSendToSelf(); reverts when specifying the same address for `from` and `to` in a token transfer. +
+ ### LSP8CannotUseAddressZeroAsOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#lsp8cannotuseaddresszeroasoperator) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotuseaddresszeroasoperator) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Error signature: `LSP8CannotUseAddressZeroAsOperator()` - Error hash: `0x9577b8b3` @@ -631,12 +1146,14 @@ error LSP8CannotUseAddressZeroAsOperator(); reverts when trying to set the zero address as an operator. +
+ ### LSP8InvalidTransferBatch -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#lsp8invalidtransferbatch) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8invalidtransferbatch) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Error signature: `LSP8InvalidTransferBatch()` - Error hash: `0x93a83119` @@ -648,12 +1165,14 @@ error LSP8InvalidTransferBatch(); reverts when the parameters used for `transferBatch` have different lengths. +
+ ### LSP8NonExistentTokenId -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#lsp8nonexistenttokenid) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistenttokenid) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Error signature: `LSP8NonExistentTokenId(bytes32)` - Error hash: `0xae8f9a36` @@ -671,12 +1190,14 @@ reverts when `tokenId` has not been minted. | --------- | :-------: | ----------- | | `tokenId` | `bytes32` | - | +
+ ### LSP8NonExistingOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#lsp8nonexistingoperator) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistingoperator) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Error signature: `LSP8NonExistingOperator(address,bytes32)` - Error hash: `0x4aa31a8c` @@ -695,12 +1216,14 @@ reverts when `operator` is not an operator for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8NotTokenOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#lsp8nottokenoperator) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenoperator) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Error signature: `LSP8NotTokenOperator(bytes32,address)` - Error hash: `0x1294d2a9` @@ -719,12 +1242,14 @@ reverts when `caller` is not an allowed operator for `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotTokenOwner -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#lsp8nottokenowner) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenowner) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Error signature: `LSP8NotTokenOwner(address,bytes32,address)` - Error hash: `0x5b271ea2` @@ -744,12 +1269,14 @@ reverts when `caller` is not the `tokenOwner` of the `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotifyTokenReceiverContractMissingLSP1Interface -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#lsp8notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Error signature: `LSP8NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0x4349776d` @@ -769,12 +1296,14 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8NotifyTokenReceiverIsEOA -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#lsp8notifytokenreceiveriseoa) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceiveriseoa) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Error signature: `LSP8NotifyTokenReceiverIsEOA(address)` - Error hash: `0x03173137` @@ -792,12 +1321,14 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8OperatorAlreadyAuthorized -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#lsp8operatoralreadyauthorized) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8operatoralreadyauthorized) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Error signature: `LSP8OperatorAlreadyAuthorized(address,bytes32)` - Error hash: `0xa7626b68` @@ -816,12 +1347,14 @@ reverts when `operator` is already authorized for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8TokenOwnerCannotBeOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Burnable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Burnable.md#lsp8tokenownercannotbeoperator) -- Solidity implementation in [**LSP8Burnable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Burnable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownercannotbeoperator) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) - Error signature: `LSP8TokenOwnerCannotBeOperator()` - Error hash: `0x89fdad62` @@ -833,193 +1366,4 @@ error LSP8TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. - - - - - - -[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 -[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 -[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 -[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 -[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 -[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 -[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X -[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y -[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md -[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[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 - - - -[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 - - - -[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership -[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership -[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership - - - -[`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 -[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol -[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 -[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol -[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll -[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol - - - -[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol -[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol -[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol -[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol -[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol -[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so -[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol -[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.md b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.md index 01db7db48b..cced87c15f 100644 --- a/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.md +++ b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.md @@ -1,21 +1,32 @@ + + + # LSP8CappedSupply -:::info Solidity contract +:::info Standard Specifications + +[`LSP-8-IdentifiableDigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md) + +::: +:::info Solidity implementation -[`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +[`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) ::: LSP8 token extension to add a max token supply cap. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### authorizeOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#authorizeoperator) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizeoperator) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `authorizeOperator(address,bytes32)` - Function selector: `0xcf5182ba` @@ -37,12 +48,14 @@ Allow an `operator` address to transfer or burn a specific `tokenId` on behalf o | `operator` | `address` | The address to authorize as an operator. | | `tokenId` | `bytes32` | The token ID operator has access to.. | +
+ ### balanceOf -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#balanceof) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#balanceof) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -66,12 +79,14 @@ Get the number of token IDs owned by `tokenOwner`. | ---- | :-------: | ----------------------------------------------------- | | `0` | `uint256` | The total number of token IDs that `tokenOwner` owns. | +
+ ### getData -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#getdata) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdata) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -81,28 +96,28 @@ Get the number of token IDs owned by `tokenOwner`. function getData(bytes32 dataKey) external view returns (bytes dataValue); ``` -_Reading the ERC725Y storage for data key `dataKey` returned the following value: `dataValue`._ - -Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`. +_Gets singular data at a given `dataKey`_ #### Parameters -| Name | Type | Description | -| --------- | :-------: | --------------------------------------------- | -| `dataKey` | `bytes32` | The data key for which to retrieve the value. | +| Name | Type | Description | +| --------- | :-------: | ------------------------------- | +| `dataKey` | `bytes32` | The key which value to retrieve | #### Returns -| Name | Type | Description | -| ----------- | :-----: | ---------------------------------------------------- | -| `dataValue` | `bytes` | The bytes value stored under the specified data key. | +| Name | Type | Description | +| ----------- | :-----: | -------------------------- | +| `dataValue` | `bytes` | The data stored at the key | + +
### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#getdatabatch) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatch) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -114,9 +129,7 @@ function getDataBatch( ) external view returns (bytes[] dataValues); ``` -_Reading the ERC725Y storage for data keys `dataKeys` returned the following values: `dataValues`._ - -Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`. +_Gets array of data for multiple given keys_ #### Parameters @@ -130,12 +143,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### getOperatorsOf -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#getoperatorsof) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getoperatorsof) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `getOperatorsOf(bytes32)` - Function selector: `0x49a6078d` @@ -159,12 +174,14 @@ Returns all `operator` addresses that are allowed to transfer or burn a specific | ---- | :---------: | ------------------------------------------------------------------------------------------------------------ | | `0` | `address[]` | An array of operators allowed to transfer or burn a specific `tokenId`. Requirements - `tokenId` must exist. | +
+ ### isOperatorFor -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#isoperatorfor) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isoperatorfor) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `isOperatorFor(address,bytes32)` - Function selector: `0x2a3654a4` @@ -192,12 +209,14 @@ Returns whether `operator` address is an operator for a given `tokenId`. | ---- | :----: | --------------------------------------------------------------------- | | `0` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. | +
+ ### owner -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#owner) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#owner) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -215,12 +234,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#renounceownership) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#renounceownership) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -232,12 +253,14 @@ 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 +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#revokeoperator) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokeoperator) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `revokeOperator(address,bytes32)` - Function selector: `0x0b0c6d82` @@ -256,108 +279,68 @@ Remove access of `operator` for a given `tokenId`, disallowing it to transfer `t | `operator` | `address` | The address to revoke as an operator. | | `tokenId` | `bytes32` | The tokenId `operator` is revoked from operating on. | +
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#setdata) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdata) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setData(bytes32 dataKey, bytes dataValue) external payable; ``` -_Setting the following data key value pair in the ERC725Y storage. Data key: `dataKey`, data value: `dataValue`. _ - -Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner). - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event. - -
+_Sets singular data for a given `dataKey`_ #### Parameters -| Name | Type | Description | -| ----------- | :-------: | ------------------------------------------ | -| `dataKey` | `bytes32` | The data key for which to set a new value. | -| `dataValue` | `bytes` | The new bytes value to set. | +| 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 +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#setdatabatch) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatch) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; ``` -_Setting the following data key value pairs in the ERC725Y storage. Data keys: `dataKeys`, data values: `dataValues`. _ - -Batch data setting function that behaves the same as [`setData`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction. - -
+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 -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner) of the contract. - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event **for each data key/value pair set**. - -
+0. Emits a [`DataChanged`](#datachanged) event. #### Parameters -| Name | Type | Description | -| ------------ | :---------: | ---------------------------------------------------- | -| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. | -| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +| 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 +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#supportsinterface) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#supportsinterface) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -381,12 +364,14 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### tokenIdsOf -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#tokenidsof) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenidsof) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `tokenIdsOf(address)` - Function selector: `0xa3b261f2` @@ -410,12 +395,14 @@ Returns the list of token IDs that the `tokenOwner` address owns. | ---- | :---------: | ------------------------------------------------------- | | `0` | `bytes32[]` | An array of `bytes32[] tokenIds` owned by `tokenOwner`. | +
+ ### tokenOwnerOf -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#tokenownerof) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenownerof) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `tokenOwnerOf(bytes32)` - Function selector: `0x217b2270` @@ -439,12 +426,14 @@ Returns the list of `tokenIds` for the `tokenOwner` address. | ---- | :-------: | ----------------------------------------- | | `0` | `address` | The owner address of the given `tokenId`. | +
+ ### tokenSupplyCap -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#tokensupplycap) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokensupplycap) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `tokenSupplyCap()` - Function selector: `0x52058d8a` @@ -464,12 +453,14 @@ Get the maximum number of tokens that can exist to circulate. Once [`totalSupply | ---- | :-------: | ------------------------------------------------------------ | | `0` | `uint256` | The maximum number of tokens that can exist in the contract. | +
+ ### totalSupply -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#totalsupply) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#totalsupply) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -487,12 +478,14 @@ Returns the number of existing tokens that have been minted in this contract. | ---- | :-------: | ------------------------------ | | `0` | `uint256` | The number of existing tokens. | +
+ ### transfer -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#transfer) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `transfer(address,address,bytes32,bool,bytes)` - Function selector: `0x511b6952` @@ -520,12 +513,14 @@ Transfer a given `tokenId` token from the `from` address to the `to` address. If | `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 +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#transferbatch) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferbatch) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `transferBatch(address[],address[],bytes32[],bool[],bytes[])` - Function selector: `0x7e87632c` @@ -553,12 +548,14 @@ Transfers multiple tokens at once based on the arrays of `from`, `to` and `token | `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 +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#transferownership) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferownership) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -576,18 +573,285 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | ---- +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +Save gas by emitting the [`DataChanged`](#datachanged) event with only the first 256 bytes of dataValue + +
+ +### \_isOperatorOrOwner + +```solidity +function _isOperatorOrOwner( + address caller, + bytes32 tokenId +) internal view returns (bool); +``` + +verifies if the `caller` is operator or owner for the `tokenId` + +#### Returns + +| Name | Type | Description | +| ---- | :----: | -------------------------------------------- | +| `0` | `bool` | true if `caller` is either operator or owner | + +
+ +### \_revokeOperator + +```solidity +function _revokeOperator( + address operator, + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +removes `operator` from the list of operators for the `tokenId` + +
+ +### \_clearOperators + +```solidity +function _clearOperators( + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +revoke all the current operators for a specific `tokenId` token which belongs to `tokenOwner`. + +#### Parameters + +| Name | Type | Description | +| ------------ | :-------: | ------------------------------------------------- | +| `tokenOwner` | `address` | The address that is the owner of the `tokenId`. | +| `tokenId` | `bytes32` | The token to remove the associated operators for. | + +
+ +### \_exists + +```solidity +function _exists(bytes32 tokenId) internal view returns (bool); +``` + +Returns whether `tokenId` exists. +Tokens start existing when they are minted ([`_mint`](#_mint)), and stop existing when they are burned ([`_burn`](#_burn)). + +
+ +### \_existsOrError + +```solidity +function _existsOrError(bytes32 tokenId) internal view; +``` + +When `tokenId` does not exist then revert with an error. + +
+ +### \_mint + +```solidity +function _mint( + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Same as [`_mint`](#_mint) but allows to mint only if newly minted `tokenId` does not increase the [`totalSupply`](#totalsupply) +over the [`tokenSupplyCap`](#tokensupplycap). +after a new `tokenId` has of tokens have been minted. + +
+ +### \_burn + +:::tip Hint + +In dApps, you can know which addresses are burning tokens by listening for the `Transfer` event and filter with the zero address as `to`. + +::: + +```solidity +function _burn(bytes32 tokenId, bytes data) internal nonpayable; +``` + +Burn a specific `tokenId`, removing the `tokenId` from the [`tokenIdsOf`](#tokenidsof) the caller and decreasing its [`balanceOf`](#balanceof) by -1. +This will also clear all the operators allowed to transfer the `tokenId`. +The owner of the `tokenId` will be notified about the `tokenId` being transferred through its LSP1 [`universalReceiver`](#universalreceiver) +function, if it is a contract that supports the LSP1 interface. Its [`universalReceiver`](#universalreceiver) function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before burning `tokenId` and updating the balances. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as the `to` address. + +
+ +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | --------------------------------------------------------------------------------------------------------------------------- | +| `tokenId` | `bytes32` | The token to burn. | +| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the LSP1 hook on the token owner's address. | + +
+ +### \_transfer + +:::danger + +This internal function does not check if the sender is authorized or not to operate on the `tokenId`. + +::: + +```solidity +function _transfer( + address from, + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Change the owner of the `tokenId` from `from` to `to`. +Both the sender and recipient will be notified of the `tokenId` being transferred through their LSP1 [`universalReceiver`](#universalreceiver) +function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before changing the owner of `tokenId`. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | The sender address. | +| `to` | `address` | @param tokenId The token to transfer. | +| `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 the LSP1 standard. | +| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | + +
+ +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer( + address from, + address to, + bytes32 tokenId +) internal nonpayable; +``` + +Hook that is called before any token transfer, including minting and burning. + +- Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function. + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | -------------------------------------- | +| `from` | `address` | The sender address | +| `to` | `address` | @param tokenId The tokenId to transfer | +| `tokenId` | `bytes32` | The tokenId to transfer | + +
+ +### \_notifyTokenSender + +```solidity +function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; +``` + +An attempt is made to notify the token sender about the `tokenId` changing owners using +LSP1 interface. + +
+ +### \_notifyTokenReceiver + +```solidity +function _notifyTokenReceiver( + address to, + bool allowNonLSP1Recipient, + bytes lsp1Data +) internal nonpayable; +``` + +An attempt is made to notify the token receiver about the `tokenId` changing owners +using LSP1 interface. When allowNonLSP1Recipient is FALSE the token receiver MUST support LSP1. +The receiver may revert when the token being sent is not wanted. + +
## Events ### AuthorizedOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#authorizedoperator) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizedoperator) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Event signature: `AuthorizedOperator(address,address,bytes32)` -- Event hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` +- Event topic hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` ::: @@ -595,7 +859,7 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c event AuthorizedOperator(address indexed operator, address indexed tokenOwner, bytes32 indexed tokenId); ``` -Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on its behalf. +Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`. #### Parameters @@ -605,14 +869,16 @@ Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on it | `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | | `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` address has access on behalf of `tokenOwner`. | +
+ ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#datachanged) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#datachanged) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -620,25 +886,25 @@ Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on it event DataChanged(bytes32 indexed dataKey, bytes dataValue); ``` -_The following data key/value pair has been changed in the ERC725Y storage: Data key: `dataKey`, data value: `dataValue`._ - -Emitted when data at a specific `dataKey` was changed to a new value `dataValue`. +_Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | -------------------------------------------- | -| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | -| `dataValue` | `bytes` | The value to set for the given data key. | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#ownershiptransferred) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownershiptransferred) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -653,14 +919,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | +
+ ### RevokedOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#revokedoperator) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokedoperator) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Event signature: `RevokedOperator(address,address,bytes32)` -- Event hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` +- Event topic hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` ::: @@ -672,20 +940,22 @@ Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on i #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ---------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address revoked as an operator. | -| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | -| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. | +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address revoked from the operator array ({getOperatorsOf}). | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | +| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. | + +
### Transfer -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#transfer) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Event signature: `Transfer(address,address,address,bytes32,bool,bytes)` -- Event hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` +- Event topic hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` ::: @@ -706,16 +976,16 @@ Emitted when `tokenId` token is transferred from the `from` to the `to` address. | `allowNonLSP1Recipient` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. | | `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. | ---- +
## Errors ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -725,14 +995,16 @@ Emitted when `tokenId` token is transferred from the `from` to the `to` address. error ERC725Y_DataKeysValuesEmptyArray(); ``` -Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array. +reverts when one of the array parameter provided to `setDataBatch` is an empty array + +
### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -742,14 +1014,16 @@ Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabat error ERC725Y_DataKeysValuesLengthMismatch(); ``` -Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. +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 +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -759,14 +1033,16 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat error ERC725Y_MsgValueDisallowed(); ``` -Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function. +reverts when sending value to the `setData(..)` functions + +
### LSP4TokenNameNotEditable -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp4tokennamenoteditable) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -778,12 +1054,14 @@ 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 +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp4tokensymbolnoteditable) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -795,12 +1073,14 @@ 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 +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8cannotsendtoaddresszero) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoaddresszero) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8CannotSendToAddressZero()` - Error hash: `0x24ecef4d` @@ -812,12 +1092,14 @@ error LSP8CannotSendToAddressZero(); reverts when trying to send token to the zero address. +
+ ### LSP8CannotSendToSelf -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8cannotsendtoself) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoself) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8CannotSendToSelf()` - Error hash: `0x5d67d6c1` @@ -829,12 +1111,14 @@ error LSP8CannotSendToSelf(); reverts when specifying the same address for `from` and `to` in a token transfer. +
+ ### LSP8CannotUseAddressZeroAsOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8cannotuseaddresszeroasoperator) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotuseaddresszeroasoperator) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8CannotUseAddressZeroAsOperator()` - Error hash: `0x9577b8b3` @@ -846,12 +1130,14 @@ error LSP8CannotUseAddressZeroAsOperator(); reverts when trying to set the zero address as an operator. +
+ ### LSP8CappedSupplyCannotMintOverCap -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8cappedsupplycannotmintovercap) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cappedsupplycannotmintovercap) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8CappedSupplyCannotMintOverCap()` - Error hash: `0xe8ba2291` @@ -865,12 +1151,14 @@ _Cannot mint anymore as total supply reached the maximum cap._ Reverts when trying to mint tokens but the [`totalSupply`](#totalsupply) has reached the maximum [`tokenSupplyCap`](#tokensupplycap). +
+ ### LSP8CappedSupplyRequired -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8cappedsupplyrequired) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cappedsupplyrequired) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8CappedSupplyRequired()` - Error hash: `0x38d9fc30` @@ -884,12 +1172,14 @@ _The `tokenSupplyCap` must be set and cannot be `0`._ Reverts when setting `0` for the [`tokenSupplyCap`](#tokensupplycap). The max token supply MUST be set to a number greater than 0. +
+ ### LSP8InvalidTransferBatch -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8invalidtransferbatch) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8invalidtransferbatch) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8InvalidTransferBatch()` - Error hash: `0x93a83119` @@ -901,12 +1191,14 @@ error LSP8InvalidTransferBatch(); reverts when the parameters used for `transferBatch` have different lengths. +
+ ### LSP8NonExistentTokenId -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8nonexistenttokenid) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistenttokenid) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8NonExistentTokenId(bytes32)` - Error hash: `0xae8f9a36` @@ -924,12 +1216,14 @@ reverts when `tokenId` has not been minted. | --------- | :-------: | ----------- | | `tokenId` | `bytes32` | - | +
+ ### LSP8NonExistingOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8nonexistingoperator) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistingoperator) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8NonExistingOperator(address,bytes32)` - Error hash: `0x4aa31a8c` @@ -948,12 +1242,14 @@ reverts when `operator` is not an operator for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8NotTokenOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8nottokenoperator) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenoperator) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8NotTokenOperator(bytes32,address)` - Error hash: `0x1294d2a9` @@ -972,12 +1268,14 @@ reverts when `caller` is not an allowed operator for `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotTokenOwner -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8nottokenowner) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenowner) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8NotTokenOwner(address,bytes32,address)` - Error hash: `0x5b271ea2` @@ -997,12 +1295,14 @@ reverts when `caller` is not the `tokenOwner` of the `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotifyTokenReceiverContractMissingLSP1Interface -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0x4349776d` @@ -1022,12 +1322,14 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8NotifyTokenReceiverIsEOA -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8notifytokenreceiveriseoa) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceiveriseoa) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8NotifyTokenReceiverIsEOA(address)` - Error hash: `0x03173137` @@ -1045,12 +1347,14 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8OperatorAlreadyAuthorized -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8operatoralreadyauthorized) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8operatoralreadyauthorized) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8OperatorAlreadyAuthorized(address,bytes32)` - Error hash: `0xa7626b68` @@ -1069,12 +1373,14 @@ reverts when `operator` is already authorized for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8TokenOwnerCannotBeOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CappedSupply**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CappedSupply.md#lsp8tokenownercannotbeoperator) -- Solidity implementation in [**LSP8CappedSupply**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CappedSupply) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownercannotbeoperator) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) - Error signature: `LSP8TokenOwnerCannotBeOperator()` - Error hash: `0x89fdad62` @@ -1086,193 +1392,4 @@ error LSP8TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. - - - - - - -[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 -[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 -[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 -[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 -[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 -[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 -[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X -[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y -[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md -[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[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 - - - -[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 - - - -[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership -[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership -[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership - - - -[`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 -[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol -[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 -[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol -[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll -[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol - - - -[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol -[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol -[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol -[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol -[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol -[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so -[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol -[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md index 292ed4d1ce..b5942022eb 100644 --- a/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md +++ b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md @@ -1,21 +1,32 @@ + + + # LSP8CompatibleERC721 -:::info Solidity contract +:::info Standard Specifications + +[`LSP-8-IdentifiableDigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md) + +::: +:::info Solidity implementation -[`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +[`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) ::: LSP8 extension, for compatibility for clients / tools that expect ERC721. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### approve -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#approve) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#approve) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `approve(address,uint256)` - Function selector: `0x095ea7b3` @@ -25,21 +36,25 @@ LSP8 extension, for compatibility for clients / tools that expect ERC721. function approve(address operator, uint256 tokenId) external nonpayable; ``` -Compatible with ERC721 approve. +_Calling `approve` function on `ILSP8CompatibleERC721` contract. Approving operator at address `operator` to transfer tokenId `tokenId` on behalf of its owner._ + +Approval function compatible with ERC721 `approve(address,uint256)`. #### Parameters -| Name | Type | Description | -| ---------- | :-------: | ------------------------------------ | -| `operator` | `address` | The address to approve for `tokenId` | -| `tokenId` | `uint256` | The tokenId to approve | +| Name | Type | Description | +| ---------- | :-------: | ------------------------------------- | +| `operator` | `address` | The address to approve for `tokenId`. | +| `tokenId` | `uint256` | The tokenId to approve. | + +
### authorizeOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#authorizeoperator) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizeoperator) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `authorizeOperator(address,bytes32)` - Function selector: `0xcf5182ba` @@ -70,12 +85,14 @@ Allow an `operator` address to transfer or burn a specific `tokenId` on behalf o | `operator` | `address` | The address to authorize as an operator. | | `tokenId` | `bytes32` | The token ID operator has access to.. | +
+ ### balanceOf -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#balanceof) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#balanceof) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -99,12 +116,14 @@ Get the number of token IDs owned by `tokenOwner`. | ---- | :-------: | ----------------------------------------------------- | | `0` | `uint256` | The total number of token IDs that `tokenOwner` owns. | +
+ ### getApproved -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#getapproved) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getapproved) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `getApproved(uint256)` - Function selector: `0x081812fc` @@ -114,26 +133,30 @@ Get the number of token IDs owned by `tokenOwner`. function getApproved(uint256 tokenId) external view returns (address); ``` +_Retrieving the address other than the token owner that is approved to transfer tokenId `tokenId` on behalf of its owner._ + Compatible with ERC721 getApproved. #### Parameters -| Name | Type | Description | -| --------- | :-------: | -------------------- | -| `tokenId` | `uint256` | The tokenId to query | +| Name | Type | Description | +| --------- | :-------: | --------------------- | +| `tokenId` | `uint256` | The tokenId to query. | #### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------- | -| `0` | `address` | The address of the operator for `tokenId` | +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------ | +| `0` | `address` | The address of the operator for `tokenId`. | + +
### getData -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#getdata) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdata) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -143,28 +166,28 @@ Compatible with ERC721 getApproved. function getData(bytes32 dataKey) external view returns (bytes dataValue); ``` -_Reading the ERC725Y storage for data key `dataKey` returned the following value: `dataValue`._ - -Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`. +_Gets singular data at a given `dataKey`_ #### Parameters -| Name | Type | Description | -| --------- | :-------: | --------------------------------------------- | -| `dataKey` | `bytes32` | The data key for which to retrieve the value. | +| Name | Type | Description | +| --------- | :-------: | ------------------------------- | +| `dataKey` | `bytes32` | The key which value to retrieve | #### Returns -| Name | Type | Description | -| ----------- | :-----: | ---------------------------------------------------- | -| `dataValue` | `bytes` | The bytes value stored under the specified data key. | +| Name | Type | Description | +| ----------- | :-----: | -------------------------- | +| `dataValue` | `bytes` | The data stored at the key | + +
### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#getdatabatch) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatch) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -176,9 +199,7 @@ function getDataBatch( ) external view returns (bytes[] dataValues); ``` -_Reading the ERC725Y storage for data keys `dataKeys` returned the following values: `dataValues`._ - -Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`. +_Gets array of data for multiple given keys_ #### Parameters @@ -192,12 +213,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### getOperatorsOf -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#getoperatorsof) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getoperatorsof) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `getOperatorsOf(bytes32)` - Function selector: `0x49a6078d` @@ -221,12 +244,14 @@ Returns all `operator` addresses that are allowed to transfer or burn a specific | ---- | :---------: | ------------------------------------------------------------------------------------------------------------ | | `0` | `address[]` | An array of operators allowed to transfer or burn a specific `tokenId`. Requirements - `tokenId` must exist. | +
+ ### isApprovedForAll -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#isapprovedforall) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isapprovedforall) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `isApprovedForAll(address,address)` - Function selector: `0xe985e9c5` @@ -252,12 +277,14 @@ function isApprovedForAll( | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### isOperatorFor -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#isoperatorfor) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isoperatorfor) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `isOperatorFor(address,bytes32)` - Function selector: `0x2a3654a4` @@ -285,12 +312,14 @@ Returns whether `operator` address is an operator for a given `tokenId`. | ---- | :----: | --------------------------------------------------------------------- | | `0` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. | +
+ ### name -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#name) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#name) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `name()` - Function selector: `0x06fdde03` @@ -308,12 +337,14 @@ Returns the name of the token. | ---- | :------: | --------------------- | | `0` | `string` | The name of the token | +
+ ### owner -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#owner) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#owner) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -331,12 +362,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### ownerOf -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#ownerof) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownerof) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `ownerOf(uint256)` - Function selector: `0x6352211e` @@ -346,26 +379,30 @@ Returns the address of the current owner. function ownerOf(uint256 tokenId) external view returns (address); ``` +_Retrieving the address that own tokenId `tokenId`._ + Compatible with ERC721 ownerOf. #### Parameters -| Name | Type | Description | -| --------- | :-------: | -------------------- | -| `tokenId` | `uint256` | The tokenId to query | +| Name | Type | Description | +| --------- | :-------: | --------------------- | +| `tokenId` | `uint256` | The tokenId to query. | #### Returns -| Name | Type | Description | -| ---- | :-------: | ------------------------ | -| `0` | `address` | The owner of the tokenId | +| Name | Type | Description | +| ---- | :-------: | ------------------------- | +| `0` | `address` | The owner of the tokenId. | + +
### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#renounceownership) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#renounceownership) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -377,12 +414,14 @@ 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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#revokeoperator) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokeoperator) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `revokeOperator(address,bytes32)` - Function selector: `0x0b0c6d82` @@ -401,12 +440,14 @@ Remove access of `operator` for a given `tokenId`, disallowing it to transfer `t | `operator` | `address` | The address to revoke as an operator. | | `tokenId` | `bytes32` | The tokenId `operator` is revoked from operating on. | +
+ ### safeTransferFrom -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#safetransferfrom) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#safetransferfrom) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `safeTransferFrom(address,address,uint256)` - Function selector: `0x42842e0e` @@ -426,6 +467,8 @@ function safeTransferFrom( ) external nonpayable; ``` +_Calling `safeTransferFrom` function on `ILSP8CompatibleERC721` contract. Transferring tokenId `tokenId` from address `from` to address `to`._ + Safe Transfer function without optional data from the ERC721 standard interface. #### Parameters @@ -436,12 +479,14 @@ Safe Transfer function without optional data from the ERC721 standard interface. | `to` | `address` | The receiving address. | | `tokenId` | `uint256` | The tokenId to transfer. | +
+ ### safeTransferFrom -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#safetransferfrom) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#safetransferfrom) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `safeTransferFrom(address,address,uint256,bytes)` - Function selector: `0xb88d4fde` @@ -462,7 +507,9 @@ function safeTransferFrom( ) external nonpayable; ``` -Safe Transfer function with optional data from the ERC721 standard interface.. +_Calling `safeTransferFrom` function with `data` on `ILSP8CompatibleERC721` contract. Transferring tokenId `tokenId` from address `from` to address `to`._ + +Safe Transfer function with optional data from the ERC721 standard interface. #### Parameters @@ -473,12 +520,14 @@ Safe Transfer function with optional data from the ERC721 standard interface.. | `tokenId` | `uint256` | The tokenId to transfer. | | `data` | `bytes` | The data to be sent with the transfer. | +
+ ### setApprovalForAll -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#setapprovalforall) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setapprovalforall) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `setApprovalForAll(address,bool)` - Function selector: `0xa22cb465` @@ -497,108 +546,68 @@ See [`_setApprovalForAll`](#_setapprovalforall) | `operator` | `address` | - | | `approved` | `bool` | - | +
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#setdata) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdata) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setData(bytes32 dataKey, bytes dataValue) external payable; ``` -_Setting the following data key value pair in the ERC725Y storage. Data key: `dataKey`, data value: `dataValue`. _ - -Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner). - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event. - -
+_Sets singular data for a given `dataKey`_ #### Parameters -| Name | Type | Description | -| ----------- | :-------: | ------------------------------------------ | -| `dataKey` | `bytes32` | The data key for which to set a new value. | -| `dataValue` | `bytes` | The new bytes value to set. | +| 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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#setdatabatch) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatch) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; ``` -_Setting the following data key value pairs in the ERC725Y storage. Data keys: `dataKeys`, data values: `dataValues`. _ - -Batch data setting function that behaves the same as [`setData`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner) of the contract. - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event **for each data key/value pair set**. +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[]` | An array of data keys to set bytes values for. | -| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +| 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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#supportsinterface) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#supportsinterface) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -622,12 +631,14 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### symbol -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#symbol) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#symbol) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `symbol()` - Function selector: `0x95d89b41` @@ -645,12 +656,14 @@ Returns the symbol of the token, usually a shorter version of the name. | ---- | :------: | ----------------------- | | `0` | `string` | The symbol of the token | +
+ ### tokenIdsOf -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#tokenidsof) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenidsof) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `tokenIdsOf(address)` - Function selector: `0xa3b261f2` @@ -674,12 +687,14 @@ Returns the list of token IDs that the `tokenOwner` address owns. | ---- | :---------: | ------------------------------------------------------- | | `0` | `bytes32[]` | An array of `bytes32[] tokenIds` owned by `tokenOwner`. | +
+ ### tokenOwnerOf -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#tokenownerof) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenownerof) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `tokenOwnerOf(bytes32)` - Function selector: `0x217b2270` @@ -703,12 +718,14 @@ Returns the list of `tokenIds` for the `tokenOwner` address. | ---- | :-------: | ----------------------------------------- | | `0` | `address` | The owner address of the given `tokenId`. | +
+ ### tokenURI -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#)) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#)) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `)` - Function selector: `0x59d76dc3` @@ -730,12 +747,14 @@ function tokenURI(uint256) external view returns (string); | ---- | :------: | ----------- | | `0` | `string` | - | +
+ ### totalSupply -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#totalsupply) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#totalsupply) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -753,12 +772,14 @@ Returns the number of existing tokens that have been minted in this contract. | ---- | :-------: | ------------------------------ | | `0` | `uint256` | The number of existing tokens. | +
+ ### transfer -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#transfer) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `transfer(address,address,bytes32,bool,bytes)` - Function selector: `0x511b6952` @@ -786,12 +807,14 @@ Transfer a given `tokenId` token from the `from` address to the `to` address. If | `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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#transferbatch) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferbatch) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `transferBatch(address[],address[],bytes32[],bool[],bytes[])` - Function selector: `0x7e87632c` @@ -819,12 +842,14 @@ Transfers multiple tokens at once based on the arrays of `from`, `to` and `token | `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. | +
+ ### transferFrom -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#transferfrom) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferfrom) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `transferFrom(address,address,uint256)` - Function selector: `0x23b872dd` @@ -844,6 +869,8 @@ function transferFrom( ) external nonpayable; ``` +_Calling `transferFrom` function on `ILSP8CompatibleERC721` contract. Transferring tokenId `tokenId` from address `from` to address `to`._ + Transfer functions from the ERC721 standard interface. #### Parameters @@ -854,12 +881,14 @@ Transfer functions from the ERC721 standard interface. | `to` | `address` | The receiving address. | | `tokenId` | `uint256` | The tokenId to transfer. | +
+ ### transferOwnership -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#transferownership) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferownership) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -877,18 +906,260 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | ---- +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 key, bytes value) internal nonpayable; +``` + +
+ +### \_isOperatorOrOwner + +```solidity +function _isOperatorOrOwner( + address caller, + bytes32 tokenId +) internal view returns (bool); +``` + +verifies if the `caller` is operator or owner for the `tokenId` + +#### Returns + +| Name | Type | Description | +| ---- | :----: | -------------------------------------------- | +| `0` | `bool` | true if `caller` is either operator or owner | + +
+ +### \_revokeOperator + +```solidity +function _revokeOperator( + address operator, + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +removes `operator` from the list of operators for the `tokenId` + +
+ +### \_clearOperators + +```solidity +function _clearOperators( + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +revoke all the current operators for a specific `tokenId` token which belongs to `tokenOwner`. + +#### Parameters + +| Name | Type | Description | +| ------------ | :-------: | ------------------------------------------------- | +| `tokenOwner` | `address` | The address that is the owner of the `tokenId`. | +| `tokenId` | `bytes32` | The token to remove the associated operators for. | + +
+ +### \_exists + +```solidity +function _exists(bytes32 tokenId) internal view returns (bool); +``` + +Returns whether `tokenId` exists. +Tokens start existing when they are minted ([`_mint`](#_mint)), and stop existing when they are burned ([`_burn`](#_burn)). + +
+ +### \_existsOrError + +```solidity +function _existsOrError(bytes32 tokenId) internal view; +``` + +When `tokenId` does not exist then revert with an error. + +
+ +### \_mint + +```solidity +function _mint( + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +
+ +### \_burn + +```solidity +function _burn(bytes32 tokenId, bytes data) internal nonpayable; +``` + +
+ +### \_transfer + +```solidity +function _transfer( + address from, + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +
+ +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer( + address from, + address to, + bytes32 tokenId +) internal nonpayable; +``` + +Hook that is called before any token transfer, including minting and burning. + +- Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function. + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | -------------------------------------- | +| `from` | `address` | The sender address | +| `to` | `address` | @param tokenId The tokenId to transfer | +| `tokenId` | `bytes32` | The tokenId to transfer | + +
+ +### \_notifyTokenSender + +```solidity +function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; +``` + +An attempt is made to notify the token sender about the `tokenId` changing owners using +LSP1 interface. + +
+ +### \_notifyTokenReceiver + +```solidity +function _notifyTokenReceiver( + address to, + bool allowNonLSP1Recipient, + bytes lsp1Data +) internal nonpayable; +``` + +An attempt is made to notify the token receiver about the `tokenId` changing owners +using LSP1 interface. When allowNonLSP1Recipient is FALSE the token receiver MUST support LSP1. +The receiver may revert when the token being sent is not wanted. + +
+ +### \_safeTransfer + +```solidity +function _safeTransfer( + address from, + address to, + uint256 tokenId, + bytes data +) internal nonpayable; +``` + +Transfer the `tokenId` from `from` to `to` and check if the `to` recipient address is +a contract that implements the `IERC721Received` interface and return the right magic value. +See [`_checkOnERC721Received`](#_checkonerc721received) for more infos. + +
+ +### \_setApprovalForAll + +```solidity +function _setApprovalForAll( + address tokensOwner, + address operator, + bool approved +) internal nonpayable; +``` + +Approve `operator` to operate on all tokens of `tokensOwner` + +
+ +**Emitted events:** + +- [`ApprovalForAll`](#approvalforall) event. + +
+ +
## Events ### Approval -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#approval) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#approval) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Event signature: `Approval(address,address,uint256)` -- Event hash: `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` +- Event topic hash: `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` ::: @@ -896,24 +1167,28 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c event Approval(address indexed owner, address indexed operator, uint256 indexed tokenId); ``` -Emitted when the allowance of a `spender` for an `owner` is set by a call to [`approve`](#approve). `value` is the new allowance. +_ERC721 `Approval` compatible event emitted. Successfully approved operator `operator` to operate on tokenId `tokenId` on behalf of token owner `owner`._ + +ERC721 `Approval` event emitted when `owner` enables `operator` for `tokenId`. To provide compatibility with indexing ERC721 events. #### Parameters -| Name | Type | Description | -| ------------------------ | :-------: | ----------- | -| `owner` **`indexed`** | `address` | - | -| `operator` **`indexed`** | `address` | - | -| `tokenId` **`indexed`** | `uint256` | - | +| Name | Type | Description | +| ------------------------ | :-------: | ------------------------------------------ | +| `owner` **`indexed`** | `address` | The address of the owner of the `tokenId`. | +| `operator` **`indexed`** | `address` | The address set as operator. | +| `tokenId` **`indexed`** | `uint256` | The approved tokenId. | + +
### ApprovalForAll -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#approvalforall) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#approvalforall) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Event signature: `ApprovalForAll(address,address,bool)` -- Event hash: `0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31` +- Event topic hash: `0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31` ::: @@ -921,24 +1196,28 @@ Emitted when the allowance of a `spender` for an `owner` is set by a call to [`a event ApprovalForAll(address indexed owner, address indexed operator, bool approved); ``` -Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`. +_ERC721 `ApprovalForAll` compatible event emitted. Successfully set "approved for all" status to `approved` for operator `operator` for token owner `owner`._ + +ERC721 `ApprovalForAll` event emitted when an `operator` is enabled or disabled for an owner to transfer any of its tokenIds. The operator can manage all NFTs of the owner. #### Parameters -| Name | Type | Description | -| ------------------------ | :-------: | ----------- | -| `owner` **`indexed`** | `address` | - | -| `operator` **`indexed`** | `address` | - | -| `approved` | `bool` | - | +| Name | Type | Description | +| ------------------------ | :-------: | ---------------------------------------------- | +| `owner` **`indexed`** | `address` | The address of the owner of tokenIds. | +| `operator` **`indexed`** | `address` | The address set as operator. | +| `approved` | `bool` | If `operator` is approved for all NFTs or not. | + +
### AuthorizedOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#authorizedoperator) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizedoperator) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Event signature: `AuthorizedOperator(address,address,bytes32)` -- Event hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` +- Event topic hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` ::: @@ -946,7 +1225,7 @@ Emitted when `account` grants or revokes permission to `operator` to transfer th event AuthorizedOperator(address indexed operator, address indexed tokenOwner, bytes32 indexed tokenId); ``` -Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on its behalf. +Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`. #### Parameters @@ -956,14 +1235,16 @@ Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on it | `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | | `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` address has access on behalf of `tokenOwner`. | +
+ ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#datachanged) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#datachanged) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -971,25 +1252,25 @@ Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on it event DataChanged(bytes32 indexed dataKey, bytes dataValue); ``` -_The following data key/value pair has been changed in the ERC725Y storage: Data key: `dataKey`, data value: `dataValue`._ - -Emitted when data at a specific `dataKey` was changed to a new value `dataValue`. +_Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | -------------------------------------------- | -| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | -| `dataValue` | `bytes` | The value to set for the given data key. | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#ownershiptransferred) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownershiptransferred) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -1004,14 +1285,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | +
+ ### RevokedOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#revokedoperator) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokedoperator) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Event signature: `RevokedOperator(address,address,bytes32)` -- Event hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` +- Event topic hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` ::: @@ -1023,20 +1306,22 @@ Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on i #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ---------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address revoked as an operator. | -| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | -| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. | +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address revoked from the operator array ({getOperatorsOf}). | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | +| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. | + +
### Transfer -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#transfer) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Event signature: `Transfer(address,address,address,bytes32,bool,bytes)` -- Event hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` +- Event topic hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` ::: @@ -1044,6 +1329,8 @@ Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on i event Transfer(address operator, address indexed from, address indexed to, bytes32 indexed tokenId, bool allowNonLSP1Recipient, bytes data); ``` +_ERC721 `Transfer` compatible event emitted. Successfully transferred tokenId `tokenId` from `from` to `to`._ + Emitted when `tokenId` token is transferred from the `from` to the `to` address. #### Parameters @@ -1057,16 +1344,16 @@ Emitted when `tokenId` token is transferred from the `from` to the `to` address. | `allowNonLSP1Recipient` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. | | `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. | ---- +
## Errors ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -1076,14 +1363,16 @@ Emitted when `tokenId` token is transferred from the `from` to the `to` address. error ERC725Y_DataKeysValuesEmptyArray(); ``` -Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array. +reverts when one of the array parameter provided to `setDataBatch` is an empty array + +
### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -1093,14 +1382,16 @@ Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabat error ERC725Y_DataKeysValuesLengthMismatch(); ``` -Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. +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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -1110,14 +1401,16 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat error ERC725Y_MsgValueDisallowed(); ``` -Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function. +reverts when sending value to the `setData(..)` functions + +
### LSP4TokenNameNotEditable -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp4tokennamenoteditable) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -1129,12 +1422,14 @@ 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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp4tokensymbolnoteditable) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -1146,12 +1441,14 @@ 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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp8cannotsendtoaddresszero) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoaddresszero) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP8CannotSendToAddressZero()` - Error hash: `0x24ecef4d` @@ -1163,12 +1460,14 @@ error LSP8CannotSendToAddressZero(); reverts when trying to send token to the zero address. +
+ ### LSP8CannotSendToSelf -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp8cannotsendtoself) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoself) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP8CannotSendToSelf()` - Error hash: `0x5d67d6c1` @@ -1180,12 +1479,14 @@ error LSP8CannotSendToSelf(); reverts when specifying the same address for `from` and `to` in a token transfer. +
+ ### LSP8CannotUseAddressZeroAsOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp8cannotuseaddresszeroasoperator) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotuseaddresszeroasoperator) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP8CannotUseAddressZeroAsOperator()` - Error hash: `0x9577b8b3` @@ -1197,12 +1498,14 @@ error LSP8CannotUseAddressZeroAsOperator(); reverts when trying to set the zero address as an operator. +
+ ### LSP8InvalidTransferBatch -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp8invalidtransferbatch) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8invalidtransferbatch) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP8InvalidTransferBatch()` - Error hash: `0x93a83119` @@ -1214,12 +1517,14 @@ error LSP8InvalidTransferBatch(); reverts when the parameters used for `transferBatch` have different lengths. +
+ ### LSP8NonExistentTokenId -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp8nonexistenttokenid) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistenttokenid) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP8NonExistentTokenId(bytes32)` - Error hash: `0xae8f9a36` @@ -1237,12 +1542,14 @@ reverts when `tokenId` has not been minted. | --------- | :-------: | ----------- | | `tokenId` | `bytes32` | - | +
+ ### LSP8NonExistingOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp8nonexistingoperator) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistingoperator) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP8NonExistingOperator(address,bytes32)` - Error hash: `0x4aa31a8c` @@ -1261,12 +1568,14 @@ reverts when `operator` is not an operator for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8NotTokenOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp8nottokenoperator) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenoperator) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP8NotTokenOperator(bytes32,address)` - Error hash: `0x1294d2a9` @@ -1285,12 +1594,14 @@ reverts when `caller` is not an allowed operator for `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotTokenOwner -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp8nottokenowner) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenowner) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP8NotTokenOwner(address,bytes32,address)` - Error hash: `0x5b271ea2` @@ -1310,12 +1621,14 @@ reverts when `caller` is not the `tokenOwner` of the `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotifyTokenReceiverContractMissingLSP1Interface -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp8notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP8NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0x4349776d` @@ -1335,12 +1648,14 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8NotifyTokenReceiverIsEOA -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp8notifytokenreceiveriseoa) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceiveriseoa) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP8NotifyTokenReceiverIsEOA(address)` - Error hash: `0x03173137` @@ -1358,12 +1673,14 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8OperatorAlreadyAuthorized -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp8operatoralreadyauthorized) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8operatoralreadyauthorized) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP8OperatorAlreadyAuthorized(address,bytes32)` - Error hash: `0xa7626b68` @@ -1382,12 +1699,14 @@ reverts when `operator` is already authorized for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8TokenOwnerCannotBeOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721.md#lsp8tokenownercannotbeoperator) -- Solidity implementation in [**LSP8CompatibleERC721**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownercannotbeoperator) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) - Error signature: `LSP8TokenOwnerCannotBeOperator()` - Error hash: `0x89fdad62` @@ -1399,193 +1718,4 @@ error LSP8TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. - - - - - - -[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 -[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 -[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 -[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 -[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 -[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 -[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X -[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y -[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md -[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[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 - - - -[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 - - - -[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership -[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership -[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership - - - -[`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 -[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol -[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 -[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol -[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll -[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol - - - -[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol -[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol -[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol -[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol -[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol -[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so -[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol -[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.md b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.md index 527c7e76cb..f4909c7842 100644 --- a/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.md +++ b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.md @@ -1,21 +1,32 @@ + + + # LSP8Enumerable -:::info Solidity contract +:::info Standard Specifications + +[`LSP-8-IdentifiableDigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md) + +::: +:::info Solidity implementation -[`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +[`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) ::: LSP8 extension that enables to enumerate over all the `tokenIds` ever minted. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### authorizeOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#authorizeoperator) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizeoperator) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `authorizeOperator(address,bytes32)` - Function selector: `0xcf5182ba` @@ -37,12 +48,14 @@ Allow an `operator` address to transfer or burn a specific `tokenId` on behalf o | `operator` | `address` | The address to authorize as an operator. | | `tokenId` | `bytes32` | The token ID operator has access to.. | +
+ ### balanceOf -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#balanceof) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#balanceof) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -66,12 +79,14 @@ Get the number of token IDs owned by `tokenOwner`. | ---- | :-------: | ----------------------------------------------------- | | `0` | `uint256` | The total number of token IDs that `tokenOwner` owns. | +
+ ### getData -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#getdata) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdata) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -81,28 +96,28 @@ Get the number of token IDs owned by `tokenOwner`. function getData(bytes32 dataKey) external view returns (bytes dataValue); ``` -_Reading the ERC725Y storage for data key `dataKey` returned the following value: `dataValue`._ - -Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`. +_Gets singular data at a given `dataKey`_ #### Parameters -| Name | Type | Description | -| --------- | :-------: | --------------------------------------------- | -| `dataKey` | `bytes32` | The data key for which to retrieve the value. | +| Name | Type | Description | +| --------- | :-------: | ------------------------------- | +| `dataKey` | `bytes32` | The key which value to retrieve | #### Returns -| Name | Type | Description | -| ----------- | :-----: | ---------------------------------------------------- | -| `dataValue` | `bytes` | The bytes value stored under the specified data key. | +| Name | Type | Description | +| ----------- | :-----: | -------------------------- | +| `dataValue` | `bytes` | The data stored at the key | + +
### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#getdatabatch) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatch) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -114,9 +129,7 @@ function getDataBatch( ) external view returns (bytes[] dataValues); ``` -_Reading the ERC725Y storage for data keys `dataKeys` returned the following values: `dataValues`._ - -Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`. +_Gets array of data for multiple given keys_ #### Parameters @@ -130,12 +143,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### getOperatorsOf -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#getoperatorsof) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getoperatorsof) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `getOperatorsOf(bytes32)` - Function selector: `0x49a6078d` @@ -159,12 +174,14 @@ Returns all `operator` addresses that are allowed to transfer or burn a specific | ---- | :---------: | ------------------------------------------------------------------------------------------------------------ | | `0` | `address[]` | An array of operators allowed to transfer or burn a specific `tokenId`. Requirements - `tokenId` must exist. | +
+ ### isOperatorFor -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#isoperatorfor) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isoperatorfor) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `isOperatorFor(address,bytes32)` - Function selector: `0x2a3654a4` @@ -192,12 +209,14 @@ Returns whether `operator` address is an operator for a given `tokenId`. | ---- | :----: | --------------------------------------------------------------------- | | `0` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. | +
+ ### owner -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#owner) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#owner) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -215,12 +234,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#renounceownership) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#renounceownership) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -232,12 +253,14 @@ 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 +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#revokeoperator) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokeoperator) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `revokeOperator(address,bytes32)` - Function selector: `0x0b0c6d82` @@ -256,108 +279,68 @@ Remove access of `operator` for a given `tokenId`, disallowing it to transfer `t | `operator` | `address` | The address to revoke as an operator. | | `tokenId` | `bytes32` | The tokenId `operator` is revoked from operating on. | +
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#setdata) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdata) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setData(bytes32 dataKey, bytes dataValue) external payable; ``` -_Setting the following data key value pair in the ERC725Y storage. Data key: `dataKey`, data value: `dataValue`. _ - -Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner). - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event. - -
+_Sets singular data for a given `dataKey`_ #### Parameters -| Name | Type | Description | -| ----------- | :-------: | ------------------------------------------ | -| `dataKey` | `bytes32` | The data key for which to set a new value. | -| `dataValue` | `bytes` | The new bytes value to set. | +| 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 +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#setdatabatch) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatch) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; ``` -_Setting the following data key value pairs in the ERC725Y storage. Data keys: `dataKeys`, data values: `dataValues`. _ - -Batch data setting function that behaves the same as [`setData`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner) of the contract. - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event **for each data key/value pair set**. +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[]` | An array of data keys to set bytes values for. | -| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +| 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 +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#supportsinterface) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#supportsinterface) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -381,12 +364,14 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### tokenAt -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#tokenat) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenat) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `tokenAt(uint256)` - Function selector: `0x92a91a3a` @@ -396,6 +381,8 @@ Returns true if this contract implements the interface defined by `interfaceId`. function tokenAt(uint256 index) external view returns (bytes32); ``` +_Retrieving the `tokenId` for `msg.sender` located in its list at index number `index`._ + Returns a token id at index. See [`totalSupply`](#totalsupply) to get total number of minted tokens. #### Parameters @@ -410,12 +397,14 @@ Returns a token id at index. See [`totalSupply`](#totalsupply) to get total numb | ---- | :-------: | ------------------------------------------------------- | | `0` | `bytes32` | TokenId or `bytes32(0)` if no tokenId exist at `index`. | +
+ ### tokenIdsOf -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#tokenidsof) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenidsof) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `tokenIdsOf(address)` - Function selector: `0xa3b261f2` @@ -439,12 +428,14 @@ Returns the list of token IDs that the `tokenOwner` address owns. | ---- | :---------: | ------------------------------------------------------- | | `0` | `bytes32[]` | An array of `bytes32[] tokenIds` owned by `tokenOwner`. | +
+ ### tokenOwnerOf -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#tokenownerof) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenownerof) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `tokenOwnerOf(bytes32)` - Function selector: `0x217b2270` @@ -468,12 +459,14 @@ Returns the list of `tokenIds` for the `tokenOwner` address. | ---- | :-------: | ----------------------------------------- | | `0` | `address` | The owner address of the given `tokenId`. | +
+ ### totalSupply -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#totalsupply) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#totalsupply) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -491,12 +484,14 @@ Returns the number of existing tokens that have been minted in this contract. | ---- | :-------: | ------------------------------ | | `0` | `uint256` | The number of existing tokens. | +
+ ### transfer -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#transfer) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `transfer(address,address,bytes32,bool,bytes)` - Function selector: `0x511b6952` @@ -524,12 +519,14 @@ Transfer a given `tokenId` token from the `from` address to the `to` address. If | `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 +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#transferbatch) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferbatch) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `transferBatch(address[],address[],bytes32[],bool[],bytes[])` - Function selector: `0x7e87632c` @@ -557,12 +554,14 @@ Transfers multiple tokens at once based on the arrays of `from`, `to` and `token | `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 +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#transferownership) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferownership) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -580,18 +579,296 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | ---- +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +Save gas by emitting the [`DataChanged`](#datachanged) event with only the first 256 bytes of dataValue + +
+ +### \_isOperatorOrOwner + +```solidity +function _isOperatorOrOwner( + address caller, + bytes32 tokenId +) internal view returns (bool); +``` + +verifies if the `caller` is operator or owner for the `tokenId` + +#### Returns + +| Name | Type | Description | +| ---- | :----: | -------------------------------------------- | +| `0` | `bool` | true if `caller` is either operator or owner | + +
+ +### \_revokeOperator + +```solidity +function _revokeOperator( + address operator, + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +removes `operator` from the list of operators for the `tokenId` + +
+ +### \_clearOperators + +```solidity +function _clearOperators( + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +revoke all the current operators for a specific `tokenId` token which belongs to `tokenOwner`. + +#### Parameters + +| Name | Type | Description | +| ------------ | :-------: | ------------------------------------------------- | +| `tokenOwner` | `address` | The address that is the owner of the `tokenId`. | +| `tokenId` | `bytes32` | The token to remove the associated operators for. | + +
+ +### \_exists + +```solidity +function _exists(bytes32 tokenId) internal view returns (bool); +``` + +Returns whether `tokenId` exists. +Tokens start existing when they are minted ([`_mint`](#_mint)), and stop existing when they are burned ([`_burn`](#_burn)). + +
+ +### \_existsOrError + +```solidity +function _existsOrError(bytes32 tokenId) internal view; +``` + +When `tokenId` does not exist then revert with an error. + +
+ +### \_mint + +```solidity +function _mint( + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Create `tokenId` by minting it and transfers it to `to`. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as `from` address. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- | +| `to` | `address` | @param tokenId The token ID to create (= mint). | +| `tokenId` | `bytes32` | The token ID to create (= mint). | +| `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. | +| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hook of the `to` address. | + +
+ +### \_burn + +:::tip Hint + +In dApps, you can know which addresses are burning tokens by listening for the `Transfer` event and filter with the zero address as `to`. + +::: + +```solidity +function _burn(bytes32 tokenId, bytes data) internal nonpayable; +``` + +Burn a specific `tokenId`, removing the `tokenId` from the [`tokenIdsOf`](#tokenidsof) the caller and decreasing its [`balanceOf`](#balanceof) by -1. +This will also clear all the operators allowed to transfer the `tokenId`. +The owner of the `tokenId` will be notified about the `tokenId` being transferred through its LSP1 [`universalReceiver`](#universalreceiver) +function, if it is a contract that supports the LSP1 interface. Its [`universalReceiver`](#universalreceiver) function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before burning `tokenId` and updating the balances. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as the `to` address. + +
+ +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | --------------------------------------------------------------------------------------------------------------------------- | +| `tokenId` | `bytes32` | The token to burn. | +| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the LSP1 hook on the token owner's address. | + +
+ +### \_transfer + +:::danger + +This internal function does not check if the sender is authorized or not to operate on the `tokenId`. + +::: + +```solidity +function _transfer( + address from, + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Change the owner of the `tokenId` from `from` to `to`. +Both the sender and recipient will be notified of the `tokenId` being transferred through their LSP1 [`universalReceiver`](#universalreceiver) +function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before changing the owner of `tokenId`. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | The sender address. | +| `to` | `address` | @param tokenId The token to transfer. | +| `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 the LSP1 standard. | +| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | + +
+ +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer( + address from, + address to, + bytes32 tokenId +) internal nonpayable; +``` + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | -------------------------------------------------------------------------------- | +| `from` | `address` | The address sending the `tokenId` (`address(0)` when `tokenId` is being minted). | +| `to` | `address` | @param tokenId The bytes32 identifier of the token being transferred. | +| `tokenId` | `bytes32` | The bytes32 identifier of the token being transferred. | + +
+ +### \_notifyTokenSender + +```solidity +function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; +``` + +An attempt is made to notify the token sender about the `tokenId` changing owners using +LSP1 interface. + +
+ +### \_notifyTokenReceiver + +```solidity +function _notifyTokenReceiver( + address to, + bool allowNonLSP1Recipient, + bytes lsp1Data +) internal nonpayable; +``` + +An attempt is made to notify the token receiver about the `tokenId` changing owners +using LSP1 interface. When allowNonLSP1Recipient is FALSE the token receiver MUST support LSP1. +The receiver may revert when the token being sent is not wanted. + +
## Events ### AuthorizedOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#authorizedoperator) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizedoperator) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Event signature: `AuthorizedOperator(address,address,bytes32)` -- Event hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` +- Event topic hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` ::: @@ -599,7 +876,7 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c event AuthorizedOperator(address indexed operator, address indexed tokenOwner, bytes32 indexed tokenId); ``` -Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on its behalf. +Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`. #### Parameters @@ -609,14 +886,16 @@ Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on it | `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | | `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` address has access on behalf of `tokenOwner`. | +
+ ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#datachanged) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#datachanged) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -624,25 +903,25 @@ Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on it event DataChanged(bytes32 indexed dataKey, bytes dataValue); ``` -_The following data key/value pair has been changed in the ERC725Y storage: Data key: `dataKey`, data value: `dataValue`._ - -Emitted when data at a specific `dataKey` was changed to a new value `dataValue`. +_Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | -------------------------------------------- | -| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | -| `dataValue` | `bytes` | The value to set for the given data key. | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#ownershiptransferred) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownershiptransferred) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -657,14 +936,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | +
+ ### RevokedOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#revokedoperator) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokedoperator) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Event signature: `RevokedOperator(address,address,bytes32)` -- Event hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` +- Event topic hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` ::: @@ -676,20 +957,22 @@ Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on i #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ---------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address revoked as an operator. | -| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | -| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. | +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address revoked from the operator array ({getOperatorsOf}). | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | +| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. | + +
### Transfer -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#transfer) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Event signature: `Transfer(address,address,address,bytes32,bool,bytes)` -- Event hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` +- Event topic hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` ::: @@ -710,16 +993,16 @@ Emitted when `tokenId` token is transferred from the `from` to the `to` address. | `allowNonLSP1Recipient` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. | | `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. | ---- +
## Errors ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -729,14 +1012,16 @@ Emitted when `tokenId` token is transferred from the `from` to the `to` address. error ERC725Y_DataKeysValuesEmptyArray(); ``` -Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array. +reverts when one of the array parameter provided to `setDataBatch` is an empty array + +
### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -746,14 +1031,16 @@ Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabat error ERC725Y_DataKeysValuesLengthMismatch(); ``` -Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. +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 +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -763,14 +1050,16 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat error ERC725Y_MsgValueDisallowed(); ``` -Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function. +reverts when sending value to the `setData(..)` functions + +
### LSP4TokenNameNotEditable -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp4tokennamenoteditable) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -782,12 +1071,14 @@ 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 +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp4tokensymbolnoteditable) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -799,12 +1090,14 @@ 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 +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp8cannotsendtoaddresszero) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoaddresszero) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP8CannotSendToAddressZero()` - Error hash: `0x24ecef4d` @@ -816,12 +1109,14 @@ error LSP8CannotSendToAddressZero(); reverts when trying to send token to the zero address. +
+ ### LSP8CannotSendToSelf -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp8cannotsendtoself) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoself) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP8CannotSendToSelf()` - Error hash: `0x5d67d6c1` @@ -833,12 +1128,14 @@ error LSP8CannotSendToSelf(); reverts when specifying the same address for `from` and `to` in a token transfer. +
+ ### LSP8CannotUseAddressZeroAsOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp8cannotuseaddresszeroasoperator) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotuseaddresszeroasoperator) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP8CannotUseAddressZeroAsOperator()` - Error hash: `0x9577b8b3` @@ -850,12 +1147,14 @@ error LSP8CannotUseAddressZeroAsOperator(); reverts when trying to set the zero address as an operator. +
+ ### LSP8InvalidTransferBatch -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp8invalidtransferbatch) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8invalidtransferbatch) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP8InvalidTransferBatch()` - Error hash: `0x93a83119` @@ -867,12 +1166,14 @@ error LSP8InvalidTransferBatch(); reverts when the parameters used for `transferBatch` have different lengths. +
+ ### LSP8NonExistentTokenId -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp8nonexistenttokenid) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistenttokenid) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP8NonExistentTokenId(bytes32)` - Error hash: `0xae8f9a36` @@ -890,12 +1191,14 @@ reverts when `tokenId` has not been minted. | --------- | :-------: | ----------- | | `tokenId` | `bytes32` | - | +
+ ### LSP8NonExistingOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp8nonexistingoperator) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistingoperator) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP8NonExistingOperator(address,bytes32)` - Error hash: `0x4aa31a8c` @@ -914,12 +1217,14 @@ reverts when `operator` is not an operator for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8NotTokenOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp8nottokenoperator) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenoperator) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP8NotTokenOperator(bytes32,address)` - Error hash: `0x1294d2a9` @@ -938,12 +1243,14 @@ reverts when `caller` is not an allowed operator for `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotTokenOwner -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp8nottokenowner) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenowner) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP8NotTokenOwner(address,bytes32,address)` - Error hash: `0x5b271ea2` @@ -963,12 +1270,14 @@ reverts when `caller` is not the `tokenOwner` of the `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotifyTokenReceiverContractMissingLSP1Interface -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp8notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP8NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0x4349776d` @@ -988,12 +1297,14 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8NotifyTokenReceiverIsEOA -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp8notifytokenreceiveriseoa) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceiveriseoa) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP8NotifyTokenReceiverIsEOA(address)` - Error hash: `0x03173137` @@ -1011,12 +1322,14 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8OperatorAlreadyAuthorized -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp8operatoralreadyauthorized) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8operatoralreadyauthorized) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP8OperatorAlreadyAuthorized(address,bytes32)` - Error hash: `0xa7626b68` @@ -1035,12 +1348,14 @@ reverts when `operator` is already authorized for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8TokenOwnerCannotBeOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Enumerable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Enumerable.md#lsp8tokenownercannotbeoperator) -- Solidity implementation in [**LSP8Enumerable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Enumerable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownercannotbeoperator) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) - Error signature: `LSP8TokenOwnerCannotBeOperator()` - Error hash: `0x89fdad62` @@ -1052,193 +1367,4 @@ error LSP8TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. - - - - - - -[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 -[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 -[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 -[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 -[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 -[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 -[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X -[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y -[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md -[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[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 - - - -[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 - - - -[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership -[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership -[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership - - - -[`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 -[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol -[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 -[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol -[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll -[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol - - - -[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol -[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol -[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol -[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol -[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol -[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so -[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol -[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md index 9c4812eb42..48128ab876 100644 --- a/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md +++ b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md @@ -1,21 +1,32 @@ + + + # LSP8CompatibleERC721Mintable -:::info Solidity contract +:::info Standard Specifications + +[`LSP-8-IdentifiableDigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md) + +::: +:::info Solidity implementation -[`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +[`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) ::: > LSP8CompatibleERC721Mintable deployable preset contract with a public {mint} function callable only by the contract {owner}. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### constructor -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#constructor) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#constructor) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) ::: @@ -23,7 +34,7 @@ constructor(string name_, string symbol_, address newOwner_); ``` -_Deploying a `LSP8CompatibleERC721Mintable` token contract with: token name = `name\_`, token symbol = `symbol\_`, and address `newOwner\_` as the token contract owner._ +_Deploying a `LSP8CompatibleERC721Mintable` token contract with: token name = `name_`, token symbol = `symbol_`, and address `newOwner_` as the token contract owner._ #### Parameters @@ -33,12 +44,14 @@ _Deploying a `LSP8CompatibleERC721Mintable` token contract with: token name = `n | `symbol_` | `string` | The symbol of the token. | | `newOwner_` | `address` | The owner of the token contract. | +
+ ### approve -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#approve) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#approve) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `approve(address,uint256)` - Function selector: `0x095ea7b3` @@ -48,21 +61,25 @@ _Deploying a `LSP8CompatibleERC721Mintable` token contract with: token name = `n function approve(address operator, uint256 tokenId) external nonpayable; ``` -Compatible with ERC721 approve. +_Calling `approve` function on `ILSP8CompatibleERC721` contract. Approving operator at address `operator` to transfer tokenId `tokenId` on behalf of its owner._ + +Approval function compatible with ERC721 `approve(address,uint256)`. #### Parameters -| Name | Type | Description | -| ---------- | :-------: | ------------------------------------ | -| `operator` | `address` | The address to approve for `tokenId` | -| `tokenId` | `uint256` | The tokenId to approve | +| Name | Type | Description | +| ---------- | :-------: | ------------------------------------- | +| `operator` | `address` | The address to approve for `tokenId`. | +| `tokenId` | `uint256` | The tokenId to approve. | + +
### authorizeOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#authorizeoperator) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizeoperator) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `authorizeOperator(address,bytes32)` - Function selector: `0xcf5182ba` @@ -93,12 +110,14 @@ Allow an `operator` address to transfer or burn a specific `tokenId` on behalf o | `operator` | `address` | The address to authorize as an operator. | | `tokenId` | `bytes32` | The token ID operator has access to.. | +
+ ### balanceOf -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#balanceof) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#balanceof) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -122,12 +141,14 @@ Get the number of token IDs owned by `tokenOwner`. | ---- | :-------: | ----------------------------------------------------- | | `0` | `uint256` | The total number of token IDs that `tokenOwner` owns. | +
+ ### getApproved -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#getapproved) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getapproved) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `getApproved(uint256)` - Function selector: `0x081812fc` @@ -137,26 +158,30 @@ Get the number of token IDs owned by `tokenOwner`. function getApproved(uint256 tokenId) external view returns (address); ``` +_Retrieving the address other than the token owner that is approved to transfer tokenId `tokenId` on behalf of its owner._ + Compatible with ERC721 getApproved. #### Parameters -| Name | Type | Description | -| --------- | :-------: | -------------------- | -| `tokenId` | `uint256` | The tokenId to query | +| Name | Type | Description | +| --------- | :-------: | --------------------- | +| `tokenId` | `uint256` | The tokenId to query. | #### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------- | -| `0` | `address` | The address of the operator for `tokenId` | +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------ | +| `0` | `address` | The address of the operator for `tokenId`. | + +
### getData -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#getdata) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdata) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -166,28 +191,28 @@ Compatible with ERC721 getApproved. function getData(bytes32 dataKey) external view returns (bytes dataValue); ``` -_Reading the ERC725Y storage for data key `dataKey` returned the following value: `dataValue`._ - -Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`. +_Gets singular data at a given `dataKey`_ #### Parameters -| Name | Type | Description | -| --------- | :-------: | --------------------------------------------- | -| `dataKey` | `bytes32` | The data key for which to retrieve the value. | +| Name | Type | Description | +| --------- | :-------: | ------------------------------- | +| `dataKey` | `bytes32` | The key which value to retrieve | #### Returns -| Name | Type | Description | -| ----------- | :-----: | ---------------------------------------------------- | -| `dataValue` | `bytes` | The bytes value stored under the specified data key. | +| Name | Type | Description | +| ----------- | :-----: | -------------------------- | +| `dataValue` | `bytes` | The data stored at the key | + +
### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#getdatabatch) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatch) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -199,9 +224,7 @@ function getDataBatch( ) external view returns (bytes[] dataValues); ``` -_Reading the ERC725Y storage for data keys `dataKeys` returned the following values: `dataValues`._ - -Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`. +_Gets array of data for multiple given keys_ #### Parameters @@ -215,12 +238,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### getOperatorsOf -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#getoperatorsof) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getoperatorsof) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `getOperatorsOf(bytes32)` - Function selector: `0x49a6078d` @@ -244,12 +269,14 @@ Returns all `operator` addresses that are allowed to transfer or burn a specific | ---- | :---------: | ------------------------------------------------------------------------------------------------------------ | | `0` | `address[]` | An array of operators allowed to transfer or burn a specific `tokenId`. Requirements - `tokenId` must exist. | +
+ ### isApprovedForAll -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#isapprovedforall) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isapprovedforall) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `isApprovedForAll(address,address)` - Function selector: `0xe985e9c5` @@ -275,12 +302,14 @@ function isApprovedForAll( | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### isOperatorFor -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#isoperatorfor) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isoperatorfor) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `isOperatorFor(address,bytes32)` - Function selector: `0x2a3654a4` @@ -308,12 +337,14 @@ Returns whether `operator` address is an operator for a given `tokenId`. | ---- | :----: | --------------------------------------------------------------------- | | `0` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. | +
+ ### mint -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#mint) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#mint) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `mint(address,bytes32,bool,bytes)` - Function selector: `0xaf255b61` @@ -328,23 +359,27 @@ function mint( ) external nonpayable; ``` +_Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `allowNonLSP1Recipient`)._ + Public [`_mint`](#_mint) function only callable by the [`owner`](#owner). #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | ----------- | -| `to` | `address` | - | -| `tokenId` | `bytes32` | - | -| `allowNonLSP1Recipient` | `bool` | - | -| `data` | `bytes` | - | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------ | +| `to` | `address` | The address that will receive the minted `tokenId`. | +| `tokenId` | `bytes32` | The tokenId to mint. | +| `allowNonLSP1Recipient` | `bool` | Set to `false` to ensure that you are minting for a recipient that implements LSP1, `false` otherwise for forcing the minting. | +| `data` | `bytes` | Any addition data to be sent alongside the minting. | + +
### name -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#name) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#name) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `name()` - Function selector: `0x06fdde03` @@ -362,12 +397,14 @@ Returns the name of the token. | ---- | :------: | --------------------- | | `0` | `string` | The name of the token | +
+ ### owner -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#owner) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#owner) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -385,12 +422,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### ownerOf -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#ownerof) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownerof) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `ownerOf(uint256)` - Function selector: `0x6352211e` @@ -400,26 +439,30 @@ Returns the address of the current owner. function ownerOf(uint256 tokenId) external view returns (address); ``` +_Retrieving the address that own tokenId `tokenId`._ + Compatible with ERC721 ownerOf. #### Parameters -| Name | Type | Description | -| --------- | :-------: | -------------------- | -| `tokenId` | `uint256` | The tokenId to query | +| Name | Type | Description | +| --------- | :-------: | --------------------- | +| `tokenId` | `uint256` | The tokenId to query. | #### Returns -| Name | Type | Description | -| ---- | :-------: | ------------------------ | -| `0` | `address` | The owner of the tokenId | +| Name | Type | Description | +| ---- | :-------: | ------------------------- | +| `0` | `address` | The owner of the tokenId. | + +
### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#renounceownership) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#renounceownership) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -431,12 +474,14 @@ 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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#revokeoperator) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokeoperator) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `revokeOperator(address,bytes32)` - Function selector: `0x0b0c6d82` @@ -455,12 +500,14 @@ Remove access of `operator` for a given `tokenId`, disallowing it to transfer `t | `operator` | `address` | The address to revoke as an operator. | | `tokenId` | `bytes32` | The tokenId `operator` is revoked from operating on. | +
+ ### safeTransferFrom -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#safetransferfrom) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#safetransferfrom) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `safeTransferFrom(address,address,uint256)` - Function selector: `0x42842e0e` @@ -480,6 +527,8 @@ function safeTransferFrom( ) external nonpayable; ``` +_Calling `safeTransferFrom` function on `ILSP8CompatibleERC721` contract. Transferring tokenId `tokenId` from address `from` to address `to`._ + Safe Transfer function without optional data from the ERC721 standard interface. #### Parameters @@ -490,12 +539,14 @@ Safe Transfer function without optional data from the ERC721 standard interface. | `to` | `address` | The receiving address. | | `tokenId` | `uint256` | The tokenId to transfer. | +
+ ### safeTransferFrom -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#safetransferfrom) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#safetransferfrom) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `safeTransferFrom(address,address,uint256,bytes)` - Function selector: `0xb88d4fde` @@ -516,7 +567,9 @@ function safeTransferFrom( ) external nonpayable; ``` -Safe Transfer function with optional data from the ERC721 standard interface.. +_Calling `safeTransferFrom` function with `data` on `ILSP8CompatibleERC721` contract. Transferring tokenId `tokenId` from address `from` to address `to`._ + +Safe Transfer function with optional data from the ERC721 standard interface. #### Parameters @@ -527,12 +580,14 @@ Safe Transfer function with optional data from the ERC721 standard interface.. | `tokenId` | `uint256` | The tokenId to transfer. | | `data` | `bytes` | The data to be sent with the transfer. | +
+ ### setApprovalForAll -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#setapprovalforall) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setapprovalforall) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `setApprovalForAll(address,bool)` - Function selector: `0xa22cb465` @@ -551,108 +606,68 @@ See [`_setApprovalForAll`](#_setapprovalforall) | `operator` | `address` | - | | `approved` | `bool` | - | +
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#setdata) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdata) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setData(bytes32 dataKey, bytes dataValue) external payable; ``` -_Setting the following data key value pair in the ERC725Y storage. Data key: `dataKey`, data value: `dataValue`. _ - -Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner). - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event. - -
+_Sets singular data for a given `dataKey`_ #### Parameters -| Name | Type | Description | -| ----------- | :-------: | ------------------------------------------ | -| `dataKey` | `bytes32` | The data key for which to set a new value. | -| `dataValue` | `bytes` | The new bytes value to set. | +| 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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#setdatabatch) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatch) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; ``` -_Setting the following data key value pairs in the ERC725Y storage. Data keys: `dataKeys`, data values: `dataValues`. _ - -Batch data setting function that behaves the same as [`setData`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner) of the contract. - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event **for each data key/value pair set**. +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[]` | An array of data keys to set bytes values for. | -| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +| 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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#supportsinterface) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#supportsinterface) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -676,12 +691,14 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### symbol -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#symbol) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#symbol) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `symbol()` - Function selector: `0x95d89b41` @@ -699,12 +716,14 @@ Returns the symbol of the token, usually a shorter version of the name. | ---- | :------: | ----------------------- | | `0` | `string` | The symbol of the token | +
+ ### tokenIdsOf -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#tokenidsof) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenidsof) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `tokenIdsOf(address)` - Function selector: `0xa3b261f2` @@ -728,12 +747,14 @@ Returns the list of token IDs that the `tokenOwner` address owns. | ---- | :---------: | ------------------------------------------------------- | | `0` | `bytes32[]` | An array of `bytes32[] tokenIds` owned by `tokenOwner`. | +
+ ### tokenOwnerOf -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#tokenownerof) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenownerof) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `tokenOwnerOf(bytes32)` - Function selector: `0x217b2270` @@ -757,12 +778,14 @@ Returns the list of `tokenIds` for the `tokenOwner` address. | ---- | :-------: | ----------------------------------------- | | `0` | `address` | The owner address of the given `tokenId`. | +
+ ### tokenURI -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#)) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#)) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `)` - Function selector: `0x59d76dc3` @@ -784,12 +807,14 @@ function tokenURI(uint256) external view returns (string); | ---- | :------: | ----------- | | `0` | `string` | - | +
+ ### totalSupply -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#totalsupply) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#totalsupply) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -807,12 +832,14 @@ Returns the number of existing tokens that have been minted in this contract. | ---- | :-------: | ------------------------------ | | `0` | `uint256` | The number of existing tokens. | +
+ ### transfer -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#transfer) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `transfer(address,address,bytes32,bool,bytes)` - Function selector: `0x511b6952` @@ -840,12 +867,14 @@ Transfer a given `tokenId` token from the `from` address to the `to` address. If | `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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#transferbatch) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferbatch) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `transferBatch(address[],address[],bytes32[],bool[],bytes[])` - Function selector: `0x7e87632c` @@ -873,12 +902,14 @@ Transfers multiple tokens at once based on the arrays of `from`, `to` and `token | `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. | +
+ ### transferFrom -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#transferfrom) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferfrom) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `transferFrom(address,address,uint256)` - Function selector: `0x23b872dd` @@ -898,6 +929,8 @@ function transferFrom( ) external nonpayable; ``` +_Calling `transferFrom` function on `ILSP8CompatibleERC721` contract. Transferring tokenId `tokenId` from address `from` to address `to`._ + Transfer functions from the ERC721 standard interface. #### Parameters @@ -908,12 +941,14 @@ Transfer functions from the ERC721 standard interface. | `to` | `address` | The receiving address. | | `tokenId` | `uint256` | The tokenId to transfer. | +
+ ### transferOwnership -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#transferownership) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferownership) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -931,18 +966,260 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | ---- +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 key, bytes value) internal nonpayable; +``` + +
+ +### \_isOperatorOrOwner + +```solidity +function _isOperatorOrOwner( + address caller, + bytes32 tokenId +) internal view returns (bool); +``` + +verifies if the `caller` is operator or owner for the `tokenId` + +#### Returns + +| Name | Type | Description | +| ---- | :----: | -------------------------------------------- | +| `0` | `bool` | true if `caller` is either operator or owner | + +
+ +### \_revokeOperator + +```solidity +function _revokeOperator( + address operator, + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +removes `operator` from the list of operators for the `tokenId` + +
+ +### \_clearOperators + +```solidity +function _clearOperators( + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +revoke all the current operators for a specific `tokenId` token which belongs to `tokenOwner`. + +#### Parameters + +| Name | Type | Description | +| ------------ | :-------: | ------------------------------------------------- | +| `tokenOwner` | `address` | The address that is the owner of the `tokenId`. | +| `tokenId` | `bytes32` | The token to remove the associated operators for. | + +
+ +### \_exists + +```solidity +function _exists(bytes32 tokenId) internal view returns (bool); +``` + +Returns whether `tokenId` exists. +Tokens start existing when they are minted ([`_mint`](#_mint)), and stop existing when they are burned ([`_burn`](#_burn)). + +
+ +### \_existsOrError + +```solidity +function _existsOrError(bytes32 tokenId) internal view; +``` + +When `tokenId` does not exist then revert with an error. + +
+ +### \_mint + +```solidity +function _mint( + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +
+ +### \_burn + +```solidity +function _burn(bytes32 tokenId, bytes data) internal nonpayable; +``` + +
+ +### \_transfer + +```solidity +function _transfer( + address from, + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +
+ +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer( + address from, + address to, + bytes32 tokenId +) internal nonpayable; +``` + +Hook that is called before any token transfer, including minting and burning. + +- Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function. + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | -------------------------------------- | +| `from` | `address` | The sender address | +| `to` | `address` | @param tokenId The tokenId to transfer | +| `tokenId` | `bytes32` | The tokenId to transfer | + +
+ +### \_notifyTokenSender + +```solidity +function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; +``` + +An attempt is made to notify the token sender about the `tokenId` changing owners using +LSP1 interface. + +
+ +### \_notifyTokenReceiver + +```solidity +function _notifyTokenReceiver( + address to, + bool allowNonLSP1Recipient, + bytes lsp1Data +) internal nonpayable; +``` + +An attempt is made to notify the token receiver about the `tokenId` changing owners +using LSP1 interface. When allowNonLSP1Recipient is FALSE the token receiver MUST support LSP1. +The receiver may revert when the token being sent is not wanted. + +
+ +### \_safeTransfer + +```solidity +function _safeTransfer( + address from, + address to, + uint256 tokenId, + bytes data +) internal nonpayable; +``` + +Transfer the `tokenId` from `from` to `to` and check if the `to` recipient address is +a contract that implements the `IERC721Received` interface and return the right magic value. +See [`_checkOnERC721Received`](#_checkonerc721received) for more infos. + +
+ +### \_setApprovalForAll + +```solidity +function _setApprovalForAll( + address tokensOwner, + address operator, + bool approved +) internal nonpayable; +``` + +Approve `operator` to operate on all tokens of `tokensOwner` + +
+ +**Emitted events:** + +- [`ApprovalForAll`](#approvalforall) event. + +
+ +
## Events ### Approval -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#approval) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#approval) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Event signature: `Approval(address,address,uint256)` -- Event hash: `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` +- Event topic hash: `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` ::: @@ -950,24 +1227,28 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c event Approval(address indexed owner, address indexed operator, uint256 indexed tokenId); ``` -Emitted when the allowance of a `spender` for an `owner` is set by a call to [`approve`](#approve). `value` is the new allowance. +_ERC721 `Approval` compatible event emitted. Successfully approved operator `operator` to operate on tokenId `tokenId` on behalf of token owner `owner`._ + +ERC721 `Approval` event emitted when `owner` enables `operator` for `tokenId`. To provide compatibility with indexing ERC721 events. #### Parameters -| Name | Type | Description | -| ------------------------ | :-------: | ----------- | -| `owner` **`indexed`** | `address` | - | -| `operator` **`indexed`** | `address` | - | -| `tokenId` **`indexed`** | `uint256` | - | +| Name | Type | Description | +| ------------------------ | :-------: | ------------------------------------------ | +| `owner` **`indexed`** | `address` | The address of the owner of the `tokenId`. | +| `operator` **`indexed`** | `address` | The address set as operator. | +| `tokenId` **`indexed`** | `uint256` | The approved tokenId. | + +
### ApprovalForAll -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#approvalforall) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#approvalforall) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Event signature: `ApprovalForAll(address,address,bool)` -- Event hash: `0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31` +- Event topic hash: `0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31` ::: @@ -975,24 +1256,28 @@ Emitted when the allowance of a `spender` for an `owner` is set by a call to [`a event ApprovalForAll(address indexed owner, address indexed operator, bool approved); ``` -Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`. +_ERC721 `ApprovalForAll` compatible event emitted. Successfully set "approved for all" status to `approved` for operator `operator` for token owner `owner`._ + +ERC721 `ApprovalForAll` event emitted when an `operator` is enabled or disabled for an owner to transfer any of its tokenIds. The operator can manage all NFTs of the owner. #### Parameters -| Name | Type | Description | -| ------------------------ | :-------: | ----------- | -| `owner` **`indexed`** | `address` | - | -| `operator` **`indexed`** | `address` | - | -| `approved` | `bool` | - | +| Name | Type | Description | +| ------------------------ | :-------: | ---------------------------------------------- | +| `owner` **`indexed`** | `address` | The address of the owner of tokenIds. | +| `operator` **`indexed`** | `address` | The address set as operator. | +| `approved` | `bool` | If `operator` is approved for all NFTs or not. | + +
### AuthorizedOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#authorizedoperator) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizedoperator) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Event signature: `AuthorizedOperator(address,address,bytes32)` -- Event hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` +- Event topic hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` ::: @@ -1000,7 +1285,7 @@ Emitted when `account` grants or revokes permission to `operator` to transfer th event AuthorizedOperator(address indexed operator, address indexed tokenOwner, bytes32 indexed tokenId); ``` -Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on its behalf. +Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`. #### Parameters @@ -1010,14 +1295,16 @@ Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on it | `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | | `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` address has access on behalf of `tokenOwner`. | +
+ ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#datachanged) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#datachanged) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -1025,25 +1312,25 @@ Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on it event DataChanged(bytes32 indexed dataKey, bytes dataValue); ``` -_The following data key/value pair has been changed in the ERC725Y storage: Data key: `dataKey`, data value: `dataValue`._ - -Emitted when data at a specific `dataKey` was changed to a new value `dataValue`. +_Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | -------------------------------------------- | -| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | -| `dataValue` | `bytes` | The value to set for the given data key. | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#ownershiptransferred) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownershiptransferred) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -1058,14 +1345,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | +
+ ### RevokedOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#revokedoperator) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokedoperator) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Event signature: `RevokedOperator(address,address,bytes32)` -- Event hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` +- Event topic hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` ::: @@ -1077,20 +1366,22 @@ Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on i #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ---------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address revoked as an operator. | -| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | -| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. | +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address revoked from the operator array ({getOperatorsOf}). | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | +| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. | + +
### Transfer -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#transfer) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Event signature: `Transfer(address,address,address,bytes32,bool,bytes)` -- Event hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` +- Event topic hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` ::: @@ -1098,6 +1389,8 @@ Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on i event Transfer(address operator, address indexed from, address indexed to, bytes32 indexed tokenId, bool allowNonLSP1Recipient, bytes data); ``` +_ERC721 `Transfer` compatible event emitted. Successfully transferred tokenId `tokenId` from `from` to `to`._ + Emitted when `tokenId` token is transferred from the `from` to the `to` address. #### Parameters @@ -1111,16 +1404,16 @@ Emitted when `tokenId` token is transferred from the `from` to the `to` address. | `allowNonLSP1Recipient` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. | | `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. | ---- +
## Errors ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -1130,14 +1423,16 @@ Emitted when `tokenId` token is transferred from the `from` to the `to` address. error ERC725Y_DataKeysValuesEmptyArray(); ``` -Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array. +reverts when one of the array parameter provided to `setDataBatch` is an empty array + +
### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -1147,14 +1442,16 @@ Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabat error ERC725Y_DataKeysValuesLengthMismatch(); ``` -Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. +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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -1164,14 +1461,16 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat error ERC725Y_MsgValueDisallowed(); ``` -Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function. +reverts when sending value to the `setData(..)` functions + +
### LSP4TokenNameNotEditable -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp4tokennamenoteditable) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -1183,12 +1482,14 @@ 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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp4tokensymbolnoteditable) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -1200,12 +1501,14 @@ 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 +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp8cannotsendtoaddresszero) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoaddresszero) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP8CannotSendToAddressZero()` - Error hash: `0x24ecef4d` @@ -1217,12 +1520,14 @@ error LSP8CannotSendToAddressZero(); reverts when trying to send token to the zero address. +
+ ### LSP8CannotSendToSelf -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp8cannotsendtoself) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoself) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP8CannotSendToSelf()` - Error hash: `0x5d67d6c1` @@ -1234,12 +1539,14 @@ error LSP8CannotSendToSelf(); reverts when specifying the same address for `from` and `to` in a token transfer. +
+ ### LSP8CannotUseAddressZeroAsOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp8cannotuseaddresszeroasoperator) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotuseaddresszeroasoperator) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP8CannotUseAddressZeroAsOperator()` - Error hash: `0x9577b8b3` @@ -1251,12 +1558,14 @@ error LSP8CannotUseAddressZeroAsOperator(); reverts when trying to set the zero address as an operator. +
+ ### LSP8InvalidTransferBatch -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp8invalidtransferbatch) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8invalidtransferbatch) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP8InvalidTransferBatch()` - Error hash: `0x93a83119` @@ -1268,12 +1577,14 @@ error LSP8InvalidTransferBatch(); reverts when the parameters used for `transferBatch` have different lengths. +
+ ### LSP8NonExistentTokenId -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp8nonexistenttokenid) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistenttokenid) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP8NonExistentTokenId(bytes32)` - Error hash: `0xae8f9a36` @@ -1291,12 +1602,14 @@ reverts when `tokenId` has not been minted. | --------- | :-------: | ----------- | | `tokenId` | `bytes32` | - | +
+ ### LSP8NonExistingOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp8nonexistingoperator) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistingoperator) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP8NonExistingOperator(address,bytes32)` - Error hash: `0x4aa31a8c` @@ -1315,12 +1628,14 @@ reverts when `operator` is not an operator for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8NotTokenOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp8nottokenoperator) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenoperator) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP8NotTokenOperator(bytes32,address)` - Error hash: `0x1294d2a9` @@ -1339,12 +1654,14 @@ reverts when `caller` is not an allowed operator for `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotTokenOwner -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp8nottokenowner) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenowner) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP8NotTokenOwner(address,bytes32,address)` - Error hash: `0x5b271ea2` @@ -1364,12 +1681,14 @@ reverts when `caller` is not the `tokenOwner` of the `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotifyTokenReceiverContractMissingLSP1Interface -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp8notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP8NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0x4349776d` @@ -1389,12 +1708,14 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8NotifyTokenReceiverIsEOA -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp8notifytokenreceiveriseoa) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceiveriseoa) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP8NotifyTokenReceiverIsEOA(address)` - Error hash: `0x03173137` @@ -1412,12 +1733,14 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8OperatorAlreadyAuthorized -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp8operatoralreadyauthorized) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8operatoralreadyauthorized) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP8OperatorAlreadyAuthorized(address,bytes32)` - Error hash: `0xa7626b68` @@ -1436,12 +1759,14 @@ reverts when `operator` is already authorized for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8TokenIdAlreadyMinted -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp8tokenidalreadyminted) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidalreadyminted) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP8TokenIdAlreadyMinted(bytes32)` - Error hash: `0x34c7b511` @@ -1459,12 +1784,14 @@ reverts when `tokenId` has already been minted. | --------- | :-------: | ----------- | | `tokenId` | `bytes32` | - | +
+ ### LSP8TokenOwnerCannotBeOperator -:::note Links +:::note References -- Specification details in [**LSP-8-CompatibleERC721Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-CompatibleERC721Mintable.md#lsp8tokenownercannotbeoperator) -- Solidity implementation in [**LSP8CompatibleERC721Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8CompatibleERC721Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownercannotbeoperator) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) - Error signature: `LSP8TokenOwnerCannotBeOperator()` - Error hash: `0x89fdad62` @@ -1476,193 +1803,4 @@ error LSP8TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. - - - - - - -[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 -[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 -[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 -[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 -[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 -[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 -[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X -[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y -[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md -[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[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 - - - -[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 - - - -[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership -[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership -[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership - - - -[`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 -[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol -[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 -[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol -[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll -[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol - - - -[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol -[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol -[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol -[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol -[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol -[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so -[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol -[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md index 0d3f80afd4..8ef3c08c8d 100644 --- a/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md +++ b/docs/contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md @@ -1,21 +1,32 @@ + + + # LSP8Mintable -:::info Solidity contract +:::info Standard Specifications + +[`LSP-8-IdentifiableDigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md) + +::: +:::info Solidity implementation -[`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +[`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) ::: > LSP8IdentifiableDigitalAsset deployable preset contract with a public {mint} function callable only by the contract {owner}. -## Methods +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### constructor -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#constructor) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#constructor) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) ::: @@ -23,7 +34,7 @@ constructor(string name_, string symbol_, address newOwner_); ``` -_Deploying a `LSP8Mintable` token contract with: token name = `name\_`, token symbol = `symbol\_`, and address `newOwner\_` as the token contract owner._ +_Deploying a `LSP8Mintable` token contract with: token name = `name_`, token symbol = `symbol_`, and address `newOwner_` as the token contract owner._ #### Parameters @@ -33,12 +44,14 @@ _Deploying a `LSP8Mintable` token contract with: token name = `name\_`, token sy | `symbol_` | `string` | The symbol of the token. | | `newOwner_` | `address` | The owner of the token contract. | +
+ ### authorizeOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#authorizeoperator) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizeoperator) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `authorizeOperator(address,bytes32)` - Function selector: `0xcf5182ba` @@ -60,12 +73,14 @@ Allow an `operator` address to transfer or burn a specific `tokenId` on behalf o | `operator` | `address` | The address to authorize as an operator. | | `tokenId` | `bytes32` | The token ID operator has access to.. | +
+ ### balanceOf -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#balanceof) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#balanceof) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -89,12 +104,14 @@ Get the number of token IDs owned by `tokenOwner`. | ---- | :-------: | ----------------------------------------------------- | | `0` | `uint256` | The total number of token IDs that `tokenOwner` owns. | +
+ ### getData -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#getdata) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdata) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -104,28 +121,28 @@ Get the number of token IDs owned by `tokenOwner`. function getData(bytes32 dataKey) external view returns (bytes dataValue); ``` -_Reading the ERC725Y storage for data key `dataKey` returned the following value: `dataValue`._ - -Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`. +_Gets singular data at a given `dataKey`_ #### Parameters -| Name | Type | Description | -| --------- | :-------: | --------------------------------------------- | -| `dataKey` | `bytes32` | The data key for which to retrieve the value. | +| Name | Type | Description | +| --------- | :-------: | ------------------------------- | +| `dataKey` | `bytes32` | The key which value to retrieve | #### Returns -| Name | Type | Description | -| ----------- | :-----: | ---------------------------------------------------- | -| `dataValue` | `bytes` | The bytes value stored under the specified data key. | +| Name | Type | Description | +| ----------- | :-----: | -------------------------- | +| `dataValue` | `bytes` | The data stored at the key | + +
### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#getdatabatch) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatch) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -137,9 +154,7 @@ function getDataBatch( ) external view returns (bytes[] dataValues); ``` -_Reading the ERC725Y storage for data keys `dataKeys` returned the following values: `dataValues`._ - -Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`. +_Gets array of data for multiple given keys_ #### Parameters @@ -153,12 +168,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### getOperatorsOf -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#getoperatorsof) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getoperatorsof) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `getOperatorsOf(bytes32)` - Function selector: `0x49a6078d` @@ -182,12 +199,14 @@ Returns all `operator` addresses that are allowed to transfer or burn a specific | ---- | :---------: | ------------------------------------------------------------------------------------------------------------ | | `0` | `address[]` | An array of operators allowed to transfer or burn a specific `tokenId`. Requirements - `tokenId` must exist. | +
+ ### isOperatorFor -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#isoperatorfor) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isoperatorfor) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `isOperatorFor(address,bytes32)` - Function selector: `0x2a3654a4` @@ -215,12 +234,14 @@ Returns whether `operator` address is an operator for a given `tokenId`. | ---- | :----: | --------------------------------------------------------------------- | | `0` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. | +
+ ### mint -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#mint) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#mint) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `mint(address,bytes32,bool,bytes)` - Function selector: `0xaf255b61` @@ -235,23 +256,27 @@ function mint( ) external nonpayable; ``` +_Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `allowNonLSP1Recipient`)._ + Public [`_mint`](#_mint) function only callable by the [`owner`](#owner). #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | ----------- | -| `to` | `address` | - | -| `tokenId` | `bytes32` | - | -| `allowNonLSP1Recipient` | `bool` | - | -| `data` | `bytes` | - | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------ | +| `to` | `address` | The address that will receive the minted `tokenId`. | +| `tokenId` | `bytes32` | The tokenId to mint. | +| `allowNonLSP1Recipient` | `bool` | Set to `false` to ensure that you are minting for a recipient that implements LSP1, `false` otherwise for forcing the minting. | +| `data` | `bytes` | Any addition data to be sent alongside the minting. | + +
### owner -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#owner) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#owner) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -269,12 +294,14 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#renounceownership) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#renounceownership) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -286,12 +313,14 @@ 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 +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#revokeoperator) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokeoperator) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `revokeOperator(address,bytes32)` - Function selector: `0x0b0c6d82` @@ -310,108 +339,68 @@ Remove access of `operator` for a given `tokenId`, disallowing it to transfer `t | `operator` | `address` | The address to revoke as an operator. | | `tokenId` | `bytes32` | The tokenId `operator` is revoked from operating on. | +
+ ### setData -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#setdata) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdata) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setData(bytes32 dataKey, bytes dataValue) external payable; ``` -_Setting the following data key value pair in the ERC725Y storage. Data key: `dataKey`, data value: `dataValue`. _ - -Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner). - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event. - -
+_Sets singular data for a given `dataKey`_ #### Parameters -| Name | Type | Description | -| ----------- | :-------: | ------------------------------------------ | -| `dataKey` | `bytes32` | The data key for which to set a new value. | -| `dataValue` | `bytes` | The new bytes value to set. | +| 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 +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#setdatabatch) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatch) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` ::: -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - ```solidity function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; ``` -_Setting the following data key value pairs in the ERC725Y storage. Data keys: `dataKeys`, data values: `dataValues`. _ - -Batch data setting function that behaves the same as [`setData`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction. - -
- -**Requirements:** +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 -- SHOULD only be callable by the [`owner`](#owner) of the contract. - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event **for each data key/value pair set**. - -
+0. Emits a [`DataChanged`](#datachanged) event. #### Parameters -| Name | Type | Description | -| ------------ | :---------: | ---------------------------------------------------- | -| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. | -| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +| 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 +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#supportsinterface) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#supportsinterface) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -435,12 +424,14 @@ Returns true if this contract implements the interface defined by `interfaceId`. | ---- | :----: | ----------- | | `0` | `bool` | - | +
+ ### tokenIdsOf -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#tokenidsof) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenidsof) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `tokenIdsOf(address)` - Function selector: `0xa3b261f2` @@ -464,12 +455,14 @@ Returns the list of token IDs that the `tokenOwner` address owns. | ---- | :---------: | ------------------------------------------------------- | | `0` | `bytes32[]` | An array of `bytes32[] tokenIds` owned by `tokenOwner`. | +
+ ### tokenOwnerOf -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#tokenownerof) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenownerof) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `tokenOwnerOf(bytes32)` - Function selector: `0x217b2270` @@ -493,12 +486,14 @@ Returns the list of `tokenIds` for the `tokenOwner` address. | ---- | :-------: | ----------------------------------------- | | `0` | `address` | The owner address of the given `tokenId`. | +
+ ### totalSupply -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#totalsupply) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#totalsupply) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -516,12 +511,14 @@ Returns the number of existing tokens that have been minted in this contract. | ---- | :-------: | ------------------------------ | | `0` | `uint256` | The number of existing tokens. | +
+ ### transfer -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#transfer) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `transfer(address,address,bytes32,bool,bytes)` - Function selector: `0x511b6952` @@ -549,12 +546,14 @@ Transfer a given `tokenId` token from the `from` address to the `to` address. If | `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 +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#transferbatch) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferbatch) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `transferBatch(address[],address[],bytes32[],bool[],bytes[])` - Function selector: `0x7e87632c` @@ -582,12 +581,14 @@ Transfers multiple tokens at once based on the arrays of `from`, `to` and `token | `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 +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#transferownership) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferownership) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -605,18 +606,300 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c | ---------- | :-------: | ----------- | | `newOwner` | `address` | - | ---- +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +Save gas by emitting the [`DataChanged`](#datachanged) event with only the first 256 bytes of dataValue + +
+ +### \_isOperatorOrOwner + +```solidity +function _isOperatorOrOwner( + address caller, + bytes32 tokenId +) internal view returns (bool); +``` + +verifies if the `caller` is operator or owner for the `tokenId` + +#### Returns + +| Name | Type | Description | +| ---- | :----: | -------------------------------------------- | +| `0` | `bool` | true if `caller` is either operator or owner | + +
+ +### \_revokeOperator + +```solidity +function _revokeOperator( + address operator, + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +removes `operator` from the list of operators for the `tokenId` + +
+ +### \_clearOperators + +```solidity +function _clearOperators( + address tokenOwner, + bytes32 tokenId +) internal nonpayable; +``` + +revoke all the current operators for a specific `tokenId` token which belongs to `tokenOwner`. + +#### Parameters + +| Name | Type | Description | +| ------------ | :-------: | ------------------------------------------------- | +| `tokenOwner` | `address` | The address that is the owner of the `tokenId`. | +| `tokenId` | `bytes32` | The token to remove the associated operators for. | + +
+ +### \_exists + +```solidity +function _exists(bytes32 tokenId) internal view returns (bool); +``` + +Returns whether `tokenId` exists. +Tokens start existing when they are minted ([`_mint`](#_mint)), and stop existing when they are burned ([`_burn`](#_burn)). + +
+ +### \_existsOrError + +```solidity +function _existsOrError(bytes32 tokenId) internal view; +``` + +When `tokenId` does not exist then revert with an error. + +
+ +### \_mint + +```solidity +function _mint( + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Create `tokenId` by minting it and transfers it to `to`. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as `from` address. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- | +| `to` | `address` | @param tokenId The token ID to create (= mint). | +| `tokenId` | `bytes32` | The token ID to create (= mint). | +| `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. | +| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hook of the `to` address. | + +
+ +### \_burn + +:::tip Hint + +In dApps, you can know which addresses are burning tokens by listening for the `Transfer` event and filter with the zero address as `to`. + +::: + +```solidity +function _burn(bytes32 tokenId, bytes data) internal nonpayable; +``` + +Burn a specific `tokenId`, removing the `tokenId` from the [`tokenIdsOf`](#tokenidsof) the caller and decreasing its [`balanceOf`](#balanceof) by -1. +This will also clear all the operators allowed to transfer the `tokenId`. +The owner of the `tokenId` will be notified about the `tokenId` being transferred through its LSP1 [`universalReceiver`](#universalreceiver) +function, if it is a contract that supports the LSP1 interface. Its [`universalReceiver`](#universalreceiver) function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before burning `tokenId` and updating the balances. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event with `address(0)` as the `to` address. + +
+ +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | --------------------------------------------------------------------------------------------------------------------------- | +| `tokenId` | `bytes32` | The token to burn. | +| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the LSP1 hook on the token owner's address. | + +
+ +### \_transfer + +:::danger + +This internal function does not check if the sender is authorized or not to operate on the `tokenId`. + +::: + +```solidity +function _transfer( + address from, + address to, + bytes32 tokenId, + bool allowNonLSP1Recipient, + bytes data +) internal nonpayable; +``` + +Change the owner of the `tokenId` from `from` to `to`. +Both the sender and recipient will be notified of the `tokenId` being transferred through their LSP1 [`universalReceiver`](#universalreceiver) +function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive +all the parameters in the calldata packed encoded. +Any logic in the [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before changing the owner of `tokenId`. + +
+ +**Emitted events:** + +- [`Transfer`](#transfer) event. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | The sender address. | +| `to` | `address` | @param tokenId The token to transfer. | +| `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 the LSP1 standard. | +| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | + +
+ +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer( + address from, + address to, + bytes32 tokenId +) internal nonpayable; +``` + +Hook that is called before any token transfer, including minting and burning. + +- Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function. + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | -------------------------------------- | +| `from` | `address` | The sender address | +| `to` | `address` | @param tokenId The tokenId to transfer | +| `tokenId` | `bytes32` | The tokenId to transfer | + +
+ +### \_notifyTokenSender + +```solidity +function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; +``` + +An attempt is made to notify the token sender about the `tokenId` changing owners using +LSP1 interface. + +
+ +### \_notifyTokenReceiver + +```solidity +function _notifyTokenReceiver( + address to, + bool allowNonLSP1Recipient, + bytes lsp1Data +) internal nonpayable; +``` + +An attempt is made to notify the token receiver about the `tokenId` changing owners +using LSP1 interface. When allowNonLSP1Recipient is FALSE the token receiver MUST support LSP1. +The receiver may revert when the token being sent is not wanted. + +
## Events ### AuthorizedOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#authorizedoperator) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizedoperator) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Event signature: `AuthorizedOperator(address,address,bytes32)` -- Event hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` +- Event topic hash: `0x34b797fc5a526f7bf1d2b5de25f6564fd85ae364e3ee939aee7c1ac27871a988` ::: @@ -624,7 +907,7 @@ Transfers ownership of the contract to a new account (`newOwner`). Can only be c event AuthorizedOperator(address indexed operator, address indexed tokenOwner, bytes32 indexed tokenId); ``` -Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on its behalf. +Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`. #### Parameters @@ -634,14 +917,16 @@ Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on it | `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | | `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` address has access on behalf of `tokenOwner`. | +
+ ### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#datachanged) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#datachanged) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -649,25 +934,25 @@ Emitted when `tokenOwner` enables `operator` to transfer or burn `tokenId` on it event DataChanged(bytes32 indexed dataKey, bytes dataValue); ``` -_The following data key/value pair has been changed in the ERC725Y storage: Data key: `dataKey`, data value: `dataValue`._ - -Emitted when data at a specific `dataKey` was changed to a new value `dataValue`. +_Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | -------------------------------------------- | -| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | -| `dataValue` | `bytes` | The value to set for the given data key. | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#ownershiptransferred) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownershiptransferred) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -682,14 +967,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | +
+ ### RevokedOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#revokedoperator) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokedoperator) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Event signature: `RevokedOperator(address,address,bytes32)` -- Event hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` +- Event topic hash: `0x17d5389f6ab6adb2647dfa0aa365c323d37adacc30b33a65310b6158ce1373d5` ::: @@ -701,20 +988,22 @@ Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on i #### Parameters -| Name | Type | Description | -| -------------------------- | :-------: | ---------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address revoked as an operator. | -| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | -| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. | +| Name | Type | Description | +| -------------------------- | :-------: | --------------------------------------------------------------- | +| `operator` **`indexed`** | `address` | The address revoked from the operator array ({getOperatorsOf}). | +| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. | +| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. | + +
### Transfer -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#transfer) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Event signature: `Transfer(address,address,address,bytes32,bool,bytes)` -- Event hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` +- Event topic hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf` ::: @@ -735,16 +1024,16 @@ Emitted when `tokenId` token is transferred from the `from` to the `to` address. | `allowNonLSP1Recipient` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. | | `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. | ---- +
## Errors ### ERC725Y_DataKeysValuesEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvaluesemptyarray) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -754,14 +1043,16 @@ Emitted when `tokenId` token is transferred from the `from` to the `to` address. error ERC725Y_DataKeysValuesEmptyArray(); ``` -Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array. +reverts when one of the array parameter provided to `setDataBatch` is an empty array + +
### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -771,14 +1062,16 @@ Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabat error ERC725Y_DataKeysValuesLengthMismatch(); ``` -Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. +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 +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -788,14 +1081,16 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat error ERC725Y_MsgValueDisallowed(); ``` -Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function. +reverts when sending value to the `setData(..)` functions + +
### LSP4TokenNameNotEditable -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp4tokennamenoteditable) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokennamenoteditable) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -807,12 +1102,14 @@ 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 +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp4tokensymbolnoteditable) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokensymbolnoteditable) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -824,12 +1121,14 @@ 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 +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp8cannotsendtoaddresszero) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoaddresszero) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP8CannotSendToAddressZero()` - Error hash: `0x24ecef4d` @@ -841,12 +1140,14 @@ error LSP8CannotSendToAddressZero(); reverts when trying to send token to the zero address. +
+ ### LSP8CannotSendToSelf -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp8cannotsendtoself) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoself) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP8CannotSendToSelf()` - Error hash: `0x5d67d6c1` @@ -858,12 +1159,14 @@ error LSP8CannotSendToSelf(); reverts when specifying the same address for `from` and `to` in a token transfer. +
+ ### LSP8CannotUseAddressZeroAsOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp8cannotuseaddresszeroasoperator) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotuseaddresszeroasoperator) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP8CannotUseAddressZeroAsOperator()` - Error hash: `0x9577b8b3` @@ -875,12 +1178,14 @@ error LSP8CannotUseAddressZeroAsOperator(); reverts when trying to set the zero address as an operator. +
+ ### LSP8InvalidTransferBatch -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp8invalidtransferbatch) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8invalidtransferbatch) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP8InvalidTransferBatch()` - Error hash: `0x93a83119` @@ -892,12 +1197,14 @@ error LSP8InvalidTransferBatch(); reverts when the parameters used for `transferBatch` have different lengths. +
+ ### LSP8NonExistentTokenId -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp8nonexistenttokenid) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistenttokenid) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP8NonExistentTokenId(bytes32)` - Error hash: `0xae8f9a36` @@ -915,12 +1222,14 @@ reverts when `tokenId` has not been minted. | --------- | :-------: | ----------- | | `tokenId` | `bytes32` | - | +
+ ### LSP8NonExistingOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp8nonexistingoperator) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistingoperator) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP8NonExistingOperator(address,bytes32)` - Error hash: `0x4aa31a8c` @@ -939,12 +1248,14 @@ reverts when `operator` is not an operator for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8NotTokenOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp8nottokenoperator) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenoperator) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP8NotTokenOperator(bytes32,address)` - Error hash: `0x1294d2a9` @@ -963,12 +1274,14 @@ reverts when `caller` is not an allowed operator for `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotTokenOwner -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp8nottokenowner) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenowner) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP8NotTokenOwner(address,bytes32,address)` - Error hash: `0x5b271ea2` @@ -988,12 +1301,14 @@ reverts when `caller` is not the `tokenOwner` of the `tokenId`. | `tokenId` | `bytes32` | - | | `caller` | `address` | - | +
+ ### LSP8NotifyTokenReceiverContractMissingLSP1Interface -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp8notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceivercontractmissinglsp1interface) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP8NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0x4349776d` @@ -1013,12 +1328,14 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8NotifyTokenReceiverIsEOA -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp8notifytokenreceiveriseoa) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceiveriseoa) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP8NotifyTokenReceiverIsEOA(address)` - Error hash: `0x03173137` @@ -1036,12 +1353,14 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit | --------------- | :-------: | ----------- | | `tokenReceiver` | `address` | - | +
+ ### LSP8OperatorAlreadyAuthorized -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp8operatoralreadyauthorized) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8operatoralreadyauthorized) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP8OperatorAlreadyAuthorized(address,bytes32)` - Error hash: `0xa7626b68` @@ -1060,12 +1379,14 @@ reverts when `operator` is already authorized for the `tokenId`. | `operator` | `address` | - | | `tokenId` | `bytes32` | - | +
+ ### LSP8TokenIdAlreadyMinted -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp8tokenidalreadyminted) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidalreadyminted) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP8TokenIdAlreadyMinted(bytes32)` - Error hash: `0x34c7b511` @@ -1083,12 +1404,14 @@ reverts when `tokenId` has already been minted. | --------- | :-------: | ----------- | | `tokenId` | `bytes32` | - | +
+ ### LSP8TokenOwnerCannotBeOperator -:::note Links +:::note References -- Specification details in [**LSP-8-Mintable**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-Mintable.md#lsp8tokenownercannotbeoperator) -- Solidity implementation in [**LSP8Mintable**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8Mintable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownercannotbeoperator) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) - Error signature: `LSP8TokenOwnerCannotBeOperator()` - Error hash: `0x89fdad62` @@ -1100,193 +1423,4 @@ error LSP8TokenOwnerCannotBeOperator(); reverts when trying to authorize or revoke the token's owner as an operator. - - - - - - -[ERC-165]: https://eips.ethereum.org/EIPS/eip-165 -[EIP-165]: https://eips.ethereum.org/EIPS/eip-165 -[ERC-173]: https://eips.ethereum.org/EIPS/eip-173 -[EIP-173]: https://eips.ethereum.org/EIPS/eip-173 -[ERC-191]: https://eips.ethereum.org/EIPS/eip-191 -[EIP-191]: https://eips.ethereum.org/EIPS/eip-191 -[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X -[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y -[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md -[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271 -[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 - - - -[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 -[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1 - - - -[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership -[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership -[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership - - - -[`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 -[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725X.sol -[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725XCore.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 -[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725Y.sol -[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/ERC725YCore.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.soll -[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/implementations/contracts/custom/OwnableUnset.sol - - - -[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Create2.sol -[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/cryptography/ECDSA.sol -[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165Checker.sol -[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/Address.sol -[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/introspection/ERC165.sol -[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/contracts/utils/structs/EnumerableSet.so -[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.2/contracts/proxy/utils/Initializable.sol -[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.0/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/contracts/contracts/LSP9Vault/LSP9Vault.md b/docs/contracts/contracts/LSP9Vault/LSP9Vault.md index c6a6851fba..a8bd3d6265 100644 --- a/docs/contracts/contracts/LSP9Vault/LSP9Vault.md +++ b/docs/contracts/contracts/LSP9Vault/LSP9Vault.md @@ -1,23 +1,34 @@ + + + # LSP9Vault -:::info Soldity contract +:::info Standard Specifications + +[`LSP-9-Vault`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md) + +::: +:::info Solidity implementation -[`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +[`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) ::: > Implementation of LSP9Vault built on top of [ERC725], [LSP-1-UniversalReceiver] -Could be owned by an EOA or by a contract and is able to receive and send assets. Also allows for registering received assets by levereging the key-value storage. +Could be owned by an EOA or by a contract and is able to receive and send assets. Also allows for registering received assets by leveraging the key-value storage. + +## Public Methods -## Methods +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. ### constructor -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#constructor) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#constructor) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) ::: @@ -25,9 +36,20 @@ Could be owned by an EOA or by a contract and is able to receive and send assets constructor(address newOwner); ``` -_New owner set, `newOwner`._ +_Deploying a LSP9Vault contract with owner set to address `initialOwner`._ + +Sets `initialOwner` as the contract owner and the `SupportedStandards:LSP9Vault` Data Key. The `constructor` also allows funding the contract on deployment. + +
+ +**Emitted events:** + +- [`ValueReceived`](#valuereceived) event when funding the contract on deployment. +- [`OwnershipTransferred`](#ownershiptransferred) event when `initialOwner` is set as the contract [`owner`](#owner). +- [`DataChanged`](#datachanged) event when setting the [`_LSP9_SUPPORTED_STANDARDS_KEY`](#_lsp9_supported_standards_key). +- [`UniversalReceiver`](#universalreceiver) event when notifying the `initialOwner`. -Sets the owner of the contract and sets the `SupportedStandards:LSP9Vault` Data Key. +
#### Parameters @@ -35,43 +57,57 @@ Sets the owner of the contract and sets the `SupportedStandards:LSP9Vault` Data | ---------- | :-------: | ------------------------------ | | `newOwner` | `address` | The new owner of the contract. | +
+ ### fallback -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#fallback) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#fallback) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) ::: ```solidity -fallback() external payable; +fallback(bytes calldata callData) external payable returns (bytes memory); ``` -Forwards the call to an extension contract (address). This address can be retrieved from the ERC725Y data key-value store using the data key below (function selector appended to the prefix): `_LSP17_FALLBACK_EXTENSIONS_HANDLER_ + function-selector`. If there is no extension stored under the data key, return. -The call to the extension is appended with bytes20 (msg.sender) and bytes32 (msg.value). -Returns the return value on success and revert in case of failure. -If the `msg.data` is shorter than 4 bytes do not check for an extension and return. -Executed when: +_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._ + +Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively, +forwarding the function call to the extension address mapped to the function being called. +This function is executed when: + +- Sending data of length less than 4 bytes to the contract. - The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI. - Receiving native tokens with some calldata. +1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) + +- If there is no address stored under the following data key, revert with [`NoExtensionFoundForFunctionSelector(bytes4)`](#noextensionfoundforfunctionselector). The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it. + +- If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed. + +2. If the data sent to this function is of length less than 4 bytes (not a function selector), return. +
**Emitted events:** -- [`ValueReceived`](#valuereceived) when receiving native tokens. +- [`ValueReceived`](#valuereceived) event when receiving native tokens.
+
+ ### receive -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#receive) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#receive) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) ::: @@ -93,12 +129,14 @@ Executed:
+
+ ### RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#renounce_ownership_confirmation_delay) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#renounce_ownership_confirmation_delay) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY()` - Function selector: `0xead3fbdf` @@ -117,12 +155,14 @@ function RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY() | ---- | :-------: | ----------- | | `0` | `uint256` | - | +
+ ### RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#renounce_ownership_confirmation_period) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#renounce_ownership_confirmation_period) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD()` - Function selector: `0x01bfba61` @@ -141,12 +181,14 @@ function RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD() | ---- | :-------: | ----------- | | `0` | `uint256` | - | +
+ ### acceptOwnership -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#acceptownership) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#acceptownership) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `acceptOwnership()` - Function selector: `0x79ba5097` @@ -156,37 +198,50 @@ function RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD() function acceptOwnership() external nonpayable; ``` -Transfer ownership of the contract from the current [`owner()`](#`owner) to the [`pendingOwner()`](#`pendingowner). Once this function is called: +_`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 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. +- The [`pendingOwner()`](#pendingowner) will gain access to the functions restricted to the [`owner()`](#owner) only.
**Requirements:** -- When notifying the previous owner via LSP1, the typeId used MUST be `keccak256('LSP9OwnershipTransferred_SenderNotification')` -- When notifying the new owner via LSP1, the typeId used MUST be `keccak256('LSP9OwnershipTransferred_RecipientNotification')` +- Only the [`pendingOwner`](#pendingowner) can call this function. +- When notifying the previous owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_SenderNotification]. +- When notifying the new owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_RecipientNotification].
+
+ ### batchCalls -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#batchcalls) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#batchcalls) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `batchCalls(bytes[])` - Function selector: `0x6963d438` ::: +:::info + +It's not possible to send value along the functions call due to the use of `delegatecall`. + +::: + ```solidity function batchCalls(bytes[] data) external nonpayable returns (bytes[] results); ``` -Allows a caller to batch different function calls in one call. Perform a `delegatecall` on self, to call different functions with preserving the context. It is not possible to send value along the functions call due to the use of `delegatecall`. +_Executing the following batch of abi-encoded function calls on the contract: `data`._ + +Allows a caller to batch different function calls in one call. Perform a `delegatecall` on self, to call different functions with preserving the context. #### Parameters @@ -196,16 +251,18 @@ Allows a caller to batch different function calls in one call. Perform a `delega #### Returns -| Name | Type | Description | -| --------- | :-------: | ------------------------------------------------------ | -| `results` | `bytes[]` | An array of values returned by the executed functions. | +| Name | Type | Description | +| --------- | :-------: | ---------------------------------------------------------------- | +| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. | + +
### execute -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#execute) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#execute) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `execute(uint256,address,uint256,bytes)` - Function selector: `0x44c028fe` @@ -226,23 +283,40 @@ function execute( ) external payable returns (bytes); ``` -_Calling address `target` using `operationType`, transferring `value` wei and data: `data`. _ - Generic executor function to: - send native tokens to any address. - interact with any contract by passing an abi-encoded function call in the `data` parameter. -- deploy a contract by providing its creation bytecode in the `data` parameter. +- deploy a contract by providing its creation bytecode in the `data` parameter. Requirements: + +- SHOULD only be callable by the owner of the contract set via ERC173. + +- if a `value` is provided, the contract MUST have at least this amount in its balance to execute successfully. + +- if the operation type is STATICCALL or DELEGATECALL, `value` SHOULD be 0. + +- `target` SHOULD be address(0) when deploying a contract. Emits an [`Executed`](#executed) event, when a call is made with `operationType` 0 (CALL), 3 (STATICCALL) or 4 (DELEGATECALL) Emits a [`ContractCreated`](#contractcreated) event, when deploying a contract with `operationType` 1 (CREATE) or 2 (CREATE2) + +
+ +**Requirements:** + +- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner. +- If a `value` is provided, the contract must have at least this amount in its balance to execute successfully. +- If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`. +- If the operation type is `STATICCALL` (3), `value` transfer is disallowed and must be 0. + +
**Emitted events:** -- [`Executed`](#executed) event, when a call is executed under `operationType` 0 and 3. -- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType` 1 and 2. -- [`ValueReceived`](#valuereceived) event, when receives native token. +- [`Executed`](#executed) event for each call that uses under `operationType`: `CALL` (0) and `STATICCALL` (3). +- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2). +- [`ValueReceived`](#valuereceived) event when receiving native tokens.
@@ -253,7 +327,7 @@ Generic executor function to: | `operationType` | `uint256` | The operation type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4 | | `target` | `address` | The address of the EOA or smart contract. (unused if a contract is created via operation type 1 or 2) | | `value` | `uint256` | The amount of native tokens to transfer (in Wei) | -| `data` | `bytes` | The call data, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. | +| `data` | `bytes` | The call data, or the creation bytecode of the contract to deploy | #### Returns @@ -261,12 +335,14 @@ Generic executor function to: | ---- | :-----: | ----------- | | `0` | `bytes` | - | +
+ ### executeBatch -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#executebatch) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#executebatch) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `executeBatch(uint256[],address[],uint256[],bytes[])` - Function selector: `0x31858452` @@ -287,28 +363,54 @@ function executeBatch( ) external payable returns (bytes[]); ``` -_Calling multiple addresses `targets` using `operationsType`, transferring `values` wei and data: `datas`. _ +Generic batch executor function to: + +- send native tokens to any address. + +- interact with any contract by passing an abi-encoded function call in the `datas` parameter. + +- deploy a contract by providing its creation bytecode in the `datas` parameter. Requirements: + +- The length of the parameters provided MUST be equal + +- SHOULD only be callable by the owner of the contract set via ERC173. + +- if a `values` is provided, the contract MUST have at least this amount in its balance to execute successfully. + +- if the operation type is STATICCALL or DELEGATECALL, `values` SHOULD be 0. + +- `targets` SHOULD be address(0) when deploying a contract. Emits an [`Executed`](#executed) event, when a call is made with `operationType` 0 (CALL), 3 (STATICCALL) or 4 (DELEGATECALL) Emits a [`ContractCreated`](#contractcreated) event, when deploying a contract with `operationType` 1 (CREATE) or 2 (CREATE2) -Batch executor function that behaves the same as [`execute`](#execute) but allowing multiple operations in the same transaction. +
+ +**Requirements:** + +- The length of the parameters provided must be equal. +- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner. +- If a `value` is provided, the contract must have at least this amount in its balance to execute successfully. +- If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`. +- If the operation type is `STATICCALL` (3), `value` transfer is disallowed and must be 0. + +
**Emitted events:** -- [`Executed`](#executed) event, when a call is executed under `operationType` 0 and 3. -- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType` 1 and 2. -- [`ValueReceived`](#valuereceived) event, when receives native token. +- [`Executed`](#executed) event for each call that uses under `operationType`: `CALL` (0) and `STATICCALL` (3). (each iteration) +- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2). (each iteration) +- [`ValueReceived`](#valuereceived) event when receiving native tokens.
#### Parameters -| Name | Type | Description | -| ---------------- | :---------: | --------------------------------------------------------------------------------------------------------------- | -| `operationsType` | `uint256[]` | The list of operations type used: `CALL = 0`; `CREATE = 1`; `CREATE2 = 2`; `STATICCALL = 3`; `DELEGATECALL = 4` | -| `targets` | `address[]` | The list of addresses to call. `targets` will be unused if a contract is created (operation types 1 and 2). | -| `values` | `uint256[]` | The list of native token amounts to transfer (in Wei). | -| `datas` | `bytes[]` | The list of calldata, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. | +| Name | Type | Description | +| ---------------- | :---------: | ----------------------------------------------------------------------------------------------------------- | +| `operationsType` | `uint256[]` | The list of operations type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4 | +| `targets` | `address[]` | The list of addresses to call. `targets` will be unused if a contract is created (operation types 1 and 2). | +| `values` | `uint256[]` | The list of native token amounts to transfer (in Wei) | +| `datas` | `bytes[]` | The list of call data, or the creation bytecode of the contract to deploy | #### Returns @@ -316,12 +418,14 @@ Batch executor function that behaves the same as [`execute`](#execute) but allow | ---- | :-------: | ----------- | | `0` | `bytes[]` | - | +
+ ### getData -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#getdata) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#getdata) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -331,28 +435,28 @@ Batch executor function that behaves the same as [`execute`](#execute) but allow function getData(bytes32 dataKey) external view returns (bytes dataValue); ``` -_Reading the ERC725Y storage for data key `dataKey` returned the following value: `dataValue`._ - -Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`. +_Gets singular data at a given `dataKey`_ #### Parameters -| Name | Type | Description | -| --------- | :-------: | --------------------------------------------- | -| `dataKey` | `bytes32` | The data key for which to retrieve the value. | +| Name | Type | Description | +| --------- | :-------: | ------------------------------- | +| `dataKey` | `bytes32` | The key which value to retrieve | #### Returns -| Name | Type | Description | -| ----------- | :-----: | ---------------------------------------------------- | -| `dataValue` | `bytes` | The bytes value stored under the specified data key. | +| Name | Type | Description | +| ----------- | :-----: | -------------------------- | +| `dataValue` | `bytes` | The data stored at the key | + +
### getDataBatch -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#getdatabatch) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#getdatabatch) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -364,9 +468,7 @@ function getDataBatch( ) external view returns (bytes[] dataValues); ``` -_Reading the ERC725Y storage for data keys `dataKeys` returned the following values: `dataValues`._ - -Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`. +_Gets array of data for multiple given keys_ #### Parameters @@ -380,12 +482,14 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys | ------------ | :-------: | ----------------------------------------- | | `dataValues` | `bytes[]` | The array of data stored at multiple keys | +
+ ### owner -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#owner) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#owner) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -403,17 +507,25 @@ Returns the address of the current owner. | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### pendingOwner -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#pendingowner) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#pendingowner) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.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); ``` @@ -426,33 +538,53 @@ The address that ownership of the contract is transferred to. This address may u | ---- | :-------: | ----------- | | `0` | `address` | - | +
+ ### renounceOwnership -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#renounceownership) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#renounceownership) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.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; ``` -Renounce ownership of the contract in a two step process. +_`msg.sender` is renouncing ownership of contract `address(this)`._ -1. the first call will initiate the process of renouncing ownership. +Renounce ownership of the contract in a 2-step process. -2. the second is used as a confirmation and will leave the contract without an owner. +1. The first call will initiate the process of renouncing ownership. + +2. The second call is used as a confirmation and will leave the contract without an owner. + +
+ +**Requirements:** + +- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner. + +
+ +
### setData -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#setdata) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#setdata) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` @@ -462,31 +594,40 @@ Renounce ownership of the contract in a two step process. function setData(bytes32 dataKey, bytes dataValue) external payable; ``` -_Setting the following data key value pair in the ERC725Y storage. Data key: `dataKey`, data value: `dataValue`. _ +_Sets singular data for a given `dataKey`_ -Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data. +
+ +**Requirements:** + +- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner. + +
**Emitted events:** +- [`ValueReceived`](#valuereceived) event when receiving native tokens. - [`DataChanged`](#datachanged) event.
#### Parameters -| Name | Type | Description | -| ----------- | :-------: | ------------------------------------------ | -| `dataKey` | `bytes32` | The data key for which to set a new value. | -| `dataValue` | `bytes` | The new bytes value to set. | +| 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 +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#setdatabatch) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#setdatabatch) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` @@ -496,31 +637,42 @@ Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; ``` -_Setting the following data key value pairs in the ERC725Y storage. Data keys: `dataKeys`, data values: `dataValues`. _ +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. + +
+ +**Requirements:** + +- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner. -Batch data setting function that behaves the same as [`setData`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction. +
**Emitted events:** -- [`DataChanged`](#datachanged) event. +- [`ValueReceived`](#valuereceived) event when receiving native tokens. +- [`DataChanged`](#datachanged) event. (on each iteration of setting data)
#### Parameters -| Name | Type | Description | -| ------------ | :---------: | ---------------------------------------------------- | -| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. | -| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | +| 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 +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#supportsinterface) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#supportsinterface) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -530,26 +682,30 @@ Batch data setting function that behaves the same as [`setData`](#setdata) but a function supportsInterface(bytes4 interfaceId) external view returns (bool); ``` -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`. +_Checking if this contract supports the interface defined by the `bytes4` interface ID `interfaceId`._ + +Achieves the goal of [ERC-165] to detect supported interfaces and [LSP-17-ContractExtension] by checking if the interfaceId being queried is supported on another linked extension. If the contract doesn't support the `interfaceId`, it forwards the call to the `supportsInterface` extension according to [LSP-17-ContractExtension], and checks if the extension implements the interface defined by `interfaceId`. #### Parameters -| Name | Type | Description | -| ------------- | :------: | ----------- | -| `interfaceId` | `bytes4` | - | +| Name | Type | Description | +| ------------- | :------: | ------------------------------------------------------ | +| `interfaceId` | `bytes4` | The interface ID to check if the contract supports it. | #### Returns -| Name | Type | Description | -| ---- | :----: | ----------- | -| `0` | `bool` | - | +| Name | Type | Description | +| ---- | :----: | --------------------------------------------------------------------------------------------- | +| `0` | `bool` | `true` if this contract implements the interface defined by `interfaceId`, `false` otherwise. | + +
### transferOwnership -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#transferownership) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#transferownership) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -559,13 +715,17 @@ Returns true if this contract implements the interface defined by `interfaceId`. function transferOwnership(address newOwner) external nonpayable; ``` -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. +_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:** -- When notifying the new owner via LSP1, the typeId used MUST be `keccak256('LSP9OwnershipTransferStarted')` +- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner. +- When notifying the new owner via LSP1, the `typeId` used must be the `keccak256(...)` hash of [LSP0OwnershipTransferStarted]. +- Pending owner cannot accept ownership in the same tx via the LSP1 hook.
@@ -573,14 +733,16 @@ Initiate the process of transferring ownership of the contract by setting the ne | Name | Type | Description | | ---------- | :-------: | ----------------------------- | -| `newOwner` | `address` | the address of the new owner. | +| `newOwner` | `address` | The address of the new owner. | + +
### universalReceiver -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#universalreceiver) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#universalreceiver) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Function signature: `universalReceiver(bytes32,bytes)` - Function selector: `0x6bb56a14` @@ -593,13 +755,28 @@ function universalReceiver( ) external payable returns (bytes returnedValues); ``` -_Forwards the call to the addresses stored in the [ERC725Y] storage under the the Vault version of [LSP1UniversalReceiverDelegate] Data Key and the `typeId` Key (param) respectively. The call will be discarded if no addresses are set._ +_Notifying the contract by calling its `universalReceiver` function with the following informations: typeId: `typeId`; data: `data`._ + +Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps: + +1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]. + +- If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. + +- If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. + +2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) + +- If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. + +- If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function.
**Emitted events:** -- [`UniversalReceiver`](#universalreceiver) when this function gets executed successfully. +- [`ValueReceived`](#valuereceived) when receiving native tokens. +- [`UniversalReceiver`](#universalreceiver) event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.
@@ -612,20 +789,359 @@ _Forwards the call to the addresses stored in the [ERC725Y] storage under the th #### Returns -| Name | Type | Description | -| ---------------- | :-----: | ------------------------------------------------------------------------------------------------------------------------------ | -| `returnedValues` | `bytes` | The ABI encoded return value of the the Vault version of [LSP1UniversalReceiverDelegate] call and the LSP1TypeIdDelegate call. | +| Name | Type | Description | +| ---------------- | :-----: | ------------------------------------------------------------------------------------------------------- | +| `returnedValues` | `bytes` | The ABI encoded return value of the LSP1UniversalReceiverDelegate call and the LSP1TypeIdDelegate call. | + +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_execute + +:::caution Warning + +Providing operation type DELEGATECALL (4) as argument will result in custom error {ERC725X_UnknownOperationType(4)} + +::: + +```solidity +function _execute( + uint256 operationType, + address target, + uint256 value, + bytes data +) internal nonpayable returns (bytes); +``` + +This function overrides the [`ERC725XCore`](#erc725xcore) internal [`_execute`](#_execute) function to disable operation type DELEGATECALL (4). + +#### Parameters + +| Name | Type | Description | +| --------------- | :-------: | ------------------------------------------------------------------------------------------------------ | +| `operationType` | `uint256` | The operation type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3. | +| `target` | `address` | The address of the EOA or smart contract. (unused if a contract is created via operation type 1 or 2). | +| `value` | `uint256` | The amount of native tokens to transfer (in Wei). | +| `data` | `bytes` | The call data, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. | + +
+ +### \_executeBatch + +```solidity +function _executeBatch( + uint256[] operationsType, + address[] targets, + uint256[] values, + bytes[] datas +) internal nonpayable returns (bytes[]); +``` + +same as `_execute` but for batch execution +see `IERC725X,execute(uint256[],address[],uint256[],bytes[])` + +
+ +### \_executeCall + +```solidity +function _executeCall( + address target, + uint256 value, + bytes data +) internal nonpayable returns (bytes result); +``` + +perform low-level call (operation type = 0) + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------------- | +| `target` | `address` | The address on which call is executed | +| `value` | `uint256` | The value to be sent with the call | +| `data` | `bytes` | The data to be sent with the call | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | ---------------------- | +| `result` | `bytes` | The data from the call | + +
+ +### \_executeStaticCall + +```solidity +function _executeStaticCall( + address target, + bytes data +) internal nonpayable returns (bytes result); +``` + +perform low-level staticcall (operation type = 3) + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------------------- | +| `target` | `address` | The address on which staticcall is executed | +| `data` | `bytes` | The data to be sent with the staticcall | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | ------------------------------------- | +| `result` | `bytes` | The data returned from the staticcall | + +
+ +### \_executeDelegateCall + +```solidity +function _executeDelegateCall( + address target, + bytes data +) internal nonpayable returns (bytes result); +``` + +perform low-level delegatecall (operation type = 4) + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | --------------------------------------------- | +| `target` | `address` | The address on which delegatecall is executed | +| `data` | `bytes` | The data to be sent with the delegatecall | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | --------------------------------------- | +| `result` | `bytes` | The data returned from the delegatecall | + +
+ +### \_deployCreate + +```solidity +function _deployCreate( + uint256 value, + bytes creationCode +) internal nonpayable returns (bytes newContract); +``` + +deploy a contract using the CREATE opcode (operation type = 1) + +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | ---------------------------------------------------------------------------------- | +| `value` | `uint256` | The value to be sent to the contract created | +| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) | + +#### Returns + +| Name | Type | Description | +| ------------- | :-----: | -------------------------------------------- | +| `newContract` | `bytes` | The address of the contract created as bytes | + +
+ +### \_deployCreate2 + +```solidity +function _deployCreate2( + uint256 value, + bytes creationCode +) internal nonpayable returns (bytes newContract); +``` + +deploy a contract using the CREATE2 opcode (operation type = 2) + +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | ----------------------------------------------------------------------------------------------------- | +| `value` | `uint256` | The value to be sent to the contract created | +| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) and a bytes32 salt | + +#### Returns + +| Name | Type | Description | +| ------------- | :-----: | -------------------------------------------- | +| `newContract` | `bytes` | The address of the contract created as bytes | + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +This function overrides the [`ERC725YCore`](#erc725ycore) internal [`_setData`](#_setdata) function to optimize gas usage by emitting only the first 256 bytes of the `dataValue`. + +
+ +**Emitted events:** + +- [`DataChanged`](#datachanged) event with only the first 256 bytes of [`dataValue`](#datavalue). + +
+ +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | -------------------------------------- | +| `dataKey` | `bytes32` | The key to store the data value under. | +| `dataValue` | `bytes` | The data value to be stored. | + +
+ +### \_transferOwnership + +```solidity +function _transferOwnership(address newOwner) internal nonpayable; +``` + +Set the pending owner of the contract and cancel any renounce ownership process that was previously started. + +
+ +**Requirements:** + +- `newOwner` cannot be the address of the contract itself. + +
+ +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ------------------------------------- | +| `newOwner` | `address` | The address of the new pending owner. | + +
+ +### \_acceptOwnership + +```solidity +function _acceptOwnership() internal nonpayable; +``` + +Set the pending owner of the contract as the new owner. + +
+ +### \_renounceOwnership + +```solidity +function _renounceOwnership() internal nonpayable; +``` + +Initiate or confirm the process of renouncing ownership after a specific delay of blocks have passed. + +
+ +### \_supportsInterfaceInERC165Extension + +```solidity +function _supportsInterfaceInERC165Extension( + bytes4 interfaceId +) internal view returns (bool); +``` + +Returns whether the interfaceId being checked is supported in the extension of the +[`supportsInterface`](#supportsinterface) selector. +To be used by extendable contracts wishing to extend the ERC165 interfaceIds originally +supported by reading whether the interfaceId queried is supported in the `supportsInterface` +extension if the extension is set, if not it returns false. + +
+ +### \_getExtension + +```solidity +function _getExtension(bytes4 functionSelector) internal view returns (address); +``` + +Returns the extension address stored under the following data key: + +- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (Check [LSP2-ERC725YJSONSchema] for encoding the data key). + +- If no extension is stored, returns the address(0). + +
+ +### \_fallbackLSP17Extendable + +```solidity +function _fallbackLSP17Extendable( + bytes callData +) internal nonpayable returns (bytes); +``` + +Forwards the call to an extension mapped to a function selector. +Calls [`_getExtension`](#_getextension) to get the address of the extension mapped to the function selector being called on the account. If there is no extension, the `address(0)` will be returned. +Reverts if there is no extension for the function being called, except for the bytes4(0) function selector, which passes even if there is no extension for it. +If there is an extension for the function selector being called, it calls the extension with the CALL opcode, passing the `msg.data` appended with the 20 bytes of the `msg.sender` and 32 bytes of the `msg.value` + +
+ +### \_validateAndIdentifyCaller + +```solidity +function _validateAndIdentifyCaller() internal view returns (bool isURD); +``` + +Modifier restricting the call to the owner of the contract and the UniversalReceiverDelegate + +
## Events ### ContractCreated -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#contractcreated) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#contractcreated) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Event signature: `ContractCreated(uint256,address,uint256,bytes32)` -- Event hash: `0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3` +- Event topic hash: `0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3` ::: @@ -633,27 +1149,29 @@ _Forwards the call to the addresses stored in the [ERC725Y] storage under the th event ContractCreated(uint256 indexed operationType, address indexed contractAddress, uint256 indexed value, bytes32 salt); ``` -_Deployed new contract at address `contractAddress` and funded with `value` wei (deployed using opcode: `operationType`)._ +_Emitted when deploying a contract_ -Emitted when a new contract was created and deployed. +Emitted whenever a contract is created #### Parameters -| Name | Type | Description | -| ------------------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `operationType` **`indexed`** | `uint256` | The opcode used to deploy the contract (`CREATE` or `CREATE2`). | -| `contractAddress` **`indexed`** | `address` | The created contract address. | -| `value` **`indexed`** | `uint256` | The amount of native tokens (in Wei) sent to fund the created contract on deployment. | -| `salt` | `bytes32` | The salt used to deterministically deploy the contract (`CREATE2` only). If `CREATE` opcode is used, the salt value will be `bytes32(0)`. | +| Name | Type | Description | +| ------------------------------- | :-------: | ------------------------------------------------------------------------------ | +| `operationType` **`indexed`** | `uint256` | The opcode used to deploy the contract (CREATE or CREATE2) | +| `contractAddress` **`indexed`** | `address` | The created contract address | +| `value` **`indexed`** | `uint256` | The amount of native tokens (in Wei) sent to fund the created contract address | +| `salt` | `bytes32` | - | + +
### DataChanged -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#datachanged) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#datachanged) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Event signature: `DataChanged(bytes32,bytes)` -- Event hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` +- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` ::: @@ -661,25 +1179,25 @@ Emitted when a new contract was created and deployed. event DataChanged(bytes32 indexed dataKey, bytes dataValue); ``` -_The following data key/value pair has been changed in the ERC725Y storage: Data key: `dataKey`, data value: `dataValue`._ - -Emitted when data at a specific `dataKey` was changed to a new value `dataValue`. +_Emitted when data at a key is changed_ #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | -------------------------------------------- | -| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | -| `dataValue` | `bytes` | The value to set for the given data key. | +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------ | +| `dataKey` **`indexed`** | `bytes32` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
### Executed -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#executed) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#executed) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Event signature: `Executed(uint256,address,uint256,bytes4)` -- Event hash: `0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e` +- Event topic hash: `0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e` ::: @@ -687,27 +1205,27 @@ Emitted when data at a specific `dataKey` was changed to a new value `dataValue` event Executed(uint256 indexed operationType, address indexed target, uint256 indexed value, bytes4 selector); ``` -_Called address `target` using `operationType` with `value` wei and `data`._ - -Emitted when calling an address `target` (EOA or contract) with `value`. +_Emitted when calling an address (EOA or contract)_ #### Parameters -| Name | Type | Description | -| ----------------------------- | :-------: | ---------------------------------------------------------------------------------------------------- | -| `operationType` **`indexed`** | `uint256` | The low-level call opcode used to call the `target` address (`CALL`, `STATICALL` or `DELEGATECALL`). | -| `target` **`indexed`** | `address` | The address to call. `target` will be unused if a contract is created (operation types 1 and 2). | -| `value` **`indexed`** | `uint256` | The amount of native tokens transferred along the call (in Wei). | -| `selector` | `bytes4` | The first 4 bytes (= function selector) of the data sent with the call. | +| Name | Type | Description | +| ----------------------------- | :-------: | ------------------------------------------------------------------------------------------------ | +| `operationType` **`indexed`** | `uint256` | The low-level call opcode used to call the `to` address (CALL, STATICALL or DELEGATECALL) | +| `target` **`indexed`** | `address` | The address to call. `target` will be unused if a contract is created (operation types 1 and 2). | +| `value` **`indexed`** | `uint256` | The amount of native tokens transferred with the call (in Wei) | +| `selector` | `bytes4` | The first 4 bytes (= function selector) of the data sent with the call | + +
### OwnershipRenounced -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#ownershiprenounced) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#ownershiprenounced) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Event signature: `OwnershipRenounced()` -- Event hash: `0xd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce` +- Event topic hash: `0xd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce` ::: @@ -715,16 +1233,20 @@ Emitted when calling an address `target` (EOA or contract) with `value`. event OwnershipRenounced(); ``` -emitted when the ownership of the contract has been renounced. +_Successfully renounced ownership of the contract. This contract is now owned by anyone, it's owner is `address(0)`._ + +Emitted when the ownership of the contract has been renounced. + +
### OwnershipTransferStarted -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#ownershiptransferstarted) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#ownershiptransferstarted) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Event signature: `OwnershipTransferStarted(address,address)` -- Event hash: `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700` +- Event topic hash: `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700` ::: @@ -732,23 +1254,27 @@ emitted when the ownership of the contract has been renounced. event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); ``` -emitted when starting the `transferOwnership(..)` 2-step process. +_The transfer of ownership of the contract was initiated. Pending new owner set to: `newOwner`._ + +Emitted when [`transferOwnership(..)`](#transferownership) was called and the first step of transferring ownership completed successfully which leads to [`pendingOwner`](#pendingowner) being updated. #### Parameters -| Name | Type | Description | -| ----------------------------- | :-------: | ----------- | -| `previousOwner` **`indexed`** | `address` | - | -| `newOwner` **`indexed`** | `address` | - | +| Name | Type | Description | +| ----------------------------- | :-------: | ---------------------------------- | +| `previousOwner` **`indexed`** | `address` | The address of the previous owner. | +| `newOwner` **`indexed`** | `address` | The address of the new owner. | + +
### OwnershipTransferred -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#ownershiptransferred) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#ownershiptransferred) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Event signature: `OwnershipTransferred(address,address)` -- Event hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` ::: @@ -763,14 +1289,16 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn | `previousOwner` **`indexed`** | `address` | - | | `newOwner` **`indexed`** | `address` | - | +
+ ### RenounceOwnershipStarted -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#renounceownershipstarted) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#renounceownershipstarted) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Event signature: `RenounceOwnershipStarted()` -- Event hash: `0x81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e7` +- Event topic hash: `0x81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e7` ::: @@ -778,16 +1306,20 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn event RenounceOwnershipStarted(); ``` -emitted when starting the `renounceOwnership(..)` 2-step process. +_Ownership renouncement initiated._ + +Emitted when starting the [`renounceOwnership(..)`](#renounceownership) 2-step process. + +
### UniversalReceiver -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#universalreceiver) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#universalreceiver) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Event signature: `UniversalReceiver(address,uint256,bytes32,bytes,bytes)` -- Event hash: `0x9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c2` +- Event topic hash: `0x9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c2` ::: @@ -795,26 +1327,32 @@ emitted when starting the `renounceOwnership(..)` 2-step process. event UniversalReceiver(address indexed from, uint256 indexed value, bytes32 indexed typeId, bytes receivedData, bytes returnedValue); ``` -_Emitted when the universalReceiver function is succesfully executed_ +\*Address `from` called the `universalReceiver(...)` function while sending `value` LYX. Notification type (typeId): `typeId` + +- Data received: `receivedData`.\* + +Emitted when the [`universalReceiver`](#universalreceiver) function was called with a specific `typeId` and some `receivedData` s #### 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 | +| Name | Type | Description | +| ---------------------- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `from` **`indexed`** | `address` | The address of the EOA or smart contract that called the {universalReceiver(...)} function. | +| `value` **`indexed`** | `uint256` | The amount sent to the {universalReceiver(...)} function. | +| `typeId` **`indexed`** | `bytes32` | A `bytes32` unique identifier (= _"hook"_)that describe the type of notification, information or transaction received by the contract. Can be related to a specific standard or a hook. | +| `receivedData` | `bytes` | Any arbitrary data that was sent to the {universalReceiver(...)} function. | +| `returnedValue` | `bytes` | The value returned by the {universalReceiver(...)} function. | + +
### ValueReceived -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#valuereceived) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#valuereceived) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Event signature: `ValueReceived(address,uint256)` -- Event hash: `0x7e71433ddf847725166244795048ecf3e3f9f35628254ecbf736056664233493` +- Event topic hash: `0x7e71433ddf847725166244795048ecf3e3f9f35628254ecbf736056664233493` ::: @@ -822,23 +1360,27 @@ _Emitted when the universalReceiver function is succesfully executed_ event ValueReceived(address indexed sender, uint256 indexed value); ``` -_Emitted when receiving native tokens._ +_`value` native tokens received from `sender`._ + +Emitted when receiving native tokens. #### Parameters -| Name | Type | Description | -| ---------------------- | :-------: | ------------------------------------- | -| `sender` **`indexed`** | `address` | The address of the sender. | -| `value` **`indexed`** | `uint256` | The amount of native tokens received. | +| Name | Type | Description | +| ---------------------- | :-------: | ---------------------------------------------------------- | +| `sender` **`indexed`** | `address` | The address that sent some native tokens to this contract. | +| `value` **`indexed`** | `uint256` | The amount of native tokens received. | + +
## Errors ### CannotTransferOwnershipToSelf -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#cannottransferownershiptoself) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#cannottransferownershiptoself) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `CannotTransferOwnershipToSelf()` - Error hash: `0x43b248cd` @@ -848,14 +1390,18 @@ _Emitted when receiving native tokens._ error CannotTransferOwnershipToSelf(); ``` -reverts when trying to transfer ownership to the address(this) +_Cannot transfer ownership to the address of the contract itself._ + +Reverts when trying to transfer ownership to the `address(this)`. + +
### ERC725X_ContractDeploymentFailed -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_contractdeploymentfailed) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_contractdeploymentfailed) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `ERC725X_ContractDeploymentFailed()` - Error hash: `0x0b07489b` @@ -865,14 +1411,16 @@ reverts when trying to transfer ownership to the address(this) error ERC725X_ContractDeploymentFailed(); ``` -Reverts when contract deployment failed via [`execute`](#execute) or [`executeBatch`](#executebatch) functions, This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`). +reverts when contract deployment via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` failed. whether using operation type 1 (CREATE) or 2 (CREATE2). + +
### ERC725X_CreateOperationsRequireEmptyRecipientAddress -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_createoperationsrequireemptyrecipientaddress) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_createoperationsrequireemptyrecipientaddress) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `ERC725X_CreateOperationsRequireEmptyRecipientAddress()` - Error hash: `0x3041824a` @@ -882,14 +1430,16 @@ Reverts when contract deployment failed via [`execute`](#execute) or [`executeBa error ERC725X_CreateOperationsRequireEmptyRecipientAddress(); ``` -Reverts when passing a `to` address that is not `address(0)` (= address zero) while deploying a contract via [`execute`](#execute) or [`executeBatch`](#executebatch) functions. This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`). +reverts when passing a `to` address while deploying a contract va `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` whether using operation type 1 (CREATE) or 2 (CREATE2). + +
### ERC725X_ExecuteParametersEmptyArray -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_executeparametersemptyarray) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_executeparametersemptyarray) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `ERC725X_ExecuteParametersEmptyArray()` - Error hash: `0xe9ad2b5f` @@ -899,14 +1449,16 @@ Reverts when passing a `to` address that is not `address(0)` (= address zero) wh error ERC725X_ExecuteParametersEmptyArray(); ``` -Reverts when one of the array parameter provided to the [`executeBatch`](#executebatch) function is an empty array. +reverts when one of the array parameter provided to `executeBatch(uint256[],address[],uint256[],bytes[]) is an empty array + +
### ERC725X_ExecuteParametersLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_executeparameterslengthmismatch) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_executeparameterslengthmismatch) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `ERC725X_ExecuteParametersLengthMismatch()` - Error hash: `0x3ff55f4d` @@ -916,14 +1468,16 @@ Reverts when one of the array parameter provided to the [`executeBatch`](#execut error ERC725X_ExecuteParametersLengthMismatch(); ``` -Reverts when there is not the same number of elements in the `operationTypes`, `targets` addresses, `values`, and `datas` array parameters provided when calling the [`executeBatch`](#executebatch) function. +reverts when there is not the same number of operation, to addresses, value, and data. + +
### ERC725X_InsufficientBalance -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_insufficientbalance) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_insufficientbalance) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `ERC725X_InsufficientBalance(uint256,uint256)` - Error hash: `0x0df9a8f8` @@ -933,21 +1487,23 @@ Reverts when there is not the same number of elements in the `operationTypes`, ` error ERC725X_InsufficientBalance(uint256 balance, uint256 value); ``` -Reverts when trying to send more native tokens `value` than available in current `balance`. +reverts when trying to send more native tokens `value` than available in current `balance`. #### Parameters -| Name | Type | Description | -| --------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `balance` | `uint256` | The balance of native tokens of the ERC725X smart contract. | -| `value` | `uint256` | The amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` that is greater than the contract's `balance`. | +| Name | Type | Description | +| --------- | :-------: | ---------------------------------------------------------------------------------------- | +| `balance` | `uint256` | the balance of the ERC725X contract. | +| `value` | `uint256` | the amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`. | + +
### ERC725X_MsgValueDisallowedInStaticCall -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_msgvaluedisallowedinstaticcall) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_msgvaluedisallowedinstaticcall) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `ERC725X_MsgValueDisallowedInStaticCall()` - Error hash: `0x72f2bc6a` @@ -957,14 +1513,16 @@ Reverts when trying to send more native tokens `value` than available in current error ERC725X_MsgValueDisallowedInStaticCall(); ``` -Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `staticcall` (`operationType == 3`). Sending native tokens via `staticcall` is not allowed because it is a state changing operation. +the `value` parameter (= sending native tokens) is not allowed when making a staticcall via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` because sending native tokens is a state changing operation. + +
### ERC725X_NoContractBytecodeProvided -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_nocontractbytecodeprovided) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_nocontractbytecodeprovided) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `ERC725X_NoContractBytecodeProvided()` - Error hash: `0xb81cd8d9` @@ -974,14 +1532,16 @@ Reverts when trying to send native tokens (`value` / `values[]` parameter of [`e error ERC725X_NoContractBytecodeProvided(); ``` -Reverts when no contract bytecode was provided as parameter when trying to deploy a contract via [`execute`](#execute) or [`executeBatch`](#executebatch). This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`). +reverts when no contract bytecode was provided as parameter when trying to deploy a contract via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`, whether using operation type 1 (CREATE) or 2 (CREATE2). + +
### ERC725X_UnknownOperationType -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_unknownoperationtype) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725x_unknownoperationtype) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `ERC725X_UnknownOperationType(uint256)` - Error hash: `0x7583b3bc` @@ -991,20 +1551,22 @@ Reverts when no contract bytecode was provided as parameter when trying to deplo error ERC725X_UnknownOperationType(uint256 operationTypeProvided); ``` -Reverts when the `operationTypeProvided` is none of the default operation types available. (CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4) +reverts when the `operationTypeProvided` is none of the default operation types available. (CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4) #### Parameters -| Name | Type | Description | -| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------ | -| `operationTypeProvided` | `uint256` | The unrecognised operation type number provided to `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`. | +| Name | Type | Description | +| ----------------------- | :-------: | ----------- | +| `operationTypeProvided` | `uint256` | - | + +
### ERC725Y_DataKeysValuesLengthMismatch -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -1014,14 +1576,16 @@ Reverts when the `operationTypeProvided` is none of the default operation types error ERC725Y_DataKeysValuesLengthMismatch(); ``` -Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. +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 +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725y_msgvaluedisallowed) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#erc725y_msgvaluedisallowed) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -1031,14 +1595,37 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat error ERC725Y_MsgValueDisallowed(); ``` -Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function. +reverts when sending value to the `setData(..)` functions + +
+ +### LSP14MustAcceptOwnershipInSeparateTransaction + +:::note References + +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#lsp14mustacceptownershipinseparatetransaction) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) +- Error signature: `LSP14MustAcceptOwnershipInSeparateTransaction()` +- Error hash: `0x5758dd07` + +::: + +```solidity +error LSP14MustAcceptOwnershipInSeparateTransaction(); +``` + +_Cannot accept ownership in the same transaction with [`transferOwnership(...)`](#transferownership)._ + +Reverts when pending owner accept ownership in the same transaction of transferring ownership. + +
### LSP1DelegateNotAllowedToSetDataKey -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#lsp1delegatenotallowedtosetdatakey) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#lsp1delegatenotallowedtosetdatakey) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `LSP1DelegateNotAllowedToSetDataKey(bytes32)` - Error hash: `0x199611f1` @@ -1048,7 +1635,7 @@ Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#set error LSP1DelegateNotAllowedToSetDataKey(bytes32 dataKey); ``` -_Couldn't set the Data Key: `dataKey`._ +_The `LSP1UniversalReceiverDelegate` is not allowed to set the following data key: `dataKey`._ Reverts when the Vault version of [LSP1UniversalReceiverDelegate] sets LSP1/6/17 Data Keys. @@ -1058,12 +1645,14 @@ Reverts when the Vault version of [LSP1UniversalReceiverDelegate] sets LSP1/6/17 | --------- | :-------: | --------------------------------------------------------------------------------------------- | | `dataKey` | `bytes32` | The data key that the Vault version of [LSP1UniversalReceiverDelegate] is not allowed to set. | +
+ ### NoExtensionFoundForFunctionSelector -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#noextensionfoundforfunctionselector) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#noextensionfoundforfunctionselector) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `NoExtensionFoundForFunctionSelector(bytes4)` - Error hash: `0xbb370b2b` @@ -1081,12 +1670,14 @@ reverts when there is no extension for the function selector being called with | ------------------ | :------: | ----------- | | `functionSelector` | `bytes4` | - | +
+ ### NotInRenounceOwnershipInterval -:::note Links +:::note References -- Specification details in [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#notinrenounceownershipinterval) -- Solidity implementation in [**LSP9Vault**](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/contracts/LSP9Vault/LSP9Vault.sol) +- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-9-Vault.md#notinrenounceownershipinterval) +- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP9Vault/LSP9Vault.sol) - Error signature: `NotInRenounceOwnershipInterval(uint256,uint256)` - Error hash: `0x8b9bf507` @@ -1099,14 +1690,18 @@ error NotInRenounceOwnershipInterval( ); ``` -reverts when trying to renounce ownership before the initial confirmation delay +_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` | - | -| `renounceOwnershipEnd` | `uint256` | - | +| Name | Type | Description | +| ------------------------ | :-------: | ----------------------------------------------------------------------- | +| `renounceOwnershipStart` | `uint256` | The start timestamp when one can confirm the renouncement of ownership. | +| `renounceOwnershipEnd` | `uint256` | The end timestamp when one can confirm the renouncement of ownership. | + +
diff --git a/docs/contracts/contracts/UniversalProfile.md b/docs/contracts/contracts/UniversalProfile.md new file mode 100644 index 0000000000..b49c5ed217 --- /dev/null +++ b/docs/contracts/contracts/UniversalProfile.md @@ -0,0 +1,1749 @@ + + + +# UniversalProfile + +:::info Standard Specifications + +[`UniversalProfile`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md) + +::: +:::info Solidity implementation + +[`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) + +::: + +> implementation of a LUKSO's Universal Profile based on LSP3 + +Implementation of the ERC725Account + LSP1 universalReceiver + +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. + +### constructor + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#constructor) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) + +::: + +```solidity +constructor(address initialOwner); +``` + +_Deploying a UniversalProfile contract with owner set to address `initialOwner`._ + +Set `initialOwner` as the contract owner and the `SupportedStandards:LSP3UniversalProfile` data key in the ERC725Y data key/value store. The `constructor` also allows funding the contract on deployment. + +
+ +**Emitted events:** + +- [`ValueReceived`](#valuereceived) event when funding the contract on deployment. +- [`OwnershipTransferred`](#ownershiptransferred) event when `initialOwner` is set as the contract [`owner`](#owner). +- [`DataChanged`](#datachanged) event when setting the [`_LSP3_SUPPORTED_STANDARDS_KEY`](#_lsp3_supported_standards_key). + +
+ +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | ------------------------- | +| `initialOwner` | `address` | the owner of the contract | + +
+ +### fallback + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#fallback) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) + +::: + +```solidity +fallback() external payable; +``` + +
+ +### receive + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#receive) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) + +::: + +```solidity +receive() external payable; +``` + +
+ +### RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#renounce_ownership_confirmation_delay) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY()` +- Function selector: `0xead3fbdf` + +::: + +```solidity +function RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY() + external + view + returns (uint256); +``` + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------- | +| `0` | `uint256` | - | + +
+ +### RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#renounce_ownership_confirmation_period) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD()` +- Function selector: `0x01bfba61` + +::: + +```solidity +function RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD() + external + view + returns (uint256); +``` + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------- | +| `0` | `uint256` | - | + +
+ +### acceptOwnership + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#acceptownership) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.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:** + +- Only the [`pendingOwner`](#pendingowner) can call this function. +- When notifying the previous owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_SenderNotification]. +- When notifying the new owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_RecipientNotification]. + +
+ +
+ +### batchCalls + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#batchcalls) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Function signature: `batchCalls(bytes[])` +- Function selector: `0x6963d438` + +::: + +:::info + +It's not possible to send value along the functions call due to the use of `delegatecall`. + +::: + +```solidity +function batchCalls(bytes[] data) external nonpayable returns (bytes[] results); +``` + +_Executing the following batch of abi-encoded function calls on the contract: `data`._ + +Allows a caller to batch different function calls in one call. Perform a `delegatecall` on self, to call different functions with preserving the context. + +#### Parameters + +| Name | Type | Description | +| ------ | :-------: | -------------------------------------------------------------------- | +| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. | + +#### Returns + +| Name | Type | Description | +| --------- | :-------: | ---------------------------------------------------------------- | +| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. | + +
+ +### execute + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#execute) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Function signature: `execute(uint256,address,uint256,bytes)` +- Function selector: `0x44c028fe` + +::: + +```solidity +function execute( + uint256 operationType, + address target, + uint256 value, + bytes data +) external payable returns (bytes); +``` + +Generic executor function to: + +- send native tokens to any address. + +- interact with any contract by passing an abi-encoded function call in the `data` parameter. + +- deploy a contract by providing its creation bytecode in the `data` parameter. Requirements: + +- SHOULD only be callable by the owner of the contract set via ERC173. + +- if a `value` is provided, the contract MUST have at least this amount in its balance to execute successfully. + +- if the operation type is STATICCALL or DELEGATECALL, `value` SHOULD be 0. + +- `target` SHOULD be address(0) when deploying a contract. Emits an [`Executed`](#executed) event, when a call is made with `operationType` 0 (CALL), 3 (STATICCALL) or 4 (DELEGATECALL) Emits a [`ContractCreated`](#contractcreated) event, when deploying a contract with `operationType` 1 (CREATE) or 2 (CREATE2) + +
+ +**Requirements:** + +- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner. +- If a `value` is provided, the contract must have at least this amount in its balance to execute successfully. +- If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`. +- If the operation type is `STATICCALL` (3) or `DELEGATECALL` (4), `value` transfer is disallowed and must be 0. + +
+ +
+ +**Emitted events:** + +- [`Executed`](#executed) event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). +- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2). +- [`ValueReceived`](#valuereceived) event when receiving native tokens. + +
+ +#### Parameters + +| Name | Type | Description | +| --------------- | :-------: | ----------------------------------------------------------------------------------------------------- | +| `operationType` | `uint256` | The operation type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4 | +| `target` | `address` | The address of the EOA or smart contract. (unused if a contract is created via operation type 1 or 2) | +| `value` | `uint256` | The amount of native tokens to transfer (in Wei) | +| `data` | `bytes` | The call data, or the creation bytecode of the contract to deploy | + +#### Returns + +| Name | Type | Description | +| ---- | :-----: | ----------- | +| `0` | `bytes` | - | + +
+ +### executeBatch + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#executebatch) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Function signature: `executeBatch(uint256[],address[],uint256[],bytes[])` +- Function selector: `0x31858452` + +::: + +```solidity +function executeBatch( + uint256[] operationsType, + address[] targets, + uint256[] values, + bytes[] datas +) external payable returns (bytes[]); +``` + +Generic batch executor function to: + +- send native tokens to any address. + +- interact with any contract by passing an abi-encoded function call in the `datas` parameter. + +- deploy a contract by providing its creation bytecode in the `datas` parameter. Requirements: + +- The length of the parameters provided MUST be equal + +- SHOULD only be callable by the owner of the contract set via ERC173. + +- if a `values` is provided, the contract MUST have at least this amount in its balance to execute successfully. + +- if the operation type is STATICCALL or DELEGATECALL, `values` SHOULD be 0. + +- `targets` SHOULD be address(0) when deploying a contract. Emits an [`Executed`](#executed) event, when a call is made with `operationType` 0 (CALL), 3 (STATICCALL) or 4 (DELEGATECALL) Emits a [`ContractCreated`](#contractcreated) event, when deploying a contract with `operationType` 1 (CREATE) or 2 (CREATE2) + +
+ +**Requirements:** + +- The length of the parameters provided must be equal. +- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner. +- If a `value` is provided, the contract must have at least this amount in its balance to execute successfully. +- If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`. +- If the operation type is `STATICCALL` (3) or `DELEGATECALL` (4), `value` transfer is disallowed and must be 0. + +
+ +
+ +**Emitted events:** + +- [`Executed`](#executed) event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). (each iteration) +- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2) (each iteration) +- [`ValueReceived`](#valuereceived) event when receiving native tokens. + +
+ +#### Parameters + +| Name | Type | Description | +| ---------------- | :---------: | ----------------------------------------------------------------------------------------------------------- | +| `operationsType` | `uint256[]` | The list of operations type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4 | +| `targets` | `address[]` | The list of addresses to call. `targets` will be unused if a contract is created (operation types 1 and 2). | +| `values` | `uint256[]` | The list of native token amounts to transfer (in Wei) | +| `datas` | `bytes[]` | The list of call data, or the creation bytecode of the contract to deploy | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------- | +| `0` | `bytes[]` | - | + +
+ +### getData + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#getdata) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.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 References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#getdatabatch) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.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 | + +
+ +### isValidSignature + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#isvalidsignature) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Function signature: `isValidSignature(bytes32,bytes)` +- Function selector: `0x1626ba7e` + +::: + +```solidity +function isValidSignature( + bytes32 dataHash, + bytes signature +) external view returns (bytes4 magicValue); +``` + +_Achieves the goal of [EIP-1271] by validating signatures of smart contracts according to their own logic._ + +Handles two cases: + +1. If the owner is an EOA, recovers an address from the hash and the signature provided: + +- Returns the `magicValue` if the address recovered is the same as the owner, indicating that it was a valid signature. + +- If the address is different, it returns the fail value indicating that the signature is not valid. + +2. If the owner is a smart contract, it forwards the call of [`isValidSignature()`](#isvalidsignature) to the owner contract: + +- If the contract fails or returns the fail value, the [`isValidSignature()`](#isvalidsignature) on the account returns the fail value, indicating that the signature is not valid. + +- If the [`isValidSignature()`](#isvalidsignature) on the owner returned the `magicValue`, the [`isValidSignature()`](#isvalidsignature) on the account returns the `magicValue`, indicating that it's a valid signature. + +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | ------------------------------------------------------------ | +| `dataHash` | `bytes32` | The hash of the data to be validated. | +| `signature` | `bytes` | A signature that can validate the previous parameter (Hash). | + +#### Returns + +| Name | Type | Description | +| ------------ | :------: | ----------------------------------------------------------------- | +| `magicValue` | `bytes4` | A `bytes4` value that indicates if the signature is valid or not. | + +
+ +### owner + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#owner) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.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 References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#pendingowner) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.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 References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#renounceownership) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.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 call is used as a confirmation and will leave the contract without an owner. + +
+ +**Requirements:** + +- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner. + +
+ +
+ +### setData + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#setdata) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.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`_ + +
+ +**Requirements:** + +- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner. + +
+ +
+ +**Emitted events:** + +- [`ValueReceived`](#valuereceived) event when receiving native tokens. +- [`DataChanged`](#datachanged) event. + +
+ +#### 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 References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#setdatabatch) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.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. + +
+ +**Requirements:** + +- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner. + +
+ +
+ +**Emitted events:** + +- [`ValueReceived`](#valuereceived) event when receiving native tokens. +- [`DataChanged`](#datachanged) event. (on each iteration of setting data) + +
+ +#### 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 References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#supportsinterface) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Function signature: `supportsInterface(bytes4)` +- Function selector: `0x01ffc9a7` + +::: + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool); +``` + +_Checking if this contract supports the interface defined by the `bytes4` interface ID `interfaceId`._ + +Achieves the goal of [ERC-165] to detect supported interfaces and [LSP-17-ContractExtension] by checking if the interfaceId being queried is supported on another linked extension. If the contract doesn't support the `interfaceId`, it forwards the call to the `supportsInterface` extension according to [LSP-17-ContractExtension], and checks if the extension implements the interface defined by `interfaceId`. + +#### Parameters + +| Name | Type | Description | +| ------------- | :------: | ------------------------------------------------------ | +| `interfaceId` | `bytes4` | The interface ID to check if the contract supports it. | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | --------------------------------------------------------------------------------------------- | +| `0` | `bool` | `true` if this contract implements the interface defined by `interfaceId`, `false` otherwise. | + +
+ +### transferOwnership + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#transferownership) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Function signature: `transferOwnership(address)` +- Function selector: `0xf2fde38b` + +::: + +```solidity +function transferOwnership(address pendingNewOwner) 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:** + +- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner. +- When notifying the new owner via LSP1, the `typeId` used must be the `keccak256(...)` hash of [LSP0OwnershipTransferStarted]. +- Pending owner cannot accept ownership in the same tx via the LSP1 hook. + +
+ +#### Parameters + +| Name | Type | Description | +| ----------------- | :-------: | ----------- | +| `pendingNewOwner` | `address` | - | + +
+ +### universalReceiver + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#universalreceiver) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Function signature: `universalReceiver(bytes32,bytes)` +- Function selector: `0x6bb56a14` + +::: + +```solidity +function universalReceiver( + bytes32 typeId, + bytes receivedData +) external payable returns (bytes returnedValues); +``` + +_Notifying the contract by calling its `universalReceiver` function with the following informations: typeId: `typeId`; data: `data`._ + +Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps: + +1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]. + +- If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. + +- If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. + +2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) + +- If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. + +- If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. + +
+ +**Emitted events:** + +- [`ValueReceived`](#valuereceived) when receiving native tokens. +- [`UniversalReceiver`](#universalreceiver) event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called. + +
+ +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | -------------------------- | +| `typeId` | `bytes32` | The type of call received. | +| `receivedData` | `bytes` | The data received. | + +#### Returns + +| Name | Type | Description | +| ---------------- | :-----: | ------------------------------------------------------------------------------------------------------- | +| `returnedValues` | `bytes` | The ABI encoded return value of the LSP1UniversalReceiverDelegate call and the LSP1TypeIdDelegate call. | + +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_checkOwner + +```solidity +function _checkOwner() internal view; +``` + +Throws if the sender is not the owner. + +
+ +### \_setOwner + +```solidity +function _setOwner(address newOwner) internal nonpayable; +``` + +Changes the owner if `newOwner` and oldOwner are different +This pattern is useful in inheritance. + +
+ +### \_execute + +```solidity +function _execute( + uint256 operationType, + address target, + uint256 value, + bytes data +) internal nonpayable returns (bytes); +``` + +check the `operationType` provided and perform the associated low-level opcode. +see `IERC725X.execute(uint256,address,uint256,bytes)`. + +
+ +### \_executeBatch + +```solidity +function _executeBatch( + uint256[] operationsType, + address[] targets, + uint256[] values, + bytes[] datas +) internal nonpayable returns (bytes[]); +``` + +same as `_execute` but for batch execution +see `IERC725X,execute(uint256[],address[],uint256[],bytes[])` + +
+ +### \_executeCall + +```solidity +function _executeCall( + address target, + uint256 value, + bytes data +) internal nonpayable returns (bytes result); +``` + +perform low-level call (operation type = 0) + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------------- | +| `target` | `address` | The address on which call is executed | +| `value` | `uint256` | The value to be sent with the call | +| `data` | `bytes` | The data to be sent with the call | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | ---------------------- | +| `result` | `bytes` | The data from the call | + +
+ +### \_executeStaticCall + +```solidity +function _executeStaticCall( + address target, + bytes data +) internal nonpayable returns (bytes result); +``` + +perform low-level staticcall (operation type = 3) + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | ------------------------------------------- | +| `target` | `address` | The address on which staticcall is executed | +| `data` | `bytes` | The data to be sent with the staticcall | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | ------------------------------------- | +| `result` | `bytes` | The data returned from the staticcall | + +
+ +### \_executeDelegateCall + +```solidity +function _executeDelegateCall( + address target, + bytes data +) internal nonpayable returns (bytes result); +``` + +perform low-level delegatecall (operation type = 4) + +#### Parameters + +| Name | Type | Description | +| -------- | :-------: | --------------------------------------------- | +| `target` | `address` | The address on which delegatecall is executed | +| `data` | `bytes` | The data to be sent with the delegatecall | + +#### Returns + +| Name | Type | Description | +| -------- | :-----: | --------------------------------------- | +| `result` | `bytes` | The data returned from the delegatecall | + +
+ +### \_deployCreate + +```solidity +function _deployCreate( + uint256 value, + bytes creationCode +) internal nonpayable returns (bytes newContract); +``` + +deploy a contract using the CREATE opcode (operation type = 1) + +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | ---------------------------------------------------------------------------------- | +| `value` | `uint256` | The value to be sent to the contract created | +| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) | + +#### Returns + +| Name | Type | Description | +| ------------- | :-----: | -------------------------------------------- | +| `newContract` | `bytes` | The address of the contract created as bytes | + +
+ +### \_deployCreate2 + +```solidity +function _deployCreate2( + uint256 value, + bytes creationCode +) internal nonpayable returns (bytes newContract); +``` + +deploy a contract using the CREATE2 opcode (operation type = 2) + +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | ----------------------------------------------------------------------------------------------------- | +| `value` | `uint256` | The value to be sent to the contract created | +| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) and a bytes32 salt | + +#### Returns + +| Name | Type | Description | +| ------------- | :-----: | -------------------------------------------- | +| `newContract` | `bytes` | The address of the contract created as bytes | + +
+ +### \_getData + +```solidity +function _getData(bytes32 dataKey) internal view returns (bytes dataValue); +``` + +
+ +### \_setData + +```solidity +function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; +``` + +This function overrides the [`ERC725YCore`](#erc725ycore) internal [`_setData`](#_setdata) function to optimize gas usage by emitting only the first 256 bytes of the `dataValue`. + +
+ +**Emitted events:** + +- [`DataChanged`](#datachanged) event with only the first 256 bytes of [`dataValue`](#datavalue). + +
+ +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | -------------------------------------- | +| `dataKey` | `bytes32` | The key to store the data value under. | +| `dataValue` | `bytes` | The data value to be stored. | + +
+ +### \_transferOwnership + +```solidity +function _transferOwnership(address newOwner) internal nonpayable; +``` + +Set the pending owner of the contract and cancel any renounce ownership process that was previously started. + +
+ +**Requirements:** + +- `newOwner` cannot be the address of the contract itself. + +
+ +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ------------------------------------- | +| `newOwner` | `address` | The address of the new pending owner. | + +
+ +### \_acceptOwnership + +```solidity +function _acceptOwnership() internal nonpayable; +``` + +Set the pending owner of the contract as the new owner. + +
+ +### \_renounceOwnership + +```solidity +function _renounceOwnership() internal nonpayable; +``` + +Initiate or confirm the process of renouncing ownership after a specific delay of blocks have passed. + +
+ +### \_supportsInterfaceInERC165Extension + +```solidity +function _supportsInterfaceInERC165Extension( + bytes4 interfaceId +) internal view returns (bool); +``` + +Returns whether the interfaceId being checked is supported in the extension of the +[`supportsInterface`](#supportsinterface) selector. +To be used by extendable contracts wishing to extend the ERC165 interfaceIds originally +supported by reading whether the interfaceId queried is supported in the `supportsInterface` +extension if the extension is set, if not it returns false. + +
+ +### \_getExtension + +```solidity +function _getExtension(bytes4 functionSelector) internal view returns (address); +``` + +Returns the extension address stored under the following data key: + +- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (Check [LSP2-ERC725YJSONSchema] for encoding the data key). + +- If no extension is stored, returns the address(0). + +
+ +### \_fallbackLSP17Extendable + +```solidity +function _fallbackLSP17Extendable( + bytes callData +) internal nonpayable returns (bytes); +``` + +Forwards the call to an extension mapped to a function selector. +Calls [`_getExtension`](#_getextension) to get the address of the extension mapped to the function selector being called on the account. If there is no extension, the `address(0)` will be returned. +Reverts if there is no extension for the function being called, except for the bytes4(0) function selector, which passes even if there is no extension for it. +If there is an extension for the function selector being called, it calls the extension with the CALL opcode, passing the `msg.data` appended with the 20 bytes of the `msg.sender` and 32 bytes of the `msg.value` + +
+ +### \_verifyCall + +```solidity +function _verifyCall( + address logicVerifier +) internal nonpayable returns (bool verifyAfter); +``` + +Calls [`lsp20VerifyCall`](#lsp20verifycall) function on the logicVerifier. +Reverts in case the value returned does not match the magic value (lsp20VerifyCall selector) +Returns whether a verification after the execution should happen based on the last byte of the magicValue + +
+ +### \_verifyCallResult + +```solidity +function _verifyCallResult( + address logicVerifier, + bytes callResult +) internal nonpayable; +``` + +Calls [`lsp20VerifyCallResult`](#lsp20verifycallresult) function on the logicVerifier. +Reverts in case the value returned does not match the magic value (lsp20VerifyCallResult selector) + +
+ +### \_validateCall + +```solidity +function _validateCall( + bool postCall, + bool success, + bytes returnedData +) internal pure; +``` + +
+ +### \_revertWithLSP20DefaultError + +```solidity +function _revertWithLSP20DefaultError( + bool postCall, + bytes returnedData +) internal pure; +``` + +
+ +## Events + +### ContractCreated + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#contractcreated) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Event signature: `ContractCreated(uint256,address,uint256,bytes32)` +- Event topic hash: `0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3` + +::: + +```solidity +event ContractCreated(uint256 indexed operationType, address indexed contractAddress, uint256 indexed value, bytes32 salt); +``` + +_Emitted when deploying a contract_ + +Emitted whenever a contract is created + +#### Parameters + +| Name | Type | Description | +| ------------------------------- | :-------: | ------------------------------------------------------------------------------ | +| `operationType` **`indexed`** | `uint256` | The opcode used to deploy the contract (CREATE or CREATE2) | +| `contractAddress` **`indexed`** | `address` | The created contract address | +| `value` **`indexed`** | `uint256` | The amount of native tokens (in Wei) sent to fund the created contract address | +| `salt` | `bytes32` | - | + +
+ +### DataChanged + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#datachanged) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Event signature: `DataChanged(bytes32,bytes)` +- Event topic 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` | The data key which data value is set | +| `dataValue` | `bytes` | The data value to set | + +
+ +### Executed + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#executed) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Event signature: `Executed(uint256,address,uint256,bytes4)` +- Event topic hash: `0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e` + +::: + +```solidity +event Executed(uint256 indexed operationType, address indexed target, uint256 indexed value, bytes4 selector); +``` + +_Emitted when calling an address (EOA or contract)_ + +#### Parameters + +| Name | Type | Description | +| ----------------------------- | :-------: | ------------------------------------------------------------------------------------------------ | +| `operationType` **`indexed`** | `uint256` | The low-level call opcode used to call the `to` address (CALL, STATICALL or DELEGATECALL) | +| `target` **`indexed`** | `address` | The address to call. `target` will be unused if a contract is created (operation types 1 and 2). | +| `value` **`indexed`** | `uint256` | The amount of native tokens transferred with the call (in Wei) | +| `selector` | `bytes4` | The first 4 bytes (= function selector) of the data sent with the call | + +
+ +### OwnershipRenounced + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#ownershiprenounced) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Event signature: `OwnershipRenounced()` +- Event topic hash: `0xd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce` + +::: + +```solidity +event OwnershipRenounced(); +``` + +_Successfully renounced ownership of the contract. This contract is now owned by anyone, it's owner is `address(0)`._ + +Emitted when the ownership of the contract has been renounced. + +
+ +### OwnershipTransferStarted + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#ownershiptransferstarted) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Event signature: `OwnershipTransferStarted(address,address)` +- Event topic hash: `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700` + +::: + +```solidity +event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); +``` + +_The transfer of ownership of the contract was initiated. Pending new owner set to: `newOwner`._ + +Emitted when [`transferOwnership(..)`](#transferownership) was called and the first step of transferring ownership completed successfully which leads to [`pendingOwner`](#pendingowner) being updated. + +#### Parameters + +| Name | Type | Description | +| ----------------------------- | :-------: | ---------------------------------- | +| `previousOwner` **`indexed`** | `address` | The address of the previous owner. | +| `newOwner` **`indexed`** | `address` | The address of the new owner. | + +
+ +### OwnershipTransferred + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#ownershiptransferred) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Event signature: `OwnershipTransferred(address,address)` +- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` + +::: + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------------- | :-------: | ----------- | +| `previousOwner` **`indexed`** | `address` | - | +| `newOwner` **`indexed`** | `address` | - | + +
+ +### RenounceOwnershipStarted + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#renounceownershipstarted) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Event signature: `RenounceOwnershipStarted()` +- Event topic hash: `0x81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e7` + +::: + +```solidity +event RenounceOwnershipStarted(); +``` + +_Ownership renouncement initiated._ + +Emitted when starting the [`renounceOwnership(..)`](#renounceownership) 2-step process. + +
+ +### UniversalReceiver + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#universalreceiver) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Event signature: `UniversalReceiver(address,uint256,bytes32,bytes,bytes)` +- Event topic hash: `0x9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c2` + +::: + +```solidity +event UniversalReceiver(address indexed from, uint256 indexed value, bytes32 indexed typeId, bytes receivedData, bytes returnedValue); +``` + +\*Address `from` called the `universalReceiver(...)` function while sending `value` LYX. Notification type (typeId): `typeId` + +- Data received: `receivedData`.\* + +Emitted when the [`universalReceiver`](#universalreceiver) function was called with a specific `typeId` and some `receivedData` s + +#### Parameters + +| Name | Type | Description | +| ---------------------- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `from` **`indexed`** | `address` | The address of the EOA or smart contract that called the {universalReceiver(...)} function. | +| `value` **`indexed`** | `uint256` | The amount sent to the {universalReceiver(...)} function. | +| `typeId` **`indexed`** | `bytes32` | A `bytes32` unique identifier (= _"hook"_)that describe the type of notification, information or transaction received by the contract. Can be related to a specific standard or a hook. | +| `receivedData` | `bytes` | Any arbitrary data that was sent to the {universalReceiver(...)} function. | +| `returnedValue` | `bytes` | The value returned by the {universalReceiver(...)} function. | + +
+ +### ValueReceived + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#valuereceived) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Event signature: `ValueReceived(address,uint256)` +- Event topic hash: `0x7e71433ddf847725166244795048ecf3e3f9f35628254ecbf736056664233493` + +::: + +```solidity +event ValueReceived(address indexed sender, uint256 indexed value); +``` + +_`value` native tokens received from `sender`._ + +Emitted when receiving native tokens. + +#### Parameters + +| Name | Type | Description | +| ---------------------- | :-------: | ---------------------------------------------------------- | +| `sender` **`indexed`** | `address` | The address that sent some native tokens to this contract. | +| `value` **`indexed`** | `uint256` | The amount of native tokens received. | + +
+ +## Errors + +### CannotTransferOwnershipToSelf + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#cannottransferownershiptoself) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `CannotTransferOwnershipToSelf()` +- Error hash: `0x43b248cd` + +::: + +```solidity +error CannotTransferOwnershipToSelf(); +``` + +_Cannot transfer ownership to the address of the contract itself._ + +Reverts when trying to transfer ownership to the `address(this)`. + +
+ +### ERC725X_ContractDeploymentFailed + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#erc725x_contractdeploymentfailed) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `ERC725X_ContractDeploymentFailed()` +- Error hash: `0x0b07489b` + +::: + +```solidity +error ERC725X_ContractDeploymentFailed(); +``` + +reverts when contract deployment via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` failed. whether using operation type 1 (CREATE) or 2 (CREATE2). + +
+ +### ERC725X_CreateOperationsRequireEmptyRecipientAddress + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#erc725x_createoperationsrequireemptyrecipientaddress) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `ERC725X_CreateOperationsRequireEmptyRecipientAddress()` +- Error hash: `0x3041824a` + +::: + +```solidity +error ERC725X_CreateOperationsRequireEmptyRecipientAddress(); +``` + +reverts when passing a `to` address while deploying a contract va `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` whether using operation type 1 (CREATE) or 2 (CREATE2). + +
+ +### ERC725X_ExecuteParametersEmptyArray + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#erc725x_executeparametersemptyarray) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `ERC725X_ExecuteParametersEmptyArray()` +- Error hash: `0xe9ad2b5f` + +::: + +```solidity +error ERC725X_ExecuteParametersEmptyArray(); +``` + +reverts when one of the array parameter provided to `executeBatch(uint256[],address[],uint256[],bytes[]) is an empty array + +
+ +### ERC725X_ExecuteParametersLengthMismatch + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#erc725x_executeparameterslengthmismatch) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `ERC725X_ExecuteParametersLengthMismatch()` +- Error hash: `0x3ff55f4d` + +::: + +```solidity +error ERC725X_ExecuteParametersLengthMismatch(); +``` + +reverts when there is not the same number of operation, to addresses, value, and data. + +
+ +### ERC725X_InsufficientBalance + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#erc725x_insufficientbalance) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `ERC725X_InsufficientBalance(uint256,uint256)` +- Error hash: `0x0df9a8f8` + +::: + +```solidity +error ERC725X_InsufficientBalance(uint256 balance, uint256 value); +``` + +reverts when trying to send more native tokens `value` than available in current `balance`. + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | ---------------------------------------------------------------------------------------- | +| `balance` | `uint256` | the balance of the ERC725X contract. | +| `value` | `uint256` | the amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`. | + +
+ +### ERC725X_MsgValueDisallowedInDelegateCall + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#erc725x_msgvaluedisallowedindelegatecall) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `ERC725X_MsgValueDisallowedInDelegateCall()` +- Error hash: `0x5ac83135` + +::: + +```solidity +error ERC725X_MsgValueDisallowedInDelegateCall(); +``` + +the `value` parameter (= sending native tokens) is not allowed when making a delegatecall via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` because msg.value is persisting. + +
+ +### ERC725X_MsgValueDisallowedInStaticCall + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#erc725x_msgvaluedisallowedinstaticcall) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `ERC725X_MsgValueDisallowedInStaticCall()` +- Error hash: `0x72f2bc6a` + +::: + +```solidity +error ERC725X_MsgValueDisallowedInStaticCall(); +``` + +the `value` parameter (= sending native tokens) is not allowed when making a staticcall via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` because sending native tokens is a state changing operation. + +
+ +### ERC725X_NoContractBytecodeProvided + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#erc725x_nocontractbytecodeprovided) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `ERC725X_NoContractBytecodeProvided()` +- Error hash: `0xb81cd8d9` + +::: + +```solidity +error ERC725X_NoContractBytecodeProvided(); +``` + +reverts when no contract bytecode was provided as parameter when trying to deploy a contract via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`, whether using operation type 1 (CREATE) or 2 (CREATE2). + +
+ +### ERC725X_UnknownOperationType + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#erc725x_unknownoperationtype) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `ERC725X_UnknownOperationType(uint256)` +- Error hash: `0x7583b3bc` + +::: + +```solidity +error ERC725X_UnknownOperationType(uint256 operationTypeProvided); +``` + +reverts when the `operationTypeProvided` is none of the default operation types available. (CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4) + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ----------- | +| `operationTypeProvided` | `uint256` | - | + +
+ +### ERC725Y_DataKeysValuesLengthMismatch + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.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. + +
+ +### LSP14MustAcceptOwnershipInSeparateTransaction + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#lsp14mustacceptownershipinseparatetransaction) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `LSP14MustAcceptOwnershipInSeparateTransaction()` +- Error hash: `0x5758dd07` + +::: + +```solidity +error LSP14MustAcceptOwnershipInSeparateTransaction(); +``` + +_Cannot accept ownership in the same transaction with [`transferOwnership(...)`](#transferownership)._ + +Reverts when pending owner accept ownership in the same transaction of transferring ownership. + +
+ +### LSP20CallingVerifierFailed + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#lsp20callingverifierfailed) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `LSP20CallingVerifierFailed(bool)` +- Error hash: `0x8c6a8ae3` + +::: + +```solidity +error LSP20CallingVerifierFailed(bool postCall); +``` + +reverts when the call to the owner fail with no revert reason + +#### Parameters + +| Name | Type | Description | +| ---------- | :----: | ---------------------------------------------------- | +| `postCall` | `bool` | True if the execution call was done, False otherwise | + +
+ +### LSP20InvalidMagicValue + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#lsp20invalidmagicvalue) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `LSP20InvalidMagicValue(bool,bytes)` +- Error hash: `0xd088ec40` + +::: + +```solidity +error LSP20InvalidMagicValue(bool postCall, bytes returnedData); +``` + +reverts when the call to the owner does not return the magic value + +#### Parameters + +| Name | Type | Description | +| -------------- | :-----: | ---------------------------------------------------- | +| `postCall` | `bool` | True if the execution call was done, False otherwise | +| `returnedData` | `bytes` | The data returned by the call to the logic verifier | + +
+ +### NoExtensionFoundForFunctionSelector + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#noextensionfoundforfunctionselector) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.sol) +- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)` +- Error hash: `0xbb370b2b` + +::: + +```solidity +error NoExtensionFoundForFunctionSelector(bytes4 functionSelector); +``` + +reverts when there is no extension for the function selector being called with + +#### Parameters + +| Name | Type | Description | +| ------------------ | :------: | ----------- | +| `functionSelector` | `bytes4` | - | + +
+ +### NotInRenounceOwnershipInterval + +:::note References + +- Specification details: [**UniversalProfile**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-3-UniversalProfile-Metadata.md#notinrenounceownershipinterval) +- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/UniversalProfile.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 timestamp when one can confirm the renouncement of ownership. | +| `renounceOwnershipEnd` | `uint256` | The end timestamp when one can confirm the renouncement of ownership. | + +
diff --git a/docs/contracts/libraries/LSP10Utils.md b/docs/contracts/libraries/LSP10Utils.md index 533113520c..7aeca69b5b 100644 --- a/docs/contracts/libraries/LSP10Utils.md +++ b/docs/contracts/libraries/LSP10Utils.md @@ -1,6 +1,14 @@ + + + # LSP10Utils -:::info Solidity contract +:::info Standard Specifications + +[`LSP-10-ReceivedVaults`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-10-ReceivedVaults.md) + +::: +:::info Solidity implementation [`LSP10Utils.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP10ReceivedVaults/LSP10Utils.sol) @@ -10,78 +18,96 @@ LSP5Utils is a library of functions that can be used to register and manage vaults received by an ERC725Y smart contract. Based on the LSP10 Received Vaults standard. ---- - ## Internal Methods +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + ### generateReceivedVaultKeys +:::caution Warning + +This function returns empty arrays when encountering errors. Otherwise the arrays will contain 3 data keys and 3 data values. + +::: + ```solidity -function generateReceivedVaultKeys(address receiver, address vault, bytes32 vaultMapKey) internal view returns (bytes32[] keys, bytes[] values); +function generateReceivedVaultKeys( + address receiver, + address vaultAddress +) internal view returns (bytes32[] lsp10DataKeys, bytes[] lsp10DataValues); ``` Generate an array of data keys/values pairs to be set on the receiver address after receiving vaults. #### Parameters -| Name | Type | Description | -| ------------- | :-------: | -------------------------------------------------------------------------------------------------------- | -| `receiver` | `address` | The address receiving the vault and where the LSP10 data keys should be added. | -| `vault` | `address` | The address of the vault being received. | -| `vaultMapKey` | `bytes32` | The `LSP10VaultMap:<vault>` data key of the vault being received containing the interfaceId of the | +| Name | Type | Description | +| -------------- | :-------: | ------------------------------------------------------------------------------ | +| `receiver` | `address` | The address receiving the vault and where the LSP10 data keys should be added. | +| `vaultAddress` | `address` | The address of the vault being received. | #### Returns -| Name | Type | Description | -| -------- | :---------: | ------------------------------------------------------------------------------------------------------------------- | -| `keys` | `bytes32[]` | An array of 3 x data keys: `LSP10Vaults[]`, `LSP10Vaults[index]` and `LSP10VaultMap:<asset>`. | -| `values` | `bytes[]` | An array of 3 x data values: the new length of `LSP10Vaults[]`, the address of the asset under `LSP10Vaults[index]` | +| Name | Type | Description | +| ----------------- | :---------: | --------------------------------------------------------------------- | +| `lsp10DataKeys` | `bytes32[]` | An array data keys used to update the [LSP-10-ReceivedAssets] data. | +| `lsp10DataValues` | `bytes[]` | An array data values used to update the [LSP-10-ReceivedAssets] data. | + +
### generateSentVaultKeys +:::caution Warning + +Returns empty arrays when encountering errors. Otherwise the arrays must have at least 3 data keys and 3 data values. + +::: + ```solidity -function generateSentVaultKeys(address sender, bytes32 vaultMapKey, uint128 vaultIndex) internal view returns (bytes32[] keys, bytes[] values); +function generateSentVaultKeys( + address sender, + address vaultAddress +) internal view returns (bytes32[] lsp10DataKeys, bytes[] lsp10DataValues); ``` Generate an array of data key/value pairs to be set on the sender address after sending vaults. #### Parameters -| Name | Type | Description | -| ------------- | :-------: | ---------------------------------------------------------------------------------------------------- | -| `sender` | `address` | The address sending the vault and where the LSP10 data keys should be updated. | -| `vaultMapKey` | `bytes32` | The `LSP10VaultMap:<vault>` data key of the vault being sent containing the interfaceId of the | -| `vaultIndex` | `uint128` | The index at which the vault address is stored under `LSP10Vaults[]` Array. | +| Name | Type | Description | +| -------------- | :-------: | ------------------------------------------------------------------------------ | +| `sender` | `address` | The address sending the vault and where the LSP10 data keys should be updated. | +| `vaultAddress` | `address` | The address of the vault that is being sent. | #### Returns -| Name | Type | Description | -| -------- | :---------: | ------------------------------------------------------------------------------------------------------------------- | -| `keys` | `bytes32[]` | An array of 3 x data keys: `LSP10Vaults[]`, `LSP10Vaults[index]` and `LSP10VaultsMap:<asset>`. | -| `values` | `bytes[]` | An array of 3 x data values: the new length of `LSP10Vaults[]`, the address of the asset under `LSP10Vaults[index]` | - -### getLSP10ReceivedVaultsCount +| Name | Type | Description | +| ----------------- | :---------: | --------------------------------------------------------------------- | +| `lsp10DataKeys` | `bytes32[]` | An array data keys used to update the [LSP-10-ReceivedAssets] data. | +| `lsp10DataValues` | `bytes[]` | An array data values used to update the [LSP-10-ReceivedAssets] data. | -:::info +
-This function does not return a number but the raw bytes stored under the `LSP10Vaults[]` Array data key. - -::: +### getLSP10ArrayLengthBytes ```solidity -function getLSP10ReceivedVaultsCount(contract IERC725Y account) internal view returns (bytes); +function getLSP10ArrayLengthBytes(contract IERC725Y erc725YContract) internal view returns (bytes); ``` -Get the total number of vault addresses stored under the `LSP10Vaults[]` Array data key. +Get the raw bytes value stored under the `_LSP10_VAULTS_ARRAY_KEY`. #### Parameters -| Name | Type | Description | -| --------- | :-----------------: | ---------------------------------------------------- | -| `account` | `contract IERC725Y` | The ERC725Y smart contract to read the storage from. | +| Name | Type | Description | +| ----------------- | :-----------------: | ----------------------------------------------- | +| `erc725YContract` | `contract IERC725Y` | The contract to query the ERC725Y storage from. | #### Returns -| Name | Type | Description | -| ---- | :-----: | ---------------------------------------------------------------- | -| `0` | `bytes` | @return The raw bytes stored under the `LSP10Vaults[]` data key. | +| Name | Type | Description | +| ---- | :-----: | ----------------------------------------------- | +| `0` | `bytes` | The raw bytes value stored under this data key. | + +
diff --git a/docs/contracts/libraries/LSP17Utils.md b/docs/contracts/libraries/LSP17Utils.md index b14f7c2411..57ca72d1bb 100644 --- a/docs/contracts/libraries/LSP17Utils.md +++ b/docs/contracts/libraries/LSP17Utils.md @@ -1,6 +1,14 @@ + + + # LSP17Utils -:::info Solidity contract +:::info Standard Specifications + +[`LSP-17-ContractExtension`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-17-ContractExtension.md) + +::: +:::info Solidity implementation [`LSP17Utils.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP17ContractExtension/LSP17Utils.sol) @@ -8,16 +16,23 @@ > LSP17 Utility library to check an extension ---- - ## Internal Methods +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + ### isExtension ```solidity -function isExtension(uint256 parametersLengthWithOffset, uint256 msgDataLength) internal pure returns (bool); +function isExtension( + uint256 parametersLengthWithOffset, + uint256 msgDataLength +) internal pure returns (bool); ``` Returns whether the call is a normal call or an extension call by checking if the `parametersLengthWithOffset` with an additional of 52 bytes supposed msg.sender and msg.value appended is equal to the msgDataLength + +
diff --git a/docs/contracts/libraries/LSP1Utils.md b/docs/contracts/libraries/LSP1Utils.md index 8acd087024..bf450e5e3d 100644 --- a/docs/contracts/libraries/LSP1Utils.md +++ b/docs/contracts/libraries/LSP1Utils.md @@ -1,6 +1,14 @@ + + + # LSP1Utils -:::info Solidity contract +:::info Standard Specifications + +[`LSP-1-UniversalReceiver`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md) + +::: +:::info Solidity implementation [`LSP1Utils.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1Utils.sol) @@ -10,14 +18,20 @@ LSP1Utils is a library of utility functions that can be used to notify the `universalReceiver` function of a contract that implements LSP1 and retrieve informations related to LSP1 `typeId`. Based on LSP1 Universal Receiver standard. ---- - ## Internal Methods +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + ### tryNotifyUniversalReceiver ```solidity -function tryNotifyUniversalReceiver(address lsp1Implementation, bytes32 typeId, bytes data) internal nonpayable; +function tryNotifyUniversalReceiver( + address lsp1Implementation, + bytes32 typeId, + bytes data +) internal nonpayable; ``` Notify a contract at `lsp1Implementation` address by calling its `universalReceiver` function if this contract @@ -31,10 +45,18 @@ supports the LSP1 interface. | `typeId` | `bytes32` | A `bytes32` typeId. | | `data` | `bytes` | Any optional data to send to the `universalReceiver` function to the `lsp1Implementation` address. | +
+ ### callUniversalReceiverWithCallerInfos ```solidity -function callUniversalReceiverWithCallerInfos(address universalReceiverDelegate, bytes32 typeId, bytes receivedData, address msgSender, uint256 msgValue) internal nonpayable returns (bytes); +function callUniversalReceiverWithCallerInfos( + address universalReceiverDelegate, + bytes32 typeId, + bytes receivedData, + address msgSender, + uint256 msgValue +) internal nonpayable returns (bytes); ``` Call a LSP1UniversalReceiverDelegate contract at `universalReceiverDelegate` address and append `msgSender` and `msgValue` @@ -52,14 +74,82 @@ as additional informations in the calldata. #### Returns -| Name | Type | Description | -| ---- | :-----: | ------------------------------------------------------------------------ | -| `0` | `bytes` | @return The data returned by the LSP1UniversalReceiverDelegate contract. | +| Name | Type | Description | +| ---- | :-----: | ---------------------------------------------------------------- | +| `0` | `bytes` | The data returned by the LSP1UniversalReceiverDelegate contract. | + +
+ +### getLSP1DelegateValue + +```solidity +function getLSP1DelegateValue( + mapping(bytes32 => bytes) erc725YStorage +) internal view returns (bytes); +``` + +_Retrieving the value stored under the ERC725Y data key `LSP1UniversalReceiverDelegate`._ + +Query internally the ERC725Y storage of a `ERC725Y` smart contract to retrieve +the value set under the `LSP1UniversalReceiverDelegate` data key. + +#### Parameters + +| Name | Type | Description | +| ---------------- | :-------------------------: | ----------------------------------------------------------- | +| `erc725YStorage` | `mapping(bytes32 => bytes)` | A reference to the ERC725Y storage mapping of the contract. | + +#### Returns + +| Name | Type | Description | +| ---- | :-----: | -------------------------------------------------------------------------- | +| `0` | `bytes` | The bytes value stored under the `LSP1UniversalReceiverDelegate` data key. | + +
+ +### getLSP1DelegateValueForTypeId + +```solidity +function getLSP1DelegateValueForTypeId( + mapping(bytes32 => bytes) erc725YStorage, + bytes32 typeId +) internal view returns (bytes); +``` + +_Retrieving the value stored under the ERC725Y data key `LSP1UniversalReceiverDelegate:` for a specific `typeId`._ + +Query internally the ERC725Y storage of a `ERC725Y` smart contract to retrieve +the value set under the `LSP1UniversalReceiverDelegate:` data key for a specific LSP1 `typeId`. + +#### Parameters + +| Name | Type | Description | +| ---------------- | :-------------------------: | ----------------------------------------------------------- | +| `erc725YStorage` | `mapping(bytes32 => bytes)` | A reference to the ERC725Y storage mapping of the contract. | +| `typeId` | `bytes32` | A bytes32 LSP1 `typeId`; | + +#### Returns + +| Name | Type | Description | +| ---- | :-----: | ------------------------------------------------------------------------------------ | +| `0` | `bytes` | The bytes value stored under the `LSP1UniversalReceiverDelegate:` data key. | + +
### getTransferDetails ```solidity -function getTransferDetails(bytes32 typeId) internal pure returns (bool invalid, bytes10 mapPrefix, bytes4 interfaceId, bool isReceiving); +function getTransferDetails( + bytes32 typeId +) + internal + pure + returns ( + bool invalid, + bytes10 mapPrefix, + bytes4 interfaceId, + bool isReceiving + ); ``` Gets all the transfer details based on the provided `bytes32 typeId`. @@ -78,3 +168,5 @@ Gets all the transfer details based on the provided `bytes32 typeId`. | `mapPrefix` | `bytes10` | The standard 10 bytes defined in a LSP standard associated with the specific `typeId`. | | `interfaceId` | `bytes4` | The bytes4 ERC165 interface ID defined in a LSP standard associated with a specific `typeId`. | | `isReceiving` | `bool` | When the typeId relate to LSP7/8 tokens or LSP9 Vaults, describe if the `typeId` relates | + +
diff --git a/docs/contracts/libraries/LSP2Utils.md b/docs/contracts/libraries/LSP2Utils.md index 8a64e0d112..6654ba2880 100644 --- a/docs/contracts/libraries/LSP2Utils.md +++ b/docs/contracts/libraries/LSP2Utils.md @@ -1,6 +1,14 @@ + + + # LSP2Utils -:::info Solidity contract +:::info Standard Specifications + +[`LSP-2-ERC725YJSONSchema`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md) + +::: +:::info Solidity implementation [`LSP2Utils.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol) @@ -10,10 +18,12 @@ LSP2Utils is a library of utility functions that can be used to encode data key of different key type defined on the LSP2 standard. Based on LSP2 ERC725Y JSON Schema standard. ---- - ## Internal Methods +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + ### generateSingletonKey ```solidity @@ -34,9 +44,11 @@ keccak256("keyName") #### Returns -| Name | Type | Description | -| ---- | :-------: | --------------------------------------------------------------- | -| `0` | `bytes32` | @return The generated `bytes32` data key of key type Singleton. | +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------------------- | +| `0` | `bytes32` | The generated `bytes32` data key of key type Singleton. | + +
### generateArrayKey @@ -58,14 +70,19 @@ keccak256("arrayKeyName[]") #### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------------------------- | -| `0` | `bytes32` | @return The generated `bytes32` data key of key type Array. | +| Name | Type | Description | +| ---- | :-------: | --------------------------------------------------- | +| `0` | `bytes32` | The generated `bytes32` data key of key type Array. | + +
### generateArrayElementKeyAtIndex ```solidity -function generateArrayElementKeyAtIndex(bytes32 arrayKey, uint128 index) internal pure returns (bytes32); +function generateArrayElementKeyAtIndex( + bytes32 arrayKey, + uint128 index +) internal pure returns (bytes32); ``` Generates an Array data key at a specific `index` by concatenating together the first 16 bytes of `arrayKey` @@ -84,14 +101,19 @@ arrayKey[index] #### Returns -| Name | Type | Description | -| ---- | :-------: | --------------------------------------------------------------------------------- | -| `0` | `bytes32` | @return The generated `bytes32` data key of key type Array at a specific `index`. | +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------------------------------------- | +| `0` | `bytes32` | The generated `bytes32` data key of key type Array at a specific `index`. | + +
### generateMappingKey ```solidity -function generateMappingKey(string firstWord, string lastWord) internal pure returns (bytes32); +function generateMappingKey( + string firstWord, + string lastWord +) internal pure returns (bytes32); ``` Generates a data key of key type Mapping that map `firstWord` to `lastWord`. This is done by hashing two strings words `firstWord` and `lastWord`. As: @@ -109,14 +131,19 @@ bytes10(firstWordHash):0000:bytes20(lastWordHash) #### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------------------------------------------------------------------------- | -| `0` | `bytes32` | @return The generated `bytes32` data key of key type Mapping that map `firstWord` to a specific `lastWord`. | +| Name | Type | Description | +| ---- | :-------: | --------------------------------------------------------------------------------------------------- | +| `0` | `bytes32` | The generated `bytes32` data key of key type Mapping that map `firstWord` to a specific `lastWord`. | + +
### generateMappingKey ```solidity -function generateMappingKey(string firstWord, address addr) internal pure returns (bytes32); +function generateMappingKey( + string firstWord, + address addr +) internal pure returns (bytes32); ``` Generates a data key of key type Mapping that map `firstWord` to an address `addr`. @@ -135,14 +162,19 @@ bytes10(firstWordHash):0000:
#### Returns -| Name | Type | Description | -| ---- | :-------: | --------------------------------------------------------------------------------------------------------------- | -| `0` | `bytes32` | @return The generated `bytes32` data key of key type Mapping that map `firstWord` to a specific address `addr`. | +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------------------------------------------------------------------- | +| `0` | `bytes32` | The generated `bytes32` data key of key type Mapping that map `firstWord` to a specific address `addr`. | + +
### generateMappingKey ```solidity -function generateMappingKey(bytes10 keyPrefix, bytes20 bytes20Value) internal pure returns (bytes32); +function generateMappingKey( + bytes10 keyPrefix, + bytes20 bytes20Value +) internal pure returns (bytes32); ``` Generate a data key of key type Mapping that map a 10 bytes `keyPrefix` to a `bytes20Value`. As: @@ -160,14 +192,20 @@ keyPrefix:bytes20Value #### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------------------------------------------------------------------------------- | -| `0` | `bytes32` | @return The generated `bytes32` data key of key type Mapping that map a `keyPrefix` to a specific `bytes20Value`. | +| Name | Type | Description | +| ---- | :-------: | --------------------------------------------------------------------------------------------------------- | +| `0` | `bytes32` | The generated `bytes32` data key of key type Mapping that map a `keyPrefix` to a specific `bytes20Value`. | + +
### generateMappingWithGroupingKey ```solidity -function generateMappingWithGroupingKey(string firstWord, string secondWord, address addr) internal pure returns (bytes32); +function generateMappingWithGroupingKey( + string firstWord, + string secondWord, + address addr +) internal pure returns (bytes32); ``` Generate a data key of key type MappingWithGrouping by using two strings `firstWord` @@ -187,14 +225,20 @@ bytes6(keccak256("firstWord")):bytes4(keccak256("secondWord")):0000:
#### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------------------------------------------------------------------------------------------------------------- | -| `0` | `bytes32` | @return The generated `bytes32` data key of key type MappingWithGrouping that map a `firstWord` to a `secondWord` to a specific address `addr`. | +| Name | Type | Description | +| ---- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------- | +| `0` | `bytes32` | The generated `bytes32` data key of key type MappingWithGrouping that map a `firstWord` to a `secondWord` to a specific address `addr`. | + +
### generateMappingWithGroupingKey ```solidity -function generateMappingWithGroupingKey(bytes6 keyPrefix, bytes4 mapPrefix, bytes20 subMapKey) internal pure returns (bytes32); +function generateMappingWithGroupingKey( + bytes6 keyPrefix, + bytes4 mapPrefix, + bytes20 subMapKey +) internal pure returns (bytes32); ``` Generate a data key of key type MappingWithGrouping that map a `keyPrefix` to an other `mapPrefix` to a specific `subMapKey`. As: @@ -213,14 +257,19 @@ keyPrefix:mapPrefix:0000:subMapKey #### Returns -| Name | Type | Description | -| ---- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------- | -| `0` | `bytes32` | @return The generated `bytes32` data key of key type MappingWithGrouping that map a `keyPrefix` to a `mapPrefix` to a specific `subMapKey`. | +| Name | Type | Description | +| ---- | :-------: | ----------------------------------------------------------------------------------------------------------------------------------- | +| `0` | `bytes32` | The generated `bytes32` data key of key type MappingWithGrouping that map a `keyPrefix` to a `mapPrefix` to a specific `subMapKey`. | + +
### generateMappingWithGroupingKey ```solidity -function generateMappingWithGroupingKey(bytes10 keyPrefix, bytes20 bytes20Value) internal pure returns (bytes32); +function generateMappingWithGroupingKey( + bytes10 keyPrefix, + bytes20 bytes20Value +) internal pure returns (bytes32); ``` Generate a data key of key type MappingWithGrouping that map a 10 bytes `keyPrefix` to a specific `bytes20Value`. As: @@ -234,14 +283,20 @@ Generate a data key of key type MappingWithGrouping that map a 10 bytes `keyPref #### Returns -| Name | Type | Description | -| ---- | :-------: | ----------------------------------------------------------------------------------------------- | -| `0` | `bytes32` | @return The generated `bytes32` data key of key type MappingWithGrouping that map a `keyPrefix` | +| Name | Type | Description | +| ---- | :-------: | --------------------------------------------------------------------------------------- | +| `0` | `bytes32` | The generated `bytes32` data key of key type MappingWithGrouping that map a `keyPrefix` | + +
### generateJSONURLValue ```solidity -function generateJSONURLValue(string hashFunction, string json, string url) internal pure returns (bytes); +function generateJSONURLValue( + string hashFunction, + string json, + string url +) internal pure returns (bytes); ``` Generate a JSONURL value content. @@ -254,10 +309,16 @@ Generate a JSONURL value content. | `json` | `string` | Bytes value of the JSON file. | | `url` | `string` | The URL where the JSON file is hosted. | +
+ ### generateASSETURLValue ```solidity -function generateASSETURLValue(string hashFunction, string assetBytes, string url) internal pure returns (bytes); +function generateASSETURLValue( + string hashFunction, + string assetBytes, + string url +) internal pure returns (bytes); ``` Generate a ASSETURL value content. @@ -272,9 +333,11 @@ Generate a ASSETURL value content. #### Returns -| Name | Type | Description | -| ---- | :-----: | ------------------------------------------- | -| `0` | `bytes` | @return The encoded value as an `ASSETURL`. | +| Name | Type | Description | +| ---- | :-----: | ----------------------------------- | +| `0` | `bytes` | The encoded value as an `ASSETURL`. | + +
### isEncodedArray @@ -292,9 +355,11 @@ Verify if `data` is an abi-encoded array. #### Returns -| Name | Type | Description | -| ---- | :----: | -------------------------------------------------------------------------------- | -| `0` | `bool` | @return `true` if the `data` represents an abi-encoded array, `false` otherwise. | +| Name | Type | Description | +| ---- | :----: | ------------------------------------------------------------------------ | +| `0` | `bool` | `true` if the `data` represents an abi-encoded array, `false` otherwise. | + +
### isEncodedArrayOfAddresses @@ -312,9 +377,11 @@ Verify if `data` is an abi-encoded array of addresses (`address[]`) encoded acco #### Returns -| Name | Type | Description | -| ---- | :----: | --------------------------------------------------------------------------------------------- | -| `0` | `bool` | @return `true` if the `data` represents an abi-encoded array of addresses, `false` otherwise. | +| Name | Type | Description | +| ---- | :----: | ------------------------------------------------------------------------------------- | +| `0` | `bool` | `true` if the `data` represents an abi-encoded array of addresses, `false` otherwise. | + +
### isBytes4EncodedArray @@ -332,14 +399,18 @@ Verify if `data` is an abi-array of `bytes4` values (`bytes4[]`) encoded accordi #### Returns -| Name | Type | Description | -| ---- | :----: | -------------------------------------------------------------------------------------------- | -| `0` | `bool` | @return `true` if the `data` represents an abi-encoded array of `bytes4`, `false` otherwise. | +| Name | Type | Description | +| ---- | :----: | ------------------------------------------------------------------------------------ | +| `0` | `bool` | `true` if the `data` represents an abi-encoded array of `bytes4`, `false` otherwise. | + +
### isCompactBytesArray ```solidity -function isCompactBytesArray(bytes compactBytesArray) internal pure returns (bool); +function isCompactBytesArray( + bytes compactBytesArray +) internal pure returns (bool); ``` Verify if `data` is a valid array of value encoded as a `CompactBytesArray` according to the LSP2 `CompactBytesArray` valueType specification. @@ -352,6 +423,83 @@ Verify if `data` is a valid array of value encoded as a `CompactBytesArray` acco #### Returns -| Name | Type | Description | -| ---- | :----: | --------------------------------------------------------------------------------------- | -| `0` | `bool` | @return `true` if the `data` is correctly encoded CompactBytesArray, `false` otherwise. | +| Name | Type | Description | +| ---- | :----: | ------------------------------------------------------------------------------- | +| `0` | `bool` | `true` if the `data` is correctly encoded CompactBytesArray, `false` otherwise. | + +
+ +### isValidLSP2ArrayLengthValue + +```solidity +function isValidLSP2ArrayLengthValue( + bytes arrayLength +) internal pure returns (bool); +``` + +Validates if the bytes `arrayLength` are exactly 16 bytes long, and are of the exact size of an LSP2 Array length value + +#### Parameters + +| Name | Type | Description | +| ------------- | :-----: | ------------------------------------- | +| `arrayLength` | `bytes` | Plain bytes that should be validated. | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | -------------------------------------------------------- | +| `0` | `bool` | `true` if the value is 16 bytes long, `false` otherwise. | + +
+ +### removeLastElementFromArrayAndMap + +```solidity +function removeLastElementFromArrayAndMap( + bytes32 arrayKey, + uint128 newArrayLength, + bytes32 removedElementIndexKey, + bytes32 removedElementMapKey +) internal pure returns (bytes32[] dataKeys, bytes[] dataValues); +``` + +Generates Data Key/Value pairs for removing the last element from an LSP2 Array and a mapping Data Key. + +#### Parameters + +| Name | Type | Description | +| ------------------------ | :-------: | ------------------------------------------------------------- | +| `arrayKey` | `bytes32` | The Data Key of Key Type Array. | +| `newArrayLength` | `uint128` | The new Array Length for the `arrayKey`. | +| `removedElementIndexKey` | `bytes32` | The Data Key of Key Type Array Index for the removed element. | +| `removedElementMapKey` | `bytes32` | The Data Key of a mapping to be removed. | + +
+ +### removeElementFromArrayAndMap + +:::info + +The function assumes that the Data Value stored under the mapping Data Key is of length 20 where the last 16 bytes are the index of the element in the array. + +::: + +```solidity +function removeElementFromArrayAndMap(contract IERC725Y ERC725YContract, bytes32 arrayKey, uint128 newArrayLength, bytes32 removedElementIndexKey, uint128 removedElementIndex, bytes32 removedElementMapKey) internal view returns (bytes32[] dataKeys, bytes[] dataValues); +``` + +Generates Data Key/Value pairs for removing an element from an LSP2 Array and a mapping Data Key. + +#### Parameters + +| Name | Type | Description | +| ------------------------ | :-----------------: | ------------------------------------------------------------- | +| `ERC725YContract` | `contract IERC725Y` | The ERC725Y contract. | +| `arrayKey` | `bytes32` | The Data Key of Key Type Array. | +| `newArrayLength` | `uint128` | The new Array Length for the `arrayKey`. | +| `removedElementIndexKey` | `bytes32` | The Data Key of Key Type Array Index for the removed element. | +| `removedElementIndex` | `uint128` | the index of the removed element. | +| `removedElementMapKey` | `bytes32` | The Data Key of a mapping to be removed. | + +
diff --git a/docs/contracts/libraries/LSP5Utils.md b/docs/contracts/libraries/LSP5Utils.md index 0528a6419e..b910fe4222 100644 --- a/docs/contracts/libraries/LSP5Utils.md +++ b/docs/contracts/libraries/LSP5Utils.md @@ -1,6 +1,14 @@ + + + # LSP5Utils -:::info Solidity contract +:::info Standard Specifications + +[`LSP-5-ReceivedAssets`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-5-ReceivedAssets.md) + +::: +:::info Solidity implementation [`LSP5Utils.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP5ReceivedAssets/LSP5Utils.sol) @@ -10,79 +18,98 @@ LSP5Utils is a library of functions that can be used to register and manage assets under an ERC725Y smart contract. Based on the LSP5 Received Assets standard. ---- - ## Internal Methods +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + ### generateReceivedAssetKeys +:::caution Warning + +Returns empty arrays when encountering errors. Otherwise the arrays must have 3 data keys and 3 data values. + +::: + ```solidity -function generateReceivedAssetKeys(address receiver, address asset, bytes32 assetMapKey, bytes4 interfaceID) internal view returns (bytes32[] keys, bytes[] values); +function generateReceivedAssetKeys( + address receiver, + address assetAddress, + bytes4 assetInterfaceId +) internal view returns (bytes32[] lsp5DataKeys, bytes[] lsp5DataValues); ``` Generate an array of data key/value pairs to be set on the receiver address after receiving assets. #### Parameters -| Name | Type | Description | -| ------------- | :-------: | --------------------------------------------------------------------------------------------------------------- | -| `receiver` | `address` | The address receiving the asset and where the LSP5 data keys should be added. | -| `asset` | `address` | The address of the asset being received (_e.g: an LSP7 or LSP8 token_). | -| `assetMapKey` | `bytes32` | The `LSP5ReceivedAssetMap:<asset>` data key of the asset being received containing the interfaceId of the | -| `interfaceID` | `bytes4` | The interfaceID of the asset being received. | +| Name | Type | Description | +| ------------------ | :-------: | ----------------------------------------------------------------------------- | +| `receiver` | `address` | The address receiving the asset and where the LSP5 data keys should be added. | +| `assetAddress` | `address` | The address of the asset being received (_e.g: an LSP7 or LSP8 token_). | +| `assetInterfaceId` | `bytes4` | The interfaceID of the asset being received. | #### Returns -| Name | Type | Description | -| -------- | :---------: | --------------------------------------------------------------------------------------------------------------------------------- | -| `keys` | `bytes32[]` | An array of 3 x data keys: `LSP5ReceivedAssets[]`, `LSP5ReceivedAssets[index]` and `LSP5ReceivedAssetsMap:<asset>`. | -| `values` | `bytes[]` | An array of 3 x data values: the new length of `LSP5ReceivedAssets[]`, the address of the asset under `LSP5ReceivedAssets[index]` | +| Name | Type | Description | +| ---------------- | :---------: | -------------------------------------------------------------------- | +| `lsp5DataKeys` | `bytes32[]` | An array Data Keys used to update the [LSP-5-ReceivedAssets] data. | +| `lsp5DataValues` | `bytes[]` | An array Data Values used to update the [LSP-5-ReceivedAssets] data. | + +
### generateSentAssetKeys +:::caution Warning + +Returns empty arrays when encountering errors. Otherwise the arrays must have at least 3 data keys and 3 data values. + +::: + ```solidity -function generateSentAssetKeys(address sender, bytes32 assetMapKey, uint128 assetIndex) internal view returns (bytes32[] keys, bytes[] values); +function generateSentAssetKeys( + address sender, + address assetAddress +) internal view returns (bytes32[] lsp5DataKeys, bytes[] lsp5DataValues); ``` -Generate an array of data key/value pairs to be set on the sender address after sending assets. +Generate an array of Data Key/Value pairs to be set on the sender address after sending assets. #### Parameters -| Name | Type | Description | -| ------------- | :-------: | ----------------------------------------------------------------------------------------------------------- | -| `sender` | `address` | The address sending the asset and where the LSP5 data keys should be updated. | -| `assetMapKey` | `bytes32` | The `LSP5ReceivedAssetMap:<asset>` data key of the asset being sent containing the interfaceId of the | -| `assetIndex` | `uint128` | The index at which the asset is stored under the `LSP5ReceivedAssets[]` Array. | +| Name | Type | Description | +| -------------- | :-------: | ----------------------------------------------------------------------------- | +| `sender` | `address` | The address sending the asset and where the LSP5 data keys should be updated. | +| `assetAddress` | `address` | The address of the asset that is being sent. | #### Returns -| Name | Type | Description | -| -------- | :---------: | --------------------------------------------------------------------------------------------------------------------------------- | -| `keys` | `bytes32[]` | An array of 3 x data keys: `LSP5ReceivedAssets[]`, `LSP5ReceivedAssets[index]` and `LSP5ReceivedAssetsMap:<asset>`. | -| `values` | `bytes[]` | An array of 3 x data values: the new length of `LSP5ReceivedAssets[]`, the address of the asset under `LSP5ReceivedAssets[index]` | - -### getLSP5ReceivedAssetsCount +| Name | Type | Description | +| ---------------- | :---------: | -------------------------------------------------------------------- | +| `lsp5DataKeys` | `bytes32[]` | An array Data Keys used to update the [LSP-5-ReceivedAssets] data. | +| `lsp5DataValues` | `bytes[]` | An array Data Values used to update the [LSP-5-ReceivedAssets] data. | -:::info +
-This function does not return a number but the raw bytes stored under the `LSP5ReceivedAssets[]` Array data key. - -::: +### getLSP5ArrayLengthBytes ```solidity -function getLSP5ReceivedAssetsCount(contract IERC725Y account) internal view returns (bytes); +function getLSP5ArrayLengthBytes(contract IERC725Y erc725YContract) internal view returns (bytes); ``` -Get the total number of asset addresses stored under the `LSP5ReceivedAssets[]` Array data key. +Get the raw bytes value stored under the `_LSP5_RECEIVED_ASSETS_ARRAY_KEY`. #### Parameters -| Name | Type | Description | -| --------- | :-----------------: | ---------------------------------------------------- | -| `account` | `contract IERC725Y` | The ERC725Y smart contract to read the storage from. | +| Name | Type | Description | +| ----------------- | :-----------------: | ----------------------------------------------- | +| `erc725YContract` | `contract IERC725Y` | The contract to query the ERC725Y storage from. | #### Returns -| Name | Type | Description | -| ---- | :-----: | ----------------------------------------------------------------------- | -| `0` | `bytes` | @return The raw bytes stored under the `LSP5ReceivedAssets[]` data key. | +| Name | Type | Description | +| ---- | :-----: | ----------------------------------------------- | +| `0` | `bytes` | The raw bytes value stored under this data key. | + +
diff --git a/docs/contracts/libraries/LSP6Utils.md b/docs/contracts/libraries/LSP6Utils.md index f2d7b528ff..5789174b78 100644 --- a/docs/contracts/libraries/LSP6Utils.md +++ b/docs/contracts/libraries/LSP6Utils.md @@ -1,6 +1,14 @@ + + + # LSP6Utils -:::info Solidity contract +:::info Standard Specifications + +[`LSP-6-KeyManager`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.md) + +::: +:::info Solidity implementation [`LSP6Utils.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP6KeyManager/LSP6Utils.sol) @@ -10,10 +18,12 @@ LSP6Utils is a library of utility functions that can be used to retrieve, check and set LSP6 permissions stored under the ERC725Y storage of a smart contract. Based on the LSP6 Key Manager standard. ---- - ## Internal Methods +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + ### getPermissionsFor ```solidity @@ -31,9 +41,11 @@ Read the permissions of a `caller` on an ERC725Y `target` contract. #### Returns -| Name | Type | Description | -| ---- | :-------: | -------------------------------------------------------------------------------- | -| `0` | `bytes32` | @return A `bytes32` BitArray containing the permissions of a controller address. | +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------------------------------------ | +| `0` | `bytes32` | A `bytes32` BitArray containing the permissions of a controller address. | + +
### getAllowedCallsFor @@ -41,6 +53,8 @@ Read the permissions of a `caller` on an ERC725Y `target` contract. function getAllowedCallsFor(contract IERC725Y target, address from) internal view returns (bytes); ``` +
+ ### getAllowedERC725YDataKeysFor ```solidity @@ -58,14 +72,19 @@ Read the Allowed ERC725Y data keys of a `caller` on an ERC725Y `target` contract #### Returns -| Name | Type | Description | -| ---- | :-----: | ----------------------------------------------------------------------------------------------------------------- | -| `0` | `bytes` | @return An abi-encoded array of allowed ERC725 data keys that the controller address is allowed to interact with. | +| Name | Type | Description | +| ---- | :-----: | --------------------------------------------------------------------------------------------------------- | +| `0` | `bytes` | An abi-encoded array of allowed ERC725 data keys that the controller address is allowed to interact with. | + +
### hasPermission ```solidity -function hasPermission(bytes32 controllerPermissions, bytes32 permissionToCheck) internal pure returns (bool); +function hasPermission( + bytes32 controllerPermissions, + bytes32 permissionToCheck +) internal pure returns (bool); ``` Compare the permissions `controllerPermissions` of a controller address to check if they includes the permissions `permissionToCheck`. @@ -79,14 +98,18 @@ Compare the permissions `controllerPermissions` of a controller address to check #### Returns -| Name | Type | Description | -| ---- | :----: | ------------------------------------------------------------------------------------------ | -| `0` | `bool` | @return `true` if `controllerPermissions` includes `permissionToCheck`, `false` otherwise. | +| Name | Type | Description | +| ---- | :----: | ---------------------------------------------------------------------------------- | +| `0` | `bool` | `true` if `controllerPermissions` includes `permissionToCheck`, `false` otherwise. | + +
### isCompactBytesArrayOfAllowedCalls ```solidity -function isCompactBytesArrayOfAllowedCalls(bytes allowedCallsCompacted) internal pure returns (bool); +function isCompactBytesArrayOfAllowedCalls( + bytes allowedCallsCompacted +) internal pure returns (bool); ``` Same as `LSP2Utils.isCompactBytesArray` with the additional requirement that each element must be 32 bytes long. @@ -99,14 +122,18 @@ Same as `LSP2Utils.isCompactBytesArray` with the additional requirement that eac #### Returns -| Name | Type | Description | -| ---- | :----: | ---------------------------------------------------------------------------------------------------------------------- | -| `0` | `bool` | @return `true` if the value passed is a valid compact bytes array of bytes32 AllowedCalls elements, `false` otherwise. | +| Name | Type | Description | +| ---- | :----: | -------------------------------------------------------------------------------------------------------------- | +| `0` | `bool` | `true` if the value passed is a valid compact bytes array of bytes32 AllowedCalls elements, `false` otherwise. | + +
### isCompactBytesArrayOfAllowedERC725YDataKeys ```solidity -function isCompactBytesArrayOfAllowedERC725YDataKeys(bytes allowedERC725YDataKeysCompacted) internal pure returns (bool); +function isCompactBytesArrayOfAllowedERC725YDataKeys( + bytes allowedERC725YDataKeysCompacted +) internal pure returns (bool); ``` Same as `LSP2Utils.isCompactBytesArray` with the additional requirement that each element must be from 1 to 32 bytes long. @@ -119,14 +146,20 @@ Same as `LSP2Utils.isCompactBytesArray` with the additional requirement that eac #### Returns -| Name | Type | Description | -| ---- | :----: | -------------------------------------------------------------------------------------------------------------------------- | -| `0` | `bool` | @return `true` if the value passed is a valid compact bytes array of bytes32 Allowed ERC725Y data keys, `false` otherwise. | +| Name | Type | Description | +| ---- | :----: | ------------------------------------------------------------------------------------------------------------------ | +| `0` | `bool` | `true` if the value passed is a valid compact bytes array of bytes32 Allowed ERC725Y data keys, `false` otherwise. | + +
### setDataViaKeyManager ```solidity -function setDataViaKeyManager(address keyManagerAddress, bytes32[] keys, bytes[] values) internal nonpayable returns (bytes result); +function setDataViaKeyManager( + address keyManagerAddress, + bytes32[] keys, + bytes[] values +) internal nonpayable returns (bytes result); ``` Use the `setData(bytes32[],bytes[])` function via the KeyManager on the target contract. @@ -139,10 +172,14 @@ Use the `setData(bytes32[],bytes[])` function via the KeyManager on the target c | `keys` | `bytes32[]` | The array of `bytes32[]` data keys. | | `values` | `bytes[]` | The array of `bytes[]` data values. | +
+ ### combinePermissions ```solidity -function combinePermissions(bytes32[] permissions) internal pure returns (bytes32); +function combinePermissions( + bytes32[] permissions +) internal pure returns (bytes32); ``` Combine multiple permissions into a single `bytes32`. @@ -156,9 +193,11 @@ Make sure that the sum of the values of the input array is less than `2^256-1 to #### Returns -| Name | Type | Description | -| ---- | :-------: | -------------------------------------------------------------- | -| `0` | `bytes32` | @return A `bytes32` value containing the combined permissions. | +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------------------ | +| `0` | `bytes32` | A `bytes32` value containing the combined permissions. | + +
### generateNewPermissionsKeys @@ -183,6 +222,8 @@ Generate a new set of 3 x LSP6 permission data keys to add a new `controller` on | `keys` | `bytes32[]` | An array of 3 x data keys containing: | | `values` | `bytes[]` | An array of 3 x data values containing: | +
+ ### getPermissionName ```solidity @@ -199,6 +240,8 @@ Returns the name of the permission as a string. #### Returns -| Name | Type | Description | -| ---- | :------: | ---------------------------------------------------------- | -| `0` | `string` | @return The string name of the `bytes32` permission value. | +| Name | Type | Description | +| ---- | :------: | -------------------------------------------------- | +| `0` | `string` | The string name of the `bytes32` permission value. | + +