Skip to content

Commit

Permalink
Document ERC1155 event differences (#4666)
Browse files Browse the repository at this point in the history
(cherry picked from commit 793d92a)
  • Loading branch information
frangio committed Oct 6, 2023
1 parent 932fddf commit 5161a4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ In this logic of removing hidden SLOADs, the `_isApprovedOrOwner` function was r

The `_exists` function was removed. Calls to this function can be replaced by `_ownerOf(tokenId) != address(0)`.

#### More about ERC1155

Batch transfers will now emit `TransferSingle` if the batch consists of a single token, while in previous versions the `TransferBatch` event would be used for all transfers initiated through `safeBatchTransferFrom`. Both behaviors are compliant with the ERC-1155 specification.

#### ERC165Storage

Users that were registering EIP-165 interfaces with `_registerInterface` from `ERC165Storage` should instead do so so by overriding the `supportsInterface` function as seen below:
Expand Down
3 changes: 1 addition & 2 deletions contracts/token/ERC1155/IERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,12 @@ interface IERC1155 is IERC165 {
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits a {TransferBatch} event.
* Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
*
* Requirements:
*
Expand Down

0 comments on commit 5161a4d

Please sign in to comment.