12345678910111213141516171819202122232425262728293031323334 |
- // SPDX-License-Identifier: MIT
- // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)
- pragma solidity ^0.8.19;
- import {ERC1155Receiver} from "./ERC1155Receiver.sol";
- /**
- * @dev Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
- *
- * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
- * stuck.
- */
- abstract contract ERC1155Holder is ERC1155Receiver {
- function onERC1155Received(
- address,
- address,
- uint256,
- uint256,
- bytes memory
- ) public virtual override returns (bytes4) {
- return this.onERC1155Received.selector;
- }
- function onERC1155BatchReceived(
- address,
- address,
- uint256[] memory,
- uint256[] memory,
- bytes memory
- ) public virtual override returns (bytes4) {
- return this.onERC1155BatchReceived.selector;
- }
- }
|