detectMethod

Detects if the specified method is present in the contract bytecode.

Example

import { detectMethod } from "thirdweb/utils/extensions/detect.js";
const hasDecimals = await detectMethod({
contract,
method: "function decimals() view returns (uint8)",
});

Parameters

Returns

A promise that resolves to a boolean indicating if the extension is detected.