From ff8d7d3822e624c544bd176fabf248fe015b06e2 Mon Sep 17 00:00:00 2001 From: abdullah <40023761+rehankhan11@users.noreply.github.com> Date: Thu, 10 Sep 2026 05:43:18 +0100 Subject: [PATCH] document runner comment blank-line requirement --- .../intelligent-contracts/first-contract.mdx | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pages/developers/intelligent-contracts/first-contract.mdx b/pages/developers/intelligent-contracts/first-contract.mdx index 786a4860..5367f140 100644 --- a/pages/developers/intelligent-contracts/first-contract.mdx +++ b/pages/developers/intelligent-contracts/first-contract.mdx @@ -15,6 +15,28 @@ First of all, you need to place a magic comment with the version of GenVM you wi ``` It is similar to Solidity's `pragma solidity`. The hash after the colon identifies the exact version of the Python runtime to use, ensuring your contract always runs against the same environment. + + +GenVM parses the **entire contiguous block** of leading `#` lines as a single JSON document — not just the first line. If you add another comment directly below the version comment with no blank line between them, the parser tries to read both lines as one JSON value and rejects the contract. + + +Always leave a blank line after the version comment before any other comment or code: + +```py +# { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" } + +# Anything you want to say about the contract. +from genlayer import * +``` + +This is broken — the missing blank line merges the two lines into the JSON parse, and the contract will fail even though the version comment itself is well-formed: + +```py +# { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" } +# Anything you want to say about the contract. +from genlayer import * +``` + ### Importing the Standard Library After the version comment, you can import the GenLayer standard library: ```py