Skip to content

Bug: examples/run_historical.sol does not compile (5 errors) #4

@golldyck

Description

@golldyck

Problem

The examples/run_historical.sol file cannot be compiled due to 5 separate errors. Any developer trying to use this example as a starting point will be blocked immediately.

Steps to Reproduce

  1. Clone the solid-ml repository
  2. Attempt to compile examples/run_historical.sol
  3. Compilation fails

Errors Found

  1. Wrong import path../lib/TensorLib.sol should be ../src/lib/TensorLib.sol
  2. Non-existent function callrunHistoricalInference should be runInferenceOnPriceFeed (per src/interfaces/OGHistorical.sol)
  3. Undefined variableinput_query on line 50 should be input (the local variable declared on line 38)
  4. Missing struct fieldHistoricalInputQuery requires candle_duration_in_mins but it is omitted in both struct constructions
  5. Undeclared state variablesresults and resultNumber are used but never declared

Additional Issues

  • README.md examples have the same function name and struct field errors
  • README.md struct assignments missing memory keyword (TensorLib.Number predictionTensorLib.Number memory prediction)
  • README.md links missing https:// protocol (hub.opengradient.aihttps://hub.opengradient.ai)
  • NatSpec typo "OGInfernece" in src/interfaces/OGInference.sol
  • Copy-paste error in src/interfaces/OGHistorical.sol NatSpec ("OGInference" → "OGHistorical")
  • Redundant uint32 >= 0 check in src/lib/TensorLib.sol wastes gas (unsigned integers are always >= 0)

Environment

  • Solidity compiler: 0.8.20+
  • Foundry/Hardhat: any version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions