Skip to content

Commit a1db817

Browse files
AC0DEM0NK3YMadeofTin
authored andcommitted
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
1 parent 99b3ad5 commit a1db817

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

EIPS/eip-1155.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ New functionality is possible with this design, such as transferring multiple to
3232
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.
3333

3434
**Smart contracts implementing the ERC-1155 standard MUST implement all of the functions in the `ERC1155` interface.**
35+
3536
**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.**
3637

3738
```solidity
@@ -150,6 +151,7 @@ interface ERC1155 /* is ERC165 */ {
150151
### ERC-1155 Token Receiver
151152

152153
**Smart contracts MUST implement all of the functions in the `ERC1155TokenReceiver` interface to accept transfers. See "Safe Transfer Rules" for further detail.**
154+
153155
**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.**
154156

155157
```solidity
@@ -332,12 +334,12 @@ To be more explicit about how the standard `safeTransferFrom` and `safeBatchTran
332334

333335
**_ERC1155TokenReceiver ERC-165 rules:_**
334336
* The implementation of the ERC-165 `supportsInterface` function SHOULD be as follows:
335-
```
337+
```solidity
336338
function supportsInterface(bytes4 interfaceID) external view returns (bool) {
337339
return interfaceID == 0x01ffc9a7 || // ERC-165 support (i.e. `bytes4(keccak256('supportsInterface(bytes4)'))`).
338340
interfaceID == 0x4e2312e0; // ERC-1155 `ERC1155TokenReceiver` support (i.e. `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) ^ bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`).
339341
}
340-
```
342+
```
341343
* The implementation MAY differ from the above but:
342344
- It MUST return the constant value `true` if `0x01ffc9a7` is passed through the `interfaceID` argument. This signifies ERC-165 support.
343345
- 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
380382
381383
##### A solidity example of the keccak256 generated constants for the various magic values (these MAY be used by implementation):
382384
383-
```
385+
```solidity
384386
bytes4 constant public ERC1155_ERC165 = 0xd9b67a26; // ERC-165 identifier for the main token standard.
385387
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)"))`).
386388
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

Comments
 (0)