Skip to content

Conversation

@Kev2547
Copy link

@Kev2547 Kev2547 commented Nov 25, 2025

Title: Add Complete Set of Plutus Learning Examples (Beginner → Intermediate → Advanced)

This PR introduces a full suite of developer-oriented Plutus examples, structured in three progressive levels: Beginner, Intermediate, and Advanced.
The goal of this contribution is to provide clear, practical, and production-aligned reference scripts that help new developers understand Plutus concepts faster, while also giving more advanced users real patterns used in Cardano dApps.

All examples include fully documented Haskell code, French README files, and inline comments explaining every important element of the validator logic.

🔰 1. Beginner Level — “Plutus Basics”

This folder contains simple UTXO-based validators designed to help newcomers understand:

How validators work in Plutus (purpose, params, Redeemer/Datum structure)

How to inspect TxInfo and basic transaction constraints

How to run the scripts in Plutus Playground

Each example includes:

Very simple rules (e.g., checking a number, requiring a signature, or verifying fixed datum)

Clear explanations of every function

Step-by-step testing instructions for Playground

This helps beginners master Plutus fundamentals in under 15 minutes.

🟦 2. Intermediate Level — “Real Patterns & Parameterized Validators”

This section introduces more realistic validator patterns used in Cardano smart contracts, such as:

Parameterized scripts

Spending from script-controlled UTXOs

Basic state transitions

Working with custom data types (Datum/Redeemer)

On-chain checks combining multiple conditions

Each example includes French comments and explanations to clarify:

Script structure

How state evolves

How logic is enforced in on-chain code

These examples bridge the gap between beginner exercises and production-level components.

🔥 3. Advanced Level — NFT-Protected Stateful Oracle (UTXO Model)

This advanced example provides a complete implementation of a stateful Oracle secured by a unique NFT, a pattern widely used in:

DEX price feeds

Lending protocols

Derivative markets

Off-chain → On-chain data injections

The validator enforces:

Controlled updates through required signature (PubKeyHash)

NFT continuity ensuring UTXO identity

Bounded price variation (change limit)

Safe transitions using well-typed Datum/Redeemer structures

Files included:

OracleValidator.hs — full validator implementation

Types.hs — OracleDatum structure

README — explanation + Playground testing instructions

This example demonstrates a production-grade UTXO state machine pattern.

🎯 Purpose of the Contribution

This PR provides the Plutus learning community with:

A coherent, progressive learning path

Examples that are simple enough for newcomers, but accurate enough for real-world dApps

High-quality explanations and comments in French, enabling broader accessibility in francophone regions (Africa, Europe, Canada)

It strengthens the Plutus educational ecosystem by offering ready-to-run, well-structured examples that developers can build upon.

📁 Files Added

beginners/*

intermediate/*

advanced/Oracle/*

README.md (French, detailed)

Fully commented Haskell source code

🙌 Notes

If requested, I can translate the README files and comments into English for better international accessibility.

Copy link
Member

@zliu41 zliu41 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs some obvious updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants