You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automatically merged updates to draft EIP(s) 1155 (ethereum#2110)
Hi, I'm a bot! This change was automatically merged because:
- It only modifies existing Draft or Last Call EIP(s)
- The PR was approved or written by at least one author of each modified EIP
- The build is passing
Copy file name to clipboardExpand all lines: EIPS/eip-1155.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ New functionality is possible with this design, such as transferring multiple to
32
32
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
33
33
34
34
**Smart contracts implementing the ERC-1155 standard MUST implement all of the functions in the `ERC1155` interface.**
35
+
35
36
**Smart contracts implementing the ERC-1155 standard MUST implement the ERC-165 `supportsInterface` function and MUST return the constant value `true` if `0xd9b67a26` is passed through the `interfaceID` argument.**
**Smart contracts MUST implement all of the functions in the `ERC1155TokenReceiver` interface to accept transfers. See "Safe Transfer Rules" for further detail.**
154
+
153
155
**Smart contracts MUST implement the ERC-165 `supportsInterface` function and signify support for the `ERC1155TokenReceiver` interface to accept transfers. See "ERC1155TokenReceiver ERC-165 rules" for further detail.**
154
156
155
157
```solidity
@@ -332,12 +334,12 @@ To be more explicit about how the standard `safeTransferFrom` and `safeBatchTran
332
334
333
335
**_ERC1155TokenReceiver ERC-165 rules:_**
334
336
* The implementation of the ERC-165 `supportsInterface` function SHOULD be as follows:
335
-
```
337
+
```solidity
336
338
function supportsInterface(bytes4 interfaceID) external view returns (bool) {
337
339
return interfaceID == 0x01ffc9a7 || // ERC-165 support (i.e. `bytes4(keccak256('supportsInterface(bytes4)'))`).
* The implementation MAY differ from the above but:
342
344
- It MUST return the constant value `true` if `0x01ffc9a7` is passed through the `interfaceID` argument. This signifies ERC-165 support.
343
345
- It MUST return the constant value `true` if `0x4e2312e0` is passed through the `interfaceID` argument. This signifies ERC-1155 `ERC1155TokenReceiver` support.
@@ -380,7 +382,7 @@ To be more explicit about how the standard `safeTransferFrom` and `safeBatchTran
380
382
381
383
##### A solidity example of the keccak256 generated constants for the various magic values (these MAY be used by implementation):
382
384
383
-
```
385
+
```solidity
384
386
bytes4 constant public ERC1155_ERC165 = 0xd9b67a26; // ERC-165 identifier for the main token standard.
385
387
bytes4 constant public ERC1155_ERC165_TOKENRECEIVER = 0x4e2312e0; // ERC-165 identifier for the `ERC1155TokenReceiver` support (i.e. `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) ^ bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`).
386
388
bytes4 constant public ERC1155_ACCEPTED = 0xf23a6e61; // Return value from `onERC1155Received` call if a contract accepts receipt (i.e `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`).
0 commit comments