Skip to content

README's opening describes only the function-pointer use case, contradicted by LibCodeGen's surface and by the repo's own committed example #87

Description

@thedavidmeister

Audit scope: whole-repo, commit 7aa85a4

Recovered from the docs/process/CI reviewer's report (its finding D2); dimension 3 (documentation), severity low.

Where

README.md:3-6

Problem

The opening paragraph says the tool "hosts the constant caches for prebuilt function-pointer tables". That is one of several things the library emits, and it is not the thing the repo's own committed example demonstrates.

Measured

  • src/lib/LibCodeGen.sol declares 14 internal functions. Eleven of them emit generated source: bytecodeHashConstantString (:98), opcodeFunctionPointersConstantString (:118), literalParserFunctionPointersConstantString (:143), operandHandlerFunctionPointersConstantString (:169), subParserWordParsersConstantString (:193), integrityFunctionPointersConstantString (:219), describedByMetaHashConstantString (:255), bytesConstantString (:275), uint8ConstantString (:303), bytes32ConstantString (:331), addressConstantString (:360). Only 5 of the 11 concern function pointers. The other 6 emit a bytecode hash, a described-by-meta hash, and generic address / uint8 / bytes32 / bytes constants.
  • src/generated/CodeGennable.sol — the repo's only committed example output, which the README itself tells you to regenerate at line 49 — contains a BYTECODE_HASH and two bytes constants and zero function pointers.

So the README's one-line description of the product is contradicted by the artifact the README points at, three sections later in the same file.

Proposed fix

Replace lines 3-6 with:

Solidity-native tooling to generate Solidity source. Builds a valid `.sol`
file (pragma + foundry-clean formatting) hosting build-time constants that a
contract imports and the compiler inlines: prebuilt function-pointer tables
(the case that motivates it — runtime gas efficiency in the Rain
interpreter), a deployed-bytecode hash, a described-by meta hash, and plain
`address`/`uint8`/`bytes32`/`bytes` constants.

Activity

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

Metadata

Metadata

Labels

auditAudit findinglowAudit findingpass3Audit finding

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions