• Stars
    star
    12,549
  • Rank 2,567 (Top 0.06 %)
  • Language
  • Created almost 3 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Learn Blockchain, Solidity, and Full Stack Web3 Development with Javascript

Web3, Full Stack Solidity, Smart Contract & Blockchain - Beginner to Expert ULTIMATE Course | Javascript Edition


Solidity, Blockchain, and Smart Contract Course โ€“ Beginner to Expert Javascript Tutorial


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: https://faucets.chain.link Backup Faucet: https://sepoliafaucet.com/

โš ๏ธ 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

Resources
  1. Testnet Faucets
  2. Resources For This Course
  3. Table of Contents
Lesson 0: The Edge of the Rabbit Hole
  1. Welcome to the course!
  2. Best Practices
Lesson 1: Blockchain Basics
  1. What is a Blockchain? What does a blockchain do?
  2. The Purpose Of Smart Contracts
  3. Other Blockchain Benefits
  4. What have Smart Contracts done so far?
  5. Making Your First Transaction
  6. Gas I: Introduction to Gas
  7. How Do Blockchains Work?
  8. Signing Transactions
  9. Gas II
  10. High-Level Blockchain Fundamentals
Lesson 2: Welcome to Remix! Simple Storage
  1. Introduction
  2. Setting Up Your First Contract
  3. Basic Solidity: Types
  4. Basic Solidity: Functions
  5. Basic Solidity: Arrays & Structs
  6. Basic Solidity: Compiler Errors and Warnings
  7. Memory, Storage, Calldata (Intro)
  8. Mappings
  9. Deploying your First Contract
  10. The EVM & A Recap of Lesson 2
Lesson 3: Remix Storage Factory
  1. Introduction
  2. Basic Solidity: Importing Contracts into other Contracts
  3. Basic Solidity: Interacting with other Contracts
  4. Basic Solidity: Inheritance & Overrides
  5. Lesson 3 Recap
Lesson 4: Remix Fund Me
  1. Introduction
  2. Sending ETH Through a Function & Reverts
  3. Chainlink & Oracles
  4. Review of Sending ETH and working with Chainlink
  5. Interfaces & Price Feeds
  6. Importing from GitHub & NPM
  7. Floating Point Math in Solidity
  8. Basic Solidity: Arrays & Structs II
  9. Review of Interfacs, Importing from GitHub, & Math in Solidity
  10. Libraries
  11. SafeMath, Overflow Checking, and the "unchecked" keywork
  12. Basic Solidity: For Loop
  13. Basic Solidity: Resetting an Array
  14. Sending ETH from a Contract
  15. Basic Solidity: Constructor
  16. Basic Solidity: Modifiers
  17. Testnet Demo
  18. Advanced Solidity
Lesson 5: Ethers.js Simple Storage
  1. Effective Debugging Strategies & Getting Help
  2. Installation & Setup
  3. Local Development Introduction
  4. Tiny Javascript Refresher
  5. Asynchronous Programming in Javascript
  6. Compiling our Solidity
  7. Ganache & Networks
  8. Introduction to Ethers.js
  9. Adding Transaction Overrides
  10. Transaction Receipts
  11. Sending a "raw" Transaction in Ethersjs
  12. Interacting with Contracts in Ethersjs
  13. Environment Variables
  14. Better Private Key Management
  15. Optional Prettier Formatting
  16. Deploying to a Testnet or a Mainnet
  17. Verifying on Block Explorers from the UI
  18. Alchemy Dashboard & The Mempool
  19. Lesson 5 Recap
Lesson 6: Hardhat Simple Storage
  1. Introduction
  2. Hardhat Setup
  3. Hardhat Setup Continued
  4. Deploying SimpleStorage from Hardhat
  5. Networks in Hardhat
  6. Programatic Verification
  7. Interacting with Contracts in Hardhat
  8. Artifacts Troubleshooting
  9. Custom Hardhat Tasks
  10. Hardhat Localhost Node
  11. The Hardhat Console
  12. Hardhat Tests
  13. Hardhat Gas Reporter
  14. Solidity Coverage
  15. Hardhat Waffle
  16. Lesson 6 Recap
Lesson 7: Hardhat Fund Me
  1. Introduction
  2. Hardhat Setup - Fund Me
  3. Linting
  4. Hardhat Setup - Fund Me - Continued
  5. Importing from NPM
  6. Hardhat Deploy
  7. Mocking
  8. Utils Folder
  9. Testnet Demo - Hardhat Fund Me
  10. Solidity Style Guide
  11. Testing Fund Me
  12. Breakpoints & Debugging
  13. Gas III:
  14. console.log & Debugging
  15. Testing Fund Me II
  16. Storage in Solidity
  17. Gas Optimizations using Storage Knowledge
  18. Solidity Chainlink Style Guide
  19. Storage Review
  20. Staging Tests
  21. Running Scripts on a Local Node
  22. Adding Scripts to your package.json
  23. Pushing to GitHub
  24. ๐Ÿธ๐Ÿฆ Tweet Me (add your repo in)!
Lesson 8: HTML / Javascript Fund Me (Full Stack / Front End)
  1. Introduction
  2. How Websites work with Web3 Wallets
  3. HTML Setup
  4. Connecting HTML to Metamask
  5. Javascript in it's own file
  6. ES6 vs Nodejs
  7. Sending a transaction from a Website
  8. Resetting an Account in Metamask
  9. Listening for Events and Completed Transactions
  10. Input Forms
  11. Reading from the Blockchain
  12. Withdraw Function
  13. Lesson 8 Recap
Lesson 9: Hardhat Smart Contract Lottery
  1. Introduction
  2. Hardhat Setup - Smart Contract Lottery
  3. Raffle.sol Setup
  4. Introduction to Events
  5. Events in Raffle.sol
  6. Introduction to Chainlink VRF
  7. Implementing Chainlink VRF - Introduction
  8. Implementing Chainlink VRF - The Request
  9. Implementing Chainlink VRF - The FulFill
  10. Introduction to Chainlink Keepers
  11. Implementing Chainlink Keepers - checkUpkeep
  12. Implementing Chainlink Keepers - checkUpkeep continued
  13. Implementing Chainlink Keepers - performUpkeep
  14. Code Cleanup
  15. Deploying Raffle.sol
  16. Raffle.sol Unit Tests
  17. Hardhat Methods & Time Travel
  18. Callstatic
  19. Raffle.sol Staging Tests
  20. Testing on a Testnet
  21. Conclusion
  22. Typescript - Smart Contract Lottery
Lesson 10: NextJS Smart Contract Lottery (Full Stack / Front End)
  1. Introduction
  2. NextJS Setup
  3. Manual Header I
  4. Manual Header II
  5. useEffect Hook
  6. Local Storage
  7. isWeb3EnabledLoading
  8. web3uikit
  9. Introduction to Calling Functions in Nextjs
  10. useState
  11. Calling Functions in NextJS
  12. useNotification
  13. Reading & Displaying Contract Data
  14. A Note about onSuccess
  15. A Challenge to You
  16. Tailwind & Styling
  17. Introduction to Hosting your Site
  18. IPFS
  19. Hosting on IPFS
  20. Hosting on IPFS & Filecoin using Fleek
  21. Filecoin Overview
  22. Lesson 10 Recap
Lesson 11: Hardhat Starter Kit
Lesson 12: Hardhat ERC20s
  1. What is an ERC? What is an EIP?
  2. What is an ERC20?
  3. Manually Creating an ERC20 Token
  4. Creating an ERC20 Token with Openzeppelin
  5. Lesson 12 Recap
Lesson 13: Hardhat DeFi & Aave
  1. What is DeFi?
  2. What is Aave?
  3. Programatic Borrowing & Lending
  4. WETH - Wrapped ETH
  5. Forking Mainnet
  6. Depositing into Aave
  7. Borrowing from Aave
  8. Repaying with Aave
  9. Visualizing the Transactions
  10. Lesson 13 Recap
  11. Happy Bow-Tie Friday with Austin Griffith
Lesson 14: Hardhat NFTs (EVERYTHING you need to know about NFTs)
  1. What is an NFT?
  2. Code Overview
  3. Hardhat Setup
  4. Basic NFT
  5. Random IPFS NFT
  6. Dynamic SVG On-Chain NFT
  7. Advanced: EVM Opcodes, Encoding, and Calling
  8. Deploying the NFTs to a Testnet
  9. Lesson 14 Recap
Lesson 15: NextJS NFT Marketplace (If you finish this lesson, you are a full-stack MONSTER!)
  1. Introduction
  2. Part I: NFT Marketplace Contracts
  3. Reentrancy
  4. Part II: Moralis Front End
  5. Part III: TheGraph Front End
Lesson 16: Hardhat Upgrades
  1. Upgradeable Smart Contracts Overview
  2. Types of Upgrades
  3. Delegatecall
  4. Small Proxy Example
  5. Transparent Upgradeable Smart Contract
Lesson 17: Hardhat DAOs
  1. Introduction
  2. What is a DAO?
  3. How to build a DAO
Lesson 18: Security & Auditing
  1. Introduction
  2. Slither
  3. Fuzzing and Eth Security Toolbox
  4. Closing Thoughts
More Resources

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?

The Purpose Of Smart Contracts

โŒจ๏ธ (00:18:27) The Purpose of Smart Contracts

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

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

Gas II Summary

โŒจ๏ธ (01:36:44) 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

โŒจ๏ธ (02:03:05) Introduction

Setting Up Your First Contract

โŒจ๏ธ (02:05:18) Setting Up Your First Contract

Basic Solidity: Types

โŒจ๏ธ (02:12:28) Basic Solidity Types

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

โŒจ๏ธ (03:06:06) 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

โŒจ๏ธ (03:30:29) 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

Review of Sending ETH and working with Chainlink

Interfaces & Price Feeds

Importing from GitHub & NPM

Floating Point Math in Solidity

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

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

  1. Tinker and isolate problem
    1. For this course, take at LEAST 15 minutes to figure out a bug.
  2. Google / Web Search the Exact problem
    1. Go to this GitHub Repo / Discussions
  3. Ask a question on a Forum like Stack Exchange Ethereum or Stack Overflow
    1. Format your questions!!
    2. 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 or CTRL + K clears the terminal
  • mkdir ethers-simple-storage-fcc
  • code . to open VSCode in a new VSCode window

Optional Javascript Crash Courses

    "[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

Ganache & Networks

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

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

โŒจ๏ธ (08:20:19) Introduction

Hardhat Setup

โŒจ๏ธ (08:22:47) 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

โŒจ๏ธ (09:26:13) Hardhat Tests

Hardhat Gas Reporter

โŒจ๏ธ (09:38:10) Hardhat Gas Reporter

Solidity Coverage

โŒจ๏ธ (09:44:40) Solidity Coverage

Hardhat Waffle

โŒจ๏ธ (09:47:02) Hardhat Waffle

Lesson 6 Recap

โŒจ๏ธ (09:47:37) 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

โŒจ๏ธ (10:00:50) Introduction

Hardhat Setup - Fund Me

โŒจ๏ธ (10:03:41) Hardhat Setup - Fund Me

Linting

โŒจ๏ธ (10:06:20) 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

โŒจ๏ธ (10:10:43) Hardhat Deploy

Mocking

โŒจ๏ธ (10:21:05) Mocking

Utils Folder

โŒจ๏ธ (10:52:51) 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 of hardhat-config.js.

Solidity Style Guide

โŒจ๏ธ (11:00:10) Solidity Style Guide

Testing Fund Me

โŒจ๏ธ (11:08:36) Testing Fund Me

Breakpoints & Debugging

โŒจ๏ธ (11:30:39) Breakpoints & Debugging

Gas III

โŒจ๏ธ (11:33:40) 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

Solidity Chainlink Style Guide

โŒจ๏ธ (12:05:29) Solidity Chainlink Style Guide

Storage Review

โŒจ๏ธ (12:09:59) Storage Review

Staging Tests

โŒจ๏ธ (12:11:43) 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

๐Ÿธ๐Ÿฆ 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

โŒจ๏ธ (13:43:43) Hardhat Setup

  • 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

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 your runContractFunction 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

โŒจ๏ธ (18:15:14) IPFS

Hosting on IPFS

โŒจ๏ธ (18:18:51) Hosting on IPFS

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

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:

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:

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

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

Types of Upgrades

  1. Parameter
  2. Social Migrate
  3. Proxy
    1. Proxy Gotchas
      1. Function Collisions
      2. Storage Collisions
    2. Metamorphic Upgrades
    3. Transparent
    4. UUPS
    5. Diamond

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

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

Congratulations

๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ Completed The Course! ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ๐ŸŽŠ

Where do I go now?

Learning More

Community

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!

Patrick Collins Twitter Patrick Collins YouTube Patrick Collins Linkedin Patrick Collins Medium

More Repositories

1

full-blockchain-solidity-course-py

Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition
10,703
star
2

chainlink

