UNPKG

hardhat

Version:

Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.

36 lines 1.64 kB
/** * Converts an internal FQN (e.g. `"project/contracts/Foo.sol:Foo"` or * `"npm/@oz/contracts@5.0.0/token/ERC20.sol:ERC20"`) to its user-friendly * form by stripping the `project/` prefix or npm version segment. */ export declare function getUserFqn(inputFqn: string): string; /** * Extracts the function name from a Solidity function signature * (e.g. `"transfer(address,uint256)"` → `"transfer"`). */ export declare function getFunctionName(signature: string): string; /** * Builds a deterministic string key for grouping gas measurements by * (contractFqn, proxyChain). Uses null-byte separators to avoid collisions. */ export declare function makeGroupKey(contractFqn: string, proxyChain: string[]): string; /** * Returns a human-readable proxy label like `"(via Proxy2 → Proxy)"`, * or `undefined` for direct calls. Strips the last element (the * implementation) and converts internal FQNs to user-friendly format. */ export declare function getProxyLabel(proxyChain: string[]): string | undefined; /** * Returns a display key for a contract entry, appending the proxy label * when the call went through a proxy chain. Used for table headers and * JSON object keys. */ export declare function getDisplayKey(userFqn: string, proxyChain: string[]): string; export declare function avg(values: number[]): number; export declare function median(values: number[]): number; export declare function formatSectionHeader(sectionName: string, { changedLength, addedLength, removedLength, }: { changedLength: number; addedLength: number; removedLength: number; }): string; //# sourceMappingURL=utils.d.ts.map