VM Interoperability
EVM Precompiles
Json

JSON Precompile

Address: 0x0000000000000000000000000000000000001003

This precompile enables EVM clients to query JSON data.

Functions

Queries

  • extractAsBytes: Extracts data as bytes from the input using the specified key.

      /// Extracts data as bytes from the input using the specified key.
      /// @param input The input data.
      /// @param key The key to extract.
      /// @return The extracted data as bytes.
      function extractAsBytes(
          bytes memory input,
          string memory key) external view returns (bytes memory response);
  • extractAsBytesList: Extracts data as a list of bytes from the input using the specified key.

    /// Extracts data as a list of bytes from the input using the specified key.
    /// @param input The input data.
    /// @param key The key to extract.
    /// @return The extracted data as bytes collection.
    function extractAsBytesList(
          bytes memory input,
          string memory key) external view returns (bytes[] memory response);
  • extractAsUint256: Extracts data as a uint256 from the input using the specified key.

    /// Extracts data as a list of bytes from the input using the specified key.
    /// @param input The input data.
    /// @param key The key to extract.
    /// @return The extracted uint256.
    function extractAsUint256(
          bytes memory input,
          string memory key) external view returns (uint256 response);

View the JSON precompile source code and the contract ABI here (opens in a new tab).