Home

Awesome

Entire course and video content updated June 15, 2024

<div align="center"> <h1> Blockchain Developer, Smart Contract, & Solidity Career Path - Powered By AI - Beginner to Expert Course <br>| Foundry Edition 2024 |</h1> <p align="center"><strong>Learn smart contract development, and level up your career </strong></p>

Stargazers Forks Contributors Issues GPLv3 License

<p align="center"> <br /> <a href="https://cyfrin.io/"> <img src=".github/images/poweredbycyfrinbluehigher.png" width="145" alt=""/></a> <a href="https://updraft.cyfrin.io/courses/foundry"> <img src=".github/images/coursebadge.png" width="242.3" alt=""/></a> <br /> </p>

Welcome to the repository for the Blockchain Developer, Smart Contract, & Solidity Cyfrin Updraft - Career Path <br>| Powered By AI |<br>| Beginner to Expert Path |<br>| Foundry Edition 2024 |

</div>

This repository houses course resources and discussions for the course.

Please refer to this for an in-depth explanation of the content:

<!-- *Lol, my t-shirt is backwards in 2 of them* --> <br/> <p align="center"> <a href="https://youtu.be/-1GB6m39-rM?si=rImbgmtZZ0M1HA-0" target="_blank"> <img src="./thumbnails/2024-update.png" width="750" alt="Blockchain Developer, Smart Contract, & Solidity Course - Powered By AI"> </a> </p> <br/>

Cyfrin Updraft Courses:

YouTube Link

Table of Contents

All the sections on this repo are for several courses on the Solidity Developer Career path of Cyfrin Updraft.

<details> <summary>Resources</summary> <ol> <li><a href="#blockchain-developer-smart-contract--solidity-course---powered-by-ai---beginner-to-expert-course--foundry-edition-2024">Blockchain Developer, Smart Contract, & Solidity Course - Powered By AI - Beginner to Expert Course | Foundry Edition 2024</a></li> <li><a href="#table-of-contents">Table of Contents</a> <ul> <li><a href="#recommended-tools">Recommended Tools</a></li> </ul> </li> <li><a href="#testnet-faucets">Testnet Faucets</a></li> <li><a href="#resources-for-this-course">Resources For This Course</a></li> <li><a href="#bonus-nfts">Bonus NFTs</a> <ul> <li><a href="#important-notes-for-zksync">Important Notes for ZKsync</a></li> <li><a href="#bridging-to-zksync">Bridging to ZKsync</a></li> </ul> </li> </ol> </details> <details> <summary> <a href="#welcome-to-the-course-repo">Welcome to the Course Repo!</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="#blockchain-basics-section-1-what-is-a-blockchain-what-does-a-blockchain-do">Course: Blockchain Basics Section 1</a> </summary> </details> <details> <summary> <a href="#solidity-101-section-1-simple-storage">Solidity 101 Section 1: 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 &amp; 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-section-2">The EVM &amp; A Recap of Section 2</a></li> </ol> </details> <details> <summary><a href="#solidity-101-section-2--remix-storage-factory">Solidity 101 Section 2: 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 &amp; Overrides</a></li> <li><a href="#section-3-recap">Section 3 Recap</a></li> </ol> </details> <details> <summary> <a href="#solidity-101-section-3-remix-fund-me">Solidity 101 Section 3: Remix Fund Me</a> </summary> <ol> <li><a href="#introduction-2">Introduction</a></li> <li><a href="#setup">Setup</a></li> <li><a href="#sending-eth-through-a-function">Sending ETH through a function</a></li> <li><a href="#reverts">Reverts</a></li> <li><a href="#getting-real-world-price-data-chainlink">Getting real world price data (Chainlink)</a></li> <li><a href="#quick-recap-i">Quick recap I</a></li> <li><a href="#interfaces">Interfaces</a></li> <li><a href="#ai-help-iii">AI Help III</a></li> <li><a href="#importing-from-npm--github">Importing from NPM / GitHub</a></li> <li><a href="#getting-prices-from-chainlink">Getting Prices from Chainlink</a></li> <li><a href="#more-solidity-math">More solidity math</a></li> <li><a href="#msgsender">msg.sender</a></li> <li><a href="#quick-recap-ii">Quick recap II</a></li> <li><a href="#library">Library</a></li> <li><a href="#safemath">SafeMath</a></li> <li><a href="#for-loop">For Loop</a></li> <li><a href="#resetting-an-array">Resetting an array</a></li> <li><a href="#transfer-send-and-call">Transfer, Send, and Call</a></li> <li><a href="#constructor">Constructor</a></li> <li><a href="#modifiers">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 &amp; Constant</a></li> <li><a href="#custom-errors">Custom Errors</a></li> <li><a href="#receive--fallback-functions">Receive &amp; Fallback Functions</a></li> </ul> </li> <li><a href="#Section-4-Recap">Section 4 Recap</a></li> </ol> </details> <details> <summary><a href="#solidity-101-section-4-ai-prompting-asking-questions-and-getting-help">Solidity 101 Section 4: AI Prompting, Asking Questions, and Getting Help</a></summary> <ol> <li><a href="#intro">Intro</a></li> <li><a href="#7-tips-for-this-course">7 Tips for this Course</a></li> <li><a href="#setting-up-github">Setting up GitHub</a></li> <li><a href="#formatting-a-question">Formatting a question</a></li> <li><a href="#speedrunethereum">SpeedRunEthereum</a></li> </ul> </details> <details> <summary> <a href="#foundry-fundamentals-section-1-foundry-simple-storage">Foundry Fundamentals Section 1: Foundry Simple Storage</a> </summary> <ol> <li><a href="#introduction-3">Introduction</a></li> <li><a href="#installation--setup-macos--linux">Installation &amp; Setup (MacOS &amp; Linux)</a> <ul> <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></li> <li><a href="#foundry-install">Foundry Install</a></li> <li><a href="#vscode-setup-ii">VSCode Setup II</a></li> <li><a href="#foundry-setup">Foundry Setup</a></li> <li><a href="#formatting-solidity-in-vscode">Formatting Solidity in VSCode</a></li> <li><a href="#compiling-in-foundry">Compiling in Foundry</a></li> <li><a href="#deploying-to-a-local-chain-i-anvil-or-ganache">Deploying to a local chain I (Anvil or Ganache)</a></li> <li><a href="#adding-another-network-to-metamask">Adding another network to metamask</a></li> <li><a href="#deploying-to-a-local-chain-ii-forge-create">Deploying to a local chain II (Forge Create)</a></li> <li><a href="#private-key-rant-i">Private Key Rant I</a></li> <li><a href="#deploying-to-a-local-chain-iii-forge-script">Deploying to a local chain III (Forge Script)</a></li> <li><a href="#what-is-a-transaction-but-actually">What is a transaction (But actually)</a></li> <li><a href="#private-key-rant-ii">Private Key Rant II</a></li> <li><a href="#can-you-encrypt-a-private-key---a-keystore-in-foundry-yet">Can you Encrypt a Private Key -&gt; a keystore in foundry yet??</a></li> <li><a href="#thirdweb-deploy">ThirdWeb Deploy</a></li> <li><a href="#private-key-rant-summary">Private Key Rant Summary:</a></li> <li><a href="#cast-send">Cast Send</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-a-contract-the-manual-way">Verifying a contract the manual way</a></li> <li><a href="#cleaning-up-the-project">Cleaning up the project</a></li> <li><a href="#Alchemy-and-the-mempool">Alchemy and the mempool</a></li> <li><a href="#summary">Summary</a></li> </ol> </details> <details> <summary> <a href="#foundry-fundamentals-section-2-foundry-fund-me">Foundry Fundamentals Section 2: Foundry Fund Me</a> </summary> <ol> <li><a href="#introduction-4">Introduction</a></li> <li><a href="#setup-1">Setup</a></li> <li><a href="#testing-introduction">Testing Introduction</a></li> <li><a href="#setup-continued">Setup Continued</a></li> <li><a href="#tests">Tests</a></li> <li><a href="#debugging-tests-i">Debugging Tests I</a></li> <li><a href="#advanced-deploy-scripts-i">Advanced Deploy Scripts I</a></li> <li><a href="#forked-tests">Forked Tests</a></li> <li><a href="#refactoring-i-testing-deploy-scripts">Refactoring I: Testing Deploy Scripts</a></li> <li><a href="#refactoring-ii-helper-config">Refactoring II: Helper Config</a></li> <li><a href="#refactoring-iii-mocking-continued">Refactoring III: Mocking (continued)</a></li> <li><a href="#magic-numbers">Magic Numbers</a></li> <li><a href="#break-time">Break time!</a> <li><a href="#more-cheatcodes">More Cheatcodes</a></li> <li><a href="#more-coverage">More Coverage</a></li> <li><a href="#chisel">Chisel</a></li> <li><a href="#gas-cheaper-withdraw">Gas: Cheaper Withdraw</a></li> <li><a href="#storage">Storage</a></li> <li><a href="#gas-cheaper-withdraw-continued">Gas: Cheaper Withdraw (continued)</a></li> <li><a href="#interactionsssol">Interactions.s.sol</a></li> <li><a href="#makefile">Makefile</a></li> <li><a href="#pushing-to-github">Pushing to GitHub</a></li> <li><a href="#Section-7-Recap">Recap</a></li> </ol> </details> <details> <summary> <a href="#foundry-fundamentals-section-3-htmljs-fund-me-quick-fullstack--front-end-tutorial">Foundry Fundamentals Section 3: Html/Js Fund Me (Quick Fullstack / Front End Tutorial)</a> </summary> <ol> <li><a href="#introduction-5">Introduction</a></li> <li><a href="#setup-2">Setup</a></li> <li><a href="#how-metamask-works-with-your-browser">How metamask works with your browser</a></li> <li><a href="#introduction-to-function-selectors">Introduction to function selectors</a></li> <li><a href="#recap">Recap</a></li> </ol> </details> <details> <summary> <a href="#foundry-fundamentals-section-4-foundry-smart-contract-lottery">Foundry Fundamentals Section 4: Foundry Smart Contract Lottery</a> </summary> <ol> <li><a href="#introduction-6">Introduction</a></li> <li><a href="#rafflesol-setup">Raffle.sol Setup</a></li> <li><a href="#solidity-contract-layout">Solidity Contract Layout</a></li> <li><a href="#custom-errors-1">Custom Errors</a></li> <li><a href="#events">Events</a></li> <li><a href="#blocktimestamp">block.timestamp</a></li> <li><a href="#chainlink-vrf">Chainlink VRF</a> <ul> <li><a href="#sub-section-chainlink-vrf">Sub-Section: Chainlink VRF</a></li> </ul> </li> <li><a href="#implementing-chainlink-vrf---introduction">Implementing Chainlink VRF - Introduction</a></li> <li><a href="#modulo">Modulo</a></li> <li><a href="#enum">Enum</a></li> <li><a href="#resetting-an-array-1">Resetting an array</a></li> <li><a href="#note-on-building">Note on building</a></li> <li><a href="#CEI-Checks-Effects-Interactions">CEI</a></li> <li><a href="#introduction-to-chainlink-automation">Introduction to Chainlink Automation</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="#mid-section-recap">Mid-Section Recap</a></li> <li><a href="#tests--deploy-script-setup">Tests & Deploy Script Setup</a> <ul> <li><a href="#mock-chainlink-vrf-coordinator">Mock Chainlink VRF Coordinator</a></li> </ul> </li> <li><a href="#tests--deploy-script-continued">Tests & Deploy Script Continued</a></li> <li><a href="#lots-of-tests">Lots of Tests</a> <ul> <li><a href="#testing-events-in-foundry">Testing Events in Foundry</a></li> <li><a href="#vmroll--vmwarp">vm.roll & vm.warp</a></li> </ul> </li> <li><a href="#create-subscription-script">Create Subscription Script</a></li> <li><a href="#create-subscription-from-the-ui">Create Subscription from the UI</a></li> <li><a href="#fund-subscription-script">Fund Subscription Script</a></li> <li><a href="#add-consumer-script">Add Consumer Script</a></li> <li><a href="#more-tests">More Tests</a></li> <li><a href="#performupkeep-tests">PerformUpkeep Tests</a></li> <li><a href="#getting-event-data-into-foundry-scripts">Getting Event Data into Foundry Scripts</a></li> <li><a href="#intro-to-fuzz-tests">Intro to Fuzz tests</a></li> <li><a href="#one-big-test">One Big Test</a></li> <li><a href="#passing-the-private-key-to-vmstartbroadcast">Passing the private key to vm.startBroadcast</a></li> <li><a href="#integrations-test">Integrations Test</a></li> <li><a href="#testnet-demo---makefile-setup">Testnet Demo - Makefile setup</a></li> <li><a href="#testnet-demo---the-demo">Testnet Demo - The Demo</a></li> <li><a href="#consolelog-debugging">Console.log Debugging</a></li> <li><a href="#forge-test---debug">forge test --debug</a></li> <li><a href="#recap-1">Recap</a> <ul> <li><a href="#recommended-link-amounts-for-sepolia-staging-test">Recommended LINK amounts for Sepolia Staging Test:</a></li> </ul> </li> </ol> </details> <details> <summary> <a href="#advanced-foundry-section-1-foundry-erc20s">Advanced Foundry Section 1: Foundry 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="#erc20-token---openzeppelin">ERC20 Token - Openzeppelin</a></li> <li><a href="#deploy-script">Deploy Script</a></li> <li><a href="#ai-tests">AI Tests</a></li> <li><a href="#section-10-recap">Section 10 Recap</a></li> </ol> </details> <details> <summary> <a href="#advanced-foundry-section-2-foundry-nfts--moodnft">Advanced Foundry Section 2: Foundry NFTs | MoodNFT</a> </summary> <ol> <li><a href="#introduction-7">Introduction</a></li> <li><a href="#what-is-an-nft">What is an NFT?</a></li> <li><a href="#foundry-setup-1">Foundry Setup</a></li> <li><a href="#ipfs">IPFS</a></li> <li><a href="#using-ipfs">Using IPFS</a></li> <li><a href="#basic-nft-deploy-script">Basic NFT: Deploy Script</a></li> <li><a href="#basic-nft-tests">Basic NFT: Tests</a></li> <li><a href="#basic-nft-interactions">Basic NFT: Interactions</a></li> <li><a href="#basic-nft-testnet-demo">Basic NFT: Testnet Demo</a></li> <li><a href="#the-issue-with-ipfs--https-tokenuri-nfts">The issue with IPFS & HTTPS TokenURI NFTs</a></li> <li><a href="#what-is-an-svg">What is an SVG?</a></li> <li><a href="#svg-nft-introduction">SVG NFT: Introduction</a></li> <li><a href="#svg-nft-encoding-the-nft">SVG NFT: Encoding the NFT</a></li> <li><a href="#svg-nft-flipping-the-mood">SVG NFT: Flipping the mood</a></li> <li><a href="#svg-nft-deploy-script">SVG NFT: Deploy Script</a></li> <li><a href="#svg-nft-debugging-practice--some-notes">SVG NFT: Debugging practice & some notes</a></li> <li><a href="#svg-nft-anvil-demo">SVG NFT: Anvil Demo</a></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> </ul> </li> <li><a href="#verifying-metamask-transactions">Verifying Metamask Transactions</a></li> <li><a href="#filecoin--arweave">Filecoin & Arweave</a></li> <li><a href="#section-11-recap">Section 11 Recap</a></li> </ol> </details> <details> <summary> <a href="#advanced-foundry-section-3-foundry-defi--stablecoin-the-pinnacle-project-get-here">Advanced Foundry Section 3: Foundry DeFi | Stablecoin (The PINNACLE PROJECT!! GET HERE!)</a> </summary> <ol> <li><a href="#what-is-defi">What is DeFi?</a></li> <li><a href="#code-walkthrough">Code Walkthrough</a></li> <li><a href="#what-is-a-stablecoin-but-actually">What is a stablecoin (But actually)</a></li> <li><a href="#decentralizedstablecoinsol">DecentralizedStableCoin.sol</a></li> <li><a href="#dscenginesol-setup">DSCEngine.sol Setup</a></li> <li><a href="#deposit-collateral">Deposit Collateral</a></li> <li><a href="#mint-dsc">Mint DSC</a> <ul> <li><a href="#getting-the-value-of-our-collateral">Getting the value of our collateral</a></li> <li><a href="#health-factor">Health Factor</a></li> <li><a href="#minting-the-dsc">Minting the DSC</a></li> </ul> </li> <li><a href="#testing-while-developing">Testing while developing</a> <ul> <li><a href="#deploy-script-1">Deploy Script</a></li> <li><a href="#tests-1">Tests</a></li> </ul> </li> <li><a href="#depositcollateralandmintdsc">depositCollateralAndMintDsc</a></li> <li><a href="#redeemcollateral">redeemCollateral</a></li> <li><a href="#liquidate">Liquidate</a> <ul> <li><a href="#setup-3">Setup</a></li> <li><a href="#refactoring">Refactoring</a></li> </ul> </li> <li><a href="#leveling-up-your-testing-skillz">Leveling up your testing skillz</a></li> <li><a href="#fuzz-invariant-testing">Fuzz (Invariant) Testing</a></li> <li><a href="#open-based-fuzz-tests">Open-based Fuzz tests</a></li> <li><a href="#handler-based-fuzz-tests">Handler-based Fuzz tests</a> <ul> <li><a href="#revert_on_fail--true">revert_on_fail = true</a></li> <li><a href="#redeeming-collateral">Redeeming Collateral</a></li> <li><a href="#minting-dsc">Minting DSC</a></li> <li><a href="#debugging-fuzz-tests">Debugging Fuzz Tests</a></li> <li><a href="#challenge-find-out-why-mintdsc-is-never-being-called-on-our-handlersol">Challenge: Find out why `mintDsc` is never being called on our Handler.sol</a></li> </ul> </li> <li><a href="#price-feed-handling">Price Feed Handling</a></li> <li><a href="#oraclelib">OracleLib</a></li> <li><a href="#note-on-audit-preparedness">Note on audit preparedness</a></li> <li><a href="#recap-2">Recap</a></li> <li><a href="#lens-protocol">Lens Protocol</a></li> <ul> <li><a href="#more-defi-learnings">More DeFi Learnings:</a></li> </ul> </ol> </details> <details> <summary> <a href="#advanced-foundry-section-4-foundry-merkle-airdrop-and-signatures">Advanced Foundry Section 4: Foundry Merkle Airdrop and Signatures</a> </summary> <ol> <li><a href="#introduction-to-merkle-airdrops-and-code-walkthrough">Introduction to Merkle Airdrops and Code Walkthrough</a></li> <li><a href="#project-setup">Project Setup</a></li> <li><a href="#merkle-proofs">Merkle Proofs</a></li> <li><a href="#base-airdrop-contract">Base Airdrop Contract</a></li> <li><a href="#already-claimed-check">Already Claimed Check</a></li> <li><a href="#merkle-tree-scripts">Merkle Tree Scripts</a></li> <li><a href="#writing-the-tests">Writing the Tests</a></li> <li><a href="#deployment-script">Deployment Script</a></li> <li><a href="#adding-signature-verification">Adding Signature Verification</a></li> <li><a href="#signature-standards">Signature Standards</a></li> <li><a href="#ecdsa-signatures">ECDSA Signatures</a></li> <li><a href="#transaction-types-introduction">Transaction Types Introduction</a></li> <li><a href="#transaction-types">Transaction Types</a></li> <li><a href="#blob-transactions">Blob Transactions</a></li> <li><a href="#type-113-transactions">Type 113 Transactions</a></li> <li><a href="#implementing-signatures">Implementing Signatures</a></li> <li><a href="#modifying-the-tests">Modifying the Tests</a></li> <li><a href="#test-on-zksync-optional">Test on ZKsync (optional)</a></li> <li><a href="#create-claiming-script">Create Claiming Script</a></li> <li><a href="#creating-a-signature">Creating a Signature</a></li> <li><a href="#splitting-a-signature">Splitting a Signature</a></li> <li><a href="#executing-the-anvil-script">Executing the Anvil Script</a></li> <li><a href="#Deploy-and-Claim-on-ZKsync-Local-Node">Deploy and Claim on ZKsync Local Node</a></li> <li><a href="#deploy-and-claim-on-zksync-sepolia">Deploy and Claim on ZKsync Sepolia</a></li> <li><a href="#summary-1">Summary</a></li> </ol> </details> <details> <summary> <a href="#advanced-foundry-section-5-foundry-upgrades">Advanced Foundry Section 5: Foundry Upgrades</a> </summary> <ol> <li><a href="#introduction-9">Introduction</a></li> <li><a href="#upgradable-smart-contracts-overview">Upgradable 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="#universal-upgradable-smart-contract">Universal Upgradable Smart Contract</a> <ul> <li><a href="#setup-4">Setup</a></li> <li><a href="#initializer">Initializer</a></li> <li><a href="#deploy">Deploy</a></li> <li><a href="#upgradebox">UpgradeBox</a></li> <li><a href="#testdemo">Test / Demo</a></li> </ul> </li> <li><a href="#testnet-demo-1">Testnet Demo</a></li> </ol> </details> <details> <summary> <a href="#advanced-foundry-section-6-foundry-account-abstraction">Advanced Foundry Section 6: Foundry Account Abstraction</a> </summary> </details> <details> <summary> <a href="#advanced-foundry-section-7-foundry-dao--governance">Advanced Foundry Section 7: Foundry DAO / Governance</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> <ul> <li><a href="#setup-5">Setup</a></li> <li><a href="#governance-token">Governance Token</a></li> <li><a href="#governor">Governor</a></li> <li><a href="#tests-2">Tests</a></li> </ul> </li> <li><a href="#wrap-up">Wrap up</a></li> <li><a href="#bonus-gas-optimization-tips">Bonus: Gas optimization tips</a></li> </ol> </details> <details> <summary> <a href="#advanced-foundry-section-8-smart-contract-security--auditing-for-developers">Advanced Foundry Section 8: Smart Contract Security & Auditing (For developers)</a> </summary> <ol> <li><a href="#introduction-11">Introduction</a></li> <li><a href="#what-is-a-smart-contract-audit">What is a smart contract audit?</a></li> <li><a href="#tools">Tools</a> <ul> <li><a href="#manual-review">Manual Review</a></li> <li><a href="#static-analysis">Static Analysis</a></li> <li><a href="#dynamic-analysis">Dynamic Analysis</a></li> <li><a href="#formal-verification">Formal Verification</a></li> <li><a href="#symbolic-execution">Symbolic Execution</a></li> <li><a href="#fuzzing">Fuzzing</a></li> <li><a href="#formal-verification--symbolic-execution">Formal Verification (& Symbolic Execution)</a></li> <li><a href="#other-security-stuff">Other security stuff</a></li> </ul> </li> <li><a href="#what-does-the-process-of-manual-review-look-like">What does the process of manual review look like?</a></li> <li><a href="#formal-verification-1">Formal Verification</a></li> <li><a href="#closing-thoughts">Closing Thoughts</a></li> </ol> </details> <details> <summary> <a href="#congratulations">Congratulations</a> </summary> <ol> <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> </ol> </details>

<a href="#disclosures">Disclosures</a>

<a href="#thank-you">Thank you</a>

Recommended Tools

Testnet Faucets

If you receive a flag pop-up requiring you to have 0.001 ETH on mainnet, you may be able to wait 10 to 20 minutes and try again to avoid adding the 0.001 ETH on the mainnet.

⚠️ 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.

Chainlist

Resources For This Course

Bonus NFTs

These are 100% optional to do.

After every section, in this GitHub repo will be a link to a contract on Sepolia or ZKsync. They contain a challenge for you to solve, and in return, you'll be given an AWESOME NFT.

Important Notes for ZKsync

IF YOU DECIDE TO MINT THE REAL NFT:

  1. We didn't audit the NFT, so if you want to make sure you'll be safe, interact with the contract using a burner wallet (a wallet with very little money that you don't use for anything else)
    1. In fact... Get good at interacting with wallets from a burner wallet
  2. Read my Tweet thread on basic wallet safety
  3. It might be a good idea to wait till later in the course when we teach you about verifying metamask transactions.
  4. Feel free to mint NFTs on sepolia without worrying about the above

Bridging to ZKsync

  1. The process for bridging looks like the following:
    1. Buy ETH (On an exchange like Coinbase or Kraken)
  2. Send ETH -> one of your wallets like:
    1. Metamask
    2. Frame
    3. Rainbow
    4. Argent
    5. Coinbase Wallet
  3. Use the ZKsync Bridge

Welcome to the Course Repo

Welcome to Ultimate Smart Contract Development Course!

<!-- _[ (0:00:00) | Section 0: Welcome!](https://www.youtube.com/watch?v=umepbfKp5rI&t=0s)_ -->

Best Practices

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Course: Blockchain Basics

<!-- _[⭐️ (0:13:54) | Section 1: Blockchain Basics](https://www.youtube.com/watch?v=umepbfKp5rI&t=834s)_ -->

⭐️ Blockchain Basics Course

The Blockchain Basics has it's own GitHub repository (aka, codebase). You can find it here: https://github.com/Cyfrin/blockchain-basics-cu?tab=readme-ov-file

Solidity 101 Section 1: Simple Storage

💻 Code: https://github.com/cyfrin/remix-simple-storage-cu

Introduction

⭐️ Welcome to Remix - Simple Storage

Setting Up Your First Contract

⌨️ Setting Up Your First Contract

Basic Solidity: Types

⌨️ Basic Solidity Types

Basic Solidity: Functions

⌨️ Basic Solidity Functions

Basic Solidity: Arrays & Structs

⌨️ Basic Solidity Arrays & Structs

Basic Solidity: Compiler Errors and Warnings

⌨️ Basic Solidity Errors & Warnings

Memory, Storage, Calldata (Intro)

⌨️ Basic Solidity Memory, Storage, & Calldata (Intro)

Mappings

⌨️ Basic Solidity Mappings

Deploying your First Contract

⌨️ Deploying your First Contract

ZKsync L2 deploy

⌨️ Deploying to ZKsync

🐸🐦 Tweet Me (add your contract in)!

The EVM & A Recap of the section

⌨️ The EVM & A Recap of Section 2

Solidity 101 Section 1 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Solidity 101 Section 2 | Remix Storage Factory

💻 Code: https://github.com/cyfrin/remix-storage-factory-cu

Introduction

⭐️ Section 2 | Storage Factory

Basic Solidity: Importing Contracts into other Contracts

⌨️ Importing Contracts into other Contracts

Basic Solidity: Interacting with other Contracts

⌨️ Interacting with other contracts

Basic Solidity: Inheritance & Overrides

⌨️ Inheritance & Overrides

Section 2 Recap

⌨️ Section 2 Recap

Solidity 101 Section 2 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Solidity 101 Section 3: Remix Fund Me

💻 Code: https://github.com/Cyfrin/remix-fund-me-cu

Introduction

⭐️ Section 3 | Fund Me

Setup

⌨️ Setup

Sending ETH through a function

⌨️ Sending ETH through a function

Reverts

⌨️ Reverts

Getting real world price data (Chainlink)

⌨️ Getting real world price data (Chainlink)

Quick recap I

⌨️ Quick recap I

Interfaces

⌨️ Interfaces

AI Help III

⌨️ AI Help III

Importing from NPM / GitHub

⌨️ Importing from NPM / GitHub

Getting Prices from Chainlink

⌨️ Getting Prices from Chainlink

More Solidity math

⌨️ More Solidity math

msg.sender

⌨️ msg.sender

Quick recap II

⌨️ Quick recap II

Library

⌨️ Library

SafeMath

⌨️ SafeMath

<!-- - [Openzeppelin Safemath](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol) doesn't seem to exist anymore? I couldn't find it.-->

For Loop

⌨️ For Loop

Resetting an array

⌨️ Resetting an array

Transfer, Send, and Call

⌨️ Transfer, Send, and Call

Constructor

⌨️ Constructor

Modifiers

⌨️ Modifiers

Testnet Demo

⌨️ Testnet Demo

Immutable & Constant

⌨️ Immutable & Constant

Custom Errors

⌨️ Custom Errors

Receive & Fallback Functions

⌨️ Receive & Fallback Functions

Section 3 Recap

⌨️ Section 3 Recap

Solidity 101 Section 3 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Solidity 101 Section 4: AI Prompting, Asking Questions, and Getting Help

DO NOT SKIP THIS!!

⭐️ Section 4 | AI Prompting

Intro

7 Tips for this Course

Setting up GitHub

⌨️ Setting up GitHub

Formatting a question

⌨️ Formatting a question

SpeedRunEthereum

⌨️ SpeedRunEthereum

Solidity 101 Section 4 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Course: Foundry Fundamentals

Foundry Fundamentals Section 1: Foundry Simple Storage

💻 Code: https://github.com/Cyfrin/foundry-simple-storage-cu

Introduction

⭐️ Foundry Simple Storage Introduction

Installation & Setup (MacOS & Linux)

⌨️ Installation & Setup (MacOS & Linux)

Windows Setup (WSL)

⌨️ (Windows Setup (WSL)

⚠️ Please use Gitpod as an absolute last resort

Gitpod

⌨️ Gitpod

Local Development Introduction

Foundry Install

⌨️ Foundry Install

VSCode Setup II

⌨️ VSCode Setup II

Foundry Setup

⌨️ Foundry Setup ⌨️ Foundry Setup II (WSL)

Formatting Solidity in VSCode

⌨️ Formatting Solidity in VSCode

    "[solidity]": {
        "editor.defaultFormatter": "NomicFoundation.hardhat-solidity"
    },
    "[javascript]":{
      "editor.defaultFormatter": "esbenp.prettier-vscode"
    }

Compiling in Foundry

⌨️ Compiling in Foundry

Compiling to ZKsync in foundry-zksync

Deploying to a local chain I (Anvil or Ganache)

⌨️ Deploying to a local chain I (Anvil or Ganache)

Adding another network to Metamask

⌨️ Adding another network to Metamask

Deploying to a local chain II (Forge Create)

⌨️ Deploying to a local chain II (Forge Create)

Private Key Rant I

⌨️ Private Key Rant I

Deploying to a local chain III (Forge Script)

⌨️ Deploying to a local chain III (Forge Script)

What is a transaction (But actually)

⌨️ What is a transaction (But actually)

cast --to-base 0x01 dec

Private Key Rant II

⌨️ Private Key Rant II

Can you Encrypt a Private Key -> a keystore in foundry yet??

Can you Encrypt a Private Key -> a keystore in foundry yet??

cast wallet import your-account-name --interactive
Enter private key:
Enter password:
`your-account-name` keystore was saved successfully. Address: address-corresponding-to-private-key
forge script <script> --rpc-url <rpc_url> --account <account_name> --sender <address> --broadcast

Never use a Env File

⌨️ Never use a Env File

Private Key Rant Summary:

Private Key Rant Summary

Summary:
When you look to deploy
with real money, you should use either:
1. A password encrypted keystore
2. Something like thirdweb deploy

The idea is you never want to have
your private key or password
ANYWHERE written in plain text
(Aka, you always want it encrypted)

Deploying to a testnet or a mainnet

⌨️ Deploying to a testnet Sepolia

Verifying a contract the manual way

⌨️ Verifying a contract the manual way

Cleaning up the project

⌨️ Cleaning up the project

Foundry ZKsync

Alchemy and the mempool

⌨️ Alchemy and the mempool

Summary

⌨️ Summary

Foundry Fundamentals Section 1 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Foundry Fundamentals Section 2: Foundry Fund Me

⭐️ Foundry Fund Me

💻 Code: https://github.com/Cyfrin/foundry-fund-me-cu

Introduction

⌨️ Introduction

Setup

⌨️ Setup

Testing Introduction

⌨️ Testing Introduction

Setup Continued

⌨️ Setup Continued

Tests

⌨️ Tests

Debugging Tests I

⌨️ Debugging Tests I

Advanced Deploy Scripts I

⌨️ Advanced Deploy Scripts I

Forked Tests

⌨️ Forked Tests

forge test -m testPriceFeedVersionIsAccurate -vvv

is deprecated. Please use

forge test --match-test testPriceFeedVersionIsAccurate -vvv
1. Unit: Testing a single function
2. Integration: Testing multiple functions
3. Forked: Testing on a forked network
4. Staging: Testing on a live network (testnet or mainnet)

Refactoring I: Testing Deploy Scripts

⌨️ Refactoring I: Testing Deploy Scripts

Refactoring II: Helper Config

⌨️ Refactoring II: Helper Config

Refactoring III: Mocking

⌨️ Refactoring III: Mocking

Magic Numbers

⌨️ Magic Numbers

Refactoring III: Mocking (continued)

⌨️ Refactoring III: Mocking (continued)

More Cheatcodes

⌨️ More Cheatcodes

More Coverage

⌨️ More Coverage

Chisel

⌨️ Chisel

Gas: Cheaper Withdraw

⌨️ Gas: Cheaper Withdraw

Storage

⌨️ Storage

cast storage

Gas: Cheaper Withdraw (continued)

⌨️ Gas: Cheaper Withdraw (continued)

Interactions.s.sol

⌨️ Interactions.s.sol

Makefile

⌨️ Makefile

ZKsync Devops

⌨️ ZKsync Devops

Pushing to GitHub

⌨️ Pushing to GitHub

🐸🐦 Tweet Me (add your repo in)!

⌨️ (2:34:56) | Tweet Me (add your repo in)!

Section 2: Recap

⌨️ Section 2: Recap

Foundry Fundamentals Section 2 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Foundry Fundamentals Section 3: Html/Js Fund Me (Quick Fullstack / Front End Tutorial)

⭐️ Section 3: HTML Fund Me

💻 Code: https://github.com/Cyfrin/html-fund-me-cu

Introduction

Setup

⌨️ Setup

How Metamask works with your browser

<!-- TODO: Replace with Correct updraft sections -->

⌨️ How Metamask works with your browser

Introduction to function selectors

⌨️ Introduction to function selectors

Recap

⌨️ Recap

Foundry Fundamentals Section 3 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Foundry Fundamentals Section 4: Foundry Smart Contract Lottery

⭐️ Section 4: Smart Contract Lottery

💻 Code: https://github.com/Cyfrin/foundry-smart-contract-lottery-cu

Introduction

⌨️ Introduction

Raffle.sol Setup

⌨️ Raffle.sol Setup

Solidity Contract Layout

⌨️ Solidity Contract Layout

// Layout of Contract:
// version
// imports
// errors
// interfaces, libraries, contracts
// Type declarations
// State variables
// Events
// Modifiers
// Functions

// Layout of Functions:
// constructor
// receive function (if exists)
// fallback function (if exists)
// external
// public
// internal
// private
// internal & private view & pure functions
// external & public view & pure functions

Custom Errors

⌨️ Custom Errors

Events

⌨️ Events

block.timestamp

⌨️ block.timestamp

Chainlink VRF

⌨️ Chainlink VRF

Sub-Section: Chainlink VRF

Implementing Chainlink VRF - Introduction

⌨️ Implementing Chainlink VRF - Introduction

forge install smartcontractkit/chainlink-brownie-contracts@1.1.1 --no-commit

Modulo

⌨️ Modulo

Enum

⌨️ Enum

Resetting an array

⌨️ Resetting an array

Note on building

⌨️ Note on building

CEI (Checks, Effects, Interactions)

⌨️ CEI (Checks, Effects, Interactions)

Introduction to Chainlink Automation

⌨️ Introduction to Chainlink Automation

Implementing Chainlink Keepers - checkUpkeep

⌨️ Implementing Chainlink Keepers - checkUpkeep

Enums

Implementing Chainlink Keepers - checkUpkeep continued

Custom Error

⌨️ Custom Error

Mid-Section Recap

⌨️ Mid-Section Recap

Tests & Deploy Script Setup

⌨️ Tests & Deploy Script Setup

Deploy Script

⌨️ Script Setup

Mock Chainlink VRF Coordinator

⌨️ Mock Chainlink VRF Coordinator

Tests & Deploy Script Continued

⌨️ Tests & Deploy Script Continued

Lots of Tests

⌨️ Lots of Tests

Headers

⌨️ Headers

Adding more tests.

⌨️ Adding more tests

Testing Events in Foundry

⌨️ Testing Events in Foundry

vm.roll & vm.warp

⌨️ vm.roll & vm.warp

Create Subscription Script

⌨️ Create Subscription Script

Create Subscription from the UI

⌨️ Create Subscription from the UI

Fund Subscription Script

⌨️ Fund Subscription Script

Add Consumer Script

⌨️ Add Consumer Script

More Tests

⌨️ More Tests

Coverage Report

⌨️ Coverage Report

PerformUpkeep Tests

⌨️ PerformUpkeep Tests

Getting Event Data into Foundry Scripts

⌨️ Getting Event Data into Foundry Scripts

Intro to Fuzz tests

⌨️ Intro to Fuzz tests

One Big Test

⌨️ One Big Test

Passing the private key to vm.startBroadcast

⌨️ Passing the private key to vm.startBroadcast

Integrations Test

⌨️ Integrations Test

Testnet Demo - Optional

⌨️ Testnet Demo - Optional

Console.log Debugging

⌨️ Console.log Debugging

forge test --debug

⌨️ forge test --debug

Recap

⌨️ Recap

Recommended LINK amounts for Sepolia Staging Test:

Foundry Fundamentals Section 4 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊

Completed Foundry Fundamentals

🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊


Course: Advanced Foundry

Advanced Foundry Section 1: Foundry ERC20s

⭐️ Section 1: ERC20s

💻 Code: https://github.com/Cyfrin/foundry-erc20-cu

Learn how to build your own ERC20 like DAI, USDC, or WETH!

What is an ERC? What is an EIP?

What is an ERC20?

⌨️ What is an ERC20?

Manually Creating an ERC20 Token

⌨️ Manually Creating an ERC20 Token

ERC20 Token - Openzeppelin

⌨️ ERC20 Token - Openzeppelin

Deploy Script

⌨️ Deploy Script

AI Tests

⌨️ AI Tests

Advanced Foundry Section 1 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Advanced Foundry Section 2: Foundry NFTs | MoodNFT

⭐️ Section 2: NFTs

💻 Code: https://github.com/Cyfrin/foundry-nft-cu

Introduction

What is an NFT?

⌨️ What is an NFT?

Foundry Setup

⌨️ Foundry Setup

IPFS

⌨️ IPFS

Using IPFS

⌨️ Using IPFS

Basic NFT: Deploy Script

⌨️ Basic NFT: Deploy Script

Basic NFT: Tests

⌨️ Basic NFT: Tests

Basic NFT: Interactions

⌨️ Basic NFT: Interactions

Basic NFT: Testnet Demo

⌨️ Basic NFT: Testnet Demo

The issue with IPFS & HTTPS TokenURI NFTs

⌨️ The issue with IPFS & HTTPS TokenURI NFTs

What is an SVG?

⌨️ What is an SVG?

SVG NFT: Introduction

⌨️ SVG NFT: Introduction

SVG NFT: Encoding the NFT

⌨️ SVG NFT: Encoding the NFT

SVG NFT: Flipping the mood

⌨️ SVG NFT: Flipping the mood

SVG NFT: Deploy Script

⌨️ SVG NFT: Deploy Script

SVG NFT: Debugging practice & some notes

⌨️ SVG NFT: Debugging practice & some notes

SVG NFT: Anvil Demo

⌨️ SVG NFT: Anvil Demo

NFTS: Filecoin & Arweave

⌨️ NFTS: Filecoin & Arweave

Advanced: EVM Opcodes, Encoding, and Calling

⌨️ Advanced: EVM Opcodes, Encoding, and Calling

abi.encode & abi.encodePacked

Introduction to Encoding Function Calls Directly

⌨️ Introduction to Encoding Function Calls Directly

Introduction to Encoding Function Calls Recap

⌨️ Introduction to Encoding Function Calls Recap

Encoding Function Calls Directly

⌨️ Encoding Function Calls Directly

Verifying Metamask Transactions

⌨️ Verifying Metamask Transactions

  1. Check the address
  2. Check the function selector
  3. Decode the calldata

Section 2 Recap

⌨️ (10:36:31) | Section 2 Recap

Advanced Foundry Section 2 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Advanced Foundry Section 3: Foundry DeFi | Stablecoin (The PINNACLE PROJECT!! GET HERE!)

💻 Code: https://github.com/Cyfrin/foundry-defi-stablecoin-cu

This is one of the top projects you can build in the blockchain space. A decentralized stablecoin! We will teach you about the differences between DAI, USDC, RAI, and other stablecoins, and allow you to build your own.

Introduction

⭐️ Section 3: DeFi Stablecoins

What is DeFi?

Code Walkthrough

⌨️ Code Walkthrough

What is a stablecoin (But actually)

⌨️ What is a stablecoin (But actually)

DecentralizedStableCoin.sol

⌨️ DecentralizedStableCoin.sol

DSCEngine.sol Setup

⌨️ DSCEngine.sol Setup

Deposit Collateral

⌨️ Deposit Collateral

Mint DSC

Getting the value of our collateral

⌨️ Getting the value of our collateral

Health Factor

⌨️ Health Factor

Minting the DSC

⌨️ Minting the DSC

Testing while developing

Deploy Script

⌨️ Deploy Script

Tests

⌨️ Tests

depositCollateralAndMintDsc

⌨️ depositCollateralAndMintDsc

redeemCollateral

⌨️ redeemCollateral

Liquidate

Setup

⌨️ Setup

Refactoring

⌨️ Refactoring

Leveling up your testing skillz

⌨️ Leveling up your testing skillz

Challenge: Get DSCEngine.sol test coverage above 85%

Fuzz (Invariant) Testing

⌨️ Fuzz (Invariant) Testing

Open-based Fuzz tests

⌨️ Open-based Fuzz tests

Handler-based Fuzz tests

revert_on_fail = true

⌨️ revert_on_fail = true

Create the collateral redeemal handler

⌨️ Create the collateral redeemal handler

DeFi Handler Deposit Collateral

⌨️ DeFi Handler Deposit Collateral

Minting DSC

⌨️ Minting DSC

Debugging Fuzz Tests

⌨️ Debugging Fuzz Tests

Challenge: Find out why mintDsc is never being called on our Handler.sol

Price Feed Handling

⌨️ Price Feed Handling

OracleLib

⌨️ OracleLib

Note on audit preparedness

⌨️ Note on audit preparedness

Recap

⌨️ Recap

Lens Protocol

⌨️ Lens Protocol

More DeFi Learnings:

Advanced Foundry Section 3 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Advanced Foundry Section 4: Foundry Merkle Airdrop and Signatures

💻 Code: https://github.com/Cyfrin/foundry-merkle-airdrop-cu

Introduction to Merkle Airdrops and Code Walkthrough

⌨️ Introduction

Project Setup

⌨️ Project Setup

Merkle Proofs

⌨️ Merkle Proofs

Base Airdrop Contract

⌨️ Base Airdrop Contract

Already Claimed Check

⌨️ Already Claimed Check

Merkle Tree Scripts

⌨️ Merkle Tree Scripts

Writing the Tests

⌨️ Writing the Tests

Deployment Script

⌨️ Deployment Script

Adding Signature Verification

⌨️ Adding Signature Verification

Signature Standards

⌨️ Signature Standards

ECDSA Signatures

⌨️ ECDSA Signatures


Transaction Types Introduction

⌨️ Transaction Types Introduction

Transaction Types

⌨️ Transaction Types

Blob Transactions

⌨️ Blob Transactions


Advanced Foundry Section 4 NFTs (TBD)

Advanced Foundry Section 5: Foundry Upgrades

💻 Code: https://github.com/Cyfrin/foundry-upgrades-cu

Introduction

⭐️ Section 5: Upgradable Contracts & Proxies

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

⌨️ Delegatecall

Small Proxy Example

⌨️ Small Proxy Example

Universal Upgradable Smart Contract

Setup

⌨️ UUPS Setup

Deploy

⌨️ Deploy

UpgradeBox

⌨️ Upgradebox

Test/Demo

⌨️ (5:53:48) | Test/Demo

Testnet Demo

⌨️ Testnet Demo

Advanced Foundry Section 5 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Advanced Foundry Section 6: Foundry Account Abstraction

💻 Code: https://github.com/Cyfrin/minimal-account-abstraction

What is account abstraction?

⌨️ Account Abstraction Introduction

Code Overview

⌨️ Code Overview

Ethereum Setup

⌨️ Etheren Account Abstraction

PackedUserOperation

⌨️ PackedUserOperation

Validate UserOp

⌨️ Validate UserOp

EntryPoint Contract

⌨️ EntryPoint Contract

Execute Function Ethereum

⌨️ Execute

Deployment Script for an Ethereum Account

⌨️ Deploy Script

Tests Owner can Execute

⌨️ Tests Owner can Execute

Unsigned PackedUserOperation Test

⌨️ Get Unsigened PackedUserOperation

Signed UserOp Test

⌨️ Signed PackedUserOperation

Using unlocked accounts for local development

⌨️ Local Dev Unlocked

Test Validation of User Ops

⌨️ Test Validate UserOps

Test Entry Point

⌨️ Test Entry Point

Advanced Debugging

⌨️ Advanced Debugging

Mid-session Recap

⌨️ Mid Session Recap

Live Demo on Arbitrum

⌨️ Live Demo

ZKsync Native Account Abstraction

⌨️ ZKsync Setup

IAccount

⌨️ IAccount

System Contracts

⌨️ System Contracts

Type 113 LifeCycle

⌨️ TxType 113 Lifecycle

Mid-ZKsync Recap

⌨️ ZKsync Accounts Recap

System Contract Call ZKsync Simulations

⌨️ ZKsync Transaction Simulations

Validate Transaction ZKsync

⌨️ ValidateTransaction

Execute Function ZKsync

⌨️ executeTransaction

Pay For Transaction ZKsync

⌨️ payForTransaction

Execute Transaction From Outside

⌨️ executeTransactionFromOutside

ZKsync Tests

⌨️ ZKsync Tests

Building a Transaction Struct

⌨️ Transaction Struct

Via Ir

⌨️ --via-ir

Validate Transaction Test

⌨️ Validate Transaction Test

Clean Up ZKsync

⌨️ Clean up

Testnet ZKsync Demo

⌨️ Testnet Demo

Rcap & End

⌨️ Recap End

Advanced Foundry Section 6 NFTs (TBD)

Advanced Foundry Section 7: Foundry DAO / Governance

Plutocracy is bad! Don't default to ERC20 token voting!!

💻 Code: https://github.com/Cyfrin/foundry-dao-cu

Introduction

⭐️ Section 14 | DAOs & Governance

What is a DAO?

How to build a DAO

DAOs toolings - Introduction to Aragon

⌨️ DAOs tooling - Special Guest from Aragon

Project Setup

⌨️ Build your own DAO Setup

Governance Token

⌨️ Governance Tokens

Governor

⌨️ Creating the Governor Contract

Tests

⌨️ Testing the Governor Contract

Wrap up

⌨️ Section Recap

Bonus: Gas optimization tips

Advanced Foundry Section 7 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Advanced Foundry Section 8: Smart Contract Security & Auditing (For developers)

Developers 100% should know all about this! Don't leave the course without at least watching this section!

[!IMPORTANT] We highly recommend you head over to the end-to-end Cyfrin Updraft Security and Auditing Curriculum.

🖥️ Code: https://github.com/PatrickAlphaC/denver-security

Introduction

⭐️ Section 6 | Security & Auditing

What is a smart contract audit?

⌨️ What is a smart contract audit?

Tools

⌨️ What tools do security professionals use?

Manual Review

⌨️ Intro to Manual review

Static Analysis

Dynamic Analysis

Formal Verification

Symbolic Execution

Fuzzing

Formal Verification (& Symbolic Execution)

Other security stuff

What does the process of manual review look like?

⌨️ Manual Review with Tincho

Formal Verification

⌨️ Formal Verification

Closing Thoughts

⌨️ Wrap. Up

Advanced Foundry Section 8 NFTs

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Congratulations

🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊 Completed all 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!

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Disclosures

Transparency is important! So we want to disclose any potential conflicts that might have affected my judgement so you can pick tools that are right for you. Patrick is co-founder of Alpha Chain, a blockchain infrastructure company. Alpha Chain runs Chainlink, Ethereum, Binance, Polygon, Harmony, Solana, Moonbeam, and Moonriver blockchain services. Alpha Chain often works with Alchemy and receives discounted services. Patrick is the co-founder of Cyfrin, and they do smart contract security & auditing services. Patrick is also the co-founder of Chain Accel, who is an advisor on the Peeranha project.

Because of all this, I have added alternatives to each section where we suggest a tool.

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

Sponsors

A huge thank you to our sponsors. These are the groups and technologies

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>

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 Cyfrin & Chain Accel for encouraging this course to come to light, and many, many, many people from the community.

And thanks to the Cyfrin team for making this possible!

<a href="https://github.com/cyfrin/security-and-auditing-full-course-s23/graphs/contributors"> <img src="https://contrib.rocks/image?repo=cyfrin/foundry-full-course-cu" /> </a>

License

Cyfrin Updraft content is open-sourced licensed as GPLv3.

Cyfrin Twitter Cyfrin YouTube Cyfrin LinkedIn

<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>