Smart Contract Masterclass

Learn Solidity and Solana by comparing with your CosmWasm implementation. An interactive course using the LocalMoney P2P trading protocol as a real-world example.

Your Progress 0/7 modules completed

Course Overview

This masterclass teaches you smart contract development across three major blockchain platforms by using the LocalMoney protocol - a P2P fiat-to-crypto trading system that you authored in CosmWasm.

📚
Learning Approach

Each module shows the same concept implemented in CosmWasm (your reference), Solidity/EVM, and Solana/Anchor side-by-side, highlighting key differences and patterns.

Aspect CosmWasm (Rust) Solidity (EVM) Solana (Anchor/Rust)
Language Rust Solidity Rust (Anchor)
State Model Key-value store with cw_storage_plus Contract storage slots Account-based PDAs
Entry Points instantiate, execute, query Functions with visibility modifiers #[instruction] handlers
Cross-Contract SubMessages & Queries Direct calls & interfaces CPI (Cross-Program Invocation)
Token Standard CW20 / Bank module ERC-20 SPL Token
Upgradeability Built-in migration Proxy patterns (UUPS/Transparent) Upgradeable authority

Modules

LocalMoney Protocol Architecture

The LocalMoney protocol consists of interconnected contracts that work together to enable P2P trading:

Hub / Config Offer Trade Escrow Profile Price Oracle Arbitrator

Protocol Components

  • Hub: Central configuration and registry for all contract addresses and protocol parameters
  • Offer: Marketplace for buy/sell offers with filtering and pagination
  • Trade: Manages the full trade lifecycle from creation to completion/dispute
  • Escrow: Secure token custody with automated fee distribution
  • Profile: User identity, reputation tracking, and encrypted contact info
  • Price Oracle: Fiat currency price feeds for conversion calculations
  • Arbitrator: Dispute resolution system with random arbitrator assignment

Getting Started

💡
Prerequisites

You should be comfortable with Rust and have written the CosmWasm contracts. Each module will use your existing code as the baseline for learning the other platforms.

Start with Module 1: Contract Foundations to understand how the basic structure of contracts differ across platforms.