Awesome
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!
Link to video: https://www.youtube.com/watch?v=gyMwXuJrbJQ
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!
Testnet Faucets
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
- Github Discussions
- Ask questions and chat about the course here!
- Stack Exchange Ethereum
- Great place for asking technical questions about Ethereum
- StackOverflow
- Great place for asking technical questions overall
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 href="#optional-links">Optional Links</a></li> </ul> </li> </ol> </details> <details> <summary><a href="#lesson-9-hardhat-smart-contract-lottery">Lesson 9: Hardhat Smart Contract Lottery</a></summary> <ol> <li><a href="#introduction-6">Introduction</a></li> <li><a href="#hardhat-setup---smart-contract-lottery">Hardhat Setup - Smart Contract Lottery</a></li> <li><a href="#rafflesol-setup">Raffle.sol Setup</a></li> <li><a href="#introduction-to-events">Introduction to Events</a></li> <li><a href="#events-in-rafflesol">Events in Raffle.sol</a></li> <li><a href="#introduction-to-chainlink-vrf">Introduction to Chainlink VRF</a><ul> <li><a href="#sub-lesson-chainlink-vrf">Sub-Lesson: Chainlink VRF</a></li> </ul> </li> <li><a href="#implementing-chainlink-vrf---introduction">Implementing Chainlink VRF - Introduction</a><ul> <li><a href="#hardhat-shorthand">Hardhat Shorthand</a></li> </ul> </li> <li><a href="#implementing-chainlink-vrf---the-request">Implementing Chainlink VRF - The Request</a></li> <li><a href="#implementing-chainlink-vrf---the-fulfill">Implementing Chainlink VRF - The FulFill</a><ul> <li><a href="#modulo">Modulo</a></li> </ul> </li> <li><a href="#introduction-to-chainlink-keepers">Introduction to Chainlink Keepers</a></li> <li><a href="#implementing-chainlink-keepers---checkupkeep">Implementing Chainlink Keepers - checkUpkeep</a><ul> <li><a href="#enums">Enums</a></li> </ul> </li> <li><a href="#implementing-chainlink-keepers---checkupkeep-continued">Implementing Chainlink Keepers - checkUpkeep continued</a></li> <li><a href="#implementing-chainlink-keepers---performupkeep">Implementing Chainlink Keepers - performUpkeep</a></li> <li><a href="#code-cleanup">Code Cleanup</a></li> <li><a href="#deploying-rafflesol">Deploying Raffle.sol</a><ul> <li><a href="#mock-chainlink-vrf-coordinator">Mock Chainlink VRF Coordinator</a></li> <li><a href="#continued">Continued</a></li> </ul> </li> <li><a href="#rafflesol-unit-tests">Raffle.sol Unit Tests</a><ul> <li><a href="#testing-events--chai-matchers">Testing Events & Chai Matchers</a></li> <li><a href="#continued-i">Continued I</a></li> </ul> </li> <li><a href="#hardhat-methods--time-travel">Hardhat Methods & Time Travel</a><ul> <li><a href="#continued-ii">Continued II</a></li> </ul> </li> <li><a href="#callstatic">Callstatic</a><ul> <li><a href="#continued-iii">Continued III</a></li> <li><a href="#massive-promise-test">Massive Promise Test</a></li> <li><a href="#continued-iv">Continued IV</a></li> </ul> </li> <li><a href="#rafflesol-staging-tests">Raffle.sol Staging Tests</a></li> <li><a href="#testing-on-a-testnet">Testing on a Testnet</a><ul> <li><a href="#recommended-link-amounts-for-sepolia-staging-test">Recommended LINK amounts for Sepolia Staging Test:</a></li> </ul> </li> <li><a href="#conclusion">Conclusion</a></li> <li><a href="#typescript---smart-contract-lottery">Typescript - Smart Contract Lottery</a></li> </ol> </details> <details> <summary><a href="#lesson-10-nextjs-smart-contract-lottery-full-stack--front-end">Lesson 10: NextJS Smart Contract Lottery (Full Stack / Front End)</a></summary> <ol> <li><a href="#introduction-7">Introduction</a><ul> <li><a href="#optional-sub-lesson-full-stack-development--other-libraries">Optional Sub-Lesson: Full Stack Development & Other Libraries</a></li> </ul> </li> <li><a href="#nextjs-setup">NextJS Setup</a></li> <li><a href="#manual-header-i">Manual Header I</a><ul> <li><a href="#react-hooks">React Hooks</a></li> </ul> </li> <li><a href="#manual-header-ii">Manual Header II</a></li> <li><a href="#useeffect-hook">useEffect Hook</a></li> <li><a href="#local-storage">Local Storage</a></li> <li><a href="#isweb3enabledloading">isWeb3EnabledLoading</a></li> <li><a href="#web3uikit">web3uikit</a></li> <li><a href="#introduction-to-calling-functions-in-nextjs">Introduction to Calling Functions in Nextjs</a><ul> <li><a href="#automatic-constant-value-ui-updater">Automatic Constant Value UI Updater</a></li> <li><a href="#runcontractfunction">runContractFunction</a></li> </ul> </li> <li><a href="#usestate">useState</a></li> <li><a href="#calling-functions-in-nextjs">Calling Functions in NextJS</a></li> <li><a href="#usenotification">useNotification</a></li> <li><a href="#reading--displaying-contract-data">Reading & Displaying Contract Data</a></li> <li><a href="#a-note-about-onsuccess">A Note about <code>onSuccess</code></a></li> <li><a href="#a-challenge-to-you">A Challenge to You</a></li> <li><a href="#tailwind--styling">Tailwind & Styling</a></li> <li><a href="#introduction-to-hosting-your-site">Introduction to Hosting your Site</a></li> <li><a href="#ipfs">IPFS</a></li> <li><a href="#hosting-on-ipfs">Hosting on IPFS</a></li> <li><a href="#hosting-on-ipfs--filecoin-using-fleek">Hosting on IPFS & Filecoin using Fleek</a></li> <li><a href="#filecoin-overview">Filecoin Overview</a></li> <li><a href="#lesson-10-recap">Lesson 10 Recap</a></li> </ol> </details> <details> <summary><a href="#lesson-11-hardhat-starter-kit">Lesson 11: Hardhat Starter Kit</a></summary> <ol> </details> <details> <summary><a href="#lesson-12-hardhat-erc20s">Lesson 12: Hardhat ERC20s</a></summary> <ol> <li><a href="#what-is-an-erc-what-is-an-eip">What is an ERC? What is an EIP?</a></li> <li><a href="#what-is-an-erc20">What is an ERC20?</a></li> <li><a href="#manually-creating-an-erc20-token">Manually Creating an ERC20 Token</a></li> <li><a href="#creating-an-erc20-token-with-openzeppelin">Creating an ERC20 Token with Openzeppelin</a></li> <li><a href="#lesson-12-recap">Lesson 12 Recap</a></li> </ul> </ol> </details> <details> <summary><a href="#lesson-13-hardhat-defi--aave">Lesson 13: Hardhat DeFi & Aave</a></summary> <ol> <li><a href="#what-is-defi">What is DeFi?</a></li> <li><a href="#what-is-aave">What is Aave?</a></li> <li><a href="#programatic-borrowing--lending">Programatic Borrowing & Lending</a></li> <li><a href="#weth---wrapped-eth">WETH - Wrapped ETH</a></li> <li><a href="#forking-mainnet">Forking Mainnet</a></li> <li><a href="#depositing-into-aave">Depositing into Aave</a></li> <li><a href="#borrowing-from-aave">Borrowing from Aave</a></li> <li><a href="#repaying-with-aave">Repaying with Aave</a></li> <li><a href="#visualizing-the-transactions">Visualizing the Transactions</a></li> <li><a href="#lesson-13-recap">Lesson 13 Recap</a></li> <li><a href="#happy-bow-tie-friday-with-austin-griffith">Happy Bow-Tie Friday with Austin Griffith</a><ul> <li><a href="#more-defi-learnings">More DeFi Learnings:</a></li> </ul> </li> </ul> </ol> </details> <details> <summary><a href="#lesson-14-hardhat-nfts-everything-you-need-to-know-about-nfts">Lesson 14: Hardhat NFTs (EVERYTHING you need to know about NFTs)</a></summary> <ol> <li><a href="#what-is-an-nft">What is an NFT?</a></li> <li><a href="#code-overview">Code Overview</a></li> <li><a href="#hardhat-setup-1">Hardhat Setup</a></li> <li><a href="#basic-nft">Basic NFT</a><ul> <li><a href="#write-tests">Write Tests</a></li> </ul> </li> <li><a href="#random-ipfs-nft">Random IPFS NFT</a><ul> <li><a href="#mapping-chainlink-vrf-requests">Mapping Chainlink VRF Requests</a></li> <li><a href="#creating-rare-nfts">Creating Rare NFTs</a></li> <li><a href="#setting-the-nft-image">Setting the NFT Image</a></li> <li><a href="#setting-an-nft-mint-price">Setting an NFT Mint Price</a></li> <li><a href="#deploy-script">Deploy Script</a></li> <li><a href="#uploading-token-images-with-pinata">Uploading Token Images with Pinata</a></li> <li><a href="#uploading-token-uris-metadata-with-pinata">Uploading Token URIs (metadata) with Pinata</a></li> <li><a href="#deploying">Deploying</a></li> <li><a href="#tests">Tests</a></li> </ul> </li> <li><a href="#dynamic-svg-on-chain-nft">Dynamic SVG On-Chain NFT</a><ul> <li><a href="#what-is-an-svg">What is an SVG?</a></li> <li><a href="#initial-code">Initial Code</a></li> <li><a href="#base64-encoding">Base64 Encoding</a></li> </ul> </li> <li><a href="#advanced-evm-opcodes-encoding-and-calling">Advanced: EVM Opcodes, Encoding, and Calling</a><ul> <li><a href="#abiencode--abiencodepacked">abi.encode & abi.encodePacked</a></li> <li><a href="#introduction-to-encoding-function-calls-directly">Introduction to Encoding Function Calls Directly</a></li> <li><a href="#introduction-to-encoding-function-calls-recap">Introduction to Encoding Function Calls Recap</a></li> <li><a href="#encoding-function-calls-directly">Encoding Function Calls Directly</a></li> <li><a href="#creating-an-nft-tokenuri-on-chain">Creating an NFT TokenURI on-Chain</a></li> <li><a href="#making-the-nft-dynamic">Making the NFT Dynamic</a></li> <li><a href="#deploy-script-1">Deploy Script</a></li> </ul> </li> <li><a href="#deploying-the-nfts-to-a-testnet">Deploying the NFTs to a Testnet</a></li> <li><a href="#lesson-14-recap">Lesson 14 Recap</a></li> </ul> </ol> </details> <details> <summary><a href="#lesson-15-nextjs-nft-marketplace-if-you-finish-this-lesson-you-are-a-full-stack-monster">Lesson 15: NextJS NFT Marketplace (If you finish this lesson, you are a full-stack MONSTER!)</a></summary> <ol> <li><a href="#introduction-8">Introduction</a></li> <li><a href="#part-i-nft-marketplace-contracts">Part I: NFT Marketplace Contracts</a><ul> <li><a href="#hardhat-setup-2">Hardhat Setup</a></li> <li><a href="#nftmarketplacesol">NftMarketplace.sol</a></li> </ul> </li> <li><a href="#reentrancy">Reentrancy</a><ul> <li><a href="#nftmarketplacesol---continued">NftMarketplace.sol - Continued</a></li> <li><a href="#nftmarketplacesol---deploy-script">NftMarketplace.sol - Deploy Script</a></li> <li><a href="#nftmarketplacesol---tests">NftMarketplace.sol - Tests</a></li> <li><a href="#nftmarketplacesol---scripts">NftMarketplace.sol - Scripts</a></li> </ul> </li> <li><a href="#part-ii-moralis-front-end">Part II: Moralis Front End</a><ul> <li><a href="#what-is-moralis">What is Moralis?</a></li> <li><a href="#nextjs-setup-1">NextJS Setup</a></li> <li><a href="#adding-tailwind">Adding Tailwind</a></li> <li><a href="#introduction-to-indexing-in-web3">Introduction to Indexing in Web3</a></li> <li><a href="#connecting-moralis-to-our-local-hardhat-node">Connecting Moralis to our Local Hardhat Node</a></li> <li><a href="#moralis-event-sync">Moralis Event Sync</a><ul> <li><a href="#reset-local-chain">Reset Local Chain</a></li> </ul> </li> <li><a href="#moralis-cloud-functions">Moralis Cloud Functions</a><ul> <li><a href="#practice-resetting-the-local-chain">Practice Resetting the Local Chain</a></li> </ul> </li> <li><a href="#moralis-cloud-functions-ii">Moralis Cloud Functions II</a></li> <li><a href="#querying-the-moralis-database">Querying the Moralis Database</a></li> <li><a href="#rendering-the-nft-images">Rendering the NFT Images</a></li> <li><a href="#update-listing-modal">Update Listing Modal</a></li> <li><a href="#buy-nft-listing">Buy NFT Listing</a></li> <li><a href="#listing-nfts-for-sale">Listing NFTs for Sale</a></li> </ul> </li> <li><a href="#part-iii-thegraph-front-end">Part III: TheGraph Front End</a><ul> <li><a href="#introduction-9">Introduction</a></li> <li><a href="#what-is-the-graph">What is The Graph?</a></li> <li><a href="#building-a-subgraph">Building a Subgraph</a></li> <li><a href="#deploying-our-subgraph">Deploying our Subgraph</a></li> <li><a href="#reading-from-the-graph">Reading from The Graph</a></li> <li><a href="#hosting-our-dapp">Hosting our Dapp</a></li> </ul> </li> </ul> </ol> </details> <details> <summary><a href="#lesson-16-hardhat-upgrades">Lesson 16: Hardhat Upgrades</a></summary> <ol> <li><a href="#upgradeable-smart-contracts-overview">Upgradeable Smart Contracts Overview</a></li> <li><a href="#types-of-upgrades">Types of Upgrades</a></li> <li><a href="#delegatecall">Delegatecall</a></li> <li><a href="#small-proxy-example">Small Proxy Example</a></li> <li><a href="#transparent-upgradeable-smart-contract">Transparent Upgradeable Smart Contract</a></li> </ul> </ol> </details> <details> <summary><a href="#lesson-17-hardhat-daos">Lesson 17: Hardhat DAOs</a></summary> <ol> <li><a href="#introduction-10">Introduction</a></li> <li><a href="#what-is-a-dao">What is a DAO?</a></li> <li><a href="#how-to-build-a-dao">How to build a DAO</a></li> </ol> </details> <details> <summary><a href="#lesson-18-security--auditing">Lesson 18: Security & Auditing</a></summary> <ol> <li><a href="#introduction-11">Introduction</a></li> <li><a href="#slither">Slither</a></li> <li><a href="#fuzzing-and-eth-security-toolbox">Fuzzing and Eth Security Toolbox</a></li> <li><a href="#closing-thoughts">Closing Thoughts</a></li> </ol> </details> <details> <summary>More Resources</summary> <ul> <li><a href="#congratulations">Congratulations</a><ul> <li><a href="#where-do-i-go-now">Where do I go now?</a><ul> <li><a href="#learning-more">Learning More</a></li> <li><a href="#community">Community</a></li> <li><a href="#hackathons">Hackathons</a></li> </ul> </li> </ul> </li> </ul> </ul> </details>Lesson 0: The Edge of the Rabbit Hole
Welcome to the course!
⌨️ (00:00:00) Lesson 0: Welcome To Blockchain
Best Practices
- Follow the repository: While going through the course be 100% certain to follow along with the github repository. If you run into in an issue check the chronological-updates in the repo.
- Be Active in the community: Ask questions and engage with other developers going through the course in the discussions tab, be sure to go and say hello or gm! This space is different from the other industries, you don't have to be secretive; communicate, network and learn with others :)
- Learn at your own pace: It doesn't matter if it takes you a day, a week, a month or even a year. Progress >>> Perfection
- Take Breaks: You will exhaust your mind and recall less if you go all out and watch the entire course in one sitting. Suggested Strategy every 25 minutes take a 5 min break, and every 2 hours take a longer 30 min break
- Refer to Documentation: Things are constantly being updated, so whenever Patrick opens up some documentation, open it your end and maybe even have the code sample next to you.
Lesson 1: Blockchain Basics
⌨️ (00:09:05) Lesson 1: Blockchain Basics
What is a Blockchain? What does a blockchain do?
- Bitcoin Whitepaper
- Ethereum Whitepaper
- What is a Smart Contract?
- Nick Szabo
- Hybrid Smart Contracts
- Blockchain Oracles
- Terminology
- Web3
- What is a blockchain
The Purpose Of Smart Contracts
⌨️ (00:18:27) The Purpose of Smart Contracts
- 🎥 Original Video
- 🦬 My ETH Denver Talk
- 🍔 McDonalds Scandal
- ⛓ More on the evolution of agreements
- ✍️ What is a Smart Contract?
- 🧱 How does a blockchain work?
- 🔮 Chainlink & Oracles
Other Blockchain Benefits
⌨️ (00:30:41) Other Blockchain Benefits
- Decentralized
- Transparency & Flexibility
- Speed & Efficiency
- Security & Immutability
- Counterparty Risk Removal
- Trust Minimized Agreements
What have Smart Contracts done so far?
⌨️ (00:36:36) What have Smart Contracts done so far?
Making Your First Transaction
⌨️ (00:39:17) Making Your First Transaction
- Metamask Download Link
- Etherscan
- Sepolia Etherscan
- Sepolia Faucet (Check the link token contracts page)
- NOTE: The Chainlink documentation always has the most up to date faucets on their link token contracts page. If the faucet above is broken, check the chainlink documentation for the most up to date faucet.
- OR, use the Sepolia ETH Faucet, just be sure to swap your metamask to Sepolia!
Gas I: Introduction to Gas
⌨️ (00:58:59) Gas I: Introduction to Gas
How Do Blockchains Work?
⌨️ (01:05:32) How Do Blockchains Work
Signing Transactions
⌨️ (01:22:55) Signing Transactions
Gas II
⌨️ (01:30:22) Gas II: Block Rewards & EIP 1559
- Block Rewards
- Advanced Gas
- EIP 1559
- GWEI, WEI, and ETH
Gas II Summary
High-Level Blockchain Fundamentals
[⌨️ (01:39:32) High-Level Blockchain Fundamentals]https://www.youtube.com/watch?v=gyMwXuJrbJQ&t=5972s()
🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed Blockchain Basics! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
Lesson 2: Welcome to Remix! Simple Storage
⌨️ (02:01:16) Lesson 2: Welcome to Remix! Simple Storage
💻 Code: https://github.com/PatrickAlphaC/simple-storage-fcc
Introduction
Setting Up Your First Contract
⌨️ (02:05:18) Setting Up Your First Contract
- Versioning
- Take notes in your code!
- What is a software license
- SPDX License
- Compiling
- Contract Declaration
Basic Solidity: Types
⌨️ (02:12:28) Basic Solidity Types
- Types & Declaring Variables
uint256
,int256
,bool
,string
,address
,bytes32
- Solidity Types
- Bits and Bytes
- Default Initializations
- Comments
Basic Solidity: Functions
⌨️ (02:18:40) Basic Solidity Functions
- Functions
- Deploying a Contract
- Smart Contracts have addresses just like our wallets
- Calling a public state-changing Function
- Visibility
- Gas III | An example
- Scope
- View & Pure Functions
Basic Solidity: Arrays & Structs
⌨️ (02:35:30) Basic Solidity Arrays & Structs
- Structs
- Intro to Storage
- Arrays
- Dynamic & Fixed Sized
push
array function
Basic Solidity: Compiler Errors and Warnings
⌨️ (02:45:35) Basic Solidity Errors & Warnings
- Yellow: Warnings are Ok
- Red: Errors are not Ok
Memory, Storage, Calldata (Intro)
⌨️ (02:46:34) Basic Solidity Memory, Storage, & Calldata (Intro)
- 6 Places you can store and access data
- calldata
- memory
- storage
- code
- logs
- stack
Mappings
⌨️ (02:50:17) Basic Solidity Mappings
Deploying your First Contract
⌨️ (02:53:38) Deploying your First Contract
- A testnet or mainnet
- Connecting Metamask
- Find a faucet here
- See the faucets at the top of this readme!
- Interacting with Deployed Contracts
The EVM & A Recap of Lesson 2
⌨️ (03:03:07) The EVM & A Recap of Lesson 2
- The EVM
Lesson 3: Remix Storage Factory
⌨️ (03:05:34) Lesson 3: Remix Storage Factory
💻 Code: https://github.com/PatrickAlphaC/storage-factory-fcc
Introduction
Basic Solidity: Importing Contracts into other Contracts
⌨️ (03:07:29) Importing Contracts into other Contracts
Basic Solidity: Interacting with other Contracts
⌨️ (03:16:36) Interacting with other contracts
- To interact, you always need: ABI + Address
- ABI
Basic Solidity: Inheritance & Overrides
⌨️ (03:25:23) Inheritance & Overrides
Lesson 3 Recap
Lesson 4: Remix Fund Me
⌨️ (03:31:55) Lesson 4: Remix Fund Me
💻 Code: https://github.com/PatrickAlphaC/fund-me-fcc
Introduction
Sending ETH Through a Function & Reverts
Chainlink & Oracles
- What is a blockchain oracle?
- What is the oracle problem?
- Chainlink
- Chainlink Price Feeds (Data Feeds)
- Chainlink VRF
- Chainlink Keepers
- Chainlink API Calls
- Importing Tokens into your Metamask
- Request and Receive Chainlink Model
Review of Sending ETH and working with Chainlink
Interfaces & Price Feeds
Importing from GitHub & NPM
Floating Point Math in Solidity
- tuple
- Floating Point Numbers in Solidity
- Type Casting
- Gas Estimation Failed
- Someone should make an article explaining this error
Basic Solidity: Arrays & Structs II
Review of Interfaces, Importing from GitHub, & Math in Solidity
Libraries
SafeMath, Overflow Checking, and the "unchecked" keyword
Basic Solidity: For Loop
- For Loop
/* */
is another way to make comments
Basic Solidity: Resetting an Array
Sending ETH from a Contract
Basic Solidity: Constructor
Basic Solidity: Modifiers
Testnet Demo
Advanced Solidity
Immutable & Constant
- Immutable
- Constant
- Current ETH Gas Prices
- Don't stress about gas optimizations! (yet)
- Naming Conventions
Custom Errors
Receive & Fallback Functions
Lesson 4 Recap
🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed Solidity Basics! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
Lesson 5: Ethers.js Simple Storage
⌨️ (05:30:42) Lesson 5: Ethers.js Simple Storage
💻 Code: https://github.com/PatrickAlphaC/ethers-simple-storage-fcc
🧪 Alchemy: https://alchemy.com/?a=673c802981
Effective Debugging Strategies & Getting Help
⌨️ (5:30:46) Effective Debugging Stategies & Getting Help
- Tinker and isolate problem
- For this course, take at LEAST 15 minutes to figure out a bug.
- Google / Web Search the Exact problem
- Go to this GitHub Repo / Discussions
- Ask a question on a Forum like Stack Exchange Ethereum or Stack Overflow
- Format your questions!!
- Use Markdown
How to Debug Anything Video
Installation & Setup
Mac & Linux Setup
Windows Setup
- WSL
- When working in WSL, use Linux commands instead of Windows commands
- TroubleShooting
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
⚠️ Please use Gitpod as an absolute last resort
Gitpod
- Gitpod
- If using this, NEVER share a private key with real money on Gitpod
- Ideally you figure out the MacOS, Linux, or Windows install though
Local Development Introduction
CMD + K
orCTRL + K
clears the terminalmkdir ethers-simple-storage-fcc
code .
to open VSCode in a new VSCode window
Optional Javascript Crash Courses
-
Import your
SimpleStorage.sol
-
Format your solidity code with:
"[solidity]": {
"editor.defaultFormatter": "NomicFoundation.hardhat-solidity"
},
"[javascript]":{
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
In your .vscode/settings.json
file.
Tiny Javascript Refresher
Asynchronous Programming in Javascript
Compiling our Solidity
- Yarn Install
- solc-js
yarn add solc@0.8.7-fixed
- yarn scripts
Ganache & Networks
- Ganache
- Networks in Metamask
- RPC URL
- Geth
- JSON RPC Spec Playground
Introduction to Ethers.js
A Note on the await Keyword
Adding Transaction Overrides
Transaction Receipts
Sending a "raw" Transaction in Ethers.js
Interacting with Contracts in Ethers.js
Environment Variables
Better Private Key Management
Optional Prettier Formatting
Deploying to a Testnet or a Mainnet
- Alchemy
- Getting your private key from Metamask
CTRL + C
stops any terminal command
Verifying on Block Explorers from the UI
Alchemy Dashboard & The Mempool
Lesson 5 Recap
Typescript Ethers Simple Storage
Lesson 6: Hardhat Simple Storage
⌨️ (08:20:17) Lesson 6: Hardhat Simple Storage
💻 Code: https://github.com/PatrickAlphaC/hardhat-simple-storage-fcc
Introduction
Hardhat Setup
Troubleshooting Hardhat Setup
⌨️ (08:29:43) Troubleshooting Hardhat Setup
Hardhat Setup Continued
⌨️ (08:31:48) Hardhat Setup Continued
Deploying SimpleStorage from Hardhat
⌨️ (08:33:10) Deploying SimpleStorage from Hardhat
Networks in Hardhat
⌨️ (08:41:44) Networks in Hardhat
Programmatic Verification
⌨️ (08:51:16) Programmatic Verification
Interacting with Contracts in Hardhat
⌨️ (09:06:37) Interacting with Contracts in Hardhat
Artifacts Troubleshooting
⌨️ (09:09:42) Artifacts Troubleshooting
Custom Hardhat Tasks
⌨️ (09:10:52) Custom Hardhat Tasks
Hardhat Localhost Node
⌨️ (09:18:12) Hardhat Localhost Node
The Hardhat Console
⌨️ (09:23:11) The Hardhat Console
Hardhat Tests
Hardhat Gas Reporter
⌨️ (09:38:10) Hardhat Gas Reporter
Solidity Coverage
⌨️ (09:44:40) Solidity Coverage
Hardhat Waffle
Lesson 6 Recap
Typescript Hardhat Simple Storage
⌨️ (09:52:15) Typescript Hardhat Simple Storage
yarn add --dev @typechain/ethers-v5 @typechain/hardhat @types/chai @types/node @types/mocha ts-node typechain typescript
Lesson 7: Hardhat Fund Me
⌨️ (10:00:48) Lesson 7: Hardhat Fund Me
💻 Code: https://github.com/PatrickAlphaC/hardhat-fund-me-fcc
Introduction
Hardhat Setup - Fund Me
⌨️ (10:03:41) Hardhat Setup - Fund Me
Linting
Hardhat Setup - Fund Me - Continued
⌨️ (10:07:47) Hardhat Setup - Fund Me - Continued
Importing from NPM
⌨️ (10:09:38) Importing from NPM
Hardhat Deploy
Mocking
- Mocking
- Aave Github
- Chainlink Github
- Multiple Versions of Solidity
- Tags in hardhat
Utils Folder
Testnet Demo - Hardhat Fund Me
⌨️ (10:55:45) Testnet Demo - Hardhat Fund Me
- Hardhat Deploy Block Confirmations
TypeScript
- Code file (TypeScript edition)
- Define blockConfirmations in the
helper-hardhat-config.ts
file instead ofhardhat-config.js
.
Solidity Style Guide
⌨️ (11:00:10) Solidity Style Guide
Testing Fund Me
- Unit Testing
- Hardhat Deploy Fixtures
- ethers.getContract
- expect
- ethers.utils.parseUnits
- Waffle Chai Matchers
Breakpoints & Debugging
⌨️ (11:30:39) Breakpoints & Debugging
Gas III
console.log & Debugging
⌨️ (11:36:35) console.log & Debugging
Testing Fund Me II
⌨️ (11:37:31) Testing Fund Me II
Storage in Solidity
⌨️ (11:44:34) Storage in Solidity
Gas Optimizations using Storage Knowledge
⌨️ (11:52:38) Gas Optimizations using Storage Knowledge
- Opcodes
- Opcodes by Gas
- Opcodes by Gas
- Append
s_
to storage variables - Append
i_
to immutable variables - Caps lock and underscore constant variables
Solidity Chainlink Style Guide
⌨️ (12:05:29) Solidity Chainlink Style Guide
Storage Review
Staging Tests
Running Scripts on a Local Node
⌨️ (12:17:58) Running Scripts on a Local Node
Adding Scripts to your package.json
⌨️ (12:22:00) Adding Scripts to your package.json
Pushing to GitHub
⌨️ (12:25:17) Pushing to GitHub
- Github Quickstart
- What is Git?
- The quickstart that we follow in the video
- Learn about git and GitHub
🐸🐦 Tweet Me (add your repo in)!
Lesson 8: HTML / Javascript Fund Me (Full Stack / Front End)
⌨️ (12:32:57) Lesson 8: HTML / Javascript Fund Me (Full Stack / Front End)
💻 Code: https://github.com/PatrickAlphaC/html-fund-me-fcc
Introduction
How Websites work with Web3 Wallets
HTML Setup
- Live Server: ExtensionID: ritwickdey.LiveServer
Connecting HTML to Metamask
Javascript in it's own file
ES6 vs Nodejs
Sending a transaction from a Website
Resetting an Account in Metamask
MetaMask - RPC Error:
[ethjs-query] while formatting ouputs from RPC '{"value":{"code":-32603,"data":{"code":-32000,"message":"Nonce too high. Expected nonce to be 2 but got 4. Note that transactions can't be queued when automining."}}}'
Listening for Events and Completed Transactions
Input Forms
Reading from the Blockchain
Withdraw Function
Lesson 8 Recap
Optional Links:
Lesson 9: Hardhat Smart Contract Lottery
⌨️ (13:41:02) Lesson 9: Hardhat Smart Contract Lottery
💻 Code: https://github.com/PatrickAlphaC/hardhat-smartcontract-lottery-fcc
Introduction
Hardhat Setup - Smart Contract Lottery
- Install dependencies:
yarn add --dev @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers ethers @nomiclabs/hardhat-etherscan @nomiclabs/hardhat-waffle chai ethereum-waffle hardhat hardhat-contract-sizer hardhat-deploy hardhat-gas-reporter prettier prettier-plugin-solidity solhint solidity-coverage dotenv
- Install dependencies (Typescript version):
yarn add --dev @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers ethers @nomiclabs/hardhat-etherscan @nomiclabs/hardhat-waffle chai ethereum-waffle hardhat hardhat-contract-sizer hardhat-deploy hardhat-gas-reporter prettier prettier-plugin-solidity solhint solidity-coverage dotenv @typechain/ethers-v5 @typechain/hardhat @types/chai @types/node ts-node typechain typescript
Raffle.sol Setup
⌨️ (13:46:55) Raffle.sol Setup
Introduction to Events
⌨️ (13:54:02) Introduction to Events
Events in Raffle.sol
⌨️ (14:00:47) Events in Raffle.sol
Introduction to Chainlink VRF
⌨️ (14:02:30) Introduction to Chainlink VRF
Sub-Lesson: Chainlink VRF
Implementing Chainlink VRF - Introduction
⌨️ (14:09:53) Implementing Chainlink VRF
Hardhat Shorthand
Implementing Chainlink VRF - The Request
Implementing Chainlink VRF - The FulFill
Modulo
Introduction to Chainlink Keepers
Implementing Chainlink Keepers - checkUpkeep
Enums
Implementing Chainlink Keepers - checkUpkeep continued
- block.timestamp
Implementing Chainlink Keepers - performUpkeep
Code Cleanup
Deploying Raffle.sol
Mock Chainlink VRF Coordinator
Continued
Raffle.sol Unit Tests
- We use
async function
in the describe blocks at the start, but we correctly take them out later.
Testing Events & Chai Matchers
Continued I
Hardhat Methods & Time Travel
Continued II
Callstatic
Continued III
Massive Promise Test
Continued IV
Raffle.sol Staging Tests
Testing on a Testnet
Recommended LINK amounts for Sepolia Staging Test:
- Chainlink VRF: 2 LINK
- Chainlink Keepers: 8 LINK
Conclusion
Typescript - Smart Contract Lottery
🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed Hardhat Basics! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
Lesson 10: NextJS Smart Contract Lottery (Full Stack / Front End)
⌨️ (16:34:07) Lesson 10: NextJS Smart Contract Lottery (Full Stack / Front End)
💻 Code: https://github.com/PatrickAlphaC/nextjs-smartcontract-lottery-fcc
⚡️⚡️ Live Demo IPFS: ipfs://QmXwACyjcS8tL7UkYwimpqMqW9sKzSHUjE4uSZBSyQVuEH
⚡️⚡️ Live Demo Fleek: https://fancy-dream-3458.on.fleek.co/
Introduction
We move into using NextJS for our front end. NextJS is a React framework for building websites.
Optional Sub-Lesson: Full Stack Development & Other Libraries
- 6 Ways to connect your dapp to a wallet
- NextJS Crash Course
- Other React libraries:
- Other Full Stack Web3 Templates
- React being quite popular
- Why use react?
NextJS Setup
yarn create next-app .
Manual Header I
React Hooks
Manual Header II
useEffect Hook
Local Storage
isWeb3EnabledLoading
web3uikit
Introduction to Calling Functions in Nextjs
Automatic Constant Value UI Updater
runContractFunction
useState
Calling Functions in NextJS
useNotification
- Add
onError
to all yourrunContractFunction
calls
Reading & Displaying Contract Data
A Note about onSuccess
onSuccess
just checks to see if MetaMask sends the transaction, not
A Challenge to You
Tailwind & Styling
Introduction to Hosting your Site
⌨️ (18:12:50) Introdunction to Hosting your Site
IPFS
Hosting on IPFS
- IPFS Companion
- Brave Browser
yarn build && yarn next export
Hosting on IPFS & Filecoin using Fleek
⌨️ (18:25:45) Hosting on IPFS & Filecoin using Fleek
Filecoin Overview
⌨️ (18:31:28) Filecoin Overview
Lesson 10 Recap
Lesson 11: Hardhat Starter Kit
⌨️ (18:51:36) Lesson 11: Hardhat Starter Kit
💻 Code: https://github.com/smartcontractkit/hardhat-starter-kit
Lesson 12: Hardhat ERC20s
⌨️ (18:59:24) Lesson 12: Hardhat ERC20s
💻 Code: https://github.com/PatrickAlphaC/hardhat-erc20-fcc
What is an ERC? What is an EIP?
What is an ERC20?
Manually Creating an ERC20 Token
Creating an ERC20 Token with Openzeppelin
Lesson 12 Recap
Lesson 13: Hardhat DeFi & Aave
⌨️ (19:16:13) Lesson 13: Hardhat DeFi & Aave
💻 Code: https://github.com/PatrickAlphaC/hardhat-defi-fcc
What is DeFi?
What is Aave?
Programmatic Borrowing & Lending
WETH - Wrapped ETH
Forking Mainnet
Depositing into Aave
Borrowing from Aave
Repaying with Aave
Visualizing the Transactions
Lesson 13 Recap
Happy Bow-Tie Friday with Austin Griffith
More DeFi Learnings:
Lesson 14: Hardhat NFTs (EVERYTHING you need to know about NFTs)
⌨️ (20:28:51) Lesson 14: Hardhat NFTs
💻 Code: https://github.com/PatrickAlphaC/hardhat-nft-fcc
What is an NFT?
Code Overview
Hardhat Setup
Basic NFT
Write Tests
Random IPFS NFT
Mapping Chainlink VRF Requests
Creating Rare NFTs
Setting the NFT Image
Setting an NFT Mint Price
Deploy Script
Uploading Token Images with Pinata
Uploading Token URIs (metadata) with Pinata
Deploying
Tests
Dynamic SVG On-Chain NFT
What is an SVG?
Initial Code
Base64 Encoding
Advanced: EVM Opcodes, Encoding, and Calling
abi.encode & abi.encodePacked
- abi.encode
- abi.encodePacked Thanks to Alex Roan for his help on this session!
- Example Contract Creation Transaction What REALLY is the ABI?
- EVM Opcodes
- More EVM Opcodes
- Solidity Cheatsheet
- abi.encode vs abi.encodePacked
Introduction to Encoding Function Calls Directly
Introduction to Encoding Function Calls Recap
Encoding Function Calls Directly
Creating an NFT TokenURI on-Chain
Making the NFT Dynamic
Deploy Script
Deploying the NFTs to a Testnet
Lesson 14 Recap
Extra credit:
- Deconstructing Solidity
- Knowing and controlling your Smart Contract Address
- From Solidity to byte code
Lesson 15: NextJS NFT Marketplace (If you finish this lesson, you are a full-stack MONSTER!)
⌨️ (23:37:03) Lesson 15: NextJS NFT Marketplace (Full Stack / Front End)
Large Update, please read
Moralis has recently updated to a self-hosted server over their own server. For this, you can do one of the following:
- Learn how to run one yourself
- Follow along to learn the concepts of this more interactive app, without actually coding along
- Skip to the section where we interact with the graph
TL;DR: TheGraph code should work exactly the same as the video, however the Moralis code will not.
💻 Code:
- Backend (Contracts): https://github.com/PatrickAlphaC/hardhat-nft-marketplace-fcc
- Frontend (Moralis Indexer): https://github.com/PatrickAlphaC/nextjs-nft-marketplace-moralis-fcc
- Frontend (TheGraph Indexer): https://github.com/PatrickAlphaC/nextjs-nft-marketplace-thegraph-fcc
Special thanks to Matt Durkin for help with this section.
Introduction
Part I: NFT Marketplace Contracts
Hardhat Setup
NftMarketplace.sol
Reentrancy
NftMarketplace.sol - Continued
NftMarketplace.sol - Deploy Script
NftMarketplace.sol - Tests
NftMarketplace.sol - Scripts
Part II: Moralis Front End
What is Moralis?
NextJS Setup
Adding Tailwind
Introduction to Indexing in Web3
Connecting Moralis to our Local Hardhat Node
Moralis Event Sync
Reset Local Chain
Moralis Cloud Functions
- Moralis Cloud Functions
- Moralis Logging
- Hardhat Network Reference
- Moralis Database only confirms a transaction with a block confirmation - so we need to move blocks on our hardhat local node.
- Moralis Triggers
Practice Resetting the Local Chain
Moralis Cloud Functions II
Querying the Moralis Database
Rendering the NFT Images
Update Listing Modal
Buy NFT Listing
Listing NFTs for Sale
Part III: TheGraph Front End
Introduction
What is The Graph?
Building a Subgraph
Deploying our Subgraph
Reading from The Graph
Hosting our Dapp
🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed Front End Basics! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
Lesson 16: Hardhat Upgrades
⌨️ (28:53:11) Lesson 16: Hardhat Upgrades
💻 Code: https://github.com/PatrickAlphaC/hardhat-upgrades-fcc
Upgradable Smart Contracts Overview
- Optional Video
- [Links from Video]
Types of Upgrades
- Parameter
- Social Migrate
- Proxy
Delegatecall
Small Proxy Example
Transparent Upgradable Smart Contract
Lesson 17: Hardhat DAOs
⌨️ (29:45:24) Lesson 17: Hardhat DAOs
⬆️ Up-to-date code: https://github.com/PatrickAlphaC/dao-template
💻 Code from video: https://github.com/PatrickAlphaC/hardhat-dao-fcc
Introduction
What is a DAO?
How to build a DAO
- How to build a DAO
- That's Patrick
- PY Code
- Python Video
- Openzeppelin Governance
- Compound Governance
- Contract Wizard
- CastVoteBySig
Lesson 18: Security & Auditing
⌨️ (31:28:32) Lesson 18: Security & Auditing
💻 Code: https://github.com/PatrickAlphaC/hardhat-security-fcc
Introduction
Slither
Fuzzing and Eth Security Toolbox
Closing Thoughts
- Best Practices
- Attacks
- Damn Vulnerable Defi
- Ethernaut
- Some Auditors:
Congratulations
🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed The Course! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
Where do I go now?
Learning More
- CryptoZombies
- Patrick Collins
- Dapp University
- ChainShot
- Cami Ramos Garzon
- Albert Hu
- Ivan Liljeqvist
- Ally Haire
- Stephen Fluin
- Eat the Blocks
- Austin Griffith
- Nader Dabit
- Ethereum.org
Community
- Hardhat Discord
- Ethereum Python Community Discord
- Chainlink Discord
- Ethereum Discord
- Reddit ethdev
Hackathons
Be sure to check out project grant programs!
And make today an amazing day!
Thank you
Thanks to everyone who is taking, participating in, and working on this course. It's been a passion project and a data dump of everything I've learnt in the web3 space to get you up to speed quickly. Also, a big thank you to Chainlink Labs for encouraging this course to come to light-and to the many Chainlink Labs team members who helped with various assets!