Learn Blockchain, Solidity, and Full Stack Web3 Development with Javascript
14,048
157 commits
updated Jun 12, 2024
ℹ️ 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.
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: 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.
onSuccess⌨️ (00:00:00) Lesson 0: Welcome To Blockchain
⌨️ (00:09:05) Lesson 1: Blockchain Basics
⌨️ (00:18:27) The Purpose of Smart Contracts
⌨️ (00:30:41) Other Blockchain Benefits
⌨️ (00:36:36) What have Smart Contracts done so far?
⌨️ (00:39:17) Making Your First Transaction
⌨️ (00:58:59) Gas I: Introduction to Gas
⌨️ (01:05:32) How Do Blockchains Work
⌨️ (01:22:55) Signing Transactions
⌨️ (01:30:22) Gas II: Block Rewards & EIP 1559
[⌨️ (01:39:32) High-Level Blockchain Fundamentals]https://www.youtube.com/watch?v=gyMwXuJrbJQ&t=5972s()
🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed Blockchain Basics! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
⌨️ (02:01:16) Lesson 2: Welcome to Remix! Simple Storage
💻 Code: https://github.com/PatrickAlphaC/simple-storage-fcc
⌨️ (02:05:18) Setting Up Your First Contract
⌨️ (02:12:28) Basic Solidity Types
uint256, int256, bool, string, address, bytes32⌨️ (02:18:40) Basic Solidity Functions
⌨️ (02:35:30) Basic Solidity Arrays & Structs
push array function⌨️ (02:45:35) Basic Solidity Errors & Warnings
⌨️ (02:46:34) Basic Solidity Memory, Storage, & Calldata (Intro)
⌨️ (02:50:17) Basic Solidity Mappings
⌨️ (02:53:38) Deploying your First Contract
⌨️ (03:03:07) The EVM & A Recap of Lesson 2
⌨️ (03:05:34) Lesson 3: Remix Storage Factory
💻 Code: https://github.com/PatrickAlphaC/storage-factory-fcc
⌨️ (03:07:29) Importing Contracts into other Contracts
⌨️ (03:16:36) Interacting with other contracts
⌨️ (03:25:23) Inheritance & Overrides
⌨️ (03:31:55) Lesson 4: Remix Fund Me
💻 Code: https://github.com/PatrickAlphaC/fund-me-fcc
/* */ is another way to make comments🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed Solidity Basics! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
⌨️ (05:30:42) Lesson 5: Ethers.js Simple Storage
💻 Code: https://github.com/PatrickAlphaC/ethers-simple-storage-fcc
🧪 Alchemy: https://alchemy.com/?a=673c802981
⌨️ (5:30:46) Effective Debugging Stategies & Getting Help
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash⚠️ Please use Gitpod as an absolute last resort
CMD + K or CTRL + K clears the terminalmkdir ethers-simple-storage-fcccode . to open VSCode in a new VSCode windowImport 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.
yarn add solc@0.8.7-fixedCTRL + C stops any terminal command⌨️ (08:20:17) Lesson 6: Hardhat Simple Storage
💻 Code: https://github.com/PatrickAlphaC/hardhat-simple-storage-fcc
⌨️ (08:29:43) Troubleshooting Hardhat Setup
⌨️ (08:31:48) Hardhat Setup Continued
⌨️ (08:33:10) Deploying SimpleStorage from Hardhat
⌨️ (08:41:44) Networks in Hardhat
⌨️ (08:51:16) Programmatic Verification
⌨️ (09:06:37) Interacting with Contracts in Hardhat
⌨️ (09:09:42) Artifacts Troubleshooting
⌨️ (09:10:52) Custom Hardhat Tasks
⌨️ (09:18:12) Hardhat Localhost Node
⌨️ (09:23:11) The Hardhat Console
⌨️ (09:38:10) Hardhat Gas Reporter
⌨️ (09:44:40) Solidity Coverage
⌨️ (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
⌨️ (10:00:48) Lesson 7: Hardhat Fund Me
💻 Code: https://github.com/PatrickAlphaC/hardhat-fund-me-fcc
⌨️ (10:03:41) Hardhat Setup - Fund Me
⌨️ (10:07:47) Hardhat Setup - Fund Me - Continued
⌨️ (10:09:38) Importing from NPM
⌨️ (10:55:45) Testnet Demo - Hardhat Fund Me
helper-hardhat-config.ts file instead of hardhat-config.js.⌨️ (11:00:10) Solidity Style Guide
⌨️ (11:30:39) Breakpoints & Debugging
⌨️ (11:36:35) console.log & Debugging
⌨️ (11:37:31) Testing Fund Me II
⌨️ (11:44:34) Storage in Solidity
⌨️ (11:52:38) Gas Optimizations using Storage Knowledge
s_ to storage variablesi_ to immutable variables⌨️ (12:05:29) Solidity Chainlink Style Guide
⌨️ (12:17:58) Running Scripts on a Local Node
⌨️ (12:22:00) Adding Scripts to your package.json
⌨️ (12:25:17) Pushing to GitHub
⌨️ (12:32:57) Lesson 8: HTML / Javascript Fund Me (Full Stack / Front End)
💻 Code: https://github.com/PatrickAlphaC/html-fund-me-fcc
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."}}}'
⌨️ (13:41:02) Lesson 9: Hardhat Smart Contract Lottery
💻 Code: https://github.com/PatrickAlphaC/hardhat-smartcontract-lottery-fcc
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
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
⌨️ (13:46:55) Raffle.sol Setup
⌨️ (13:54:02) Introduction to Events
⌨️ (14:00:47) Events in Raffle.sol
⌨️ (14:02:30) Introduction to Chainlink VRF
⌨️ (14:09:53) Implementing Chainlink VRF
async function in the describe blocks at the start, but we correctly take them out later.🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed Hardhat Basics! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
⌨️ (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/
We move into using NextJS for our front end. NextJS is a React framework for building websites.
yarn create next-app .
onError to all your runContractFunction callsonSuccessonSuccess just checks to see if MetaMask sends the transaction, not⌨️ (18:12:50) Introdunction to Hosting your Site
yarn build && yarn next export⌨️ (18:25:45) Hosting on IPFS & Filecoin using Fleek
⌨️ (18:31:28) Filecoin Overview
⌨️ (18:51:36) Lesson 11: Hardhat Starter Kit
💻 Code: https://github.com/smartcontractkit/hardhat-starter-kit
⌨️ (18:59:24) Lesson 12: Hardhat ERC20s
💻 Code: https://github.com/PatrickAlphaC/hardhat-erc20-fcc
⌨️ (19:16:13) Lesson 13: Hardhat DeFi & Aave
💻 Code: https://github.com/PatrickAlphaC/hardhat-defi-fcc
⌨️ (20:28:51) Lesson 14: Hardhat NFTs
💻 Code: https://github.com/PatrickAlphaC/hardhat-nft-fcc
Extra credit:
⌨️ (23:37:03) Lesson 15: NextJS NFT Marketplace (Full Stack / Front End)
Moralis has recently updated to a self-hosted server over their own server. For this, you can do one of the following:
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.
🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed Front End Basics! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
⌨️ (28:53:11) Lesson 16: Hardhat Upgrades
💻 Code: https://github.com/PatrickAlphaC/hardhat-upgrades-fcc
⌨️ (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
⌨️ (31:28:32) Lesson 18: Security & Auditing
💻 Code: https://github.com/PatrickAlphaC/hardhat-security-fcc
🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed The Course! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
Be sure to check out project grant programs!
And make today an amazing day!
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!
(top 24 of 32)
205 followers · starred Mar 2023
15 followers · starred Jul 2022
57 followers · starred Jun 2023
195 followers · starred May 2022
Learn Blockchain, Solidity, and Full Stack Web3 Development with Javascript
14,048
157 commits
updated Jun 12, 2024
ℹ️ 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.
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: 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.
onSuccess⌨️ (00:00:00) Lesson 0: Welcome To Blockchain
⌨️ (00:09:05) Lesson 1: Blockchain Basics
⌨️ (00:18:27) The Purpose of Smart Contracts
⌨️ (00:30:41) Other Blockchain Benefits
⌨️ (00:36:36) What have Smart Contracts done so far?
⌨️ (00:39:17) Making Your First Transaction
⌨️ (00:58:59) Gas I: Introduction to Gas
⌨️ (01:05:32) How Do Blockchains Work
⌨️ (01:22:55) Signing Transactions
⌨️ (01:30:22) Gas II: Block Rewards & EIP 1559
[⌨️ (01:39:32) High-Level Blockchain Fundamentals]https://www.youtube.com/watch?v=gyMwXuJrbJQ&t=5972s()
🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed Blockchain Basics! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
⌨️ (02:01:16) Lesson 2: Welcome to Remix! Simple Storage
💻 Code: https://github.com/PatrickAlphaC/simple-storage-fcc
⌨️ (02:05:18) Setting Up Your First Contract
⌨️ (02:12:28) Basic Solidity Types
uint256, int256, bool, string, address, bytes32⌨️ (02:18:40) Basic Solidity Functions
⌨️ (02:35:30) Basic Solidity Arrays & Structs
push array function⌨️ (02:45:35) Basic Solidity Errors & Warnings
⌨️ (02:46:34) Basic Solidity Memory, Storage, & Calldata (Intro)
⌨️ (02:50:17) Basic Solidity Mappings
⌨️ (02:53:38) Deploying your First Contract
⌨️ (03:03:07) The EVM & A Recap of Lesson 2
⌨️ (03:05:34) Lesson 3: Remix Storage Factory
💻 Code: https://github.com/PatrickAlphaC/storage-factory-fcc
⌨️ (03:07:29) Importing Contracts into other Contracts
⌨️ (03:16:36) Interacting with other contracts
⌨️ (03:25:23) Inheritance & Overrides
⌨️ (03:31:55) Lesson 4: Remix Fund Me
💻 Code: https://github.com/PatrickAlphaC/fund-me-fcc
/* */ is another way to make comments🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed Solidity Basics! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
⌨️ (05:30:42) Lesson 5: Ethers.js Simple Storage
💻 Code: https://github.com/PatrickAlphaC/ethers-simple-storage-fcc
🧪 Alchemy: https://alchemy.com/?a=673c802981
⌨️ (5:30:46) Effective Debugging Stategies & Getting Help
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash⚠️ Please use Gitpod as an absolute last resort
CMD + K or CTRL + K clears the terminalmkdir ethers-simple-storage-fcccode . to open VSCode in a new VSCode windowImport 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.
yarn add solc@0.8.7-fixedCTRL + C stops any terminal command⌨️ (08:20:17) Lesson 6: Hardhat Simple Storage
💻 Code: https://github.com/PatrickAlphaC/hardhat-simple-storage-fcc
⌨️ (08:29:43) Troubleshooting Hardhat Setup
⌨️ (08:31:48) Hardhat Setup Continued
⌨️ (08:33:10) Deploying SimpleStorage from Hardhat
⌨️ (08:41:44) Networks in Hardhat
⌨️ (08:51:16) Programmatic Verification
⌨️ (09:06:37) Interacting with Contracts in Hardhat
⌨️ (09:09:42) Artifacts Troubleshooting
⌨️ (09:10:52) Custom Hardhat Tasks
⌨️ (09:18:12) Hardhat Localhost Node
⌨️ (09:23:11) The Hardhat Console
⌨️ (09:38:10) Hardhat Gas Reporter
⌨️ (09:44:40) Solidity Coverage
⌨️ (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
⌨️ (10:00:48) Lesson 7: Hardhat Fund Me
💻 Code: https://github.com/PatrickAlphaC/hardhat-fund-me-fcc
⌨️ (10:03:41) Hardhat Setup - Fund Me
⌨️ (10:07:47) Hardhat Setup - Fund Me - Continued
⌨️ (10:09:38) Importing from NPM
⌨️ (10:55:45) Testnet Demo - Hardhat Fund Me
helper-hardhat-config.ts file instead of hardhat-config.js.⌨️ (11:00:10) Solidity Style Guide
⌨️ (11:30:39) Breakpoints & Debugging
⌨️ (11:36:35) console.log & Debugging
⌨️ (11:37:31) Testing Fund Me II
⌨️ (11:44:34) Storage in Solidity
⌨️ (11:52:38) Gas Optimizations using Storage Knowledge
s_ to storage variablesi_ to immutable variables⌨️ (12:05:29) Solidity Chainlink Style Guide
⌨️ (12:17:58) Running Scripts on a Local Node
⌨️ (12:22:00) Adding Scripts to your package.json
⌨️ (12:25:17) Pushing to GitHub
⌨️ (12:32:57) Lesson 8: HTML / Javascript Fund Me (Full Stack / Front End)
💻 Code: https://github.com/PatrickAlphaC/html-fund-me-fcc
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."}}}'
⌨️ (13:41:02) Lesson 9: Hardhat Smart Contract Lottery
💻 Code: https://github.com/PatrickAlphaC/hardhat-smartcontract-lottery-fcc
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
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
⌨️ (13:46:55) Raffle.sol Setup
⌨️ (13:54:02) Introduction to Events
⌨️ (14:00:47) Events in Raffle.sol
⌨️ (14:02:30) Introduction to Chainlink VRF
⌨️ (14:09:53) Implementing Chainlink VRF
async function in the describe blocks at the start, but we correctly take them out later.🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed Hardhat Basics! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
⌨️ (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/
We move into using NextJS for our front end. NextJS is a React framework for building websites.
yarn create next-app .
onError to all your runContractFunction callsonSuccessonSuccess just checks to see if MetaMask sends the transaction, not⌨️ (18:12:50) Introdunction to Hosting your Site
yarn build && yarn next export⌨️ (18:25:45) Hosting on IPFS & Filecoin using Fleek
⌨️ (18:31:28) Filecoin Overview
⌨️ (18:51:36) Lesson 11: Hardhat Starter Kit
💻 Code: https://github.com/smartcontractkit/hardhat-starter-kit
⌨️ (18:59:24) Lesson 12: Hardhat ERC20s
💻 Code: https://github.com/PatrickAlphaC/hardhat-erc20-fcc
⌨️ (19:16:13) Lesson 13: Hardhat DeFi & Aave
💻 Code: https://github.com/PatrickAlphaC/hardhat-defi-fcc
⌨️ (20:28:51) Lesson 14: Hardhat NFTs
💻 Code: https://github.com/PatrickAlphaC/hardhat-nft-fcc
Extra credit:
⌨️ (23:37:03) Lesson 15: NextJS NFT Marketplace (Full Stack / Front End)
Moralis has recently updated to a self-hosted server over their own server. For this, you can do one of the following:
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.
🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed Front End Basics! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
⌨️ (28:53:11) Lesson 16: Hardhat Upgrades
💻 Code: https://github.com/PatrickAlphaC/hardhat-upgrades-fcc
⌨️ (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
⌨️ (31:28:32) Lesson 18: Security & Auditing
💻 Code: https://github.com/PatrickAlphaC/hardhat-security-fcc
🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed The Course! 🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
Be sure to check out project grant programs!
And make today an amazing day!
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!
(top 24 of 32)
205 followers · starred Mar 2023
15 followers · starred Jul 2022
57 followers · starred Jun 2023
195 followers · starred May 2022