Skip to content

Commit

Permalink
docs: update auto-generated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
b00ste committed Aug 15, 2023
1 parent 48b821b commit 44b4ae9
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 526 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ See [`IERC165-supportsInterface`](#ierc165-supportsinterface).

:::

:::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.

:::

:::caution Warning

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].
Expand All @@ -79,7 +86,7 @@ When the data stored in the ERC725Y storage of the LSP0 contract is corrupted (\
function universalReceiver(
bytes32 typeId,
bytes
) external payable returns (bytes result);
) external payable returns (bytes returnedMessage);
```

_Reacted on received notification with `typeId`._
Expand All @@ -106,9 +113,9 @@ _Reacted on received notification with `typeId`._

#### Returns

| Name | Type | Description |
| -------- | :-----: | ---------------------------------------- |
| `result` | `bytes` | The result of the reaction for `typeId`. |
| Name | Type | Description |
| ----------------- | :-----: | ---------------------------------------- |
| `returnedMessage` | `bytes` | The result of the reaction for `typeId`. |

<br/>

Expand All @@ -126,7 +133,7 @@ function _whenReceiving(
address notifier,
bytes32 notifierMapKey,
bytes4 interfaceID
) internal nonpayable returns (bytes);
) internal nonpayable returns (bytes returnedMessage);
```

To avoid stack too deep error
Expand All @@ -143,7 +150,7 @@ function _whenSending(
address notifier,
bytes32 notifierMapKey,
uint128 arrayIndex
) internal nonpayable returns (bytes);
) internal nonpayable returns (bytes returnedMessage);
```

To avoid stack too deep error
Expand Down Expand Up @@ -189,149 +196,6 @@ Emitted when the [`universalReceiver`](#universalreceiver) function was called w

## Errors

### CannotRegisterEOAsAsAssets

:::note References

- 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 CannotRegisterEOAsAsAssets(address caller);
```

_EOA: `caller` cannot be registered as an asset._

Reverts when EOA calls the [`universalReceiver(..)`](#universalreceiver) function with an asset/vault typeId.

#### Parameters

| Name | Type | Description |
| -------- | :-------: | ---------------------- |
| `caller` | `address` | The address of the EOA |

<br/>

### InvalidLSP10ReceivedVaultsArrayLength

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#invalidlsp10receivedvaultsarraylength)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Error signature: `InvalidLSP10ReceivedVaultsArrayLength(bytes,uint256)`
- Error hash: `0x12ce1c39`

:::

```solidity
error InvalidLSP10ReceivedVaultsArrayLength(
bytes invalidValueStored,
uint256 invalidValueLength
);
```

Reverts when the value stored under the 'LSP10ReceivedVaults[]' Array 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 _e.g: `0x00000000000000000000000000000000` (zero), meaning empty array, no vaults received._ _e.g: `0x00000000000000000000000000000005` (non-zero), meaning 5 array elements, 5 vaults received._

- `0x` (nothing stored under this data key, equivalent to empty array).

#### Parameters

| Name | Type | Description |
| -------------------- | :-------: | ------------------------------------------------------------------------------------------------------------ |
| `invalidValueStored` | `bytes` | The invalid value stored under the `LSP10ReceivedVaults[]` Array data key. |
| `invalidValueLength` | `uint256` | The invalid number of bytes stored under the `LSP10ReceivedVaults[]` Array data key (MUST be 16 bytes long). |

<br/>

### InvalidLSP5ReceivedAssetsArrayLength

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#invalidlsp5receivedassetsarraylength)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Error signature: `InvalidLSP5ReceivedAssetsArrayLength(bytes,uint256)`
- Error hash: `0xecba7af8`

:::

```solidity
error InvalidLSP5ReceivedAssetsArrayLength(
bytes invalidValueStored,
uint256 invalidValueLength
);
```

Reverts when the value stored under the 'LSP5ReceivedAssets[]' Array 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 _e.g: `0x00000000000000000000000000000000` (zero), empty array, no assets received._ _e.g. `0x00000000000000000000000000000005` (non-zero), 5 array elements, 5 assets received._

- `0x` (nothing stored under this data key, equivalent to empty array)

#### Parameters

| Name | Type | Description |
| -------------------- | :-------: | ------------------------------------------------------------------------------------------------------------- |
| `invalidValueStored` | `bytes` | The invalid value stored under the `LSP5ReceivedAssets[]` Array data key. |
| `invalidValueLength` | `uint256` | The invalid number of bytes stored under the `LSP5ReceivedAssets[]` data key (MUST be exactly 16 bytes long). |

<br/>

### MaxLSP10VaultsCountReached

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#maxlsp10vaultscountreached)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Error signature: `MaxLSP10VaultsCountReached(address)`
- Error hash: `0x11610270`

:::

```solidity
error MaxLSP10VaultsCountReached(address notRegisteredVault);
```

Reverts when the `LSP10Vaults[]` Array reaches its maximum limit (`max(uint128)`).

#### Parameters

| Name | Type | Description |
| -------------------- | :-------: | ---------------------------------------------------------- |
| `notRegisteredVault` | `address` | The address of the LSP9Vault that could not be registered. |

<br/>

### MaxLSP5ReceivedAssetsCountReached

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#maxlsp5receivedassetscountreached)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Error signature: `MaxLSP5ReceivedAssetsCountReached(address)`
- Error hash: `0x0b51a2d0`

:::

```solidity
error MaxLSP5ReceivedAssetsCountReached(address 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. |

<br/>

### NativeTokensNotAccepted

:::note References
Expand All @@ -352,53 +216,3 @@ _Cannot send native tokens to [`universalReceiver(...)`](#universalreceiver) fun
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`)

<br/>

### ReceivedAssetsIndexSuperiorToUint128

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#receivedassetsindexsuperiortouint128)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Error signature: `ReceivedAssetsIndexSuperiorToUint128(uint256)`
- Error hash: `0xe8a4fba0`

:::

```solidity
error ReceivedAssetsIndexSuperiorToUint128(uint256 index);
```

Reverts when the received assets index is superior to `max(uint128)`.

#### Parameters

| Name | Type | Description |
| ------- | :-------: | -------------------------- |
| `index` | `uint256` | The received assets index. |

<br/>

### VaultIndexSuperiorToUint128

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#vaultindexsuperiortouint128)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Error signature: `VaultIndexSuperiorToUint128(uint256)`
- Error hash: `0x76f9db1b`

:::

```solidity
error VaultIndexSuperiorToUint128(uint256 index);
```

Reverts when the vault index is superior to `max(uint128)`.

#### Parameters

| Name | Type | Description |
| ------- | :-------: | ---------------- |
| `index` | `uint256` | The vault index. |

<br/>
Loading

0 comments on commit 44b4ae9

Please sign in to comment.