Skip to content

Token Receiver Documentation#

Informational

The documentation for onERC1155BatchReceived and ERC1155Received are swapped

/// @notice Receive ERC1155
function onERC1155BatchReceived(
    address,
    address,
    uint256[] calldata,
    uint256[] calldata,
    bytes calldata
) external pure virtual returns (bytes4) {
    return IERC1155Receiver.onERC1155BatchReceived.selector;
}

/// @notice Receive ERC1155 batch
function onERC1155Received(
    address,
    address,
    uint256,
    uint256,
    bytes calldata
) external pure virtual returns (bytes4) {
    return IERC1155Receiver.onERC1155Received.selector;
}

Recommendation#

Appropriately modify the documentation:

/// @notice Receive ERC1155 batch
function onERC1155BatchReceived(
    address,
    address,
    uint256[] calldata,
    uint256[] calldata,
    bytes calldata
) external pure virtual returns (bytes4) {
    return IERC1155Receiver.onERC1155BatchReceived.selector;
}

/// @notice Receive ERC1155
function onERC1155Received(
    address,
    address,
    uint256,
    uint256,
    bytes calldata
) external pure virtual returns (bytes4) {
    return IERC1155Receiver.onERC1155Received.selector;
}