Skip to content

Commit

Permalink
docs: auto-generate new docs for LSP8
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed Sep 18, 2023
1 parent 9026d61 commit 2c0630d
Show file tree
Hide file tree
Showing 8 changed files with 254 additions and 103 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import {
ERC725YDataKeys,
PERMISSIONS,
ALL_PERMISSIONS,
LSP8_TOKENID_TYPES,
LSP25_VERSION,
ErrorSelectors,
EventSigHashes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,8 @@ mapping(bytes32 => bytes) _store
function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable;
```

Save gas by emitting the [`DataChanged`](#datachanged) event with only the first 256 bytes of dataValue
The ERC725Y data key `_LSP8_TOKENID_TYPE_KEY` cannot be changed
once the identifiable digital asset contract has been deployed.

<br/>

Expand Down Expand Up @@ -1319,7 +1320,7 @@ Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital ass
error LSP8CannotSendToAddressZero();
```

reverts when trying to send token to the zero address.
Reverts when trying to send token to the zero address.

<br/>

Expand All @@ -1338,7 +1339,7 @@ reverts when trying to send token to the zero address.
error LSP8CannotSendToSelf();
```

reverts when specifying the same address for `from` and `to` in a token transfer.
Reverts when specifying the same address for `from` and `to` in a token transfer.

<br/>

Expand All @@ -1357,7 +1358,7 @@ reverts when specifying the same address for `from` and `to` in a token transfer
error LSP8CannotUseAddressZeroAsOperator();
```

reverts when trying to set the zero address as an operator.
Reverts when trying to set the zero address as an operator.

<br/>

Expand All @@ -1376,7 +1377,7 @@ reverts when trying to set the zero address as an operator.
error LSP8InvalidTransferBatch();
```

reverts when the parameters used for `transferBatch` have different lengths.
Reverts when the parameters used for `transferBatch` have different lengths.

<br/>

Expand All @@ -1395,7 +1396,7 @@ reverts when the parameters used for `transferBatch` have different lengths.
error LSP8NonExistentTokenId(bytes32 tokenId);
```

reverts when `tokenId` has not been minted.
Reverts when `tokenId` has not been minted.

#### Parameters

Expand All @@ -1420,7 +1421,7 @@ reverts when `tokenId` has not been minted.
error LSP8NonExistingOperator(address operator, bytes32 tokenId);
```

reverts when `operator` is not an operator for the `tokenId`.
Reverts when `operator` is not an operator for the `tokenId`.

#### Parameters

Expand All @@ -1446,7 +1447,7 @@ reverts when `operator` is not an operator for the `tokenId`.
error LSP8NotTokenOperator(bytes32 tokenId, address caller);
```

reverts when `caller` is not an allowed operator for `tokenId`.
Reverts when `caller` is not an allowed operator for `tokenId`.

#### Parameters

Expand All @@ -1472,7 +1473,7 @@ reverts when `caller` is not an allowed operator for `tokenId`.
error LSP8NotTokenOwner(address tokenOwner, bytes32 tokenId, address caller);
```

reverts when `caller` is not the `tokenOwner` of the `tokenId`.
Reverts when `caller` is not the `tokenOwner` of the `tokenId`.

#### Parameters

Expand Down Expand Up @@ -1501,7 +1502,7 @@ error LSP8NotifyTokenReceiverContractMissingLSP1Interface(
);
```

reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool allowNonLSP1Recipient` set as `false`.
Reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool allowNonLSP1Recipient` set as `false`.

#### Parameters

Expand All @@ -1526,7 +1527,7 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr
error LSP8NotifyTokenReceiverIsEOA(address tokenReceiver);
```

reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool allowNonLSP1Recipient` set as `false`.
Reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool allowNonLSP1Recipient` set as `false`.

#### Parameters

Expand All @@ -1551,7 +1552,7 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit
error LSP8OperatorAlreadyAuthorized(address operator, bytes32 tokenId);
```

reverts when `operator` is already authorized for the `tokenId`.
Reverts when `operator` is already authorized for the `tokenId`.

#### Parameters

Expand All @@ -1562,6 +1563,25 @@ reverts when `operator` is already authorized for the `tokenId`.

<br/>

### LSP8TokenIdTypeNotEditable

:::note References

- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidtypenoteditable)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdTypeNotEditable()`
- Error hash: `0x53bc1122`

:::

```solidity
error LSP8TokenIdTypeNotEditable();
```

Reverts when trying to edit the data key `LSP8TokenIdType` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdType` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed.

<br/>

### LSP8TokenOwnerCannotBeOperator

:::note References
Expand All @@ -1577,7 +1597,7 @@ reverts when `operator` is already authorized for the `tokenId`.
error LSP8TokenOwnerCannotBeOperator();
```

reverts when trying to authorize or revoke the token's owner as an operator.
Reverts when trying to authorize or revoke the token's owner as an operator.

<br/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,8 @@ mapping(bytes32 => bytes) _store
function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable;
```

Save gas by emitting the [`DataChanged`](#datachanged) event with only the first 256 bytes of dataValue
The ERC725Y data key `_LSP8_TOKENID_TYPE_KEY` cannot be changed
once the identifiable digital asset contract has been deployed.

<br/>

Expand Down Expand Up @@ -1345,7 +1346,7 @@ Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital ass
error LSP8CannotSendToAddressZero();
```

reverts when trying to send token to the zero address.
Reverts when trying to send token to the zero address.

<br/>

Expand All @@ -1364,7 +1365,7 @@ reverts when trying to send token to the zero address.
error LSP8CannotSendToSelf();
```

reverts when specifying the same address for `from` and `to` in a token transfer.
Reverts when specifying the same address for `from` and `to` in a token transfer.

<br/>

Expand All @@ -1383,7 +1384,7 @@ reverts when specifying the same address for `from` and `to` in a token transfer
error LSP8CannotUseAddressZeroAsOperator();
```

reverts when trying to set the zero address as an operator.
Reverts when trying to set the zero address as an operator.

<br/>

Expand All @@ -1402,7 +1403,7 @@ reverts when trying to set the zero address as an operator.
error LSP8InvalidTransferBatch();
```

reverts when the parameters used for `transferBatch` have different lengths.
Reverts when the parameters used for `transferBatch` have different lengths.

<br/>

Expand All @@ -1421,7 +1422,7 @@ reverts when the parameters used for `transferBatch` have different lengths.
error LSP8NonExistentTokenId(bytes32 tokenId);
```

reverts when `tokenId` has not been minted.
Reverts when `tokenId` has not been minted.

#### Parameters

Expand All @@ -1446,7 +1447,7 @@ reverts when `tokenId` has not been minted.
error LSP8NonExistingOperator(address operator, bytes32 tokenId);
```

reverts when `operator` is not an operator for the `tokenId`.
Reverts when `operator` is not an operator for the `tokenId`.

#### Parameters

Expand All @@ -1472,7 +1473,7 @@ reverts when `operator` is not an operator for the `tokenId`.
error LSP8NotTokenOperator(bytes32 tokenId, address caller);
```

reverts when `caller` is not an allowed operator for `tokenId`.
Reverts when `caller` is not an allowed operator for `tokenId`.

#### Parameters

Expand All @@ -1498,7 +1499,7 @@ reverts when `caller` is not an allowed operator for `tokenId`.
error LSP8NotTokenOwner(address tokenOwner, bytes32 tokenId, address caller);
```

reverts when `caller` is not the `tokenOwner` of the `tokenId`.
Reverts when `caller` is not the `tokenOwner` of the `tokenId`.

#### Parameters

Expand Down Expand Up @@ -1527,7 +1528,7 @@ error LSP8NotifyTokenReceiverContractMissingLSP1Interface(
);
```

reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool allowNonLSP1Recipient` set as `false`.
Reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool allowNonLSP1Recipient` set as `false`.

#### Parameters

Expand All @@ -1552,7 +1553,7 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr
error LSP8NotifyTokenReceiverIsEOA(address tokenReceiver);
```

reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool allowNonLSP1Recipient` set as `false`.
Reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool allowNonLSP1Recipient` set as `false`.

#### Parameters

Expand All @@ -1577,7 +1578,7 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit
error LSP8OperatorAlreadyAuthorized(address operator, bytes32 tokenId);
```

reverts when `operator` is already authorized for the `tokenId`.
Reverts when `operator` is already authorized for the `tokenId`.

#### Parameters

Expand All @@ -1588,6 +1589,25 @@ reverts when `operator` is already authorized for the `tokenId`.

<br/>

### LSP8TokenIdTypeNotEditable

:::note References

- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidtypenoteditable)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol)
- Error signature: `LSP8TokenIdTypeNotEditable()`
- Error hash: `0x53bc1122`

:::

```solidity
error LSP8TokenIdTypeNotEditable();
```

Reverts when trying to edit the data key `LSP8TokenIdType` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdType` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed.

<br/>

### LSP8TokenOwnerCannotBeOperator

:::note References
Expand All @@ -1603,7 +1623,7 @@ reverts when `operator` is already authorized for the `tokenId`.
error LSP8TokenOwnerCannotBeOperator();
```

reverts when trying to authorize or revoke the token's owner as an operator.
Reverts when trying to authorize or revoke the token's owner as an operator.

<br/>

Expand Down
Loading

0 comments on commit 2c0630d

Please sign in to comment.