Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Important: If you're upgrading snforge to version 0.48.0 or later, please read the 0.48.0 Migration Guide.

File Format Rules

Some rules have to be checked when providing a file for snforge, in order for correct parsing behavior. Different ones apply for JSON and plain text files.

Plain Text Files

  • Elements have to be separated with newlines
  • Elements have to be either:
    • Cairo felt252 values, surrounded by ''
    • byte arrays, surrounded by ""

Example

Below is an example of valid plain text file:

1
2
'hello'
10
"world"

JSON Files

  • Elements have to be either:
    • Cairo felt252 values, surrounded by ''
    • byte arrays, surrounded by ""
    • array of integers or strings fulfilling the above conditions

⚠️ Warning

A JSON object is an unordered data structure. To make reading JSONs deterministic, the values are read from the JSON in an order that is alphabetical in respect to JSON keys. Nested JSON values are sorted by the flattened format keys (a.b.c).

Example

Below is an example of valid JSON file:

{
  "a": 1,
  "nested": {
    "b": 2,
    "c": 448378203247
  },
  "d": 10,
  "e": "world"
}