les exemples plutus pour devellopeurs #7453
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.