From 60da4f4ea3eefcc3473c984fac2f925fa212e5e1 Mon Sep 17 00:00:00 2001 From: James Geary <36774175+jgeary@users.noreply.github.com> Date: Mon, 31 Oct 2022 15:16:17 -0400 Subject: [PATCH] standardize ierc165 usage --- contracts/modules/Asks/Omnibus/AsksOmnibus.sol | 4 ++-- contracts/modules/Offers/Omnibus/OffersOmnibus.sol | 1 - .../modules/ReserveAuction/Omnibus/ReserveAuctionOmnibus.sol | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/contracts/modules/Asks/Omnibus/AsksOmnibus.sol b/contracts/modules/Asks/Omnibus/AsksOmnibus.sol index a824b7ae..44e49c5d 100644 --- a/contracts/modules/Asks/Omnibus/AsksOmnibus.sol +++ b/contracts/modules/Asks/Omnibus/AsksOmnibus.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.10; import {ReentrancyGuard} from "@rari-capital/solmate/src/utils/ReentrancyGuard.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {ERC721TransferHelper} from "../../../transferHelpers/ERC721TransferHelper.sol"; import {IncomingTransferSupportV1} from "../../../common/IncomingTransferSupport/V1/IncomingTransferSupportV1.sol"; @@ -66,11 +67,10 @@ contract AsksOmnibus is IAsksOmnibus, ReentrancyGuard, IncomingTransferSupportV1 } /// @notice Implements EIP-165 for standard interface detection - /// @dev `0x01ffc9a7` is the IERC165 interface id /// @param _interfaceId The identifier of a given interface /// @return If the given interface is supported function supportsInterface(bytes4 _interfaceId) external pure returns (bool) { - return _interfaceId == type(IAsksOmnibus).interfaceId || _interfaceId == 0x01ffc9a7; + return _interfaceId == type(IAsksOmnibus).interfaceId || _interfaceId == type(IERC165).interfaceId; } /// @notice Creates a simple ETH ask for a given NFT diff --git a/contracts/modules/Offers/Omnibus/OffersOmnibus.sol b/contracts/modules/Offers/Omnibus/OffersOmnibus.sol index a75940e3..b2253fd4 100644 --- a/contracts/modules/Offers/Omnibus/OffersOmnibus.sol +++ b/contracts/modules/Offers/Omnibus/OffersOmnibus.sol @@ -74,7 +74,6 @@ contract OffersOmnibus is IOffersOmnibus, ReentrancyGuard, IncomingTransferSuppo } /// @notice Implements EIP-165 for standard interface detection - /// @dev `0x01ffc9a7` is the IERC165 interface id /// @param _interfaceId The identifier of a given interface /// @return If the given interface is supported function supportsInterface(bytes4 _interfaceId) external pure returns (bool) { diff --git a/contracts/modules/ReserveAuction/Omnibus/ReserveAuctionOmnibus.sol b/contracts/modules/ReserveAuction/Omnibus/ReserveAuctionOmnibus.sol index 5557f18c..463ce4eb 100644 --- a/contracts/modules/ReserveAuction/Omnibus/ReserveAuctionOmnibus.sol +++ b/contracts/modules/ReserveAuction/Omnibus/ReserveAuctionOmnibus.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.10; import {ReentrancyGuard} from "@rari-capital/solmate/src/utils/ReentrancyGuard.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {ERC721TransferHelper} from "../../../transferHelpers/ERC721TransferHelper.sol"; import {IncomingTransferSupportV1} from "../../../common/IncomingTransferSupport/V1/IncomingTransferSupportV1.sol"; @@ -88,11 +89,10 @@ contract ReserveAuctionOmnibus is } /// @notice Implements EIP-165 for standard interface detection - /// @dev `0x01ffc9a7` is the IERC165 interface id /// @param _interfaceId The identifier of a given interface /// @return If the given interface is supported function supportsInterface(bytes4 _interfaceId) external pure returns (bool) { - return _interfaceId == type(IReserveAuctionOmnibus).interfaceId || _interfaceId == 0x01ffc9a7; + return _interfaceId == type(IReserveAuctionOmnibus).interfaceId || _interfaceId == type(IERC165).interfaceId; } /// @notice Creates a simple ETH auction for a given NFT