|
@@ -3,15 +3,23 @@
|
|
|
|
|
|
pragma solidity ^0.8.19;
|
|
|
|
|
|
-import {ERC1155Receiver} from "./ERC1155Receiver.sol";
|
|
|
+import {IERC165, ERC165} from "../../../utils/introspection/ERC165.sol";
|
|
|
+import {IERC1155Receiver} from "../IERC1155Receiver.sol";
|
|
|
|
|
|
/**
|
|
|
- * @dev Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
|
|
|
+ * @dev Simple implementation of `IERC1155Receiver` 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 {
|
|
|
+abstract contract ERC1155Holder is ERC165, IERC1155Receiver {
|
|
|
+ /**
|
|
|
+ * @dev See {IERC165-supportsInterface}.
|
|
|
+ */
|
|
|
+ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
|
|
|
+ return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
|
|
|
+ }
|
|
|
+
|
|
|
function onERC1155Received(
|
|
|
address,
|
|
|
address,
|