ERC1155Holder.sol 977 B

12345678910111213141516171819202122232425262728293031323334
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)
  3. pragma solidity ^0.8.19;
  4. import {ERC1155Receiver} from "./ERC1155Receiver.sol";
  5. /**
  6. * @dev Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
  7. *
  8. * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
  9. * stuck.
  10. */
  11. abstract contract ERC1155Holder is ERC1155Receiver {
  12. function onERC1155Received(
  13. address,
  14. address,
  15. uint256,
  16. uint256,
  17. bytes memory
  18. ) public virtual override returns (bytes4) {
  19. return this.onERC1155Received.selector;
  20. }
  21. function onERC1155BatchReceived(
  22. address,
  23. address,
  24. uint256[] memory,
  25. uint256[] memory,
  26. bytes memory
  27. ) public virtual override returns (bytes4) {
  28. return this.onERC1155BatchReceived.selector;
  29. }
  30. }