From 0b0071dc779b3e66996ec4722c7f5d3d3caf8a42 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 20:07:17 +0000 Subject: [PATCH] Update docs --- CHANGELOG.md | 4 ++++ contracts/token/ERC1155/IERC1155.sol | 3 +-- docs/modules/api/pages/token/ERC1155.adoc | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9575afbb5..1616a5379 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: diff --git a/contracts/token/ERC1155/IERC1155.sol b/contracts/token/ERC1155/IERC1155.sol index a014946b0..461e48b98 100644 --- a/contracts/token/ERC1155/IERC1155.sol +++ b/contracts/token/ERC1155/IERC1155.sol @@ -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: * diff --git a/docs/modules/api/pages/token/ERC1155.adoc b/docs/modules/api/pages/token/ERC1155.adoc index 17f576b3f..de25deaa4 100644 --- a/docs/modules/api/pages/token/ERC1155.adoc +++ b/docs/modules/api/pages/token/ERC1155.adoc @@ -370,7 +370,7 @@ 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: