Skip to content

ericbsantana/evm-lottery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EVM Lottery Workshop

A hands-on workshop for building a lottery dApp on Monad/EVM from scratch.

Covers Solidity contracts, Foundry testing, a swappable randomness adapter interface, and a React/wagmi frontend. Structured as a guided course where you write the code step by step - an AI tutor explains each concept and reviews what you wrote rather than handing you the answers.

Stack

Area Tool
Contracts Solidity ^0.8.24, Foundry/Forge
Randomness Custom IRandomnessAdapter interface (swappable fake/VRF)
Frontend React, TypeScript, wagmi, viem
Chain Monad testnet (local Anvil for early steps)

What you build

A complete lottery dApp across 9 lessons:

  1. EVM and wallet mental model
  2. Solidity basics by building
  3. Foundry test suite
  4. Lottery contract - rounds, tickets, and prize logic
  5. Randomness abstraction via a VRF adapter interface
  6. Frontend wallet connection
  7. Contract reads and writes from the browser
  8. Monad testnet deployment
  9. Security checklist

How to use this repo

Step 1 - Load the teaching context into your AI assistant.

Open AGENTS.md and paste it into your AI tool (or point it at the file). This defines the teaching protocol: one concept at a time, the AI waits for you to write the code, then reviews what you wrote. Without it, the AI will just write everything for you.

Step 2 - Follow the docs in order.

docs/00-course-map.md
docs/01-evm-wallet-mental-model.md
docs/02-local-dev-setup.md
docs/03-product-and-protocol-design.md
docs/04-solidity-basics-by-building.md
docs/05-contract-v1-local-lottery.md
docs/06-foundry-tests.md
docs/07-randomness-and-vrf-adapter.md
docs/08-frontend-wallet-and-contract-calls.md
docs/09-deploy-to-monad-testnet.md
docs/10-security-checklist.md
docs/11-learning-roadmap.md

Each lesson ends with a working checkpoint. Complete it before moving on.

Step 3 - Use the reference implementation when stuck.

contracts/src/ and contracts/test/ contain the finished contracts and tests. Look at them after you have tried writing the code yourself.

Prerequisites

  • Basic programming experience in any language
  • No prior Solidity, EVM, or wallet knowledge required

Disclaimer

Educational project targeting Monad testnet. Not audited, not intended for production use or real-money gambling. On-chain gambling is jurisdiction-sensitive - understand your local laws before adapting this for any public use.

About

🎟️ Build a lottery dApp on Monad/EVM with Solidity and Foundry - crash course guided by AI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors