ERC721HolderUpgradeable.sol 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)
  3. pragma solidity ^0.8.0;
  4. import "../IERC721ReceiverUpgradeable.sol";
  5. import "../../../proxy/utils/Initializable.sol";
  6. /**
  7. * @dev Implementation of the {IERC721Receiver} interface.
  8. *
  9. * Accepts all token transfers.
  10. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
  11. */
  12. contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable {
  13. function __ERC721Holder_init() internal onlyInitializing {
  14. }
  15. function __ERC721Holder_init_unchained() internal onlyInitializing {
  16. }
  17. /**
  18. * @dev See {IERC721Receiver-onERC721Received}.
  19. *
  20. * Always returns `IERC721Receiver.onERC721Received.selector`.
  21. */
  22. function onERC721Received(
  23. address,
  24. address,
  25. uint256,
  26. bytes memory
  27. ) public virtual override returns (bytes4) {
  28. return this.onERC721Received.selector;
  29. }
  30. /**
  31. * This empty reserved space is put in place to allow future versions to add new
  32. * variables without shifting down storage in the inheritance chain.
  33. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
  34. */
  35. uint256[50] private __gap;
  36. }