Practical overview
When it fits
Use Oksolc when exploring or integrating an alternative compiler for Solidity development and iteration, especially in workflows that use optimized via-IR compilation. Follow the maintainers’ recommendation to use the original solc for on-chain deployment.
Who it is for
- Solidity developers evaluating an alternative compiler during development.
- Teams integrating a Solidity compiler through a C-compatible interface.
- Zig developers building Solidity-related tooling.
Documented uses
- Compile Solidity source files from the command line.
- Submit Standard JSON requests to control compiler settings and requested artifacts.
- Connect a built compiler to a Foundry project using the documented via-IR configuration.
- Integrate compiler functionality through the C ABI or public Zig module.
- Compare compiler behavior with Solidity 0.8.36 while accounting for documented exceptions.
Requirements & limits
The project is published as a public GitHub repository under the GPL-3.0 license. Building requires Zig 0.16.0, libc and a working C toolchain.
- The documented compatibility target is Solidity 0.8.36, with specified intentional deviations in some compiler output.
- The
compilecommand enables the optimizer with 200 runs; Standard JSON is the route for exact settings and output selection. - Filesystem imports must remain within configured roots and cannot contain symlinks.
- The optional browser features require additional pinned Bun and TypeScript tools; ordinary builds do not require them.
- The maintainers recommend original solc rather than oksolc for on-chain deployment.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Build the Oksolc CLI and libraries
Compile the CLI, shared library and C header from the repository.
Before you start
- Zig 0.16.0
- libc and a working C toolchain
Steps
From the repository, run
zig build -Doptimize=ReleaseFast.Find the executable at
zig-out/bin/oksolc, with the library and header underzig-out/libandzig-out/include.Add
zig-out/binto PATH or use the documented--prefixoption to choose an installation prefix.
Expected outcome
A locally built oksolc CLI, shared library and C header.
Guide limitations
- Oksolc is not considered production-ready for on-chain deployment; the maintainers recommend the original solc for deployment.
- A first Zig build downloads dependencies declared in
build.zig.zon.
Configure Oksolc for a Foundry project
Point a Foundry project at a built oksolc executable and enable its supported optimized via-IR pipeline.
Before you start
- A built oksolc executable
- A Foundry project with a
foundry.tomlfile
Steps
Set the
solcvalue in[profile.default]to the absolute path of the oksolc executable.Set
via_ir = true,optimizer = trueandoptimizer_runs = 200.Run
forge buildin the project; runforge cleanfirst if rebuilding artifacts produced by a previous compiler.
Expected outcome
Foundry is configured to invoke oksolc with the documented via-IR and optimizer settings.
Guide limitations
- The maintainers do not consider oksolc production-ready for on-chain deployment and recommend original solc for deployment.
- The documented supported compilation path is optimized via-IR.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 October 2026
- Original website title
- okcontract/oksolc · Official homepage title · retained in its source language

