Assessment Report
OKcontract
oksolc
oksolc is a Zig rewrite of solc. It only supports a normal 0.8.36 compile:
via_ir = true, optimizer = true, optimizer_runs = 200,
the same JSON input Foundry and Hardhat already send.
via_ir = false is rejected.
Hackerbane reviewed
okcontract/oksolc
at a59339132a1aecc8594a34cbba6b5a1bffbeeca8
against solc 0.8.36+commit.8a079791.
Report date is 30 September 2026.
Remediation was read on 11 October 2026 at
f8749e66983f9a0e70837e7d3823e372db5c6901
on okcontract/oksolc-hackerbane.
1Critical
15High
3Medium
6Low
4Info
Hackerbane · Assessment Report
HACK-AR-2026-OKSOLC
Contents
- Document revision history
- Contacts
- 1Executive overview
- 1.1Introduction
- 1.2What we found
- 1.3How this review was done
- 2Scoring (BVSS)
- 2.4Scope
- 3Findings overview
- 4Findings
- 4.5A subassembly key of 0x is rejected
- 4.15memoryguard at 2^31 compiles on oksolc and ICEs solc
- 5Recommendations
- 6Fuzz testing
- 7Static analysis
- 8Remediation record
- 9Exhibit B
Document revision history
| Version | Date | Description |
| 0.4 | 09/30/2026 | Draft Review. Every finding is PENDING. |
| 1.0 | 10/02/2026 | Remediation Plan. OKcontract response on audit/hackerbane-1. |
| 1.1 | 10/11/2026 | Remediation Plan Review against f8749e66983f9a0e70837e7d3823e372db5c6901. |
| 1.2 | 10/12/2026 | Document ID changed from HB-AR-2026.17 to HACK-AR-2026-OKSOLC. No other changes. |
Contacts
1 Executive overview
1.1 Introduction
oksolc 0.1.4 compiles Solidity through the via-IR pipeline and aims to match solc 0.8.36
bytecode. Hackerbane reviewed
okcontract/oksolc
at commit a59339132a1aecc8594a34cbba6b5a1bffbeeca8.
The oracle is solc 0.8.36+commit.8a079791, source tag v0.8.36 commit
8a079791d9cca7a6c03fd6a8429b93aa3bddefed.
Report date is 30 September 2026.
Remediation was read on 11 October 2026 at
f8749e66983f9a0e70837e7d3823e372db5c6901.
Scope is in section 2.4.
1.2 What we found
On 11 October 2026 the remediation tree at
f8749e66983f9a0e70837e7d3823e372db5c6901 was read finding by finding.
Twenty-three findings are solved. HACK-05 and HACK-15 are risk accepted and still differ
from solc 0.8.36. HACK-17, HACK-19, HACK-27, and HACK-29 are acknowledged.
The Zig unit suite was not rerun for this revision. The ERC721ConsecutiveTarget
closure from OpenZeppelin 5.6.1 was compiled on 11 October 2026.
Creation and runtime bytecode matched solc on the 50-source via-IR campaign and on the
frozen corpus (5/5). Seaport 1.6 matched, including the one stack-too-deep error.
That is the path the README supports.
HACK-01 was assembly JSON import. At the review pin, parseAssemblyJSONNode
applied .data strings in parse order. solc applies them in sorted key order.
Two keys for one hash, differing only by case, deployed 22 on oksolc and
11 on solc. Commit cb426c8 sorts the keys.
oksolc does not ship an import-asm-json command. Its JSON printer sorts keys,
so a round trip of an oksolc export does not hit HACK-01.
HACK-05 still rejects a subassembly key of 0x. solc 0.8.36 takes index 0.
HACK-15 still compiles memoryguard(2147483648). The guard in
stack_limit_evader.zig rejects reserved_memory at
2^32 - 1. The other Highs from the draft are solved, including HACK-14 in
f7d50b0. HACK-16 was recompiled on 11 October 2026 from
audit/vectors/H-10/consecutive.json (38 files, 1099241 bytes).
oksolc at f8749e6 returned 0 errors. All 19 nonempty creation-bytecode
objects matched solc 0.8.36, including ERC721ConsecutiveTarget.
HACK-18 is solved. HACK-17 and HACK-19 are acknowledged: empty-contract unoptimized IR
still omits shift_right_224_unsigned, and the 2^64 array bound
stays hexadecimal. HACK-28 is solved in 29da586 by encoding named
require arguments in declaration order. The named fixture bytecode differs
from solc 0.8.36 via-IR.
Open Highs
| ID | Action | Status |
| HACK-05 | A subassembly key of 0x is rejected | RISK ACCEPTED |
| HACK-15 | memoryguard at 2^31 compiles on oksolc and ICEs solc | RISK ACCEPTED |
1.3 How this review was done
- Line read of the via-IR pipeline, Yul optimizer, EVM assembly, Standard JSON, paths, and the incremental cache, recorded in
audit/04-review/.
- Differential compile of 50 Solidity sources, via-IR, optimizer runs 200, cancun, against solc 0.8.36. Creation and runtime bytecode matched. A second batch covered try/catch, modifiers, immutables, and Yul loops.
- Issue 8 inputs: Seaport 1.6 (bytecode match, shared stack-too-deep), Solady 0.1.26 (HACK-14), OpenZeppelin 5.6.1 (HACK-16).
--jobs 1 and 4 matched a serial compile. A user-config SQLite cache matched --no-cache on that input.
- EMI on two contracts with metadata stripped. Opt-level matrix: optimizer off, runs 1, 200, and 1000000, shanghai and cancun. Bytecode matched.
- 63
bugs.json shapes, plus 18 blog proofs of concept that had a static code block, and the SOL-2023-3 Yul verbatim object. No bytecode diff.
- Assembly JSON import harness:
Assembly.fromJSON then assemble, compared with solc --experimental --import-asm-json --bin. The harness source was removed after the run.
zig build lint reported no issues. zig build fuzz-json-adapter under ASan passed 1000 mutations plus 5 seeds. Two unit-test binaries that the build log marked failed command were re-run and passed 141 and 583 tests.
- On 11 October 2026 each finding was checked against the tree at
f8749e6. The Zig unit suite was not rerun. The solc 0.8.36 SIGSEGV in HACK-27 was not rerun. HACK-16 was compiled again from audit/vectors/H-10/consecutive.json (38 files, 1099241 bytes, viaIR, optimizer runs 200, osaka). oksolc at f8749e6 returned 0 errors in 0.85 s (max RSS 492 MB). solc 0.8.36 reports 44 contracts. All 19 nonempty creation-bytecode objects matched, including ERC721ConsecutiveTarget.
2 Scoring (BVSS)
Each finding gets a BVSS vector. Exploitability is Attack Origin, Attack Cost, and
Attack Complexity. Impact is Confidentiality, Integrity, Availability, Deposit, and
Yield. The coefficient is Reversibility times Scope. The printed score is
min(10, E * I * C * 10), rounded up to one decimal.
S = min(10, E * I * C * 10)
2.1 Exploitability
E is the product of Attack Origin (AO), Attack Cost (AC), and Attack Complexity (AX).
| Metric | Value | Numeric |
| Attack Origin (AO) | Arbitrary (AO:A) / Specific (AO:S) | 1 / 0.2 |
| Attack Cost (AC) | Low / Medium / High | 1 / 0.67 / 0.33 |
| Attack Complexity (AX) | Low / Medium / High | 1 / 0.67 / 0.33 |
2.2 Impact
I is max(metrics) plus one quarter of the rest. Integrity and Availability are used here. Deposit and Yield stay None: this tree does not custody funds.
| Metric | None | Low | Medium | High | Critical |
| C, I, A, D, Y | 0 | 0.25 | 0.5 | 0.75 | 1 |
2.3 Severity coefficient
C is Reversibility (R) times Scope (S). R:N is 1, R:P is 0.5, R:F is 0.25. S:U is 1, S:C is 1.25.
| Band | Range |
| Critical | 9.0 - 10.0 |
| High | 7.0 - 8.9 |
| Medium | 4.5 - 6.9 |
| Low | 2.0 - 4.4 |
| Informational | 0.0 - 1.9 |
Wrong deployed bytes are Integrity Critical (HACK-01, score 10). A program solc rejects
and oksolc compiles, or the reverse when the bytes differ, is Integrity High (7.5).
A compile that aborts on input solc accepts is Availability High (7.5). IR spelling
with matching bytecode is Integrity Medium (5.0). A different diagnostic with no bytecode
is Integrity Low (2.5). Oracle notes about solc, and the documented viaIR: false
rejection, are impact None (0.0) and printed as Informational.
2.4 Scope
Code repositories:
- oksolc
- Repository: okcontract/oksolc
- Commit ID: a59339132a1aecc8594a34cbba6b5a1bffbeeca8
- Last remediation commit ID: f8749e66983f9a0e70837e7d3823e372db5c6901 on okcontract/oksolc-hackerbane branch audit/hackerbane-1
- Product version 0.1.4. Zig 0.16.0. Optimize mode ReleaseFast.
- solc oracle
- Binary: 0.8.36+commit.8a079791.Linux.g++
- Source tag v0.8.36, commit 8a079791d9cca7a6c03fd6a8429b93aa3bddefed
In scope: compiles with via_ir = true, optimizer on, optimizer_runs = 200 (the JSON input Foundry and Hardhat send to solc), the Yul optimizer, EVM assembly including JSON import, the C ABI error mapping, CLI path checks, and the incremental cache equality rule (a cached or parallel compile must match a clean single-thread compile).
Out of scope:
- Browser UI.
-Dbrowser is off by default.
- SMT.
- Legacy codegen as a product path.
viaIR: false is rejected (HACK-26).
- A new line-by-line review of commits after a593391. Those commits were read to record remediation status.
3 Findings overview
| Critical | High | Medium | Low | Informational |
| 1 | 15 | 3 | 6 | 4 |
4 Findings
4.1 (HACK-01) ASSEMBLY DATA KEYS THAT DIFFER ONLY BY CASE KEEP THE OTHER PAYLOAD
Critical (10)
Bytecode
SOLVED
Description
Two .data entries for one 32-byte hash, spelled in different cases, produce different bytecode. oksolc appends 22. solc 0.8.36 appends 11.
audit/vectors/C-01/data.json. oksolc bytecode 6003fe22. solc --experimental --import-asm-json --bin bytecode 6003fe11. The final data byte is what would be deployed.
Code location
Listing 1: src/libevmasm/assembly.zig (Lines 1361-1372)
| 1361 | for (data_object.keys(), data_object.values()) |key, *value| { |
| 1362 | switch (value.*) { |
| 1363 | .string => |encoded_data| { |
| 1364 | const decoded = try CommonData.fromHexAlloc(allocator, encoded_data, .dont_throw); |
| 1365 | if (encoded_data.len != 0 and decoded.len == 0) { |
| 1366 | allocator.free(decoded); |
| 1367 | return error.InvalidAssemblyDataHex; |
| 1368 | } |
| 1369 | const hash = try assemblyDataKey(allocator, key); |
| 1370 | try putDataEntryOwned(result, hash, decoded); |
| 1371 | }, |
| 1372 | .object => { |
Proof of concept
- Feed assembly JSON whose .data object has two keys for one 32-byte hash. The lowercase key maps to hex 11. The uppercase key maps to hex 22. .code is a PUSH data of that hash.
- oksolc Assembly.fromJSON then assemble returns 6003fe22.
- solc 0.8.36 --experimental --import-asm-json --bin returns 6003fe11.
BVSS
AO:A/AC:L/AX:L/C:N/I:C/A:N/D:N/Y:N/R:N/S:U (10)
Recommendation
Apply .data string entries in sorted key order, the same order json.zig already prints.
References
Source id C-01. src/libevmasm/assembly.zig:1361.
Remediation plan
SOLVED: The OKcontract team solved this in commit cb426c8 on 10/02/2026 by applying assembly .data entries in sorted key order.
4.2 (HACK-02) OKSOLC COMPILE FOLLOWS A SYMLINK OUT OF THE PROJECT
High (7.5)
Path
SOLVED
Description
oksolc compile src/link.sol reads a symlink that points outside the project and emits bytecode for that outside file. An import of the same symlink is rejected.
A file named inside the project can supply source from outside it. The compiler output for that run contained contract Secret from /tmp/outside-secret.sol, under the key src/link.sol, with creation bytecode 280 hex characters and no errors. import "./link.sol" from Main.sol returned ParserError: Source "src/link.sol" not found: Source path is outside configured roots or is not a regular file.
Code location
Listing 2: src/cli/input.zig (Lines 65-87)
| 65 | pub fn loadSourcesAt(allocator: std.mem.Allocator, io: std.Io, paths: []const []const u8, project: ?[]const u8) !LoadedSources { |
| 66 | const sources = try allocator.alloc(Source, paths.len); |
| 67 | errdefer allocator.free(sources); |
| 68 | var loaded: usize = 0; |
| 69 | errdefer for (sources[0..loaded]) |source| { |
| 70 | allocator.free(source.content); |
| 71 | if (project != null) allocator.free(source.name); |
| 72 | }; |
| 73 | var total: usize = 0; |
| 74 | for (paths, sources) |path, *source| { |
| 75 | const content = try std.Io.Dir.cwd().readFileAlloc(io, path, allocator, .limited(64 * 1024 * 1024 -| total)); |
| 76 | errdefer allocator.free(content); |
| 77 | const name = if (project) |root| name: { |
| 78 | const canonical = try std.Io.Dir.cwd().realPathFileAlloc(io, path, allocator); |
| 79 | defer allocator.free(canonical); |
| 80 | if (!@import("project_sources.zig").pathContainedBy(root, canonical) or canonical.len <= root.len) |
| 81 | break :name try allocator.dupe(u8, path); |
| 82 | const relative = try allocator.dupe(u8, std.mem.trimStart(u8, canonical[root.len..], "/\\")); |
| 83 | std.mem.replaceScalar(u8, relative, '\\', '/'); |
| 84 | break :name relative; |
| 85 | } else path; |
| 86 | source.* = .{ .name = name, .content = content }; |
| 87 | loaded += 1; |
Proof of concept
- Point oksolc compile at a symlink whose target sits outside the project root.
- The compiler follows the link and compiles the outside file. An import of the same link is rejected.
BVSS
AO:A/AC:L/AX:L/C:N/I:H/A:N/D:N/Y:N/R:N/S:U (7.5)
Recommendation
Reject the path when any component is a symlink, or when realPath is outside the project, before the bytes are kept. Use the same rule as FileSourceLoader.read. Add a CLI test next to the import symlink tests in src/cli/main.zig.
References
Source id H-02. src/cli/input.zig:75.
Remediation plan
SOLVED: The OKcontract team solved this in commit efefeb8 on 10/02/2026 by rejecting symlink entry paths in openSourceFile before the bytes are kept.
4.3 (HACK-03) A PUSH VALUE THAT ALREADY HAS 0X IS ASSEMBLED
High (7.5)
Bytecode
SOLVED
Description
PUSH value 0x10 assembles to 6010 on oksolc. solc rejects it.
audit/vectors/H-14/push.json. oksolc bytecode 6010. solc throws Unexpected content found while parsing character string.
Code location
Listing 3: src/libevmasm/assembly.zig (Lines 1557-1561)
| 1557 | fn parseU256Hex(input: []const u8) AssemblyError!u256 { |
| 1558 | const digits = if (std.mem.startsWith(u8, input, "0x")) input[2..] else input; |
| 1559 | if (digits.len == 0) return error.InvalidAssemblyItemValue; |
| 1560 | return std.fmt.parseUnsigned(u256, digits, 16) catch return error.InvalidAssemblyItemValue; |
| 1561 | } |
Proof of concept
- Import assembly JSON {"name":"PUSH","value":"0x10"}.
- oksolc emits 6010. solc throws Unexpected content found while parsing character string.
BVSS
AO:A/AC:L/AX:L/C:N/I:H/A:N/D:N/Y:N/R:N/S:U (7.5)
Recommendation
Reject a PUSH value that already starts with 0x. The caller adds that prefix.
References
Source id H-14. src/libevmasm/assembly.zig:1557.
Remediation plan
SOLVED: The OKcontract team solved this in commit f307ba6 on 10/02/2026. parseU256Hex rejects a PUSH value that already starts with 0x.
4.4 (HACK-04) ASSEMBLY TAG INTEGERS ARE PARSED AS PLAIN DECIMAL
High (7.5)
Accept
SOLVED
Description
parseU256Decimal is base 10 only. solc's u256(string) is Boost: a leading 0 is octal, a leading 0x is hex, and digit 8 in an octal token is rejected.
A tag id in assembly JSON is not the same integer on the two compilers, so a jump can target a different JUMPDEST or fail to link.
Code location
Listing 4: src/libevmasm/assembly.zig (Lines 1563-1565)
| 1563 | fn parseU256Decimal(input: []const u8) AssemblyError!u256 { |
| 1564 | return std.fmt.parseUnsigned(u256, input, 10) catch return error.InvalidAssemblyItemValue; |
| 1565 | } |
Proof of concept
- Tag value 08: oksolc emits 5b. solc rejects the octal digit.
- PUSH [tag] 8 with tag 010: solc emits 6003565b00. oksolc returns ReferenceToTagWithoutPosition.
- Tag value 0x10: solc emits 5b. oksolc returns InvalidAssemblyItemValue.
BVSS
AO:A/AC:L/AX:L/C:N/I:H/A:N/D:N/Y:N/R:N/S:U (7.5)
Recommendation
Parse tag values with the same prefixes Boost accepts, and reject an octal token that contains 8 or 9.
References
Source id H-13. src/libevmasm/assembly.zig:1563.
Remediation plan
SOLVED: The OKcontract team solved this in commit a764971 on 10/02/2026. Tag integers accept decimal, octal, and 0x hex, and reject an octal digit 8 or 9.
4.5 (HACK-05) A SUBASSEMBLY KEY OF 0X IS REJECTED
High (7.5)
Accept
RISK ACCEPTED
Description
.data key 0x with no digits is SubassemblyIndexNotInteger on oksolc. solc takes subassembly 0 and emits fe.
audit/vectors/H-15/sub.json. solc bytecode fe. oksolc does not assemble.
Code location
Listing 5: src/libevmasm/assembly.zig (Lines 1641-1652)
| 1641 | fn parseHexStoiIndex(input: []const u8) AssemblyError!usize { |
| 1642 | var index: usize = 0; |
| 1643 | while (index < input.len and std.ascii.isWhitespace(input[index])) : (index += 1) {} |
| 1644 | var negative = false; |
| 1645 | if (index < input.len and (input[index] == '+' or input[index] == '-')) { |
| 1646 | negative = input[index] == '-'; |
| 1647 | index += 1; |
| 1648 | } |
| 1649 | if (index + 2 <= input.len and input[index] == '0' and |
| 1650 | (input[index + 1] == 'x' or input[index + 1] == 'X')) index += 2; |
| 1651 | const digit_start = index; |
| 1652 | var value: u32 = 0; |
Proof of concept
- Import assembly JSON with an empty .code and a .data key 0x whose object contains STOP.
- oksolc returns SubassemblyIndexNotInteger. solc emits fe.
BVSS
AO:A/AC:L/AX:L/C:N/I:N/A:H/D:N/Y:N/R:N/S:U (7.5)
Recommendation
Treat a 0x prefix with no digits as index 0, which is what std::stoi returns.
References
Source id H-15. src/libevmasm/assembly.zig:1649.
Remediation plan
RISK ACCEPTED: The OKcontract team declined this change. parseHexStoiIndex still returns SubassemblyIndexNotInteger for a bare 0x prefix. solc 0.8.36 treats that prefix as index 0.
4.6 (HACK-06) SUPER.F() CRASHES WHEN THE NEXT BASE IS UNIMPLEMENTED
High (7.5)
Availability
SOLVED
Description
super.f() aborts when the next base in the linearization declares f without a body and a later base implements it. solc 0.8.36 compiles the call. oksolc returns InvalidAst, and the CLI prints error: InternalFailure.
audit/vectors/H-12/super.sol crashes oksolc. solc emits creation bytecode for A and C, 280 hex characters each. contract C is B, A with the same functions compiles on both, because A.f is the next base and it has a body. Replacing an implemented A.f with an empty B.f is TypeError 4593 on both, so that shape never reaches this lookup.
Code location
Listing 6: src/libsolidity/analysis/control_flow_builder.zig (Lines 847-872)
| 847 | fn resolveVirtualFunction( |
| 848 | declaration: *const AST.Node, |
| 849 | most_derived_contract: *const AST.Node, |
| 850 | search_start: ?*const AST.Node, |
| 851 | ) BuildError!*const AST.Node { |
| 852 | const annotation = ASTAnnotations.annotationConst(most_derived_contract) orelse |
| 853 | return error.InvalidAst; |
| 854 | const hierarchy = switch (annotation.*) { |
| 855 | .contract_definition => |value| value.linearized_base_contracts, |
| 856 | else => return error.InvalidAst, |
| 857 | }; |
| 858 | var found_start = search_start == null; |
| 859 | for (hierarchy) |contract| { |
| 860 | if (!found_start and contract != search_start.?) continue; |
| 861 | found_start = true; |
| 862 | if (contract.nodeKind() != .contract_definition) return error.InvalidAst; |
| 863 | for (contract.payload.contract_definition.sub_nodes) |candidate| { |
| 864 | if (candidate.nodeKind() != .function_definition) continue; |
| 865 | if (search_start != null and |
| 866 | !candidate.payload.function_definition.implemented()) continue; |
| 867 | if (candidate == declaration or callableOverrides(candidate, declaration, 0)) |
| 868 | return candidate; |
| 869 | } |
| 870 | } |
| 871 | return error.InvalidAst; |
| 872 | } |
Proof of concept
- Compile contract C is A, B where B.f has no body, A.f is implemented, and C.f calls super.f(). via-IR, optimizer runs 200.
- oksolc returns InvalidAst and the CLI prints InternalFailure. solc compiles A and C.
- contract C is B, A compiles on both.
BVSS
AO:A/AC:L/AX:L/C:N/I:N/A:H/D:N/Y:N/R:N/S:U (7.5)
Recommendation
Match super lookup by signature, the way resolveFunctionVirtual in ast.zig:810 already skips an unimplemented function and continues. Do not require the later function to override the unimplemented declaration. Return a compile error instead of InvalidAst if nothing matches.
References
Source id H-12. src/libsolidity/analysis/control_flow_builder.zig:865.
Remediation plan
SOLVED: The OKcontract team solved this in commit fb9a4c6 on 10/02/2026. resolveVirtualFunction skips an unimplemented base and binds a later function with the same name and parameter types.
4.7 (HACK-07) HOMESTEAD CALL RETURNING STRING MEMORY IS ACCEPTED
High (7.5)
Accept
SOLVED
Description
An external call that returns string memory, compiled for homestead, is accepted. solc 0.8.36 rejects it. The creation bytecode contains STATICCALL.
audit/vectors/H-03/pre_byz.sol compiles on oksolc and is TypeError 6359 on solc. The creation bytecode is 1034 hex characters and contains one STATICCALL (0xfa). Homestead has no STATICCALL. The form that assigns the result to an unused local is TypeError 9574 on solc and is also accepted.
Code location
Listing 7: src/libsolidity/analysis/type_checker.zig (Lines 3161-3175)
| 3161 | "Cannot call function via contract type name.", |
| 3162 | ); |
| 3163 | } |
| 3164 | break :blk function_type.return_parameter_types; |
| 3165 | }, |
| 3166 | else => blk: { |
| 3167 | if (function_type.kind == .BareStaticCall and !self.evm_version.hasStaticCall()) |
| 3168 | try self.reporter.typeError( |
| 3169 | errorId(5052), |
| 3170 | node.location, |
| 3171 | "\"staticcall\" is not supported by the VM version.", |
| 3172 | ); |
| 3173 | try self.checkFunctionGeneral(node, function_type, false); |
| 3174 | break :blk function_type.return_parameter_types; |
| 3175 | }, |
Proof of concept
- Compile an external call that returns string memory with evmVersion homestead, via-IR.
- oksolc accepts and the bytecode contains STATICCALL (0xfa). solc reports 6359 or 9574.
BVSS
AO:A/AC:L/AX:L/C:N/I:H/A:N/D:N/Y:N/R:N/S:U (7.5)
Recommendation
When the EVM version has no returndata, type the call with the same dynamic-stripped return list solc uses, and reject the conversion.
References
Source id H-03. src/libsolidity/analysis/type_checker.zig:3166.
Remediation plan
SOLVED: The OKcontract team solved this in commit ad69808 on 10/02/2026 by stripping dynamic return types when the selected EVM version has no returndata.
4.8 (HACK-08) STRING.LENGTH IS ACCEPTED
High (7.5)
Accept
SOLVED
Description
string memory has a .length member. solc 0.8.36 reports TypeError 9582. bytes .length matches.
audit/vectors/H-04/string_len.sol compiles. Creation bytecode is 548 hex characters and the prefix matches a bytes memory length read. solc rejects with 9582.
Code location
Listing 8: src/libsolidity/analysis/type_checker.zig (Lines 4523-4537)
| 4523 | fn resolveArrayMember( |
| 4524 | self: *TypeChecker, |
| 4525 | node: *AST.Node, |
| 4526 | owner_type: *const Types.Type, |
| 4527 | array: Types.ArrayType, |
| 4528 | name: []const u8, |
| 4529 | arguments: ?@import("../ast/ast_enums.zig").FuncCallArguments, |
| 4530 | owner_pure: bool, |
| 4531 | ) CheckError!?ResolvedMember { |
| 4532 | if (std.mem.eql(u8, name, "length")) |
| 4533 | return .{ |
| 4534 | .type_ref = self.type_provider.uint256(), |
| 4535 | .is_pure = owner_pure, |
| 4536 | }; |
| 4537 | if (array.reference.location != .Storage or array.length != null) return null; |
Proof of concept
- Compile a contract that reads string.length.
- oksolc accepts. solc reports 9582. bytes.length matches on both.
BVSS
AO:A/AC:L/AX:L/C:N/I:H/A:N/D:N/Y:N/R:N/S:U (7.5)
Recommendation
Return null for length when the array kind is string, and let the existing missing-member path report 9582.
References
Source id H-04. src/libsolidity/analysis/type_checker.zig:4532.
Remediation plan
SOLVED: The OKcontract team solved this in commit f1b6bbf on 10/02/2026. string.length takes the missing-member path and reports 9582.
4.9 (HACK-09) A BARE STORAGE PUSH IS ACCEPTED
High (7.5)
Accept
SOLVED
Description
a.push; with no call is accepted. solc 0.8.36 reports TypeError 6675 because push is not unique.
audit/vectors/H-05/push_bare.sol compiles. Creation bytecode is 254 hex characters. solc rejects with 6675.
Code location
Listing 9: src/libsolidity/analysis/type_checker.zig (Lines 4558-4579)
| 4558 | } |
| 4559 | if (!std.mem.eql(u8, name, "push")) return null; |
| 4560 | const argument_count = if (arguments) |value| value.types.items.len else 0; |
| 4561 | if (argument_count == 0) { |
| 4562 | const returns = [_]*const Types.Type{array.base_type}; |
| 4563 | const return_names = [_][]const u8{""}; |
| 4564 | const unbound = try self.type_provider.function( |
| 4565 | &.{self_pointer}, |
| 4566 | &returns, |
| 4567 | &.{""}, |
| 4568 | &return_names, |
| 4569 | .ArrayPush, |
| 4570 | .NonPayable, |
| 4571 | null, |
| 4572 | .{}, |
| 4573 | ); |
| 4574 | return .{ |
| 4575 | .type_ref = try self.type_provider.withBoundFirstArgument(unbound), |
| 4576 | .is_pure = false, |
| 4577 | }; |
| 4578 | } |
| 4579 | const parameters = [_]*const Types.Type{ self_pointer, array.base_type }; |
Proof of concept
- Compile a bare storage member access a.push with no call parentheses.
- oksolc accepts it as the no-argument push. solc reports 6675.
BVSS
AO:A/AC:L/AX:L/C:N/I:H/A:N/D:N/Y:N/R:N/S:U (7.5)
Recommendation
If arguments is null, leave both overloads unresolved and report 6675.
References
Source id H-05. src/libsolidity/analysis/type_checker.zig:4560.
Remediation plan
SOLVED: The OKcontract team solved this in commit 2458d45 on 10/02/2026. A bare storage push with no argument list reports 6675.
4.10 (HACK-10) .SELECTOR IS ACCEPTED ON INTERNAL FUNCTIONS AND ANONYMOUS EVENTS
High (7.5)
Accept
SOLVED
Description
.selector resolves on an internal function and on an anonymous event. solc 0.8.36 reports TypeError 9582 for both.
audit/vectors/H-06/internal.sol compiles (creation bytecode 292 hex characters). audit/vectors/H-06/event.sol compiles (342 hex characters). solc rejects both with 9582. h.value(1)() on a payable function is TypeError 8820 on both compilers.
Code location
Listing 10: src/libsolidity/analysis/type_checker.zig (Lines 4680-4688)
| 4680 | const function = owner_type.asFunction() orelse return null; |
| 4681 | if (std.mem.eql(u8, name, "selector")) |
| 4682 | return .{ |
| 4683 | .type_ref = try self.type_provider.fixedBytes( |
| 4684 | if (function.kind == .Event) 32 else 4, |
| 4685 | ), |
| 4686 | .is_pure = function.declaration != null, |
| 4687 | }; |
| 4688 | if (std.mem.eql(u8, name, "address") and function.kind == .External) |
Proof of concept
- Read .selector on an internal function, and on an anonymous event.
- oksolc accepts both. solc reports 9582 on both. .value(1)() on a payable function is 8820 on both.
BVSS
AO:A/AC:L/AX:L/C:N/I:H/A:N/D:N/Y:N/R:N/S:U (7.5)
Recommendation
Return null unless the function kind is external (or public) and, for events, the event is not anonymous.
References
Source id H-06. src/libsolidity/analysis/type_checker.zig:4681.
Remediation plan
SOLVED: The OKcontract team solved this in commit 3de4dbc on 10/02/2026 by limiting .selector to the external interface, inherited public functions, and non-anonymous events.
4.11 (HACK-11) A STATE-VARIABLE FUNCTION SELECTOR IS A COMPILE-TIME CONSTANT
High (7.5)
Accept
SOLVED
Description
bytes4 constant S = i.f.selector compiles when i is a state variable. solc 0.8.36 reports TypeError 8349.
audit/vectors/H-07/state_sel.sol compiles. Creation bytecode is 162 hex characters. solc rejects with 8349.
Code location
Listing 11: src/libsolidity/analysis/type_checker.zig (Lines 4686-4687)
| 4686 | .is_pure = function.declaration != null, |
| 4687 | }; |
Proof of concept
- Compile bytes4 constant S = i.f.selector where i.f is a state variable of function type.
- oksolc accepts. solc reports 8349.
BVSS
AO:A/AC:L/AX:L/C:N/I:H/A:N/D:N/Y:N/R:N/S:U (7.5)
Recommendation
Set is_pure from the parent expression, matching solc, so a state read is not a constant.
References
Source id H-07. src/libsolidity/analysis/type_checker.zig:4686.
Remediation plan
SOLVED: The OKcontract team solved this in commit 143eaef on 10/02/2026. Selector purity follows the parent expression, so a state-variable read is not a constant.
4.12 (HACK-12) UINT256.MIN AND UINT256.MAX ARE ACCEPTED ON THE TYPE NAME
High (7.5)
Accept
SOLVED
Description
uint256.min and uint256.max compile. solc 0.8.36 reports TypeError 9582. type(uint256).min matches.
audit/vectors/H-08/uint_min.sol and uint_max.sol compile. solc rejects each with 9582. type(uint256).min produces the same 278 hex character creation bytecode on both compilers.
Code location
Listing 12: src/libsolidity/analysis/type_checker.zig (Lines 4954-4970)
| 4954 | .type_ref = try self.type_provider.function( |
| 4955 | ¶meters, |
| 4956 | &returns, |
| 4957 | ¶meter_names, |
| 4958 | ¶meter_names, |
| 4959 | .Unwrap, |
| 4960 | .Pure, |
| 4961 | user_type.declaration, |
| 4962 | .{}, |
| 4963 | ), |
| 4964 | .is_pure = true, |
| 4965 | }; |
| 4966 | } |
| 4967 | }, |
| 4968 | .Integer => if (std.mem.eql(u8, name, "min") or std.mem.eql(u8, name, "max")) |
| 4969 | return .{ .type_ref = actual_type, .is_pure = true }, |
| 4970 | .Array => |array| if (array.kind != .Ordinary and std.mem.eql(u8, name, "concat")) { |
Proof of concept
- Compile uint256.min and uint256.max on the type name.
- oksolc accepts. solc reports 9582. type(uint256).min matches on both.
BVSS
AO:A/AC:L/AX:L/C:N/I:H/A:N/D:N/Y:N/R:N/S:U (7.5)
Recommendation
Delete the integer arm in resolveTypeMember. Leave min and max on the meta-type path.
References
Source id H-08. src/libsolidity/analysis/type_checker.zig:4968.
Remediation plan
SOLVED: The OKcontract team solved this in commit 40b5b5b on 10/02/2026. min and max stay on the meta-type path. The bare type name reports 9582.
4.13 (HACK-13) AN OVERLOADED MODULE MEMBER IS DROPPED
High (7.5)
Accept
SOLVED
Description
import "A.sol" as M then M.f(1) is TypeError 9582 when A.sol exports two free functions named f. solc 0.8.36 compiles it.
audit/vectors/H-09/ is rejected by oksolc with 9582. solc emits creation bytecode for contract C, 280 hex characters, sha256 prefix 3ef10f29715cdfa0.
Code location
Listing 13: src/libsolidity/analysis/type_checker.zig (Lines 5128-5147)
| 5128 | fn resolveModuleMember( |
| 5129 | self: *TypeChecker, |
| 5130 | source_unit: *const AST.Node, |
| 5131 | name: []const u8, |
| 5132 | ) CheckError!?ResolvedMember { |
| 5133 | const annotation = ASTAnnotations.annotationConst(source_unit) orelse return error.InvalidAst; |
| 5134 | const exports = switch (annotation.*) { |
| 5135 | .source_unit => |*value| try value.exported_symbols.get(), |
| 5136 | else => return error.InvalidAst, |
| 5137 | }; |
| 5138 | for (exports.*) |symbol| { |
| 5139 | if (!std.mem.eql(u8, symbol.name, name) or symbol.declarations.len != 1) continue; |
| 5140 | const declaration = symbol.declarations[0]; |
| 5141 | return .{ |
| 5142 | .type_ref = try self.declarationType(declaration), |
| 5143 | .declaration = declaration, |
| 5144 | .is_pure = true, |
| 5145 | }; |
| 5146 | } |
| 5147 | return null; |
Proof of concept
- Compile a file-level module with two functions of the same name and a call that should resolve the overload.
- oksolc drops the overload and reports 9582. solc emits creation bytecode whose prefix is 3ef10f29715cdfa0.
BVSS
AO:A/AC:L/AX:L/C:N/I:H/A:N/D:N/Y:N/R:N/S:U (7.5)
Recommendation
Return the whole declaration list for that name and let the existing overload resolution pick f(uint).
References
Source id H-09. src/libsolidity/analysis/type_checker.zig:5138.
Remediation plan
SOLVED: The OKcontract team solved this in commit 949ce1b on 10/02/2026. Module lookup keeps every declaration of the name and filters by the call arguments.
4.14 (HACK-14) A ZERO-ARGUMENT LIBRARY FUNCTION ABORTS USING-FOR LOOKUP
High (7.5)
Availability
SOLVED
Description
using L for * plus a call a.p(1) aborts if the library also has function p() .... solc 0.8.36 compiles it. The CLI reports error: InternalFailure and writes no JSON.
audit/vectors/H-11/using.sol is InvalidAst on oksolc and compiles on solc (2 contracts). Solady 0.1.26 does the same. src/utils/DynamicArrayLib.sol defines p() with no parameters, and test/DynamicArrayLib.t.sol calls a.p(uint256(1)) under using DynamicArrayLib for *. The issue 8 JSON exits 1 in 1.55 s, RSS 522 MB, stderr error: InternalFailure. solc compiles that JSON (254 contracts, warnings only). src/ without the tests compiles on oksolc.
Code location
Listing 14: src/libsolidity/analysis/type_checker.zig (Lines 5290-5294)
| 5290 | const parameters = try self.parameterTypesAndNames(function.callable.parameters); |
| 5291 | defer self.allocator.free(parameters.types); |
| 5292 | defer self.allocator.free(parameters.names); |
| 5293 | if (parameters.types.len == 0) return error.InvalidAst; |
| 5294 | const returns = if (function.callable.return_parameters) |return_parameters| |
Proof of concept
- Library L has p(A, uint256) and p(). A contract does using L for * and calls a.p(uint256(1)).
- oksolc returns InvalidAst. The CLI prints InternalFailure. solc compiles it. This is the Solady 0.1.26 failure, reduced.
BVSS
AO:A/AC:L/AX:L/C:N/I:N/A:H/D:N/Y:N/R:N/S:U (7.5)
Recommendation
Skip a zero-parameter function in attachedFunctionType (return null, or continue in the caller) instead of error.InvalidAst. Let the one-argument p bind. Surface the Zig error name in the JSON error instead of InternalFailure.
References
Source id H-11. src/libsolidity/analysis/type_checker.zig:5293.
Remediation plan
SOLVED: The OKcontract team solved this in commit f7d50b0 on 09/30/2026. A zero-parameter library function is skipped before attachedFunctionType. using { L.p } with no parameters reports 4731 at the directive.
4.15 (HACK-15) MEMORYGUARD AT 2^31 COMPILES ON OKSOLC AND ICES SOLC
High (7.5)
Accept
RISK ACCEPTED
Description
A Yul Standard JSON input with memoryguard(2147483648) is compiled by oksolc to bytecode 63800000005f5500. solc 0.8.36 returns InternalCompilerError and no bytecode.
Accept/reject mismatch on Yul Standard JSON. oksolc emits creation bytecode. solc 0.8.36 emits an internal compiler error. A pipeline that treats a clean JSON compile as "solc 0.8.36 accepted this" will ship bytecode for a program the reference compiler rejects. Solidity viaIR sources do not reach this builtin from user assembly.
Code location
Listing 15: src/libyul/optimiser/stack_limit_evader.zig (Lines 192-212)
| 192 | pub fn runWithUnreachableVariables( |
| 193 | context: *OptimiserStepContext, |
| 194 | ast_root: *AST.Block, |
| 195 | unreachable_variables: *const Compilability.UnreachableVariables, |
| 196 | ) !void { |
| 197 | const evm_dialect = try requireObjectDialect(context.dialect); |
| 198 | const allocator = context.dispenser.allocator; |
| 199 | const memory_guard_handle = context.dialect.findBuiltin("memoryguard") orelse |
| 200 | return error.MissingMemoryGuardBuiltin; |
| 201 | var memory_guard_calls = try FunctionCallFinder.findFunctionCalls( |
| 202 | allocator, |
| 203 | ast_root, |
| 204 | .{ .builtin = memory_guard_handle }, |
| 205 | ); |
| 206 | defer memory_guard_calls.deinit(allocator); |
| 207 | if (memory_guard_calls.items.len == 0) return; |
| 208 | |
| 209 | const reserved_memory = try literalArgumentValue(memory_guard_calls.items[0]); |
| 210 | const limit: u256 = (@as(u256, 1) << 32) - 1; |
| 211 | if (reserved_memory >= limit) return error.ReservedMemoryTooLarge; |
| 212 | for (memory_guard_calls.items) |call| |
Proof of concept
- Compile Yul memoryguard(2147483648) via the assembly path used in audit/vectors/H-01.
- oksolc emits 63800000005f5500. solc hits an internal compiler error and emits no bytecode.
BVSS
AO:A/AC:L/AX:L/C:N/I:H/A:N/D:N/Y:N/R:N/S:U (7.5)
Recommendation
Reject when reserved_memory >= (1 << 31), and return an error before codegen. Add audit/vectors/H-01/request.json to the frozen corpus and expect a compile error. See SPEC-02 for the reading that solc's expression is the accidental one.
References
Source id H-01. src/libyul/optimiser/stack_limit_evader.zig:210.
Remediation plan
RISK ACCEPTED: The OKcontract team declined the 2^31 ceiling. stack_limit_evader.zig still rejects reserved_memory only at 2^32 - 1. memoryguard(2147483648) still compiles. solc 0.8.36 aborts at 2^31.
4.16 (HACK-16) OPENZEPPELIN 5.6.1 DIES IN THE UNUSED PRUNER
High (7.5)
Availability
SOLVED
Description
The OpenZeppelin 5.6.1 Standard JSON from oksolc issue 8 compiles on solc 0.8.36 and fails on oksolc with YulException: Yul optimizer failed: MissingReference.
Input sha256 666aacb7 (the solar dani/bench-oksolc OpenZeppelin file, 2761150 bytes). Settings are inside that JSON (osaka, optimizer runs 200). oksolc: 16.07 s, max RSS 9166784 kB, one error, 0 contracts. Exit status of --standard-json was 0 because the failure is a JSON error. solc 0.8.36: 60.17 s, max RSS 1422768 kB, 0 errors, 480 contracts. Issue 8 describes an OOM near 50 GiB. This run stopped in the optimizer at 9.2 GiB RSS. The same error reproduces on audit/vectors/H-10/consecutive.json (38 files, 1099241 bytes). The only source that can be removed without error 6275 is the trigger, ERC721ConsecutiveTarget in trigger.sol. Without it, the other 37 files compile. solc compiles the 38-file JSON: 0 errors, 44 contracts. A rewritten helper that does not inherit StdUtils compiled on oksolc, so this is not every subclass of ERC721Consecutive.
Code location
Listing 16: src/libyul/optimiser/unused_pruner.zig (Lines 285-291)
| 285 | fn subtractReferences( |
| 286 | self: *UnusedPruner, |
| 287 | subtrahend: *const NameCollectorModule.ReferenceMap, |
| 288 | ) !void { |
| 289 | for (subtrahend.items()) |entry| { |
| 290 | const count = self.references.getPtr(entry.key) orelse return error.MissingReference; |
| 291 | if (count.* < entry.value) return error.ReferenceUnderflow; |
Proof of concept
- Compile audit/vectors/H-10/consecutive.json (ERC721ConsecutiveTarget plus its 37 imports, OpenZeppelin 5.6.1 settings).
- oksolc returns YulException: Yul optimizer failed: MissingReference and zero contracts.
- solc 0.8.36 returns 0 errors and 44 contracts. The full 390-source project fails the same way.
BVSS
AO:A/AC:L/AX:L/C:N/I:N/A:H/D:N/Y:N/R:N/S:U (7.5)
Recommendation
Find the name that is subtracted without a prior reference count, and align that count with solc's unused pruner. Add a reduced Yul or Solidity case next to the pruner tests.
References
Source id H-10. src/libyul/optimiser/unused_pruner.zig:290.
Remediation plan
SOLVED: The OKcontract team solved the pruner abort in commit df3f818 on 10/02/2026 by counting the inserted discard call before a later pass subtracts it. On 11 October 2026 audit/vectors/H-10/consecutive.json (38 files, 1099241 bytes) was compiled at f8749e6, viaIR, optimizer runs 200, osaka. oksolc returned 0 errors in 0.85 s. solc 0.8.36 reports 44 contracts. All 19 nonempty creation-bytecode objects matched, including ERC721ConsecutiveTarget.
4.17 (HACK-17) EMPTY DISPATCH OMITS UNUSED SELECTOR SHIFT HELPER
Medium (5.0)
IR
ACKNOWLEDGED
Description
Contracts with no external interface functions get unoptimized IR that lacks shift_right_224_unsigned. solc still emits that helper. Optimized IR and bytecode match.
Unoptimized ir token compare fails when the external interface is empty. The helper is dead. Optimized IR and bytecode matched solc.
Code location
Listing 17: src/libsolidity/codegen/ir/ir_generator.zig (Lines 710-718)
| 710 | for (functions.items) |function| self.allocator.free(function.signature); |
| 711 | functions.deinit(self.allocator); |
| 712 | } |
| 713 | var output: Generated.Buffer = .{ .generator = generator }; |
| 714 | if (functions.items.len != 0) { |
| 715 | const shift = try utils.shiftRightFunction(224); |
| 716 | defer self.allocator.free(shift); |
| 717 | var branch = try generator.ifStatement(try generator.expression("iszero(lt(calldatasize(), 4))", .{}), try generator.statements("let selector := @0(calldataload(0))", .{shift})); |
| 718 | var dispatch = try generator.switchStatement(try generator.identifier("selector"), &.{}); |
BVSS
AO:A/AC:L/AX:L/C:N/I:M/A:N/D:N/Y:N/R:N/S:U (5.0)
Recommendation
Call shiftRightFunction(224) while building the dispatch routine even when there are no cases, so the collector keeps the helper solc keeps. Add an empty contract to the corpus with ir requested.
References
Source id M-03. src/libsolidity/codegen/ir/ir_generator.zig:714.
Remediation plan
ACKNOWLEDGED: The OKcontract team left dispatchRoutine as written. shiftRightFunction(224) runs only when the external interface is non-empty. Optimized IR and bytecode for an empty contract match solc 0.8.36. Unoptimized IR omits shift_right_224_unsigned.
4.18 (HACK-18) STORAGE ARRAY PUSH PARAMETER IS VALUE_0 NOT VALUE0
Medium (5.0)
IR
SOLVED
Description
Unoptimized IR for array.push names the value parameter value_0. solc 0.8.36 names it value0. Bytecode and irOptimized still match on the reduced fixtures after the optimizer renames temps, except where M-01's hex bound remains in irOptimized.
Unoptimized ir token compare fails for contracts that push to storage arrays. The name is internal. Runtime bytecode matched solc on both fixtures.
Code location
Listing 18: src/libsolidity/codegen/yul_util_functions.zig (Lines 4249-4250)
| 4249 | const values = try generator.indexedNames("value_", value_count); |
| 4250 | const panic = try self.panicFunction(.resource_error); |
BVSS
AO:A/AC:L/AX:L/C:N/I:M/A:N/D:N/Y:N/R:N/S:U (5.0)
Recommendation
Pass "value" into indexedNames at the three storage-update sites, matching suffixedVariableNameList("value", ...). Keep the value0 unit test and add a storage push IR token fixture.
References
Source id M-02. src/libsolidity/codegen/yul_util_functions.zig:4249.
Remediation plan
SOLVED: The OKcontract team solved this in commit 65d0a9e on 10/02/2026. storageArrayPushFunction names the parameter with indexedNames, which prints value0.
4.19 (HACK-19) YUL NUMBER SPELLING DIFFERS FROM SOLC 0.8.36
Medium (5.0)
IR
ACKNOWLEDGED
Description
A Foundry user who requests ir or irOptimized for a storage array push gets a different Yul text than solc 0.8.36. Creation and runtime bytecode match.
ir and, for the array bound, irOptimized fail an exact or token compare. Deployed bytecode does not change. A tool that hashes irOptimized will not match solc. A tool that executes the bytecode will.
Code location
Listing 19: src/libsolidity/codegen/yul_util_functions.zig (Lines 4274-4277, 4802-4805)
| 4274 | \\let data := sload(array) |
| 4275 | \\let oldLen := @0(data) |
| 4276 | \\if iszero(lt(oldLen, 0x10000000000000000)) { @1() } |
| 4277 | \\switch gt(oldLen, 31) |
| 4802 | const code = try generator.functionDefinition( |
| 4803 | \\function @0(array, data, oldLen, newLen) { |
| 4804 | \\if gt(newLen, 0x10000000000000000) { @1() } |
| 4805 | \\switch lt(oldLen, 32) |
BVSS
AO:A/AC:L/AX:L/C:N/I:M/A:N/D:N/Y:N/R:N/S:U (5.0)
Recommendation
Emit (u256(1) << 64) with the decimal spelling solc uses, and give error selectors the 0x hint solc prints. Add 08_transient.sol and 27_array_pop.sol to the frozen corpus with ir and irOptimized selected explicitly.
References
Source id M-01. src/libsolidity/codegen/yul_util_functions.zig:4276.
Remediation plan
ACKNOWLEDGED: The OKcontract team shipped hexadecimal custom-error selectors in 910b649 and byte-array pop helper order in 1935ab2, both on 10/02/2026. They acknowledged the rest. The 2^64 array bound stays 0x10000000000000000. solc 0.8.36 prints 18446744073709551616. Unoptimized IR for revert E(x) names the memory pointer _2 and the encoded length _3. solc 0.8.36 uses those names the other way around. Creation bytecode matches.
4.20 (HACK-20) NAMED TYPE CONVERSION ALSO REPORTS THE CONVERSION ERROR
Low (2.5)
Diagnostic
SOLVED
Description
uint({a: true}) reports TypeError 5153 and TypeError 9640. solc 0.8.36 reports 5153 and stops.
Both compilers reject audit/vectors/L-04/named.sol. oksolc adds 9640, "Explicit type conversion not allowed from bool to uint256". No bytecode from either side.
Code location
Listing 20: src/libsolidity/analysis/type_checker.zig (Lines 3008-3028)
| 3008 | fn checkTypeConversion( |
| 3009 | self: *TypeChecker, |
| 3010 | node: *AST.Node, |
| 3011 | requested_type: *const Types.Type, |
| 3012 | ) CheckError!*const Types.Type { |
| 3013 | const value = node.payload.function_call; |
| 3014 | if (value.arguments.len != 1) { |
| 3015 | try self.reporter.typeError( |
| 3016 | errorId(2558), |
| 3017 | node.location, |
| 3018 | "Exactly one argument expected for explicit type conversion.", |
| 3019 | ); |
| 3020 | return requested_type; |
| 3021 | } |
| 3022 | if (value.names.len != 0) |
| 3023 | try self.reporter.typeError( |
| 3024 | errorId(5153), |
| 3025 | node.location, |
| 3026 | "Type conversion cannot allow named arguments.", |
| 3027 | ); |
| 3028 | const argument_type = (try expressionAnnotation( |
BVSS
AO:A/AC:L/AX:L/C:N/I:L/A:N/D:N/Y:N/R:N/S:U (2.5)
Recommendation
Return after reporting 5153.
References
Source id L-04. src/libsolidity/analysis/type_checker.zig:3022.
Remediation plan
SOLVED: The OKcontract team solved this in commit 59ba23e on 10/02/2026. checkTypeConversion returns after reporting 5153.
4.21 (HACK-21) NON-PAYABLE CONSTRUCTOR VALUE OPTION OMITS THE CONTRACT NAME
Low (2.5)
Diagnostic
SOLVED
Description
new D{value: 1}(0) on a non-payable constructor is error 7006 on both compilers. oksolc's message does not name D. solc's message does. Neither compiler emits bytecode.
Diagnostic text. Error code 7006 and the reject match. A tool that compares message strings will not. A tool that keys off the code will.
Code location
Listing 21: src/libsolidity/analysis/type_checker.zig (Lines 4013-4015)
| 4013 | if (function_type.kind == .Creation) |
| 4014 | "Cannot set option \"value\", since the constructor is not payable." |
| 4015 | else |
BVSS
AO:A/AC:L/AX:L/C:N/I:L/A:N/D:N/Y:N/R:N/S:U (2.5)
Recommendation
When kind == .Creation, include the contract's human-readable name the way TypeChecker.cpp:2985 does. Add the vector to the corpus and compare error code and message.
References
Source id L-03. src/libsolidity/analysis/type_checker.zig:4013.
Remediation plan
SOLVED: The OKcontract team solved this in commit 63f9af6 on 10/02/2026. Error 7006 for a non-payable constructor includes the contract name.
4.22 (HACK-22) .GAS() IS A DEPRECATION ERROR INSTEAD OF A MISSING MEMBER
Low (2.5)
Diagnostic
SOLVED
Description
h.gas(1)() is TypeError 1621 on oksolc and TypeError 9582 on solc 0.8.36. Both reject the program.
audit/vectors/L-05/gas.sol produces no bytecode from either compiler. A tool that branches on the error code sees 1621 instead of 9582. .value(1)() on a payable function is 8820 on both.
Code location
Listing 22: src/libsolidity/analysis/type_checker.zig (Lines 4715-4737)
| 4715 | if (std.mem.eql(u8, name, "gas") and function.kind != .Creation) { |
| 4716 | const gas_set = try self.type_provider.copyAndSetCallOptions( |
| 4717 | owner_type, |
| 4718 | true, |
| 4719 | false, |
| 4720 | false, |
| 4721 | ); |
| 4722 | const names = [_][]const u8{""}; |
| 4723 | return .{ |
| 4724 | .type_ref = try self.type_provider.function( |
| 4725 | &.{self.type_provider.uint256()}, |
| 4726 | &.{gas_set}, |
| 4727 | &names, |
| 4728 | &names, |
| 4729 | .SetGas, |
| 4730 | .Pure, |
| 4731 | null, |
| 4732 | function.options, |
| 4733 | ), |
| 4734 | .is_pure = false, |
| 4735 | }; |
| 4736 | } |
| 4737 | return null; |
BVSS
AO:A/AC:L/AX:L/C:N/I:L/A:N/D:N/Y:N/R:N/S:U (2.5)
Recommendation
Do not resolve gas on a function type. Leave the missing-member path to report 9582.
References
Source id L-05. src/libsolidity/analysis/type_checker.zig:4715.
Remediation plan
SOLVED: The OKcontract team solved this in commit 95341aa on 10/02/2026. An internal h.gas(1)() is 9582. External this.h.gas(1)() stays 1621, which matches solc 0.8.36.
4.23 (HACK-23) OUTPUT SELECTION STAR INCLUDES IR AND IROPTIMIZED
Low (2.5)
JSON
SOLVED
Description
outputSelection "*" makes oksolc emit ir and irOptimized. solc 0.8.36 does not. Bytecode, ABI, metadata, and method identifiers still matched on the fixtures when those fields were compared.
A client that sends "*" and compares the whole JSON document will see extra keys. Foundry's usual selection lists concrete artifacts. Bytecode under evm.bytecode.object matched.
Code location
Listing 23: src/libsolidity/interface/standard_compiler.zig (Lines 2039-2052)
| 2039 | const wants_ir = isArtifactRequested( |
| 2040 | &settings.projection.output_selection, |
| 2041 | parsed.tree.source_name, |
| 2042 | contract_name, |
| 2043 | "ir", |
| 2044 | true, |
| 2045 | ); |
| 2046 | const wants_optimized_ir = isArtifactRequested( |
| 2047 | &settings.projection.output_selection, |
| 2048 | parsed.tree.source_name, |
| 2049 | contract_name, |
| 2050 | "irOptimized", |
| 2051 | true, |
| 2052 | ); |
BVSS
AO:A/AC:L/AX:L/C:N/I:L/A:N/D:N/Y:N/R:N/S:U (2.5)
Recommendation
Pass false for ir and irOptimized, matching solc's wildcard flag. Keep emitting them when the request names them.
References
Source id L-02. src/libsolidity/interface/standard_compiler.zig:2039.
Remediation plan
SOLVED: The OKcontract team solved this in commit 28251ec on 10/02/2026. The serial and parallel paths pass false for the ir and irOptimized wildcard flag.
4.24 (HACK-24) EMPTY STORAGE LAYOUT USES TYPES OBJECT INSTEAD OF NULL
Low (2.5)
JSON
SOLVED
Description
When a contract has no variables in a storage area, oksolc emits "types": {}. solc 0.8.36 emits "types": null. Slot lists are empty on both sides. Contracts that do have variables in that area matched, including packed structs and the transient fixture's persistent array.
Exact JSON compare of storageLayout or transientStorageLayout fails for empty areas. Slot numbers do not change. Upgrade tools that only read the storage array see the same entries.
Code location
Listing 24: src/libsolidity/interface/storage_layout.zig (Lines 24-74)
| 24 | compatibility_ids: CompatibilityIdResolver, |
| 25 | contract: ?*const AST.Node = null, |
| 26 | types: Json = .{ .object = .empty }, |
| 27 | |
| 28 | pub fn init( |
| 29 | allocator: std.mem.Allocator, |
| 30 | type_provider: *TypeProviderModule.TypeProvider, |
| 31 | compatibility_ids: CompatibilityIdResolver, |
| 32 | ) StorageLayout { |
| 33 | return .{ |
| 34 | .allocator = allocator, |
| 35 | .type_provider = type_provider, |
| 36 | .compatibility_ids = compatibility_ids, |
| 37 | }; |
| 38 | } |
| 39 | |
| 40 | /// Generates the exact Standard JSON layout for ordinary or transient |
| 41 | /// storage. All returned strings and containers are owned by `allocator`. |
| 42 | pub fn generate( |
| 43 | self: *StorageLayout, |
| 44 | contract: *const AST.Node, |
| 45 | location: Types.DataLocation, |
| 46 | ) StorageLayoutError!Json { |
| 47 | if (self.contract != null or contract.nodeKind() != .contract_definition) |
| 48 | return error.InvalidAst; |
| 49 | if (location != .Storage and location != .Transient) |
| 50 | return error.InvalidAst; |
| 51 | self.contract = contract; |
| 52 | self.types = .{ .object = .empty }; |
| 53 | |
| 54 | const contract_type = try self.type_provider.contract(contract, false); |
| 55 | const variables = try TypeBehavior.linearizedStateVariablesAlloc( |
| 56 | self.allocator, |
| 57 | contract_type.payload.Contract, |
| 58 | location, |
| 59 | ); |
| 60 | defer self.allocator.free(variables); |
| 61 | |
| 62 | var storage = std.json.Array.init(self.allocator); // zlinter-disable-current-line require_errdefer_dealloc - JSON graph uses caller-owned arena lifetime and transfers into the result |
| 63 | for (variables) |entry| |
| 64 | try storage.append(try self.generateVariable( |
| 65 | entry.declaration, |
| 66 | entry.slot, |
| 67 | entry.byte_offset, |
| 68 | )); |
| 69 | |
| 70 | var layout: Json = .{ .object = .empty }; |
| 71 | try layout.object.put(self.allocator, "storage", .{ .array = storage }); |
| 72 | try layout.object.put(self.allocator, "types", self.types); |
| 73 | return layout; |
| 74 | } |
BVSS
AO:A/AC:L/AX:L/C:N/I:L/A:N/D:N/Y:N/R:N/S:U (2.5)
Recommendation
Leave types as JSON null until the first type is inserted. Add an empty contract storage-layout byte compare to the corpus.
References
Source id L-01. src/libsolidity/interface/storage_layout.zig:26.
Remediation plan
SOLVED: The OKcontract team solved this in commit 141f70c on 10/02/2026. An empty storage or transient layout writes types as null until the first type is inserted.
4.25 (HACK-25) A 2^256 YUL LITERAL IS A PARSER ERROR
Low (2.5)
Diagnostic
SOLVED
Description
let a := 115792089237316195423570985008687907853269984665640564039457584007913129639936 is ParserError "Invalid number literal." on oksolc. solc 0.8.36 reports TypeError "Number literal too large (> 256 bits)". Both reject the object.
No bytecode. A tool that switches on errors[].type sees ParserError instead of TypeError.
Code location
Listing 25: src/libyul/asm_parser.zig (Lines 536-539, 958-968)
| 536 | else => .Number, |
| 537 | }; |
| 538 | if (kind == .Number and !isValidNumberLiteral(self.currentLiteral())) |
| 539 | try self.fatalParserError(4828, self.currentLocation(), "Invalid number literal."); |
| 958 | fn isValidNumberLiteral(literal: []const u8) bool { |
| 959 | if (std.mem.startsWith(u8, literal, "0x")) { |
| 960 | if (literal.len == 2) return false; |
| 961 | _ = std.fmt.parseUnsigned(u256, literal[2..], 16) catch return false; |
| 962 | return true; |
| 963 | } |
| 964 | for (literal) |character| if (!std.ascii.isDigit(character)) return false; |
| 965 | if (literal.len == 0) return false; |
| 966 | _ = std.fmt.parseUnsigned(u256, literal, 10) catch return false; |
| 967 | return true; |
| 968 | } |
BVSS
AO:A/AC:L/AX:L/C:N/I:L/A:N/D:N/Y:N/R:N/S:U (2.5)
Recommendation
Parse the digits, then report the same too-large TypeError solc uses when the value does not fit in 256 bits. Stop the parse after the first fatal error so the second ParserError is not emitted.
References
Source id L-06. src/libyul/asm_parser.zig:538.
Remediation plan
SOLVED: The OKcontract team solved this in commit ca4a734 on 10/02/2026. An oversized Yul literal stays in the tree and the analyzer reports TypeError 6708.
4.26 (HACK-26) VIAIR FALSE IS REJECTED WITH UNIMPLEMENTEDFEATUREERROR
Informational (0.0)
Product
SOLVED
Description
Standard JSON with viaIR: false and an EVM output request is an error in oksolc and a successful compile in solc 0.8.36. The error code is UnimplementedFeatureError. No legacy bytecode is emitted.
A Foundry project that points solc at oksolc and leaves via_ir unset will not build. It will not deploy legacy bytecode that oksolc never generated.
Code location
Listing 26: src/libsolidity/interface/standard_compiler.zig (Lines 317-330)
| 317 | |
| 318 | if (requestsSolidityEvmOutput(&settings.projection.output_selection) and !settings.ir.via_ir) { |
| 319 | const message = "Zig port: Solidity EVM output requires \"settings.viaIR\": true; the legacy direct-codegen pipeline is unsupported."; |
| 320 | try appendError( |
| 321 | arena, |
| 322 | errors_value, |
| 323 | .UnimplementedFeatureError, |
| 324 | message, |
| 325 | message, |
| 326 | null, |
| 327 | null, |
| 328 | ); |
| 329 | return finishOutput(allocator, &output); |
| 330 | } |
BVSS
AO:A/AC:L/AX:L/C:N/I:N/A:N/D:N/Y:N/R:N/S:U (0.0)
Recommendation
Keep the rejection. The Foundry snippet in the README already sets via_ir = true. No corpus change required beyond a test that the error type stays UnimplementedFeatureError.
References
Source id I-01. src/libsolidity/interface/standard_compiler.zig:317.
Remediation plan
SOLVED: No code change. requestsSolidityEvmOutput with viaIR false still returns UnimplementedFeatureError, which is what this row asked to keep.
4.27 (HACK-27) SOLC SEGFAULTS ON ASSEMBLY TAG 2^32-1
Informational (0.0)
Oracle
ACKNOWLEDGED
Description
Tag value 4294967295 makes solc 0.8.36 die with SIGSEGV (exit 139). oksolc returns TagTooLarge and emits nothing.
This input is not a bytecode mismatch. oksolc does not assemble it. The solc binary used as the oracle crashes, so there is no solc bytecode to compare.
Code location
Listing 27: libevmasm/Assembly.cpp (Lines 188-189)
| 188 | m_usedTags = std::max(m_usedTags, static_cast<unsigned>(data) + 1); |
| 189 | return data; |
BVSS
AO:A/AC:L/AX:L/C:N/I:N/A:N/D:N/Y:N/R:N/S:U (0.0)
Recommendation
No oksolc change for this row. A solc fix would be to reject the tag before the unsigned increment wraps.
References
Source id SPEC-03. libevmasm/Assembly.cpp:188.
Remediation plan
ACKNOWLEDGED: No oksolc change. updateUsedTags still returns TagTooLarge at 4294967295. The solc 0.8.36 SIGSEGV was not rerun for this revision.
4.28 (HACK-28) REQUIRE NAMED CUSTOM ERROR ENCODES SOURCE ORDER
Informational (0.0)
Oracle
SOLVED
Description
require(ok, E({b: y, a: x})) encodes the payload as (y, x) in both compilers. The error is declared E(uint256 a, uint256 b), so a name binding would encode (x, y). revert E({b: y, a: x}) encodes (x, y) in oksolc, and that contract's bytecode matched solc.
A contract that uses named arguments out of declaration order inside require reverts with the source-order payload. Callers that decode by the error's parameter names will read the fields swapped. solc 0.8.36 does the same, so replacing oksolc with solc does not fix it.
Code location
Listing 28: libsolidity/codegen/ir/IRGeneratorForStatements.cpp (Lines 1166-1172)
| 1166 | auto const& errorConstructorCall = dynamic_cast<FunctionCall const&>(*arguments[1]); |
| 1167 | appendCode() << m_utils.requireWithErrorFunction(errorConstructorCall) << "(" <<IRVariable(*arguments[0]).name(); |
| 1168 | for (auto argument: errorConstructorCall.arguments()) |
| 1169 | if (argument->annotation().type->sizeOnStack() > 0) |
| 1170 | appendCode() << ", " << IRVariable(*argument).commaSeparatedList(); |
| 1171 | appendCode() << ")\n"; |
| 1172 | } |
BVSS
AO:A/AC:L/AX:L/C:N/I:N/A:N/D:N/Y:N/R:N/S:U (0.0)
Recommendation
Do not "fix" oksolc alone. That would break the byte-compatibility claim. File the language bug against solc. If solc changes the order, change oksolc in the same release and add this fixture to the corpus. Replacement text for a solc bug note: require(cond, Error({name: value, ...})) passes the constructor arguments in source order into a helper whose parameters were built from sorted argument order. revert Error({...}) encodes in declaration order.
References
Source id SPEC-01. libsolidity/codegen/ir/IRGeneratorForStatements.cpp:1166.
Remediation plan
SOLVED: The OKcontract team solved this in commit 29da586 on 10/02/2026 by passing named require arguments to the helper in declaration order. Named require(false, X({b: 2, a: 1})) now reverts as X(1, 2). solc 0.8.36 via-IR still encodes that call in source order. Bytecode for the named fixture differs from solc.
4.29 (HACK-29) SOLC MEMORYGUARD CEILING IS 2^31 FROM SHIFT PRECEDENCE
Informational (0.0)
Oracle
ACKNOWLEDGED
Description
solc aborts Yul optimization when memoryguard's literal is >= 2^31. The next assert in the same function caps slot count at 2^32 - 1. The two expressions are not the same bound.
Users of solc 0.8.36 cannot compile Yul whose reserved memory is in [2^31, 2^32). The failure is an assertion, not a source diagnostic with an error code.
Code location
Listing 29: libyul/optimiser/StackLimitEvader.cpp (Lines 203-229)
| 203 | yulAssert(reservedMemory < u256(1) << 32 - 1, ""); |
| 204 | |
| 205 | for (FunctionCall const* memoryGuardCall: memoryGuardCalls) |
| 206 | if (reservedMemory != literalArgumentValue(*memoryGuardCall)) |
| 207 | return; |
| 208 | |
| 209 | CallGraph callGraph = CallGraphGenerator::callGraph(_astRoot); |
| 210 | |
| 211 | // We cannot move variables in recursive functions to fixed memory offsets. |
| 212 | for (FunctionHandle function: callGraph.recursiveFunctions()) |
| 213 | { |
| 214 | yulAssert(std::holds_alternative<YulName>(function), "Builtins are not recursive."); |
| 215 | if (_unreachableVariables.count(std::get<YulName>(function))) |
| 216 | return; |
| 217 | } |
| 218 | |
| 219 | std::map<YulName, FunctionDefinition const*> functionDefinitions = allFunctionDefinitions(_astRoot); |
| 220 | |
| 221 | MemoryOffsetAllocator memoryOffsetAllocator{ |
| 222 | _unreachableVariables, |
| 223 | callGraph.functionCalls, |
| 224 | functionDefinitions, |
| 225 | evmDialect->reachableStackDepth() |
| 226 | }; |
| 227 | uint64_t requiredSlots = memoryOffsetAllocator.run(); |
| 228 | yulAssert(requiredSlots < (uint64_t(1) << 32) - 1, ""); |
| 229 | |
BVSS
AO:A/AC:L/AX:L/C:N/I:N/A:N/D:N/Y:N/R:N/S:U (0.0)
Recommendation
If the ceiling is meant to match the slot cap, write reservedMemory < (u256(1) << 32) - 1 and report a normal Yul error instead of an uncaught assertion. If 2^31 is intentional, say so in the assert message. Until one of those lands, oksolc matches this binary by rejecting at 1 << 31 (H-01).
References
Source id SPEC-02. libyul/optimiser/StackLimitEvader.cpp:203.
Remediation plan
ACKNOWLEDGED: No solc patch is included. oksolc keeps the HACK-15 bound, reserved_memory below 2^32 - 1, and does not adopt the 2^31 ceiling from solc's shift precedence.
5 Recommendations
Critical
| ID | Risk | Recommendation | Status |
| HACK-01 | Critical (10) | Apply .data string entries in sorted key order, the same order json.zig already prints. | SOLVED |
High
| ID | Risk | Recommendation | Status |
| HACK-02 | High (7.5) | Reject the path when any component is a symlink, or when realPath is outside the project, before the bytes are kept. Use the same rule as FileSourceLoader.read. Add a CLI test next to the import symlink tests in src/cli/main.zig. | SOLVED |
| HACK-03 | High (7.5) | Reject a PUSH value that already starts with 0x. The caller adds that prefix. | SOLVED |
| HACK-04 | High (7.5) | Parse tag values with the same prefixes Boost accepts, and reject an octal token that contains 8 or 9. | SOLVED |
| HACK-05 | High (7.5) | Treat a 0x prefix with no digits as index 0, which is what std::stoi returns. | RISK ACCEPTED |
| HACK-06 | High (7.5) | Match super lookup by signature, the way resolveFunctionVirtual in ast.zig:810 already skips an unimplemented function and continues. Do not require the later function to override the unimplemented declaration. Return a compile error instead of InvalidAst if nothing matches. | SOLVED |
| HACK-07 | High (7.5) | When the EVM version has no returndata, type the call with the same dynamic-stripped return list solc uses, and reject the conversion. | SOLVED |
| HACK-08 | High (7.5) | Return null for length when the array kind is string, and let the existing missing-member path report 9582. | SOLVED |
| HACK-09 | High (7.5) | If arguments is null, leave both overloads unresolved and report 6675. | SOLVED |
| HACK-10 | High (7.5) | Return null unless the function kind is external (or public) and, for events, the event is not anonymous. | SOLVED |
| HACK-11 | High (7.5) | Set is_pure from the parent expression, matching solc, so a state read is not a constant. | SOLVED |
| HACK-12 | High (7.5) | Delete the integer arm in resolveTypeMember. Leave min and max on the meta-type path. | SOLVED |
| HACK-13 | High (7.5) | Return the whole declaration list for that name and let the existing overload resolution pick f(uint). | SOLVED |
| HACK-14 | High (7.5) | Skip a zero-parameter function in attachedFunctionType (return null, or continue in the caller) instead of error.InvalidAst. Let the one-argument p bind. Surface the Zig error name in the JSON error instead of InternalFailure. | SOLVED |
| HACK-15 | High (7.5) | Reject when reserved_memory >= (1 << 31), and return an error before codegen. Add audit/vectors/H-01/request.json to the frozen corpus and expect a compile error. See SPEC-02 for the reading that solc's expression is the accidental one. | RISK ACCEPTED |
| HACK-16 | High (7.5) | Find the name that is subtracted without a prior reference count, and align that count with solc's unused pruner. Add a reduced Yul or Solidity case next to the pruner tests. | SOLVED |
Medium
| ID | Risk | Recommendation | Status |
| HACK-17 | Medium (5.0) | Call shiftRightFunction(224) while building the dispatch routine even when there are no cases, so the collector keeps the helper solc keeps. Add an empty contract to the corpus with ir requested. | ACKNOWLEDGED |
| HACK-18 | Medium (5.0) | Pass "value" into indexedNames at the three storage-update sites, matching suffixedVariableNameList("value", ...). Keep the value0 unit test and add a storage push IR token fixture. | SOLVED |
| HACK-19 | Medium (5.0) | Emit (u256(1) << 64) with the decimal spelling solc uses, and give error selectors the 0x hint solc prints. Add 08_transient.sol and 27_array_pop.sol to the frozen corpus with ir and irOptimized selected explicitly. | ACKNOWLEDGED |
Low
| ID | Risk | Recommendation | Status |
| HACK-20 | Low (2.5) | Return after reporting 5153. | SOLVED |
| HACK-21 | Low (2.5) | When kind == .Creation, include the contract's human-readable name the way TypeChecker.cpp:2985 does. Add the vector to the corpus and compare error code and message. | SOLVED |
| HACK-22 | Low (2.5) | Do not resolve gas on a function type. Leave the missing-member path to report 9582. | SOLVED |
| HACK-23 | Low (2.5) | Pass false for ir and irOptimized, matching solc's wildcard flag. Keep emitting them when the request names them. | SOLVED |
| HACK-24 | Low (2.5) | Leave types as JSON null until the first type is inserted. Add an empty contract storage-layout byte compare to the corpus. | SOLVED |
| HACK-25 | Low (2.5) | Parse the digits, then report the same too-large TypeError solc uses when the value does not fit in 256 bits. Stop the parse after the first fatal error so the second ParserError is not emitted. | SOLVED |
Informational
| ID | Risk | Recommendation | Status |
| HACK-26 | Informational (0.0) | Keep the rejection. The Foundry snippet in the README already sets via_ir = true. No corpus change required beyond a test that the error type stays UnimplementedFeatureError. | SOLVED |
| HACK-27 | Informational (0.0) | No oksolc change for this row. A solc fix would be to reject the tag before the unsigned increment wraps. | ACKNOWLEDGED |
| HACK-28 | Informational (0.0) | Do not "fix" oksolc alone. That would break the byte-compatibility claim. File the language bug against solc. If solc changes the order, change oksolc in the same release and add this fixture to the corpus. Replacement text for a solc bug note: require(cond, Error({name: value, ...})) passes the constructor arguments in source order into a helper whose parameters were built from sorted argument order. revert Error({...}) encodes in declaration order. | SOLVED |
| HACK-29 | Informational (0.0) | If the ceiling is meant to match the slot cap, write reservedMemory < (u256(1) << 32) - 1 and report a normal Yul error instead of an uncaught assertion. If 2^31 is intentional, say so in the assert message. Until one of those lands, oksolc matches this binary by rejecting at 1 << 31 (H-01). | ACKNOWLEDGED |
6 Fuzz testing
zig build fuzz-json-adapter was run under ASan. 1000 mutations plus 5 seeds passed.
Log: the audit host file campaign-out/followup/asan.log.
Equivalence modulo inputs was run on 01_storage.sol and on a contract with
set and add, with bytecodeHash: none and
appendCBOR: false. An unused internal function left creation and runtime
bytecode unchanged, and the two compilers matched. The default script compare includes
metadata, so both compilers' bytecode changed together.
An opt-level matrix on that second contract matched: optimizer off, runs 1, runs 200,
runs 1000000, shanghai, and cancun. A function-count series at n=50, 150, and 400 was
near linear on both compilers. No separate performance finding was filed.
7 Static analysis
zig build lint completed with no issues. The rest of the review was a manual
line read of the compiler, diffed against the solc 0.8.36 sources, plus the differential
compiles in section 1.3. No third-party Zig analyzer was run.
8 Remediation record
Statuses below were read on 11 October 2026 from
okcontract/oksolc-hackerbane commit
f8749e66983f9a0e70837e7d3823e372db5c6901.
That branch is not merged to okcontract/oksolc main.
Confirmed means the cited function was read in that tree. The Zig unit suite was not rerun.
| Date | Finding | Commit or statement | Confirmed | Merge |
| 10/02/2026 | HACK-01 | cb426c8 sorted .data keys | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-02 | efefeb8 reject symlink entry paths | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-03 | f307ba6 reject prefixed PUSH values | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-04 | a764971 honor tag integer bases | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-05 | Declined. Bare 0x stays rejected. | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-06 | fb9a4c6 resolve super by signature | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-07 | ad69808 strip unavailable dynamic returns | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-08 | f1b6bbf hide string.length | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-09 | 2458d45 reject bare storage push | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-10 | 3de4dbc restrict .selector | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-11 | 143eaef selector purity follows the parent | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-12 | 40b5b5b min and max stay on the meta-type | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-13 | 949ce1b keep module overloads | Yes | audit/hackerbane-1 |
| 09/30/2026 | HACK-14 | f7d50b0 skip zero-parameter library helpers | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-15 | Declined. Bound stays below 2^32 - 1. | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-16 | df3f818. consecutive.json compiled 11 October 2026. Bytecode matched solc. | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-17 | Acknowledged. Unused shift helper stays omitted. | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-18 | 65d0a9e push parameter value0 | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-19 | 910b649 and 1935ab2. Hex 2^64 bound acknowledged. | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-20 | 59ba23e return after 5153 | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-21 | 63f9af6 name the contract in 7006 | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-22 | 95341aa drop internal .gas lookup | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-23 | 28251ec wildcard excludes ir | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-24 | 141f70c empty layout types null | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-25 | ca4a734 analyzer reports 6708 | Yes | audit/hackerbane-1 |
| 09/30/2026 | HACK-26 | Rejection kept. No new commit. | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-27 | Acknowledged. TagTooLarge unchanged. | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-28 | 29da586 declaration-order named require | Yes | audit/hackerbane-1 |
| 10/02/2026 | HACK-29 | Acknowledged with HACK-15. No 2^31 ceiling. | Yes | audit/hackerbane-1 |
Still different from solc 0.8.36: HACK-05 and HACK-15 (risk accepted), HACK-17 and HACK-19 (acknowledged IR text), HACK-27 and HACK-29 (acknowledged upstream notes). HACK-28 matches declaration order and therefore differs from solc 0.8.36 via-IR on named require.
9 Exhibit B
| Severity | Range | Meaning in this report |
| Critical | 9.0 - 10.0 | Compiler output bytes differ from solc on an input both tools accept. |
| High | 7.0 - 8.9 | Accept/reject differs, or a compile aborts, on a reachable path. |
| Medium | 4.5 - 6.9 | IR text differs. Solidity bytecode matches. |
| Low | 2.0 - 4.4 | Diagnostic class, message text, or JSON shape. Both sides reject, or bytecode matches. |
| Informational | 0.0 - 1.9 | Documented product limit, or a solc behavior recorded so the oracle is explicit. |
Warranty caps for a paid review sit in the services agreement when one exists.