From 9b610d3db4cf640d82cf185ca4585a9aa19cc08b Mon Sep 17 00:00:00 2001 From: Yamen Merhi Date: Fri, 3 Feb 2023 21:15:41 +0200 Subject: [PATCH] Add warning for `supportsERC165InterfaceUnchecked` edge case (#4017) (cherry picked from commit d13ec90f3719b6a1182b96455aea1ba21699f197) --- contracts/utils/introspection/ERC165Checker.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/utils/introspection/ERC165Checker.sol b/contracts/utils/introspection/ERC165Checker.sol index 4c5fe2092..2b75ba737 100644 --- a/contracts/utils/introspection/ERC165Checker.sol +++ b/contracts/utils/introspection/ERC165Checker.sol @@ -102,6 +102,10 @@ library ERC165Checker { * @dev Assumes that account contains a contract that supports ERC165, otherwise * the behavior of this method is undefined. This precondition can be checked * with {supportsERC165}. + * + * Some precompiled contracts will falsely indicate support for a given interface, so caution + * should be exercised when using this function. + * * Interface identification is specified in ERC-165. */ function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) {