Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PLEarn — Play. Learn. Earn.

Phase 1 MVP — 2 of 6 challenges implemented (33%) · Wave submission ready

A hands-on Soroban smart contract challenge platform. Pick a challenge, write your contract, run the tests, and level up your Stellar/Soroban skills.


What is PLEarn?

PLEarn is a learn-by-doing platform for Soroban smart contract development. Each challenge gives you:

  • A clear objective and requirements
  • Starter code with TODO stubs to fill in
  • Pre-written tests that validate your solution automatically

No guessing whether your contract is correct — the tests tell you.


Project Structure

PLEarn-Contract/
├── challenges/
│   ├── beginner/
│   │   ├── 01-hello-token/
│   │   │   ├── INSTRUCTIONS.md   # What to build
│   │   │   ├── Cargo.toml
│   │   │   ├── src/lib.rs        # Your solution goes here
│   │   │   └── tests/test.rs     # Pre-written tests
│   │   └── 02-token-transfer/
│   │       ├── INSTRUCTIONS.md
│   │       ├── Cargo.toml
│   │       ├── src/lib.rs
│   │       └── tests/test.rs
│   ├── intermediate/
│   │   ├── 01-voting-contract/
│   │   └── 02-access-control/
│   └── advanced/
│       ├── 01-staking-contract/
│       └── 02-multisig-wallet/
├── scripts/
│   ├── run-tests.sh              # Run all challenges
│   └── validate.sh               # Validate a single challenge
└── docs/

Prerequisites

  • Rust (stable)
  • Soroban target: rustup target add wasm32-unknown-unknown
  • Soroban CLI (optional, for deployment)

Getting Started

1. Pick a challenge

Browse the challenges/ folder. Start with beginner/ if you're new to Soroban.

challenges/beginner/01-hello-token/INSTRUCTIONS.md

2. Read the instructions

Each challenge has an INSTRUCTIONS.md with:

  • The objective
  • Required functions to implement
  • Expected behavior
  • Hints

3. Write your solution

Open src/lib.rs and fill in the TODO stubs:

#[contractimpl]
impl HelloToken {
    pub fn initialize(env: Env, admin: Address) {
        // your code here
    }

    pub fn mint(env: Env, to: Address, amount: i128) {
        // your code here
    }

    pub fn balance(env: Env, account: Address) -> i128 {
        // your code here
    }
}

4. Validate your solution

./scripts/validate.sh challenges/beginner/01-hello-token

You'll see either:

✅ Challenge passed!

or a detailed test failure output showing exactly what went wrong.

5. Run all challenges

./scripts/run-tests.sh

Challenges

🟢 Beginner

# Challenge Status Description
01 Hello Token ✅ Implemented Mint a token and query balances
02 Token Transfer ✅ Implemented Add peer-to-peer transfer with auth

🟡 Intermediate

# Challenge Status Description
01 Voting Contract 🔲 Open On-chain proposals and voting
02 Access Control 🔲 Open Role-based permissions system

🔴 Advanced

# Challenge Status Description
01 Staking Contract 🔲 Open Stake tokens and earn time-based rewards
02 Multisig Wallet 🔲 Open M-of-N approval before executing transactions

Contributing

PLEarn is built in the open. Contributions are welcome across all skill levels. See docs/contributing.md for the full guide.

Ways to contribute

  • Add a new challenge — Create a new folder under the appropriate difficulty level with INSTRUCTIONS.md, src/lib.rs, tests/test.rs, and Cargo.toml
  • Write test cases — Improve coverage for existing challenges
  • Fix broken tests — Find and fix tests that don't compile or have incorrect assertions
  • Improve instructions — Make challenge descriptions clearer or add better hints

Adding a new challenge

challenges/<difficulty>/<number>-<name>/
├── INSTRUCTIONS.md
├── Cargo.toml
├── src/
│   └── lib.rs        # starter code with TODO stubs
└── tests/
    └── test.rs       # pre-written tests

Follow the naming convention: 01-hello-token, 02-token-transfer, etc.

Challenge checklist

  • INSTRUCTIONS.md has a clear objective, requirements, expected behavior, and hints
  • src/lib.rs has the contract struct, #[contractimpl] block, and TODO comments
  • tests/test.rs covers the happy path and at least one failure case
  • Cargo.toml uses soroban-sdk = "22.0.11" with testutils feature
  • ./scripts/validate.sh challenges/<path> runs without errors on a correct solution

Scripts Reference

Script Usage Description
validate.sh ./scripts/validate.sh challenges/beginner/01-hello-token Test a single challenge
run-tests.sh ./scripts/run-tests.sh Test all challenges

License

MIT

About

Build the core of Plearn as a test-driven learning system, where developers solve Soroban smart contract challenges locally and validate their solutions using automated tests. This phase focuses on simplicity, usability, and hands-on learning without requiring a full application stack.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages