# Build an Active Organization Contract on GenLayer

The goal is to create an Intelligent Contract that determines whether an organization is active using explicit criteria and structured outputs.

This contract is built to be easy for validators, easy to challenge and safe to use.

### **Step 1 : Open GenLayer Studio**

1. Go to: [studio.genlayer.com](http://studio.genlayer.com)
    
2. Connect your wallet.
    
3. Click “Create New Contract” or choose a template like hello\_[world.py](http://world.py).
    

### **Step 2 : Create the Contract File**

Create a file named:

### `org_active_check.tpy`

Copy this code into the file:

`from genlayer import fetch, llm, store`

`def main(url: str, snapshot_date: str): # 1. Fetch data (snapshot) about_page = fetch(url + "/about", snapshot_date=snapshot_date) news_page = fetch(url + "/news", snapshot_date=snapshot_date)`

`# 2. Create a structured prompt with explicit criteria prompt = f""" You are a verifier.`

`Determine if the organization is active based on the information below.`

`Criteria: 1. Recent updates within 6 months 2. Evidence of ongoing projects or funding 3. Public communications in the last 6 months`

`Snapshot date: {snapshot_date} About page content: {about_page} News page content: {news_page}`

`Provide a JSON response with: - result: YES or NO - criteria: pass/fail for each - reason: short explanation - sources: list of URLs used """`

`# 3. Run the LLM response = llm(prompt)`

`# 4. Store raw data and reasoning for reproducibility store("about_page", about_page) store("news_page", news_page) store("prompt", prompt) store("llm_response", response)`

`return response`

### **Step 3: Deploy the Contract**

1\. Click Deploy

2\. Choose Testnet

3\. Confirm the transaction

### **Step 4: Run a Test Call**

After deployment:

1\. Open the contract

2\. Enter inputs:

`url:` [`https://example.org`](https://example.org) `snapshot_date: 2026-01-01`

3\. Run the contract

### **Step 5: Review Output**

A good output looks like this:

`{ "result": "YES", "criteria": { "recent_updates": true, "ongoing_projects": true, "public_communications": false }, "reason": "Updates and projects found within the last 6 months, but no public communications detected.", "sources": [ "`[`https://example.org/about`](https://example.org/about)`", "`[`https://example.org/news`](https://example.org/news)`" ]`

### **Step 6: Make It Challenge-Friendly**

This is where GenLayer differs from typical smart contracts. If a validator disagrees, they need to challenge specific criteria.So your contract must include:

• Sources used

• Explicit criteria results

• The LLM prompt

These are stored in the contract for auditability.

### **Step 7 — Share Your Work**

To earn points in the Builder Program:

1\. Share your deployed contract link in Discord

2\. Post a short demo thread on X

3\. Submit the link on [points.genlayer.foundation](http://points.genlayer.foundation)
