Challenges
Master Stylus development through hands-on coding challenges. Start from the basics and work your way up to advanced patterns.
Your Progress
0 / 5 completed
30 total challenges planned
Keep it up! You're doing great.
Hello Stylus
Welcome to Stylus! In this first challenge, you'll write your first Stylus smart contract that stores and retrieves a greeting message.
Counter Contract
Now let's build something a bit more interactive - a counter contract! This is a classic example that demonstrates state management in smart contracts.
Multi-Value Storage
Let's expand on storage by working with multiple values of different types. This challenge introduces you to various storage types available in Stylus.
Events and Logs
Events are crucial for off-chain applications to track what happens in your contract. Let's learn how to emit events in Stylus!
Error Handling
Proper error handling is essential for secure smart contracts. Let's learn how to define and use custom errors in Stylus.
Ownership Pattern
Implement the Ownable pattern to restrict access to admin functions.
Payable Functions
Learn to accept and handle ETH payments in your Stylus contracts.
Storage Mappings
Master StorageMap for key-value data storage patterns.
Storage Vectors
Work with dynamic arrays using StorageVec for flexible data storage.
ERC-20 Token
Build a complete ERC-20 fungible token implementation.
ERC-721 NFT
Create a non-fungible token contract with minting capabilities.
Role-Based Access Control
Implement a flexible role-based permission system.
Reentrancy Guard
Protect your contracts from reentrancy attacks.
Time Locks
Implement time-based restrictions and delays in your contracts.
Multi-Signature Wallet
Build a wallet requiring multiple approvals for transactions.
Token Staking
Create a staking contract with reward distribution.
Simple AMM
Build a basic automated market maker for token swaps.
Voting System
Implement a decentralized voting mechanism with proposals.
DAO Governor
Build a full governance system for decentralized organizations.
Escrow Service
Create a trustless escrow for secure transactions.
English Auction
Implement a timed auction with bidding functionality.
Dutch Auction
Build a descending price auction mechanism.
Merkle Airdrop
Distribute tokens efficiently using Merkle proofs.
Flash Loans
Implement uncollateralized loans that must be repaid in one transaction.
Yield Vault
Create an ERC-4626 compliant tokenized vault.
Oracle Integration
Integrate price feeds and external data into your contracts.
Cross-Contract Calls
Call other contracts and handle responses safely.
Upgradeable Proxy
Implement the proxy pattern for upgradeable contracts.
Factory Pattern
Deploy new contracts from within a contract.
Gas Optimization
Learn advanced techniques to minimize gas costs.