Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events missing in library ABI when using another lib #15752

Open
michprev opened this issue Jan 22, 2025 · 0 comments
Open

Events missing in library ABI when using another lib #15752

michprev opened this issue Jan 22, 2025 · 0 comments
Labels

Comments

@michprev
Copy link

Description

After reading #14501, I believe the case I am describing is not well-expected behavior.

When including a library Lib (with using-for) into another library Lib2, events from Lib are missing in Lib2 ABI. However, when I do the same with a contract, i.e. include Lib into contract Foo, the contract's ABI includes events from Lib.

Note that Lib2 may be deployed as a standalone lib and delegatecalled into, making it impossible to resolve the emitted event correctly.

Image

Environment

  • Compiler version: 0.8.28, 0.8.0, 0.7.0
  • Compilation pipeline (legacy, IR, EOF): legacy, IR
  • Target EVM version (as per compiler settings):
  • Framework/IDE (e.g. Foundry, Hardhat, Remix):
  • EVM execution environment / backend / blockchain client:
  • Operating system: macOS

Steps to Reproduce

Compile and print ABI

library Lib {
    event Foo(uint256 value);

    function foo(uint256 value) internal {
        emit Foo(value);
    }
}

library Lib2 {
    using Lib for uint256;

    function foo2(uint256 value) internal {
        value.foo();
    }
}

contract Foo {
    using Lib for uint256;

    function bar() public {
        uint256 value = 1;
        value.foo();
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant