OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Jsmnsol

JsmnSol is an MIT-licensed Solidity library that parses small JSON strings on-chain by recording token positions in the original string, with helpers to retrieve substrings and convert values such as integers and booleans.

Independent OpenViST project profile, based on linked sources.

Jsmnsol — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when a Solidity contract needs to interpret selected values from a small JSON string, including an oracle response, on-chain.

Who it is for

  • Solidity developers who need contracts to parse small JSON payloads.
  • Developers processing oracle responses within smart contracts.

Documented uses

  • Parse a JSON string and obtain its tokens and token count.
  • Retrieve a selected value using its token start and end indices.
  • Convert extracted values to integers or booleans.
  • Handle oracle response data on-chain and potentially reduce some additional oracle calls.
Before you choose

Requirements & limits

The public GitHub repository identifies an MIT license and documents cloning or installation through Truffle with ethpm.

  • The parser takes a maximum element count as an input, alongside the JSON string.
  • Tokens store indices into the original JSON rather than copied values.
  • Numbers, booleans and null share a primitive token type and are distinguished by inspecting the first character.
  • The documentation recommends restricting use to small JSON because Solidity string handling is complicated and expensive.
  • The README documents both direct repository cloning and a Truffle/ethpm installation route.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Add JsmnSol to a Solidity project

Install the library and import its Solidity file using one of the documented methods.

Before you start

  • A Solidity project.
  • For the package-manager route, a project using Truffle and ethpm.

Steps

  1. Clone the JsmnSol repository to obtain the library files, then import JsmnSolLib.sol into the project.

  2. Alternatively, with Truffle, run the documented ethpm command truffle install jsmnsol-lib; import the library from installed_contracts using the documented path.

Expected outcome

The project has the JsmnSol library available through an import.

Guide limitations

  • The library is intended for small JSON data because Solidity string handling is complicated and expensive.
  • This covers installation and import only, not deployment or runtime testing.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
16 October 2026
Original website title
chrisdotn/jsmnSol · Official homepage title · retained in its source language