ERC1155Holder.sol 974 B

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)
  3. pragma solidity ^0.8.0;
  4. import "./ERC1155Receiver.sol";
  5. /**
  6. * 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. * @dev _Available since v3.1._
  12. */
  13. contract ERC1155Holder is ERC1155Receiver {
  14. function onERC1155Received(
  15. address,
  16. address,
  17. uint256,
  18. uint256,
  19. bytes memory
  20. ) public virtual override returns (bytes4) {
  21. return this.onERC1155Received.selector;
  22. }
  23. function onERC1155BatchReceived(
  24. address,
  25. address,
  26. uint256[] memory,
  27. uint256[] memory,
  28. bytes memory
  29. ) public virtual override returns (bytes4) {
  30. return this.onERC1155BatchReceived.selector;
  31. }
  32. }