node of the decentralized oracle network, bridging on and off-chain computation
Go
6,990
star
3

hardhat-starter-kit

A repo for boilerplate code for testing, deploying, and shipping chainlink solidity code.
JavaScript
1,203
star
4

chainlink-mix

Working with smart contracts with eth-brownie, python, and Chainlink.
Solidity
484
star
5

defi-minimal

This repo is dedicated to making minimal repos of existing defi primatives.
JavaScript
473
star
6

documentation

https://docs.chain.link The Chainlink developer documentation website for Smart Contract Devs and Node Operators
MDX
406
star
7

foundry-starter-kit

Solidity
331
star
8

external-adapters-js

Monorepo containing JavaScript implementation of external adapters
TypeScript
270
star
9

truffle-starter-kit

An example smart contract utilizing Chainlink
JavaScript
258
star
10

starter-kits

A repo of starter kits for working with various languages and frameworks across the smart contract ecosystem.
238
star
11

foundry-starter-kit-old

Solidity
204
star
12

smart-contract-examples

Example and sample projects
Solidity
188
star
13

solana-starter-kit

Example code for using Chainlink on Solana
JavaScript
172
star
14

chainlink-brownie-contracts

A repository for automatically using the latest chainlink repo from the core chainlink repo.
Solidity
168
star
15

chainlink-ruby

Easily connect your applications to blockchains
Ruby
157
star
16

Web3_tutorial_Chinese

Solidity
152
star
17

functions-hardhat-starter-kit

JavaScript
148
star
18

chainlink-polkadot

Go
139
star
19

LinkToken

LINK Token Contracts for the Chainlink Network
Solidity
132
star
20

ccip

Cross Chain Interoperability Protocol
Go
122
star
21

huff-starter-kit

A template repo to work with huff smart contracts and learn about low level EVM opcodes. Also Horse โ™˜.
Solidity
101
star
22

apeworx-starter-kit

A repo dedicated to showing how to make smart contracts in a purely pythonic environment
Python
90
star
23

chainlink-solana

Go
81
star
24

blockchain-developer-hub

Dive into blockchain and smart contract development.
JavaScript
80
star
25

ccip-starter-kit-foundry

This project demonstrates a couple of basic Chainlink CCIP use cases
Solidity
75
star
26

chainlink-fullstack

Full stack starter project showcasing Chainlink products on Ethereum (EVM)
TypeScript
68
star
27

libocr

libocr consists of a Go library and a set of Solidity smart contracts that implement the Chainlink Offchain Reporting Protocol
Go
68
star
28

hardhat-chainlink

Integrates Chainlink into Hardhat projects. This package is currently in the BETA testing phase and is not recommended for production usage yet.
TypeScript
65
star
29

solidity-cborutils

A library for encoding CBOR in Solidity.
Solidity
64
star
30

dapptools-starter-kit

Solidity
63
star
31

ccip-cross-chain-nft

This project demonstrates how to mint an NFT on one blockchain from another blockchain using Chainlink CCIP
Solidity
62
star
32

ccip-read

TypeScript
60
star
33

chainlink-testing-framework

A testing framework for smart contracts and Chainlink nodes
Go
60
star
34

foundry-chainlink-toolkit

A plugin to use Chainlink products/services in Foundry
Solidity
59
star
35

chainlink-starknet

Go
58
star
36

ccip-starter-kit-hardhat

This project demonstrates a couple of basic Chainlink CCIP use cases
TypeScript
58
star
37

prediction-game

Rugby prediction game using Chainlink Functions, Automation, and CCIP.
TypeScript
56
star
38

chainlink-local

The Chainlink CCIP Local Simulator, visit documentation by clicking the link below:
Solidity
49
star
39

ccip-defi-lending

CCIP Launch Defi Demo
JavaScript
46
star
40

smart-contract-db

This repository is an archive. This project has been superseded by blockchain.education https://github.com/smartcontractkit/blockchain-developer-hub
TypeScript
44
star
41

external-initiator

Initiate Chainlink job runs from external sources
Go
39
star
42

chainlink-solana-demo

Showing how to deploy a Solana program using Chainlink Price Feeds
TypeScript
37
star
43

chainlink-automation-templates

Real-world sample projects using Chainlink Automation
Solidity
35
star
44

usechainlinkfunctions

TypeScript
31
star
45

functions-toolkit

An NPM package with collection of tools that can be used for working with Chainlink Functions.
TypeScript
26
star
46

