Skip to content

[Bug]: Solidity: library calls Lib.f() get no calls edge #5004

Open

Description

@rohit-jsfreaky

Pre-flight checks

  • I have checked the Troubleshooting section in the README

What happened?

A Solidity library call Lib.f(...) gets no calls edge, not even when it is made inside the library itself. Base.f() on a contract has the same problem. On OpenZeppelin Contracts v5.4.0 the compiler (solc 0.8.28 AST, referencedDeclaration) resolves 208 library calls inside functions. graphify links 0 of them.

The cause: extract_solidity sends every dotted call to raw_calls with is_member_call: True and no receiver name. The shared cross-file pass in extract.py skips all member calls, and Solidity has no member pass of its own.

Steps to reproduce

Three files in one folder, then graphify update .:

MathLib.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
library MathLib {
    function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; }
    function clamp(uint256 x, uint256 hi) internal pure returns (uint256) { return MathLib.max(x, hi) == x ? hi : x; }
}

TimeLib.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
library TimeLib { function now48() internal view returns (uint48) { return uint48(block.timestamp); } }

Vault.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {MathLib} from "./MathLib.sol";
import "./TimeLib.sol";
contract Vault {
    uint256 public cap; uint48 public updatedAt;
    function setCap(uint256 newCap) external { cap = MathLib.max(newCap, 1); updatedAt = TimeLib.now48(); }
}

Error output or graph output

No calls edge at all. Expected:

setCap() -> max()      (named import)
setCap() -> now48()    (whole-file import)
clamp()  -> max()      (qualified call inside the same library)

Graphify version

0.9.102

Operating System

Windows

Python Version

3.12

Installation Method

uv tool install (recommended)

Activity

  1. github-actions commented on Nov 4, 2026

    @github-actions

    Thanks for opening this issue, @rohit-jsfreaky. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions