Update: Head to Cyfrin Updraft
ℹ️ Important:
This repo is no longer actively maintained as there have been changes in Hardhat tooling. The video is out of sync with the code, and you can still follow along with the video, but you will likely need to troubleshoot the changes in the tooling and dependencies. Note also that best practices have evolved since this video was made.
If you'd like to continue your training with more up-to-date material, you can take a look at Cyfrin Updraft. That content is developed with love by Patrick & Cyfrin <3. However note that Cyfrin Updraft training uses Foundry, not Hardhat, so there will be tooling changes involved.
Web3, Full Stack Solidity, Smart Contract & Blockchain - Beginner to Expert ULTIMATE Course | Javascript Edition
<br/>
<p align="center">
<a href="https://www.youtube.com/watch?v=gyMwXuJrbJQ" target="_blank">
<img src="./img/blockchain1.png" width="500" alt="Solidity, Blockchain, and Smart Contract Course – Beginner to Expert Javascript Tutorial">
</a>
</p>
<br/>
Welcome to the repository for the Ultimate Web3, Full Stack Solidity, and Smart Contract - Beginner to Expert Full Course | Javascript Edition FreeCodeCamp Course!
All code references have both a javascript and a typescript edition.
Recommended Testnet: Sepolia
We have updated the repos to work with Sepolia due to Rinkeby and Kovan being sunset, and Goerli being a disaster. Let us know if any of the changes break stuff!
Main Faucet:<a href="https://faucets.chain.link" target="_blank"> https://faucets.chain.link</a>
Backup Faucet:<a href="https://sepoliafaucet.com/" target="_blank"> https://sepoliafaucet.com/</a>
⚠️ All code associated with this course is for demo purposes only. They have not been audited and should not be considered production ready. Please use at your own risk.
Resources For This Course
Questions
Table of Contents
<details>
<summary>Resources</summary>
<ol>
<li><a href="#testnet-faucets">Testnet Faucets</a></li>
<li><a href="#resources-for-this-course">Resources For This Course</a><ul>
<li><a href="#questions">Questions</a></li>
</ul>
</li>
<li><a href="#table-of-contents">Table of Contents</a></li>
</ol>
</details>
<details>
<summary> <a href="#lesson-0-the-edge-of-the-rabbit-hole">Lesson 0: The Edge of the Rabbit Hole</a></summary>
<ol>
<li>
<a href="#welcome-to-the-course">Welcome to the course! </a>
</li>
<li>
<a href="#best-practices">Best Practices </a>
</li>
</ol>
</details>
<details>
<summary> <a href="#lesson-1-blockchain-basics"> Lesson 1: Blockchain Basics </a> </summary>
<ol>
<li>
<a href="#what-is-a-blockchain-what-does-a-blockchain-do">What is a Blockchain? What does a blockchain do?</a>
</li>
<li><a href="#the-purpose-of-smart-contracts">The Purpose Of Smart Contracts</a></li>
<li><a href="#other-blockchain-benefits">Other Blockchain Benefits</a></li>
<li><a href="#what-have-smart-contracts-done-so-far">What have Smart Contracts done so far?</a></li>
<li><a href="#making-your-first-transaction">Making Your First Transaction</a></li>
<li><a href="#gas-i-introduction-to-gas">Gas I: Introduction to Gas</a></li>
<li><a href="#how-do-blockchains-work">How Do Blockchains Work?</a></li>
<li><a href="#signing-transactions">Signing Transactions</a></li>
<li><a href="#gas-ii">Gas II</a></li>
<li><a href="#high-level-blockchain-fundamentals">High-Level Blockchain Fundamentals</a></li>
</ol>
</details>
<details>
<summary><a href="#lesson-2-welcome-to-remix-simple-storage">Lesson 2: Welcome to Remix! Simple Storage</a></summary>
<ol>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#setting-up-your-first-contract">Setting Up Your First Contract</a></li>
<li><a href="#basic-solidity-types">Basic Solidity: Types</a></li>
<li><a href="#basic-solidity-functions">Basic Solidity: Functions</a></li>
<li><a href="#basic-solidity-arrays--structs">Basic Solidity: Arrays & Structs</a></li>
<li><a href="#basic-solidity-compiler-errors-and-warnings">Basic Solidity: Compiler Errors and Warnings</a></li>
<li><a href="#memory-storage-calldata-intro">Memory, Storage, Calldata (Intro)</a></li>
<li><a href="#mappings">Mappings</a></li>
<li><a href="#deploying-your-first-contract">Deploying your First Contract</a></li>
<li><a href="#the-evm--a-recap-of-lesson-2">The EVM & A Recap of Lesson 2</a></li>
</ol>
</details>
<details>
<summary><a href="#lesson-3-remix-storage-factory">Lesson 3: Remix Storage Factory</a></summary>
<ol>
<li><a href="#introduction-1">Introduction</a></li>
<li><a href="#basic-solidity-importing-contracts-into-other-contracts">Basic Solidity: Importing Contracts into other Contracts</a></li>
<li><a href="#basic-solidity-interacting-with-other-contracts">Basic Solidity: Interacting with other Contracts</a></li>
<li><a href="#basic-solidity-inheritance--overrides">Basic Solidity: Inheritance & Overrides</a></li>
<li><a href="#lesson-3-recap">Lesson 3 Recap</a></li>
</ol>
</details>
<details>
<summary><a href="#lesson-4-remix-fund-me">Lesson 4: Remix Fund Me</a></summary>
<ol>
<li><a href="#introduction-2">Introduction</a></li>
<li><a href="#sending-eth-through-a-function--reverts">Sending ETH Through a Function & Reverts</a></li>
<li><a href="#chainlink--oracles">Chainlink & Oracles</a></li>
<li><a href="#review-of-sending-eth-and-working-with-chainlink">Review of Sending ETH and working with Chainlink</a></li>
<li><a href="#interfaces--price-feeds">Interfaces & Price Feeds</a></li>
<li><a href="#importing-from-github--npm">Importing from GitHub & NPM</a></li>
<li><a href="#floating-point-math-in-solidtiy">Floating Point Math in Solidity</a></li>
<li><a href="#basic-solidity-arrays--structs-ii">Basic Solidity: Arrays & Structs II</a></li>
<li><a href="#review-of-interfacs-importing-from-github--math-in-solidity">Review of Interfacs, Importing from GitHub, & Math in Solidity</a></li>
<li><a href="#libraries">Libraries</a></li>
<li><a href="#safemath-overflow-checking-and-the-unchecked-keywork">SafeMath, Overflow Checking, and the "unchecked" keywork</a></li>
<li><a href="#basic-solidity-for-loop">Basic Solidity: For Loop</a></li>
<li><a href="#basic-solidity-resetting-an-array">Basic Solidity: Resetting an Array</a></li>
<li><a href="#sending-eth-from-a-contract">Sending ETH from a Contract</a></li>
<li><a href="#basic-solidity-constructor">Basic Solidity: Constructor</a></li>
<li><a href="#basic-solidity-modifiers">Basic Solidity: Modifiers</a></li>
<li><a href="#testnet-demo">Testnet Demo</a></li>
<li><a href="#advanced-solidity">Advanced Solidity</a><ul>
<li><a href="#immutable--constant">Immutable & Constant</a></li>
<li><a href="#custom-errors">Custom Errors</a></li>
<li><a href="#receive--fallback-functions">Receive & Fallback Functions</a></li>
<li><a href="#lesson-4-recap">Lesson 4 Recap</a></li>
</ol>
</details>
<details>
<summary><a href="#lesson-5-ethersjs-simple-storage">Lesson 5: Ethers.js Simple Storage</a></summary>
<ol>
<li><a href="#effective-debugging-strategies--getting-help">Effective Debugging Strategies & Getting Help</a><ul>
<li><a href="#how-to-debug-anything-video">How to Debug Anything Video</a></li>
</ul>
</li>
<li><a href="#installation--setup">Installation & Setup</a><ul>
<li><a href="#mac--linux-setup">Mac & Linux Setup</a></li>
<li><a href="#windows-setup">Windows Setup</a></li>
<li><a href="#gitpod">Gitpod</a></li>
</ul>
</li>
<li><a href="#local-development-introduction">Local Development Introduction</a><ul>
<li><a href="#optional-javascript-crash-courses">Optional Javascript Crash Courses</a></li>
</ul>
</li>
<li><a href="#tiny-javascript-refresher">Tiny Javascript Refresher</a></li>
<li><a href="#asynchronous-programming-in-javascript">Asynchronous Programming in Javascript</a></li>
<li><a href="#compiling-our-solidity">Compiling our Solidity</a></li>
<li><a href="#ganache--networks">Ganache & Networks</a></li>
<li><a href="#introduction-to-ethersjs">Introduction to Ethers.js</a><ul>
<li><a href="#a-note-on-the-await-keyword">A Note on the await Keyword</a></li>
</ul>
</li>
<li><a href="#adding-transaction-overrides">Adding Transaction Overrides</a></li>
<li><a href="#transaction-receipts">Transaction Receipts</a></li>
<li><a href="#sending-a-raw-transaction-in-ethersjs">Sending a "raw" Transaction in Ethersjs</a></li>
<li><a href="#interacting-with-contracts-in-ethersjs">Interacting with Contracts in Ethersjs</a></li>
<li><a href="#environment-variables">Environment Variables</a></li>
<li><a href="#better-private-key-management">Better Private Key Management</a></li>
<li><a href="#optional-prettier-formatting">Optional Prettier Formatting</a></li>
<li><a href="#deploying-to-a-testnet-or-a-mainnet">Deploying to a Testnet or a Mainnet</a></li>
<li><a href="#verifying-on-block-explorers-from-the-ui">Verifying on Block Explorers from the UI</a></li>
<li><a href="#alchemy-dashboard--the-mempool">Alchemy Dashboard & The Mempool</a></li>
<li><a href="#lesson-5-recap">Lesson 5 Recap</a><ul>
<li><a href="#typescript-ethers-simple-storage">Typescript Ethers Simple Storage</a></li>
</ul>
</li>
</ol>
</details>
<details>
<summary><a href="#lesson-6-hardhat-simple-storage">Lesson 6: Hardhat Simple Storage</a></summary>
<ol>
<li><a href="#introduction-3">Introduction</a></li>
<li><a href="#hardhat-setup">Hardhat Setup</a><ul>
<li><a href="#troubleshooting-hardaht-setup">Troubleshooting Hardaht Setup</a></li>
</ul>
</li>
<li><a href="#hardhat-setup-continued">Hardhat Setup Continued</a></li>
<li><a href="#deploying-simplestorage-from-hardhat">Deploying SimpleStorage from Hardhat</a></li>
<li><a href="#networks-in-hardhat">Networks in Hardhat</a></li>
<li><a href="#programatic-verification">Programatic Verification</a></li>
<li><a href="#interacting-with-contracts-in-hardhat">Interacting with Contracts in Hardhat</a></li>
<li><a href="#artifacts-troubleshooting">Artifacts Troubleshooting</a></li>
<li><a href="#custom-hardhat-tasks">Custom Hardhat Tasks</a></li>
<li><a href="#hardhat-localhost-node">Hardhat Localhost Node</a></li>
<li><a href="#the-hardhat-console">The Hardhat Console</a></li>
<li><a href="#hardhat-tests">Hardhat Tests</a></li>
<li><a href="#hardhat-gas-reporter">Hardhat Gas Reporter</a></li>
<li><a href="#solidity-coverage">Solidity Coverage</a></li>
<li><a href="#hardhat-waffle">Hardhat Waffle</a></li>
<li><a href="#lesson-6-recap">Lesson 6 Recap</a><ul>
<li><a href="#typescript-hardhat-simple-storage">Typescript Hardhat Simple Storage</a></li>
</ul>
</li>
</ol>
</details>
<details>
<summary><a href="#lesson-7-hardhat-fund-me">Lesson 7: Hardhat Fund Me</a></summary>
<ol>
<li><a href="#introduction-4">Introduction</a></li>
<li><a href="#hardhat-setup---fund-me">Hardhat Setup - Fund Me</a></li>
<li><a href="#linting">Linting</a></li>
<li><a href="#hardhat-setup---fund-me---continued">Hardhat Setup - Fund Me - Continued</a></li>
<li><a href="#importing-from-npm">Importing from NPM</a></li>
<li><a href="#hardhat-deploy">Hardhat Deploy</a></li>
<li><a href="#mocking">Mocking</a></li>
<li><a href="#utils-folder">Utils Folder</a></li>
<li><a href="#testnet-demo---hardhat-fund-me">Testnet Demo - Hardhat Fund Me</a></li>
<li><a href="#solidity-style-guide">Solidity Style Guide</a></li>
<li><a href="#testing-fund-me">Testing Fund Me</a></li>
<li><a href="#breakpoints--debugging">Breakpoints & Debugging</a></li>
<li><a href="#gas-iii">Gas III:</a></li>
<li><a href="#consolelog--debugging">console.log & Debugging</a></li>
<li><a href="#testing-fund-me-ii">Testing Fund Me II</a></li>
<li><a href="#storage-in-solidity">Storage in Solidity</a></li>
<li><a href="#gas-optimizations-using-storage-knowledge">Gas Optimizations using Storage Knowledge</a></li>
<li><a href="#solidity-chainlink-style-guide">Solidity Chainlink Style Guide</a></li>
<li><a href="#storage-review">Storage Review</a></li>
<li><a href="#staging-tests">Staging Tests</a></li>
<li><a href="#running-scripts-on-a-local-node">Running Scripts on a Local Node</a></li>
<li><a href="#adding-scripts-to-your-packagejson">Adding Scripts to your package.json</a></li>
<li><a href="#pushing-to-github">Pushing to GitHub</a></li>
<li><a href="#-tweet-me-add-your-repo-in">🐸🐦 Tweet Me (add your repo in)!</a></li>
</ol>
</details>
<details>
<summary><a href="#lesson-8-html--javascript-fund-me-full-stack--front-end">Lesson 8: HTML / Javascript Fund Me (Full Stack / Front End)</a></summary>
<ol>
<li><a href="#introduction-5">Introduction</a></li>
<li><a href="#how-websites-work-with-web3-wallets">How Websites work with Web3 Wallets</a></li>
<li><a href="#html-setup">HTML Setup</a></li>
<li><a href="#connecting-html-to-metamask">Connecting HTML to Metamask</a></li>
<li><a href="#javascript-in-its-own-file">Javascript in it's own file</a></li>
<li><a href="#es6-vs-nodejs">ES6 vs Nodejs</a></li>
<li><a href="#sending-a-transaction-from-a-website">Sending a transaction from a Website</a></li>
<li><a href="#resetting-an-account-in-metamask">Resetting an Account in Metamask</a></li>
<li><a href="#listening-for-events-and-completed-transactions">Listening for Events and Completed Transactions</a></li>
<li><a href="#input-forms">Input Forms</a></li>
<li><a href="#reading-from-the-blockchain">Reading from the Blockchain</a></li>
<li><a href="#withdraw-function">Withdraw Function</a></li>
<li><a href="#lesson-8-recap">Lesson 8 Recap</a><ul>
<li><a