near-protocol-contracts

Rust
26
star
47

chainlink-common

SDK for building Chainlink Services and Plugins
Go
25
star
48

chainlink-cosmos

Go
25
star
49

env-enc

TypeScript
25
star
50

ccip-cross-chain-name-service

This project is an educational example of how to create a minimal cross-chain name service using Chainlink CCIP
TypeScript
25
star
51

functions-deepdive-constellation2023

Deepdive Workshop For Constellation 2023 Hackathon
JavaScript
24
star
52

run-functions-dapp

Demo dApp using Chainlink Functions to bring web2 data on-chain.
TypeScript
24
star
53

wasp

Protocol-agnostic load testing library for Go
Go
24
star
54

devnet

An Ethereum development network with preset configs for easy testing.
Makefile
22
star
55

Blockchain-RPC-Exporter

Prometheus exporter for EVM compatible RPC endpoints.
Python
20
star
56

ccip-owner-contracts

A set of smart contracts used for administering Chainlink contracts, most notably CCIP
Solidity
18
star
57

chainlink-functions-demo-app

TypeScript
18
star
58

schemas

specification for offering and requesting off-blockchain services
17
star
59

paypal-adapter

TypeScript
17
star
60

chainlink-github-actions

Common action to run chainlink-testing-framework based tests in github ci
TypeScript
16
star
61

risk-management-network

Rust
16
star
62

wei_watchers

A service for push notifications of Ethereum logs and account balances.
Ruby
15
star
63

chain-selectors

Go
15
star
64

arbitrum-quickstart

JavaScript
14
star
65

ccip-tic-tac-toe

TypeScript
14
star
66

solc-api

minimal Solidity compiler service
JavaScript
14
star
67

chainlink-env

Chainlink k8s environment library
Go
14
star
68

datastreams-demo

Demo dApp using Chainlink Data Streams.
TypeScript
13
star
69

operator-ui

TypeScript
13
star
70

hello_chainlink

chainlink demos
JavaScript
12
star
71

chainlink-staking-v0.2-public-guide

12
star
72

wsrpc

A bi-directional Websockets RPC library
Go
12
star
73

quickstarts-historical-prices-api

TypeScript
12
star
74

functions-lens-eventbrite

Solidity
12
star
75

tdh2

An implementation of the TDH2 protocol by Shoup & Gennaro (paper link https://www.shoup.net/papers/thresh1.pdf)
Go
11
star
76

chainlink-RSK

Solidity
11
star
77

functions-the-graph-uniswap

Solidity
11
star
78

rwa-tokenization

TypeScript
11
star
79

chainlink-automation

Go
10
star
80

chainlink-data-streams

Go
10
star
81

workshop-distributed-news

Solidity
10
star
82

solana-prediction-game

JavaScript
10
star
83

builder

A docker build file for chainlink
Dockerfile
10
star
84

chainlink-vrf

OCR2VRF (in development, do not use in production)
Go
10
star
85

ccip-liquidation-protector

This project demonstrates how to automate preventing DeFi liquidations & optimizing interest rates on multiple blockchains using Chainlink CCIP, Chainlink Automation and Chainlink Functions
TypeScript
10
star
86

cairo-starter-kit

The boilerplate code for getting started with the usage of Chainlink services on Starknet
TypeScript
9
star
87

ea-framework-js

TypeScript
9
star
88

hardhat-network

Deploys a basic hardhat chain for testing
Dockerfile
9
star
89

bq-example-contract

JavaScript
8
star
90

.github

TypeScript
8
star
91

chainlink-node-compose

Docker Compose script for launching multiple chainlink nodes
Shell
8
star
92

substrate-adapter

Go
7
star
93

link-token-sidechain-evm

LINK Token On EVM Sidechains
Solidity
7
star
94

push-gha-metrics-action

Shell
7
star
95

DEVREL-collaborative-nft-tutorial

Solidity
7
star
96

blockchain-ecosystem-map

JavaScript
7
star
97

timelock-worker

Daemon to poll and execute scheduled transactions from a Timelock contract.
Go
7
star
98

chainlink-solhint-rules

CLL custom Solhint rules
JavaScript
7
star
99

functions-google-bigquery

Demonstration of accessing data from Google BigQuery via Chainlink Functions
JavaScript
6
star
100

chainlink-terra-feeds-demo

Showing how to deploy a Terra smart contract which utilizes Chainlink Data Feeds
Rust
6
star