瀏覽代碼

Add warning for `supportsERC165InterfaceUnchecked` edge case (#4017)

Yamen Merhi 2 年之前
父節點
當前提交
d13ec90f37
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      contracts/utils/introspection/ERC165Checker.sol

+ 4 - 0
contracts/utils/introspection/ERC165Checker.sol

@@ -101,6 +101,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) {