Smart contract lottery - Project setup

A foundational guide to Initializing the Raffle Smart Contract - Create the basic `Raffle.sol` file, add NatSpec documentation, and define core raffle functions. Implement an immutable entrance fee pattern using a constructor and getter for gas efficiency.

Solidity Developer

Foundry Fundamentals

1. Introduction
A fundamental guide to Understanding dApp Interactions with HTML Fund Me - Understand the crucial interaction layer between dApps, browser wallets, and smart contracts using a simplified HTML example. Learn the importance of verifying wallet transactions for user safety. Duration: 2min
2. How Metamask interacts with dapps
A foundational guide to HTML Fund Me: Frontend Project Setup - Clone the project repository from GitHub and run the basic HTML/JavaScript application locally using VS Code. Preview the initial user interface elements like connect, fund, and withdraw buttons. Duration: 1min
3. Introduction to window.ethereum
A foundational guide to How Websites Interact with MetaMask - Discover how dApps securely communicate with your wallet via the injected `window.ethereum` provider object. Understand the process for detecting MetaMask, requesting connections, and initiating blockchain transactions. Duration: 12min
4. Decoding Ethereum transactions
A security-focused guide to Understanding Ethereum Function Selectors - Demystify the 'Hex Data' in wallet confirmations by learning how function selectors link UI actions to specific contract functions. Use Foundry's `cast sig` to verify selectors and protect yourself from malicious transaction requests. Duration: 7min
5. Section recap
A core-concepts guide to Understanding Frontend and Wallet Interactions - Explore how dApp frontends connect to wallets like MetaMask using `window.ethereum` and request user accounts. Learn the Ethers.js pattern (Provider, Signer, Contract) for securely initiating smart contract transactions that require wallet approval. Duration: 4min
6. Summary Quiz Quiz
Questions: 11

Course Overview

About the course

What you'll learn

Foundryup, Foundry Forge, and Anvil

Blockchain Oracles

How to create local Blockchain testnets

How to verify a smart contract

How to write and run smart contract tests

Course Description

Who is this course for?

  • Software engineers
  • Web3 developers
  • Blockchain security researchers

Potential Careers

Security researcher

$49,999 - $120,000 (avg. salary)

Smart Contract Engineer

$100,000 - $150,000 (avg. salary)

Web3 developer

$60,000 - $150,000 (avg. salary)

Web3 Developer Relations

$85,000 - $125,000 (avg. salary)

Smart Contract Auditor

$100,000 - $200,000 (avg. salary)

Meet your instructors

Patrick Collins

Patrick Collins

Founder at Cyfrin

Web3 engineer, educator, and Cyfrin co-founder. Patrick's smart contract development and security courses have helped hundreds of thousands of engineers kickstarting their careers into web3.

Guest lecturers:

Richard Gottleber

Richard Gottleber

Developer relations at Chainlink

Vasiliy Gualoto

Vasiliy Gualoto

Developer relations at ThirdWeb

Last updated on May 27, 2025