@lukso/lsp8-contracts 0.15.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/artifacts/LSP8CappedSupply.json +959 -0
- package/artifacts/LSP8CappedSupplyInitAbstract.json +972 -0
- package/artifacts/LSP8IdentifiableDigitalAsset.json +936 -0
- package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +949 -0
- package/artifacts/LSP8Mintable.json +1006 -0
- package/artifacts/LSP8MintableInit.json +1026 -0
- package/contracts/ILSP8IdentifiableDigitalAsset.sol +328 -0
- package/contracts/LSP8Constants.sol +41 -0
- package/contracts/LSP8Errors.sol +118 -0
- package/contracts/LSP8IdentifiableDigitalAsset.sol +241 -0
- package/contracts/LSP8IdentifiableDigitalAssetCore.sol +806 -0
- package/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol +248 -0
- package/contracts/extensions/LSP8Burnable.sol +30 -0
- package/contracts/extensions/LSP8BurnableInitAbstract.sol +24 -0
- package/contracts/extensions/LSP8CappedSupply.sol +85 -0
- package/contracts/extensions/LSP8CappedSupplyInitAbstract.sol +88 -0
- package/contracts/extensions/LSP8Enumerable.sol +69 -0
- package/contracts/extensions/LSP8EnumerableInitAbstract.sol +64 -0
- package/contracts/presets/ILSP8Mintable.sol +33 -0
- package/contracts/presets/LSP8Mintable.sol +60 -0
- package/contracts/presets/LSP8MintableInit.sol +43 -0
- package/contracts/presets/LSP8MintableInitAbstract.sol +62 -0
- package/dist/index.cjs +33 -0
- package/dist/index.d.cts +29 -0
- package/dist/index.d.mts +29 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.mjs +28 -0
- package/package.json +56 -0
- package/types/LSP8CappedSupply.ts +792 -0
- package/types/LSP8CappedSupplyInitAbstract.ts +824 -0
- package/types/LSP8IdentifiableDigitalAsset.ts +778 -0
- package/types/LSP8IdentifiableDigitalAssetInitAbstract.ts +813 -0
- package/types/LSP8Mintable.ts +797 -0
- package/types/LSP8MintableInit.ts +860 -0
- package/types/common.ts +131 -0
- package/types/contracts/LSP8IdentifiableDigitalAsset.ts +778 -0
- package/types/contracts/LSP8IdentifiableDigitalAssetInitAbstract.ts +813 -0
- package/types/contracts/extensions/LSP8CappedSupply.ts +792 -0
- package/types/contracts/extensions/LSP8CappedSupplyInitAbstract.ts +824 -0
- package/types/contracts/presets/LSP8Mintable.ts +797 -0
- package/types/contracts/presets/LSP8MintableInit.ts +860 -0
- package/types/index.ts +16 -0
@@ -0,0 +1,328 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.4;
|
3
|
+
|
4
|
+
// interfaces
|
5
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
6
|
+
import {
|
7
|
+
IERC725Y
|
8
|
+
} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
|
9
|
+
|
10
|
+
/**
|
11
|
+
* @title Interface of the LSP8 - Identifiable Digital Asset standard, a non-fungible digital asset.
|
12
|
+
*/
|
13
|
+
interface ILSP8IdentifiableDigitalAsset is IERC165, IERC725Y {
|
14
|
+
// --- Events
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @dev Emitted when `tokenId` token is transferred from the `from` to the `to` address.
|
18
|
+
* @param operator The address of operator that sent the `tokenId`
|
19
|
+
* @param from The previous owner of the `tokenId`
|
20
|
+
* @param to The new owner of `tokenId`
|
21
|
+
* @param tokenId The tokenId that was transferred
|
22
|
+
* @param force If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not.
|
23
|
+
* @param data Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses.
|
24
|
+
*/
|
25
|
+
event Transfer(
|
26
|
+
address operator,
|
27
|
+
address indexed from,
|
28
|
+
address indexed to,
|
29
|
+
bytes32 indexed tokenId,
|
30
|
+
bool force,
|
31
|
+
bytes data
|
32
|
+
);
|
33
|
+
|
34
|
+
/**
|
35
|
+
* @dev Emitted when `tokenOwner` enables `operator` to transfer or burn the `tokenId`.
|
36
|
+
* @param operator The address authorized as an operator.
|
37
|
+
* @param tokenOwner The owner of the `tokenId`.
|
38
|
+
* @param tokenId The tokenId `operator` address has access on behalf of `tokenOwner`.
|
39
|
+
* @param operatorNotificationData The data to notify the operator about via LSP1.
|
40
|
+
*/
|
41
|
+
event OperatorAuthorizationChanged(
|
42
|
+
address indexed operator,
|
43
|
+
address indexed tokenOwner,
|
44
|
+
bytes32 indexed tokenId,
|
45
|
+
bytes operatorNotificationData
|
46
|
+
);
|
47
|
+
|
48
|
+
/**
|
49
|
+
* @dev Emitted when `tokenOwner` disables `operator` to transfer or burn `tokenId` on its behalf.
|
50
|
+
* @param operator The address revoked from the operator array ({getOperatorsOf}).
|
51
|
+
* @param tokenOwner The owner of the `tokenId`.
|
52
|
+
* @param tokenId The tokenId `operator` is revoked from operating on.
|
53
|
+
* @param notified Bool indicating whether the operator has been notified or not
|
54
|
+
* @param operatorNotificationData The data to notify the operator about via LSP1.
|
55
|
+
*/
|
56
|
+
event OperatorRevoked(
|
57
|
+
address indexed operator,
|
58
|
+
address indexed tokenOwner,
|
59
|
+
bytes32 indexed tokenId,
|
60
|
+
bool notified,
|
61
|
+
bytes operatorNotificationData
|
62
|
+
);
|
63
|
+
|
64
|
+
/**
|
65
|
+
* @dev Emitted when setting data for `tokenId`.
|
66
|
+
* @param tokenId The tokenId which data is set for.
|
67
|
+
* @param dataKey The data key for which a bytes value is set.
|
68
|
+
* @param dataValue The value to set for the given data key.
|
69
|
+
*/
|
70
|
+
event TokenIdDataChanged(
|
71
|
+
bytes32 indexed tokenId,
|
72
|
+
bytes32 indexed dataKey,
|
73
|
+
bytes dataValue
|
74
|
+
);
|
75
|
+
|
76
|
+
// --- Token queries
|
77
|
+
|
78
|
+
/**
|
79
|
+
* @dev Returns the number of existing tokens that have been minted in this contract.
|
80
|
+
* @return The number of existing tokens.
|
81
|
+
*/
|
82
|
+
function totalSupply() external view returns (uint256);
|
83
|
+
|
84
|
+
// --- Token owner queries
|
85
|
+
|
86
|
+
/**
|
87
|
+
* @dev Get the number of token IDs owned by `tokenOwner`.
|
88
|
+
|
89
|
+
* @param tokenOwner The address to query *
|
90
|
+
* @return The total number of token IDs that `tokenOwner` owns.
|
91
|
+
*/
|
92
|
+
function balanceOf(address tokenOwner) external view returns (uint256);
|
93
|
+
|
94
|
+
/**
|
95
|
+
* @dev Returns the list of `tokenIds` for the `tokenOwner` address.
|
96
|
+
*
|
97
|
+
* @param tokenId tokenOwner The address to query owned tokens
|
98
|
+
* @return The owner address of the given `tokenId`.
|
99
|
+
*
|
100
|
+
* @custom:requirements `tokenId` must exist.
|
101
|
+
* @custom:info if the `tokenId` is not owned by any address, the returned address will be `address(0)`
|
102
|
+
*/
|
103
|
+
function tokenOwnerOf(bytes32 tokenId) external view returns (address);
|
104
|
+
|
105
|
+
/**
|
106
|
+
* @dev Returns the list of token IDs that the `tokenOwner` address owns.
|
107
|
+
* @param tokenOwner The address that we want to get the list of token IDs for.
|
108
|
+
* @return An array of `bytes32[] tokenIds` owned by `tokenOwner`.
|
109
|
+
*/
|
110
|
+
function tokenIdsOf(
|
111
|
+
address tokenOwner
|
112
|
+
) external view returns (bytes32[] memory);
|
113
|
+
|
114
|
+
// --- TokenId Metadata functionality
|
115
|
+
|
116
|
+
/**
|
117
|
+
* @notice Retrieves data for a specific `tokenId` and `dataKey`.
|
118
|
+
* @param tokenId The unique identifier for a token.
|
119
|
+
* @param dataKey The key for the data to retrieve.
|
120
|
+
* @return dataValues The data value associated with the given `tokenId` and `dataKey`.
|
121
|
+
*/
|
122
|
+
function getDataForTokenId(
|
123
|
+
bytes32 tokenId,
|
124
|
+
bytes32 dataKey
|
125
|
+
) external returns (bytes memory dataValues);
|
126
|
+
|
127
|
+
/**
|
128
|
+
* @notice Retrieves data in batch for multiple `tokenId` and `dataKey` pairs.
|
129
|
+
* @param tokenIds An array of token IDs.
|
130
|
+
* @param dataKeys An array of data keys corresponding to the token IDs.
|
131
|
+
* @return dataValues An array of data values for each pair of `tokenId` and `dataKey`.
|
132
|
+
*/
|
133
|
+
function getDataBatchForTokenIds(
|
134
|
+
bytes32[] memory tokenIds,
|
135
|
+
bytes32[] memory dataKeys
|
136
|
+
) external returns (bytes[] memory dataValues);
|
137
|
+
|
138
|
+
/**
|
139
|
+
* @notice Sets data for a specific `tokenId` and `dataKey`.
|
140
|
+
* @param tokenId The unique identifier for a token.
|
141
|
+
* @param dataKey The key for the data to set.
|
142
|
+
* @param dataValue The value to set for the given data key.
|
143
|
+
* @custom:events {TokenIdDataChanged} event.
|
144
|
+
*/
|
145
|
+
function setDataForTokenId(
|
146
|
+
bytes32 tokenId,
|
147
|
+
bytes32 dataKey,
|
148
|
+
bytes memory dataValue
|
149
|
+
) external;
|
150
|
+
|
151
|
+
/**
|
152
|
+
* @notice Sets data in batch for multiple `tokenId` and `dataKey` pairs.
|
153
|
+
* @param tokenIds An array of token IDs.
|
154
|
+
* @param dataKeys An array of data keys corresponding to the token IDs.
|
155
|
+
* @param dataValues An array of values to set for the given data keys.
|
156
|
+
* @custom:events {TokenIdDataChanged} event for each pair.
|
157
|
+
*/
|
158
|
+
function setDataBatchForTokenIds(
|
159
|
+
bytes32[] memory tokenIds,
|
160
|
+
bytes32[] memory dataKeys,
|
161
|
+
bytes[] memory dataValues
|
162
|
+
) external;
|
163
|
+
|
164
|
+
// --- Operator functionality
|
165
|
+
|
166
|
+
/**
|
167
|
+
* @dev Allow an `operator` address to transfer or burn a specific `tokenId` on behalf of its token owner. See {isOperatorFor}.
|
168
|
+
* Notify the operator based on the LSP1-UniversalReceiver standard
|
169
|
+
*
|
170
|
+
* @param operator The address to authorize as an operator.
|
171
|
+
* @param tokenId The token ID operator has access to.
|
172
|
+
* @param operatorNotificationData The data to notify the operator about via LSP1.
|
173
|
+
*
|
174
|
+
* @custom:requirements
|
175
|
+
* - `tokenId` must exist.
|
176
|
+
* - caller MUST be the {tokenOwnerOf} `tokenId`.
|
177
|
+
* - the owner of a `tokenId` cannot grant itself as an `operator` (`operator` cannot be the calling address).
|
178
|
+
* - `operator` cannot be the zero address.
|
179
|
+
*
|
180
|
+
* @custom:events {OperatorAuthorizationChanged} event.
|
181
|
+
*/
|
182
|
+
function authorizeOperator(
|
183
|
+
address operator,
|
184
|
+
bytes32 tokenId,
|
185
|
+
bytes memory operatorNotificationData
|
186
|
+
) external;
|
187
|
+
|
188
|
+
/**
|
189
|
+
* @dev Remove access of `operator` for a given `tokenId`, disallowing it to transfer `tokenId` on behalf of its owner.
|
190
|
+
* See also {isOperatorFor}.
|
191
|
+
*
|
192
|
+
* @param operator The address to revoke as an operator.
|
193
|
+
* @param tokenId The tokenId `operator` is revoked from operating on.
|
194
|
+
* @param notify Boolean indicating whether to notify the operator or not
|
195
|
+
* @param operatorNotificationData The data to notify the operator about via LSP1.
|
196
|
+
*
|
197
|
+
* @custom:requirements
|
198
|
+
* - `tokenId` must exist.
|
199
|
+
* - caller must be the {tokenOwnerOf} `tokenId`.
|
200
|
+
* - the owner of a `tokenId` cannot grant revoke itself as an `operator` (`operator` cannot be the calling address).
|
201
|
+
* - `operator` cannot be the zero address.
|
202
|
+
*
|
203
|
+
* @custom:events {OperatorRevoked} event with address of the operator being revoked for the caller (token owner)..
|
204
|
+
*/
|
205
|
+
function revokeOperator(
|
206
|
+
address operator,
|
207
|
+
bytes32 tokenId,
|
208
|
+
bool notify,
|
209
|
+
bytes memory operatorNotificationData
|
210
|
+
) external;
|
211
|
+
|
212
|
+
/**
|
213
|
+
* @dev Returns whether `operator` address is an operator for a given `tokenId`.
|
214
|
+
*
|
215
|
+
* @param operator The address to query operator status for.
|
216
|
+
* @param tokenId The token ID to check if `operator` is allowed to operate on.
|
217
|
+
*
|
218
|
+
* @return `true` if `operator` is an operator for `tokenId`, `false` otherwise.
|
219
|
+
*
|
220
|
+
* @custom:requirements
|
221
|
+
* - `tokenId` must exist.
|
222
|
+
* - caller must be the current {tokenOwnerOf} `tokenId`.
|
223
|
+
*
|
224
|
+
* @custom:info The tokenOwner is its own operator.
|
225
|
+
*/
|
226
|
+
function isOperatorFor(
|
227
|
+
address operator,
|
228
|
+
bytes32 tokenId
|
229
|
+
) external view returns (bool);
|
230
|
+
|
231
|
+
/**
|
232
|
+
* @dev Returns all `operator` addresses that are allowed to transfer or burn a specific `tokenId` on behalf of its owner.
|
233
|
+
*
|
234
|
+
* @param tokenId The token ID to get the operators for.
|
235
|
+
* @return An array of operators allowed to transfer or burn a specific `tokenId`.
|
236
|
+
*
|
237
|
+
* Requirements
|
238
|
+
* - `tokenId` must exist.
|
239
|
+
*/
|
240
|
+
function getOperatorsOf(
|
241
|
+
bytes32 tokenId
|
242
|
+
) external view returns (address[] memory);
|
243
|
+
|
244
|
+
// --- Transfer functionality
|
245
|
+
|
246
|
+
/**
|
247
|
+
* @dev Transfer a given `tokenId` token from the `from` address to the `to` address.
|
248
|
+
*
|
249
|
+
* If operators are set for a specific `tokenId`, all the operators are revoked after the tokenId have been transferred.
|
250
|
+
*
|
251
|
+
* The `force` parameter MUST be set to `true` when transferring tokens to Externally Owned Accounts (EOAs)
|
252
|
+
* or contracts that do not implement the LSP1 standard.
|
253
|
+
*
|
254
|
+
* @param from The address that owns the given `tokenId`.
|
255
|
+
* @param to The address that will receive the `tokenId`.
|
256
|
+
* @param tokenId The token ID to transfer.
|
257
|
+
* @param force When set to `true`, the `to` address CAN be any addres.
|
258
|
+
* When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard.
|
259
|
+
* @param data Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses.
|
260
|
+
*
|
261
|
+
* @custom:requirements
|
262
|
+
* - `from` cannot be the zero address.
|
263
|
+
* - `to` cannot be the zero address.
|
264
|
+
* - `from` and `to` cannot be the same address (`from` cannot send the `tokenId` to itself).
|
265
|
+
* - `from` must own the given `tokenId`.
|
266
|
+
* - If the caller is not `from`, it must be an operator for the `tokenId`.
|
267
|
+
*
|
268
|
+
* @custom:events
|
269
|
+
* - {Transfer} event when the `tokenId` is successfully transferred.
|
270
|
+
*
|
271
|
+
* @custom:hint The `force` parameter **MUST be set to `true`** to transfer tokens to Externally Owned Accounts (EOAs)
|
272
|
+
* or contracts that do not implement the LSP1 Universal Receiver Standard. Otherwise the function will revert making the transfer fail.
|
273
|
+
*
|
274
|
+
* @custom:info if the `to` address is a contract that implements LSP1, it will always be notified via its `universalReceiver(...)` function, regardless if `force` is set to `true` or `false`.
|
275
|
+
*
|
276
|
+
* @custom:warning Be aware that when either the sender or the recipient can have logic that revert in their `universalReceiver(...)` function when being notified.
|
277
|
+
* This even if the `force` was set to `true`.
|
278
|
+
*/
|
279
|
+
function transfer(
|
280
|
+
address from,
|
281
|
+
address to,
|
282
|
+
bytes32 tokenId,
|
283
|
+
bool force,
|
284
|
+
bytes memory data
|
285
|
+
) external;
|
286
|
+
|
287
|
+
/**
|
288
|
+
* @dev Transfers multiple tokens at once based on the arrays of `from`, `to` and `tokenId`.
|
289
|
+
* If any transfer fails, the whole call will revert.
|
290
|
+
*
|
291
|
+
* @param from An array of sending addresses.
|
292
|
+
* @param to An array of recipient addresses.
|
293
|
+
* @param tokenId An array of token IDs to transfer.
|
294
|
+
* @param force When set to `true`, `to` may be any address.
|
295
|
+
* When set to `false`, `to` must be a contract that supports the LSP1 standard and not revert.
|
296
|
+
* @param data Any additional data the caller wants included in the emitted event, and sent in the hooks to the `from` and `to` addresses.
|
297
|
+
*
|
298
|
+
*
|
299
|
+
* @custom:requirements
|
300
|
+
* - The arrays of `from`, `to` and `tokenId` must have the same length.
|
301
|
+
* - no values in the `from` array can be the zero address.
|
302
|
+
* - no values in the `to` array can be the zero address.
|
303
|
+
* - `from` and `to` cannot be the same address at the same index on each arrays.
|
304
|
+
* - each `tokenId` must be owned by `from`.
|
305
|
+
* - If the caller is not `from`, it must be an operator of each `tokenId`.
|
306
|
+
*
|
307
|
+
* @custom:events
|
308
|
+
* - {Transfer} events on each successful token transfer.
|
309
|
+
*/
|
310
|
+
function transferBatch(
|
311
|
+
address[] memory from,
|
312
|
+
address[] memory to,
|
313
|
+
bytes32[] memory tokenId,
|
314
|
+
bool[] memory force,
|
315
|
+
bytes[] memory data
|
316
|
+
) external;
|
317
|
+
|
318
|
+
/**
|
319
|
+
* @notice Executing the following batch of abi-encoded function calls on the contract: `data`.
|
320
|
+
*
|
321
|
+
* @dev Allows a caller to batch different function calls in one call. Perform a `delegatecall` on self, to call different functions with preserving the context.
|
322
|
+
* @param data An array of ABI encoded function calls to be called on the contract.
|
323
|
+
* @return results An array of abi-encoded data returned by the functions executed.
|
324
|
+
*/
|
325
|
+
function batchCalls(
|
326
|
+
bytes[] calldata data
|
327
|
+
) external returns (bytes[] memory results);
|
328
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.4;
|
3
|
+
|
4
|
+
// --- ERC165 interface ids
|
5
|
+
bytes4 constant _INTERFACEID_LSP8 = 0x3a271706;
|
6
|
+
|
7
|
+
// --- ERC725Y Data Keys
|
8
|
+
|
9
|
+
// keccak256('LSP8TokenIdFormat')
|
10
|
+
bytes32 constant _LSP8_TOKENID_FORMAT_KEY = 0xf675e9361af1c1664c1868cfa3eb97672d6b1a513aa5b81dec34c9ee330e818d;
|
11
|
+
|
12
|
+
// keccak256('LSP8TokenMetadataBaseURI')
|
13
|
+
bytes32 constant _LSP8_TOKEN_METADATA_BASE_URI = 0x1a7628600c3bac7101f53697f48df381ddc36b9015e7d7c9c5633d1252aa2843;
|
14
|
+
|
15
|
+
// keccak256('LSP8ReferenceContract')
|
16
|
+
bytes32 constant _LSP8_REFERENCE_CONTRACT = 0x708e7b881795f2e6b6c2752108c177ec89248458de3bf69d0d43480b3e5034e6;
|
17
|
+
|
18
|
+
// --- Token Hooks
|
19
|
+
|
20
|
+
// keccak256('LSP8Tokens_SenderNotification')
|
21
|
+
bytes32 constant _TYPEID_LSP8_TOKENSSENDER = 0xb23eae7e6d1564b295b4c3e3be402d9a2f0776c57bdf365903496f6fa481ab00;
|
22
|
+
|
23
|
+
// keccak256('LSP8Tokens_RecipientNotification')
|
24
|
+
bytes32 constant _TYPEID_LSP8_TOKENSRECIPIENT = 0x0b084a55ebf70fd3c06fd755269dac2212c4d3f0f4d09079780bfa50c1b2984d;
|
25
|
+
|
26
|
+
// keccak256('LSP8Tokens_OperatorNotification')
|
27
|
+
bytes32 constant _TYPEID_LSP8_TOKENOPERATOR = 0x8a1c15a8799f71b547e08e2bcb2e85257e81b0a07eee2ce6712549eef1f00970;
|
28
|
+
|
29
|
+
// --- Token IDs Format
|
30
|
+
|
31
|
+
uint256 constant _LSP8_TOKENID_FORMAT_NUMBER = 0;
|
32
|
+
uint256 constant _LSP8_TOKENID_FORMAT_STRING = 1;
|
33
|
+
uint256 constant _LSP8_TOKENID_FORMAT_ADDRESS = 2;
|
34
|
+
uint256 constant _LSP8_TOKENID_FORMAT_UNIQUE_ID = 3;
|
35
|
+
uint256 constant _LSP8_TOKENID_FORMAT_HASH = 4;
|
36
|
+
|
37
|
+
uint256 constant _LSP8_TOKENID_FORMAT_MIXED_DEFAULT_NUMBER = 100;
|
38
|
+
uint256 constant _LSP8_TOKENID_FORMAT_MIXED_DEFAULT_STRING = 101;
|
39
|
+
uint256 constant _LSP8_TOKENID_FORMAT_MIXED_DEFAULT_ADDRESS = 102;
|
40
|
+
uint256 constant _LSP8_TOKENID_FORMAT_MIXED_DEFAULT_UNIQUE_ID = 103;
|
41
|
+
uint256 constant _LSP8_TOKENID_FORMAT_MIXED_DEFAULT_HASH = 104;
|
@@ -0,0 +1,118 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.4;
|
3
|
+
|
4
|
+
// --- Errors
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @dev Reverts when `tokenId` has not been minted.
|
8
|
+
*/
|
9
|
+
error LSP8NonExistentTokenId(bytes32 tokenId);
|
10
|
+
|
11
|
+
/**
|
12
|
+
* @dev Reverts when `caller` is not the `tokenOwner` of the `tokenId`.
|
13
|
+
*/
|
14
|
+
error LSP8NotTokenOwner(address tokenOwner, bytes32 tokenId, address caller);
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @dev Reverts when `caller` is not an allowed operator for `tokenId`.
|
18
|
+
*/
|
19
|
+
error LSP8NotTokenOperator(bytes32 tokenId, address caller);
|
20
|
+
|
21
|
+
/**
|
22
|
+
* @dev Reverts when `operator` is already authorized for the `tokenId`.
|
23
|
+
*/
|
24
|
+
error LSP8OperatorAlreadyAuthorized(address operator, bytes32 tokenId);
|
25
|
+
|
26
|
+
/**
|
27
|
+
* @dev Reverts when trying to set the zero address as an operator.
|
28
|
+
*/
|
29
|
+
error LSP8CannotUseAddressZeroAsOperator();
|
30
|
+
|
31
|
+
/**
|
32
|
+
* @dev Reverts when trying to send token to the zero address.
|
33
|
+
*/
|
34
|
+
error LSP8CannotSendToAddressZero();
|
35
|
+
|
36
|
+
/**
|
37
|
+
* @dev Reverts when `operator` is not an operator for the `tokenId`.
|
38
|
+
*/
|
39
|
+
error LSP8NonExistingOperator(address operator, bytes32 tokenId);
|
40
|
+
|
41
|
+
/**
|
42
|
+
* @dev Reverts when `tokenId` has already been minted.
|
43
|
+
*/
|
44
|
+
error LSP8TokenIdAlreadyMinted(bytes32 tokenId);
|
45
|
+
|
46
|
+
/**
|
47
|
+
* @dev Reverts when the parameters used for `transferBatch` have different lengths.
|
48
|
+
*/
|
49
|
+
error LSP8InvalidTransferBatch();
|
50
|
+
|
51
|
+
/**
|
52
|
+
* @dev Reverts if the `tokenReceiver` does not implement LSP1
|
53
|
+
* when minting or transferring tokens with `bool force` set as `false`.
|
54
|
+
*/
|
55
|
+
error LSP8NotifyTokenReceiverContractMissingLSP1Interface(
|
56
|
+
address tokenReceiver
|
57
|
+
);
|
58
|
+
|
59
|
+
/**
|
60
|
+
* @dev Reverts if the `tokenReceiver` is an EOA
|
61
|
+
* when minting or transferring tokens with `bool force` set as `false`.
|
62
|
+
*/
|
63
|
+
error LSP8NotifyTokenReceiverIsEOA(address tokenReceiver);
|
64
|
+
|
65
|
+
/**
|
66
|
+
* @dev Reverts when trying to authorize or revoke the token's owner as an operator.
|
67
|
+
*/
|
68
|
+
error LSP8TokenOwnerCannotBeOperator();
|
69
|
+
|
70
|
+
/**
|
71
|
+
* @dev Error occurs when sending native tokens to the LSP8 contract without sending any data.
|
72
|
+
*
|
73
|
+
* E.g. Sending value without passing a bytes4 function selector to call a LSP17 Extension.
|
74
|
+
*
|
75
|
+
* @notice LSP8 contract cannot receive native tokens.
|
76
|
+
*/
|
77
|
+
error LSP8TokenContractCannotHoldValue();
|
78
|
+
|
79
|
+
/**
|
80
|
+
* @dev Reverts when trying to edit the data key `LSP8TokenIdFormat` after the identifiable digital asset contract has been deployed.
|
81
|
+
* The `LSP8TokenIdFormat` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract.
|
82
|
+
* It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed.
|
83
|
+
*/
|
84
|
+
error LSP8TokenIdFormatNotEditable();
|
85
|
+
|
86
|
+
/**
|
87
|
+
* @dev Reverts when the length of the token IDs data arrays is not equal
|
88
|
+
*/
|
89
|
+
error LSP8TokenIdsDataLengthMismatch();
|
90
|
+
|
91
|
+
/**
|
92
|
+
* @dev Reverts when empty arrays is passed to the function
|
93
|
+
*/
|
94
|
+
error LSP8TokenIdsDataEmptyArray();
|
95
|
+
|
96
|
+
/**
|
97
|
+
* @dev Reverts when a batch call failed.
|
98
|
+
* @notice Batch call failed.
|
99
|
+
*/
|
100
|
+
error LSP8BatchCallFailed(uint256 callIndex);
|
101
|
+
|
102
|
+
/**
|
103
|
+
* @dev Reverts when the token owner changed inside the {_beforeTokenTransfer} hook.
|
104
|
+
*/
|
105
|
+
error LSP8TokenOwnerChanged(
|
106
|
+
bytes32 tokenId,
|
107
|
+
address oldOwner,
|
108
|
+
address newOwner
|
109
|
+
);
|
110
|
+
|
111
|
+
/**
|
112
|
+
* @dev Reverts when the call to revoke operator is not authorized.
|
113
|
+
*/
|
114
|
+
error LSP8RevokeOperatorNotAuthorized(
|
115
|
+
address caller,
|
116
|
+
address tokenOwner,
|
117
|
+
bytes32 tokenId
|
118
|
+
);
|