Skip to content

feat(slang): emit the JSON ABI and enable --abi and --hashes - #702

Draft
nebasuke wants to merge 2 commits into
mainfrom
slang-abi-output
Draft

nebasuke wants to merge 2 commits into
mainfrom
slang-abi-output

Conversation

@nebasuke

@nebasuke nebasuke commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

TODO: this PR is in a temporary state as most of this implementation will move to slang repo.

Claude summary

Emits the JSON ABI in solc's spelling for every contract, interface, abstract contract and library the Slang frontend compiles, each over its whole hierarchy, and lets --abi and --hashes through the CLI. The abi::matches_solc test pins parity with solc's ABI apart from internalType.

  • Errors a contract reaches from file level or from a library join its ABI with slang #2176.

@github-actions

github-actions Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Coverage Summary

Crate Line Coverage Function Coverage
solx 🟢 83.6% 🔴 20.0%
solx-benchmark-converter 🔴 0.0% 🔴 0.0%
solx-codegen-evm 🟡 55.3% 🔴 49.2%
solx-compiler-downloader 🔴 0.0% 🔴 0.0%
solx-core 🔴 47.3% 🟡 54.8%
solx-dev 🔴 3.2% 🔴 4.2%
solx-mlir 🟡 51.0% 🔴 46.3%
solx-slang 🔴 23.1% 🔴 31.9%
solx-solc-test-adapter 🔴 1.7% 🔴 2.1%
solx-standard-json 🔴 40.5% 🔴 45.2%
solx-tester 🔴 36.6% 🔴 34.6%
solx-utils 🔴 32.7% 🔴 37.5%
Total 🔴 12.9% 🔴 16.1%

Codecov Report | HTML Report | Workflow Run

Renders Slang's `ContractAbi` in solc's JSON-ABI spelling for every contract and library the frontend lowers, and lets `--abi` and `--hashes` through the CLI selection under the Slang frontend. `internalType` is not emitted until Slang carries it.

The new `abi::matches_solc` test compares the rendered ABI to solc's, with `internalType` stripped; it failed on the previous sources with an empty output, as did `hashes::default`.
An interface and an abstract contract deploy nothing, but solc lists them with their ABI and method identifiers and no bytecode; the Slang frontend now does the same. An interface's ABI is composed from the entries Slang computes for its linearised functions, errors and events, since Slang computes no whole ABI for an interface, and the method identifiers of every object go through one `MethodIdentifiers` helper.

The `SlangAbi.sol` fixture pins parity with solc over an interface, an abstract contract, a library and a contract with structs, arrays, events, errors, getters, receive and fallback.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant