Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Cyfrin/foundry-full-course-cu
https://github.com/Cyfrin/foundry-full-course-cu
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/Cyfrin/foundry-full-course-cu
- Owner: Cyfrin
- License: gpl-3.0
- Created: 2023-04-28T14:22:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-01T01:03:54.000Z (3 months ago)
- Last Synced: 2024-08-01T23:05:34.888Z (3 months ago)
- Size: 6.85 MB
- Stars: 3,036
- Watchers: 85
- Forks: 706
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- Blockchain-Development-Resources - Learn Solidity, Blockchain Development, & Smart Contracts | Powered By AI
README
[contributors-shield]: https://img.shields.io/github/contributors/cyfrin/foundry-full-course-cu.svg?style=for-the-badge
[contributors-url]: https://github.com/cyfrin/foundry-full-course-cu/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/cyfrin/foundry-full-course-cu.svg?style=for-the-badge
[forks-url]: https://github.com/cyfrin/foundry-full-course-cu/network/members
[stars-shield]: https://img.shields.io/github/stars/cyfrin/foundry-full-course-cu.svg?style=for-the-badge
[stars-url]: https://github.com/cyfrin/foundry-full-course-cu/stargazers
[issues-shield]: https://img.shields.io/github/issues/cyfrin/foundry-full-course-cu.svg?style=for-the-badge
[issues-url]: https://github.com/cyfrin/foundry-full-course-cu/issues
[license-shield]: https://img.shields.io/github/license/cyfrin/foundry-full-course-cu.svg?style=for-the-badge
[license-url]: https://github.com/cyfrin/foundry-full-course-cu/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555_Entire course and video content updated June 15, 2024_
Blockchain Developer, Smart Contract, & Solidity Career Path - Powered By AI - Beginner to Expert Course
| Foundry Edition 2024 |Learn smart contract development, and level up your career
[![Stargazers][stars-shield]][stars-url] [![Forks][forks-shield]][forks-url]
[![Contributors][contributors-shield]][contributors-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]Welcome to the repository for the Blockchain Developer, Smart Contract, & Solidity Cyfrin Updraft - Career Path
| Powered By AI |
| Beginner to Expert Path |
| Foundry Edition 2024 |This repository houses course resources and [discussions](https://github.com/Cyfrin/foundry-full-course-cu/discussions) for the course.
Please refer to this for an in-depth explanation of the content:
- [Website](https://updraft.cyfrin.io) - Join Cyfrin Updraft and enjoy 50+ hours of smart contract development courses
- [Twitter](https://twitter.com/CyfrinUpdraft) - Stay updated with the latest course releases
- [LinkedIn](https://www.linkedin.com/school/cyfrin-updraft/) - Add Updraft to your learning experiences
- [Discord](https://discord.gg/cyfrin) - Join a community of 3000+ developers and auditors
- [Newsletter](https://cyfrin.io/newsletter) - Weekly security research tips and resources to level up your career
- [Codehawks](https://codehawks.com) - Smart contracts auditing competitions to help secure web3
Cyfrin Updraft Courses:
- [Cyfrin Updraft - Blockchain basics](https://updraft.cyfrin.io/courses/blockchain-basics)
- [Cyfrin Updraft - Solidity basics](https://updraft.cyfrin.io/courses/solidity)
- [Cyfrin Updraft - Foundry Fundamentals](https://updraft.cyfrin.io/courses/foundry)
- [Cyfrin Updraft - Advanced Foundry](https://updraft.cyfrin.io/courses/advanced-foundry)[YouTube Link](https://www.youtube.com/watch?v=-1GB6m39-rM)
# Table of Contents
> All the sections for on this repo are for several courses on the Solidity Developer Career path of Cyfrin Updraft.
Resources
- Blockchain Developer, Smart Contract, & Solidity Course - Powered By AI - Beginner to Expert Course | Foundry Edition 2024
Table of Contents
- Testnet Faucets
- Resources For This Course
Bonus NFTs
Course: Blockchain Basics Section 1
- What is a Blockchain? What does a blockchain do?
- The Purpose Of Smart Contracts
- Other Blockchain Benefits
- What have Smart Contracts done so far?
- Making Your First Transaction
- Gas I: Introduction to Gas
- How Do Blockchains Work?
- Signing Transactions
- Gas II
- Gas II Summary
- High-Level Blockchain Fundamentals
- L1s L2s and Rollups
- Rollup Stages
- Making your First Transaction on zkSync
- Why zkSync is our Recommended Chain
Solidity 101 Section 1: Simple Storagee
- Introduction
- Setting Up Your First Contract
- Basic Solidity: Types
- Basic Solidity: Functions
- Basic Solidity: Arrays & Structs
- Basic Solidity: Compiler Errors and Warnings
- Memory, Storage, Calldata (Intro)
- Mappings
- Deploying your First Contract
- The EVM & A Recap of Section 2
Solidity 101 Section 2: Remix Storage Factory
- Introduction
- Basic Solidity: Importing Contracts into other Contracts
- Basic Solidity: Interacting with other Contracts
- Basic Solidity: Inheritance & Overrides
- Section 3 Recap
Solidity 101 Section 3: Remix Fund Me
- Introduction
- Setup
- Sending ETH through a function
- Reverts
- Getting real world price data (Chainlink)
- Quick recap I
- Interfaces
- AI Help III
- Importing from NPM / GitHub
- Getting Prices from Chainlink
- More solidity math
- msg.sender
- Quick recap II
- Library
- SafeMath
- For Loop
- Resetting an array
- Transfer, Send, and Call
- Constructor
- Modifiers
- Testnet Demo
Advanced Solidity
- Section 4 Recap
Solidity 101 Section 4: AI Prompting, Asking Questions, and Getting Help
Foundry Fundamentals Section 1: Foundry Simple Storage
- Introduction
Installation & Setup (MacOS & Linux)
- Local Development Introduction
- Foundry Install
- VSCode Setup II
- Foundry Setup
- Formatting Solidity in VSCode
- Compiling in Foundry
- Deploying to a local chain I (Anvil or Ganache)
- Adding another network to metamask
- Deploying to a local chain II (Forge Create)
- Private Key Rant I
- Deploying to a local chain III (Forge Script)
- What is a transaction (But actually)
- Private Key Rant II
- Can you Encrypt a Private Key -> a keystore in foundry yet??
- ThirdWeb Deploy
- Private Key Rant Summary:
- Cast Send
- Deploying to a testnet or a mainnet
- Verifying a contract the manual way
- Cleaning up the project
- Alchemy and the mempool
- Summary
Foundry Fundamentals Section 2: Foundry Fund Me
- Introduction
- Setup
- Testing Introduction
- Setup Continued
- Tests
- Debugging Tests I
- Advanced Deploy Scripts I
- Forked Tests
- Refactoring I: Testing Deploy Scripts
- Refactoring II: Helper Config
- Refactoring III: Mocking (continued)
- Magic Numbers
Break time!
- More Cheatcodes
- More Coverage
- Chisel
- Gas: Cheaper Withdraw
- Storage
- Gas: Cheaper Withdraw (continued)
- Interactions.s.sol
- Makefile
- Pushing to GitHub
- Recap
Foundry Fundamentals Section 3: Html/Js Fund Me (Quick Fullstack / Front End Tutorial)
Foundry Fundamentals Section 4: Foundry Smart Contract Lottery
- Introduction
- Raffle.sol Setup
- Solidity Contract Layout
- Custom Errors
- Events
- block.timestamp
Chainlink VRF
- Implementing Chainlink VRF - Introduction
- Modulo
- Enum
- Resetting an array
- Note on building
- CEI
- Introduction to Chainlink Automation
Implementing Chainlink Keepers - checkUpkeep
- Implementing Chainlink Keepers - checkUpkeep continued
- Implementing Chainlink Keepers - performUpkeep
- Mid-Section Recap
Tests & Deploy Script Setup
- Tests & Deploy Script Continued
Lots of Tests
- Create Subscription Script
- Create Subscription from the UI
- Fund Subscription Script
- Add Consumer Script
- More Tests
- PerformUpkeep Tests
- Getting Event Data into Foundry Scripts
- Intro to Fuzz tests
- One Big Test
- Passing the private key to vm.startBroadcast
- Integrations Test
- Testnet Demo - Makefile setup
- Testnet Demo - The Demo
- Console.log Debugging
- forge test --debug
Recap
Advanced Foundry Section 1: Foundry ERC20s
- What is an ERC? What is an EIP?
- What is an ERC20?
- Manually Creating an ERC20 Token
- ERC20 Token - Openzeppelin
- Deploy Script
- AI Tests
- Section 10 Recap
Advanced Foundry Section 2: Foundry NFTs | MoodNFT
- Introduction
- What is an NFT?
- Foundry Setup
- IPFS
- Using IPFS
- Basic NFT: Deploy Script
- Basic NFT: Tests
- Basic NFT: Interactions
- Basic NFT: Testnet Demo
- The issue with IPFS & HTTPS TokenURI NFTs
- What is an SVG?
- SVG NFT: Introduction
- SVG NFT: Encoding the NFT
- SVG NFT: Flipping the mood
- SVG NFT: Deploy Script
- SVG NFT: Debugging practice & some notes
- SVG NFT: Anvil Demo
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
- Verifying Metamask Transactions
- Filecoin & Arweave
- Section 11 Recap
Advanced Foundry Section 3: Foundry DeFi | Stablecoin (The PINNACLE PROJECT!! GET HERE!)
- What is DeFi?
- Code Walkthrough
- What is a stablecoin (But actually)
- DecentralizedStableCoin.sol
- DSCEngine.sol Setup
- Deposit Collateral
Mint DSC
Testing while developing
- depositCollateralAndMintDsc
- redeemCollateral
Liquidate
- Leveling up your testing skillz
- Fuzz (Invariant) Testing
- Open-based Fuzz tests
Handler-based Fuzz tests
- revert_on_fail = true
- Redeeming Collateral
- Minting DSC
- Debuggin Fuzz Tests
- Challenge: Find out why `mintDsc` is never being called on our Handler.sol
- Price Feed Handling
- OracleLib
- Note on audit preparedness
- Recap
- Lens Protocol
Advanced Foundry Section 4: Foundry Merkle Airdrop and Signatures
- Introduction to Merkle Airdrops and Code Walkthrough
- Project Setup
- Merkle Proofs
- Base Airdrop Contract
- Already Claimed Check
- Merkle Tree Scripts
- Writing the Tests
- Deployment Script
- Adding Signature Verification
- Signature Standards
- ECDSA Signatures
- Transaction Types Introduction
- Transaction Types
- Blob Transactions
- Type 113 Transactions
- Implementing Signatures
- Modifying the Tests
- Test on zkSync (optional)
- Create Claiming Script
- Creating a Signature
- Splitting a Signature
- Executing the Anvil Script
- Deploy and Claim on zkSync Local Node
- Deploy and Claim on zkSync Sepolia
- Summary
Advanced Foundry Section 5: Foundry Upgrades
- Introduction
- Upgradable Smart Contracts Overview
- Types of Upgrades
- Delegatecall
- Small Proxy Example
Universal Upgradable Smart Contract
- Testnet Demo
Advanced Foundry Section 6: Foundry Account Abstraction
Advanced Foundry Section 7: Foundry DAO / Governance
Advanced Foundry Section 8: Smart Contract Security & Auditing (For developers)
- Introduction
- What is a smart contract audit?
Tools
- 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?
- Formal Verification
- Closing Thoughts
## Recommended Tools
- Recommended Testnet: Sepolia
- Recommended DevOps: [foundry-devops](https://github.com/Cyfrin/foundry-devops)# [Testnet Faucets](https://faucets.chain.link)
- Main (Sepolia): Sepolia GCP Faucet
- Alchemy Faucet (Sepolia): https://sepoliafaucet.com/
- Infura Faucet (Sepolia): https://www.infura.io/faucet/sepolia
- zkSync Faucets (zkSync Sepolia): https://docs.zksync.io/build/tooling/network-faucets.html
- zkSync Bridge: https://portal.zksync.io/bridge/> ⚠️ 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
- [Chainlist](https://chainlist.org/): https://chainlist.org/
# Resources For This Course
- AI Frens
- [ChatGPT](https://chat.openai.com/)
- Just know that it will often get things wrong, but it's very fast!
- [Phind](https://www.phind.com/)
- Like ChatGPT, but it searches the web
- [Bard](https://bard.google.com/)
- [Other AI extensions](https://twitter.com/aisolopreneur/status/1654823630155464704?s=42&t=-pu_sCYtfrfPJU7OXfifrQ)
- [Github Discussions](https://github.com/Cyfrin/foundry-full-course-cu/discussions)
- Ask questions and chat about the course here!
- [Stack Exchange Ethereum](https://ethereum.stackexchange.com/)
- Great place for asking technical questions about Ethereum
- [Peeranha](https://peeranha.io/)
- Decentralized Stack Exchange!
- [Cookbook](./cookbook-listings.md)
- A smart contract registry and co-pilot# Bonus NFTs
These are 100% optional to do.
- [Sepolia](https://sepolia.etherscan.io/address/0x76B50696B8EFFCA6Ee6Da7F6471110F334536321)
- [zkSync Sepolia](https://sepolia.explorer.zksync.io/address/0x96bA338cf715fcbE935BCa076A7a8BAB1f18E39A)
- [zkSync](https://explorer.zksync.io/address/0xBbA202c6DA89646F13C11a63C4aF182E4fFd4c2e)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](https://twitter.com/PatrickAlphaC/status/1663936101650685954)
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](https://www.coinbase.com/home) or [Kraken](https://www.kraken.com/))
2. Send ETH -> one of your wallets like:
1. [Metamask](https://metamask.io/)
2. [Frame](https://frame.sh/)
3. [Rainbow](https://rainbow.me/)
4. [Argent](https://www.argent.xyz/)
5. [Coinbase Wallet](https://www.coinbase.com/wallet)
3. Use the [zkSync Bridge](https://portal.zksync.io/bridge/)# Welcome to the Course Repo
## Welcome to Ultimate Smart Contract Development Course!
## Best Practices
- **Follow the repository:** While going through the course be 100% certain to follow along with the github repository. If you run into 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 on your end and maybe even have the code sample next to you.
- **Use ChatGPT and/or the course chat**(back to top) ⬆️
# Course: Blockchain Basics
[⭐️ Blockchain Basics Course](https://updraft.cyfrin.io/courses/blockchain-basics)
# Blockchain Basics Section 1: What is a Blockchain? What does a blockchain do?
_[⌨️ What is a Blockchain?](https://updraft.cyfrin.io/courses/blockchain-basics/basics/what-is-a-blockchain)_
- [Bitcoin Whitepaper](https://bitcoin.org/bitcoin.pdf)
- [Satoshi Nakamoto](https://en.wikipedia.org/wiki/Satoshi_Nakamoto)
- [Ethereum Whitepaper](https://ethereum.org/en/whitepaper/)
- [Vitalik Buterin](https://en.wikipedia.org/wiki/Vitalik_Buterin)
- [What is a Smart Contract?](https://chain.link/education/smart-contracts)
- [Nick Szabo](https://en.wikipedia.org/wiki/Nick_Szabo)
- [Hybrid Smart Contracts](https://blog.chain.link/hybrid-smart-contracts-explained/)
- [Blockchain Oracles](https://betterprogramming.pub/what-is-a-blockchain-oracle-f5ccab8dbd72?source=friends_link&sk=d921a38466df8a9176ed8dd767d8c77d)
- [Terminology](https://connect.comptia.org/content/articles/blockchain-terminology)
- [Web3](https://en.wikipedia.org/wiki/Web3)
- [What is a blockchain](https://www.investopedia.com/terms/b/blockchain.asp)## The Purpose Of Smart Contracts
_[⌨️ The Purpose Of Smart Contracts](https://updraft.cyfrin.io/courses/blockchain-basics/basics/the-purpose-of-smart-contracts?lesson_format=video)_
- 🎥 [Original Video](https://www.youtube.com/watch?v=_JeRq7Gwj5Y&feature=youtu.be)
- 🦬 [My ETH Denver Talk](https://www.youtube.com/watch?v=06hXCX_jj2E)
- 🍔 [McDonalds Scandal](https://www.chicagotribune.com/sns-mcdonalds-story.html)
- ⛓ [More on the evolution of agreements](https://www.youtube.com/watch?v=ufVyX7JDCgg)
- ✍️ [What is a Smart Contract?](https://www.youtube.com/watch?v=ZE2HxTmxfrI)
- 🧱 [How does a blockchain work?](https://www.youtube.com/watch?v=SSo_EIwHSd4)
- 🔮 [Chainlink & Oracles](https://www.youtube.com/watch?v=tIUHQ7sDoaU)## Other Blockchain Benefits
_[⌨️ Other Blockchain Benefits](https://updraft.cyfrin.io/courses/blockchain-basics/basics/smart-contract-landscape)_
- Decentralized
- Transparency & Flexibility
- Speed & Efficiency
- Security & Immutability
- Counterparty Risk Removal
- Trust Minimized Agreements## What have Smart Contracts done so far?
- [DeFi](https://chain.link/education/defi)
- [Defi Llama](https://defillama.com/)
- [Why DeFi is Important](https://medium.com/the-capital/why-defi-1519cc4d4bd3)
- [DAOs](https://betterprogramming.pub/what-is-a-dao-what-is-the-architecture-of-a-dao-how-to-build-a-dao-high-level-d096a97162cc)
- [NFTs](https://www.youtube.com/watch?v=9yuHz6g_P50)## Making Your First Transaction
_[⌨️ Making Your First Transaction](https://updraft.cyfrin.io/courses/blockchain-basics/basics/metamask-setup-making-your-first-transaction)_
- [Metamask Download Link](https://metamask.io/)
- [What is a Private Key?](https://www.coinbase.com/learn/crypto-basics/what-is-a-private-key)
- [What is a Secret Phrase?](https://metamask.zendesk.com/hc/en-us/articles/360060826432-What-is-a-Secret-Recovery-Phrase-and-how-to-keep-your-crypto-wallet-secure)
- [Etherscan](https://etherscan.io/)
- [Sepolia Etherscan](https://sepolia.etherscan.io/)
- Sepolia Faucet (Check the [link token contracts page](https://docs.chain.link/docs/link-token-contracts/#sepolia))
- NOTE: The Chainlink documentation always has the most up to date faucets on their [link token contracts page](https://docs.chain.link/docs/link-token-contracts/#sepolia). If the faucet above is broken, check the chainlink documentation for the most up to date faucet.
- OR, use the [Sepolia ETH Faucet](https://faucets.chain.link/), just be sure to swap your metamask to Sepolia!## Gas I: Introduction to Gas
_[⌨️ Gas I: Introduction to Gas](https://updraft.cyfrin.io/courses/blockchain-basics/basics/introduction-to-gas)_
- [Gas and Gas Fees](https://ethereum.org/en/developers/docs/gas/)
- [Wei, Gwei, and Ether Converter](https://eth-converter.com/)
- [ETH Gas Station](https://ethgasstation.info/)## How Do Blockchains Work?
_[⌨️ How Do Blockchains Work?](https://updraft.cyfrin.io/courses/blockchain-basics/basics/how-do-blockchains-work)_
- [What is a hash?](https://techjury.net/blog/what-is-cryptographic-hash/)
- [Blockchain Demo](https://andersbrownworth.com/blockchain/)
- [Summary](https://ethereum.org/en/developers/docs/intro-to-ethereum/)## Signing Transactions
_[⌨️ Signing Transactions](https://updraft.cyfrin.io/courses/blockchain-basics/basics/signing-ethereum-transactions)_
- [Public / Private Keys](https://andersbrownworth.com/blockchain/public-private-keys/keys)
- [Layer 2 and Rollups](https://ethereum.org/en/developers/docs/scaling/layer-2-rollups/)
- [Decentralized Blockchain Oracles](https://blog.chain.link/what-is-the-blockchain-oracle-problem/)## Gas II
_[⌨️ Gas II: Block Rewards & EIP 1559](https://updraft.cyfrin.io/courses/blockchain-basics/basics/gas-in-depth)_
- [Block Rewards](https://www.investopedia.com/terms/b/block-reward.asp)
- Advanced Gas
- [EIP 1559](https://www.youtube.com/watch?v=MGemhK9t44Q)
- GWEI, WEI, and ETH
- [ETH Converter](https://eth-converter.com/)## Gas II Summary
- [Run Your Own Ethereum Node](https://geth.ethereum.org/docs/getting-started)
## High-Level Blockchain Fundamentals
_[⌨️ High-Level Blockchain Fundamentals](https://updraft.cyfrin.io/courses/blockchain-basics/basics/how-the-blockchain-works)_
- [Consensus](https://wiki.polkadot.network/docs/learn-consensus)
- [Proof of Stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/)
- [Proof of Work](https://ethereum.org/en/developers/docs/consensus-mechanisms/pow/)
- [Nakamoto Consensus](https://blockonomi.com/nakamoto-consensus/)
- [The merge](https://ethereum.org/en/eth2/)## L1s L2s and Rollups
- [Replay attacks](https://www.cyfrin.io/blog/replay-attack-in-ethereum)
- [Sybil attacks](https://www.cyfrin.io/blog/understanding-sybil-attacks-in-blockchain-and-smart-contracts)
- [Double-spending](https://www.cyfrin.io/blog/understanding-double-spending-in-blockchain)
- [Zero-knowledge proofs](https://ethereum.org/en/zero-knowledge-proofs/)## Rollup Stages
- [L2 Beat](https://l2beat.com/scaling/summary)
## Making your First Transaction on zkSync
- [zkSync bridge](https://portal.zksync.io/bridge/?network=sepolia)
## Why zkSync is our Recommended Chain
- [zkSync](https://zksync.io/)
## Blockchain Basics Section 1 NFTs
- [zkSync](https://explorer.zksync.io/address/0xfa257F68Ca436F6e00299917837D7712Fa5bdf75)
- [Sepolia](https://sepolia.etherscan.io/address/0x25056312685339b49e1d1C5a0b72Ff9eff13AF77)(back to top) ⬆️
# Course: Solidity & Smart Contract Developmnet
[⭐️ Learn Solidity & Smart Contract Development](https://updraft.cyfrin.io/courses/solidity)
💻 Code: [https://github.com/cyfrin/remix-simple-storage-cu](https://github.com/cyfrin/remix-simple-storage-cu)
# Solidity 101 Section 1: Simple Storage
## Introduction_[⭐️ Welcome to Remix - Simple Storage](https://updraft.cyfrin.io/courses/solidity/simple-storage/welcome-to-solidity-fundamentals?lesson_format=video)_
- [Remix](https://remix.ethereum.org/)
- [Solidity Documentation](https://docs.soliditylang.org/en/latest/index.html)## Setting Up Your First Contract
_[⌨️ Setting Up Your First Contract](https://updraft.cyfrin.io/courses/solidity/simple-storage/create-solidity-smart-contract)_
- Versioning
- Take notes in your code!
- [What is a software license](https://snyk.io/learn/what-is-a-software-license/)
- SPDX License
- Compiling
- Contract Declaration## Basic Solidity: Types
_[⌨️ Basic Solidity Types](https://updraft.cyfrin.io/courses/solidity/simple-storage/solidity-basic-types)_
- [Types & Declaring Variables](https://docs.soliditylang.org/en/v0.8.13/)
- `uint256`, `int256`, `bool`, `string`, `address`, `bytes32`
- [Solidity Types](https://docs.soliditylang.org/en/latest/types.html)
- [Bits and Bytes](https://www.youtube.com/watch?v=Dnd28lQHquU)
- Default Initializations
- Comments## Basic Solidity: Functions
_[⌨️ Basic Solidity Functions](https://updraft.cyfrin.io/courses/solidity/simple-storage/solidity-functions)_
- Functions
- Deploying a Contract
- Smart Contracts have addresses just like our wallets
- Calling a public state-changing Function
- [Visibility](https://docs.soliditylang.org/en/latest/contracts.html#visibility-and-getters)
- Gas III | An example
- Scope
- View & Pure Functions## Basic Solidity: Arrays & Structs
_[⌨️ Basic Solidity Arrays & Structs](https://updraft.cyfrin.io/courses/solidity/simple-storage/solidity-arrays-and-structs)_
- Structs
- Intro to Storage
- Arrays
- Dynamic & Fixed Sized
- `push` array function## Basic Solidity: Compiler Errors and Warnings
_[⌨️ Basic Solidity Errors & Warnings](https://updraft.cyfrin.io/courses/solidity/simple-storage/solidity-errors-and-warnings)_
- Yellow: Warnings are Ok
- Red: Errors are not Ok## Memory, Storage, Calldata (Intro)
_[⌨️ Basic Solidity Memory, Storage, & Calldata (Intro)](https://updraft.cyfrin.io/courses/solidity/simple-storage/solidity-memory-storage-calldata)_
- 6 Places you can store and access data
- calldata
- memory
- storage
- code
- logs
- stack## Mappings
_[⌨️ Basic Solidity Mappings](https://updraft.cyfrin.io/courses/solidity/simple-storage/solidity-mappings)_
- [Mappings](https://solidity-by-example.org/mapping)
## Deploying your First Contract
_[⌨️ Deploying your First Contract](https://updraft.cyfrin.io/courses/solidity/simple-storage/deploying-solidity-smart-contract)_
- A testnet or mainnet
- Connecting Metamask
- [Find faucets here!](#testnet-faucets)
- See the faucets at the top of this readme!
- Interacting with Deployed Contracts## zkSync L2 deploy
_[⌨️ Deploying to Zksync](https://updraft.cyfrin.io/courses/solidity/simple-storage/zksync-deploying)_
- zkSync compiler edition: 0.8.24
## 🐸🐦 [Tweet Me (add your contract in)!](https://twitter.com/intent/tweet?text=I%20just%20deployed%20a%20Smart%20Contract%20to%20the%20@zksyncdevs%20testnet!%0a%0a%20Thanks%20@PatrickAlphaC%20and%20@cyfrinupdraft!)
## The EVM & A Recap of the section
_[⌨️ The EVM & A Recap of Section 2](https://updraft.cyfrin.io/courses/solidity/simple-storage/evm-recap)_
- The EVM
## Solidity 101 Section 1 NFTs
- [zkSync](https://explorer.zksync.io/address/0x5f9f9f46ECb48D625e320888922Bf86555608E9C)
- [Sepolia](https://sepolia.etherscan.io/address/0x5c1ddb86F11BB46D3067C702AC554aEaED9ff8f0#code)(back to top) ⬆️
# Solidity 101 Section 2 | Remix Storage Factory
💻 Code: [https://github.com/cyfrin/remix-storage-factory-cu](https://github.com/cyfrin/remix-storage-factory-cu)
## Introduction
_[⭐️ Section 2 | Storage Factory](https://updraft.cyfrin.io/courses/solidity/storage-factory/factory-introduction)_
- [Factory Pattern](https://betterprogramming.pub/learn-solidity-the-factory-pattern-75d11c3e7d29)
## Basic Solidity: Importing Contracts into other Contracts
_[⌨️ Importing Contracts into other Contracts](https://updraft.cyfrin.io/courses/solidity/storage-factory/solidity-imports)_
- [Composibility](https://chain.link/techtalks/defi-composability)
- [Solidity new keyword](https://docs.soliditylang.org/en/latest/control-structures.html?highlight=new#creating-contracts-via-new)
- [Importing Code in solidity](https://solidity-by-example.org/import)## Basic Solidity: Interacting with other Contracts
_[⌨️ Interacting with other contracts](https://updraft.cyfrin.io/courses/solidity/storage-factory/interacting-with-smart-contracts-abi)_
- To interact, you always need: ABI + Address
- [ABI](https://docs.soliditylang.org/en/latest/abi-spec.html?highlight=abi)## Basic Solidity: Inheritance & Overrides
_[⌨️ Inheritance & Overrides](https://updraft.cyfrin.io/courses/solidity/storage-factory/inheritance-in-solidity-smart-contracts)_
- [Inheritance](https://solidity-by-example.org/inheritance)
- [Override & Virtual Keyword](https://docs.soliditylang.org/en/latest/contracts.html?highlight=override#function-overriding)## Section 2 Recap
_[⌨️ Section 2 Recap](https://updraft.cyfrin.io/courses/solidity/storage-factory/summary-and-recap)_
## Solidity 101 Section 2 NFTs
- [zkSync](https://explorer.zksync.io/address/0x1D5c2Eb5F17Fa0BA4E3DfDDBF59DC0e6316219Ff)
- [Sepolia](https://sepolia.etherscan.io/address/0x4A62A8901e6113dEF0AEeEC77E531779cd40da73#code)(back to top) ⬆️
# Solidity 101 Section 3: Remix Fund Me
💻 Code: [https://github.com/Cyfrin/remix-fund-me-cu](https://github.com/Cyfrin/remix-fund-me-cu)
## Introduction
_[⭐️ Section 3 | Fund Me](https://updraft.cyfrin.io/courses/solidity/fund-me/fund-me-intro)_
## Setup
_[⌨️ Setup](https://updraft.cyfrin.io/courses/solidity/fund-me/setup)_
## Sending ETH through a function
_[⌨️ Sending ETH through a function](https://updraft.cyfrin.io/courses/solidity/fund-me/sending-eth-through-a-function)_
- [Ethereum Unit Converter](https://eth-converter.com/)
- [Fields in a Transaction](https://ethereum.org/en/developers/docs/transactions/)
- [More on v,r,s](https://ethereum.stackexchange.com/questions/15766/what-does-v-r-s-in-eth-gettransactionbyhash-mean)
- [payable](https://solidity-by-example.org/payable)
- [msg.value & Other global keywords](https://docs.soliditylang.org/en/latest/cheatsheet.html?highlight=cheatsheet#global-variables)
- [require](https://codedamn.com/news/solidity/what-is-require-in-solidity)
- [revert](https://medium.com/blockchannel/the-use-of-revert-assert-and-require-in-solidity-and-the-new-revert-opcode-in-the-evm-1a3a7990e06e)## Reverts
_[⌨️ Reverts](https://updraft.cyfrin.io/courses/solidity/fund-me/solidity-reverts)_
## Getting real world price data (Chainlink)
_[⌨️ Getting real world price data (Chainlink)](https://updraft.cyfrin.io/courses/solidity/fund-me/real-world-price-data)_
- [What is a blockchain oracle?](https://chain.link/education/blockchain-oracles)
- [What is the oracle problem?](https://blog.chain.link/what-is-the-blockchain-oracle-problem/)
- [Chainlink](https://chain.link/)
- [Chainlink Price Feeds (Data Feeds)](https://docs.chain.link/docs/get-the-latest-price/)
- [data.chain.link](https://data.chain.link/)
- [Chainlink VRF](https://docs.chain.link/docs/chainlink-vrf/)
- [Chainlink Keepers](https://docs.chain.link/docs/chainlink-keepers/introduction/)
- [Chainlink API Calls](https://docs.chain.link/docs/request-and-receive-data/)
- [Importing Tokens into your Metamask](https://consensys.net/blog/metamask/how-to-add-your-custom-tokens-in-metamask/)
- [Request and Receive Chainlink Model](https://docs.chain.link/docs/architecture-request-model/)## Quick recap I
_[⌨️ Quick recap I](https://updraft.cyfrin.io/courses/solidity/fund-me/mid-section-recap-fund-me)_
## Interfaces
_[⌨️ Interfaces](https://updraft.cyfrin.io/courses/solidity/fund-me/solidity-smart-contract-interfaces)_
- For reference - [ChainLink Interface's Repo](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol)
## AI Help III
_[⌨️ AI Help III](https://updraft.cyfrin.io/courses/solidity/fund-me/ai-help-development-part-2)_
## Importing from NPM / GitHub
_[⌨️ Importing from NPM / GitHub](https://updraft.cyfrin.io/courses/solidity/fund-me/import-libraries-smart-contracts-from-npm-github)_
- [Chainlink NPM Package](https://www.npmjs.com/package/@chainlink/contracts)
## Getting Prices from Chainlink
_[⌨️ Getting Prices from Chainlink](https://updraft.cyfrin.io/courses/solidity/fund-me/getting-prices-from-chainlink)_
## More Solidity math
_[⌨️ More Solidity math](https://updraft.cyfrin.io/courses/solidity/fund-me/solidity-math)_
- Multiply before you divide
- [tuple](https://docs.soliditylang.org/en/latest/abi-spec.html?highlight=tuple#handling-tuple-types)
- [Floating Point Numbers in Solidity](https://stackoverflow.com/questions/58277234/does-solidity-supports-floating-point-number)
- [Type Casting](https://ethereum.stackexchange.com/questions/6891/type-casting-in-solidity)
- Gas Estimation Failed
- Someone should make an article explaining this error## msg.sender
_[⌨️ msg.sender](https://updraft.cyfrin.io/courses/solidity/fund-me/solidity-msg-sender)_
- [msg.sender](https://docs.soliditylang.org/en/latest/cheatsheet.html?highlight=msg.sender)
- named mappings## Quick recap II
_[⌨️ Quick recap II](https://updraft.cyfrin.io/courses/solidity/fund-me/quick-recap-fund-me)_
## Library
_[⌨️ Library](https://updraft.cyfrin.io/courses/solidity/fund-me/create-solidity-library)_
- [Library](https://docs.soliditylang.org/en/v0.8.14/contracts.html?highlight=library#libraries)
- [Solidity-by-example Library](https://solidity-by-example.org/library)## SafeMath
_[⌨️ SafeMath](https://updraft.cyfrin.io/courses/solidity/fund-me/safemath)_
- [unchecked vs. checked](https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic)
## For Loop
_[⌨️ For Loop](https://updraft.cyfrin.io/courses/solidity/fund-me/solidity-for-loop)_
- [For Loop](https://solidity-by-example.org/loop)
- `/* */` is another way to make comments## Resetting an array
_[⌨️ (Resetting an array](https://updraft.cyfrin.io/courses/solidity/fund-me/solidity-reset-an-array)_
## Transfer, Send, and Call
_[⌨️ Transfer, Send, and Call](https://updraft.cyfrin.io/courses/solidity/fund-me/sending-eth-from-a-contract)_
- [Transfer, Send, Call](https://solidity-by-example.org/sending-ether/)
- [this keyword](https://ethereum.stackexchange.com/questions/1781/what-is-the-this-keyword-in-solidity)## Constructor
_[⌨️ Constructor](https://updraft.cyfrin.io/courses/solidity/fund-me/solidity-smart-contract-constructor)_
- [Constructor](https://solidity-by-example.org/constructor)
## Modifiers
_[⌨️ Modifiers](https://updraft.cyfrin.io/courses/solidity/fund-me/solidity-function-modifiers)_
- [Double equals](https://www.geeksforgeeks.org/solidity-operators/)
- [Modifier](https://solidity-by-example.org/function-modifier)## Testnet Demo
_[⌨️ Tesnet Demo](https://updraft.cyfrin.io/courses/solidity/fund-me/testnet-demo)_
- [Disconnecting Metamask](https://help.1inch.io/en/articles/4666771-metamask-how-to-connect-disconnect-and-switch-accounts-with-metamask-on-1inch-network)
### Immutable & Constant
_[⌨️ Immutable & Constant](https://updraft.cyfrin.io/courses/solidity/fund-me/solidity-immutability-and-constants)_
- [Immutable](https://solidity-by-example.org/immutable)
- [Constant](https://solidity-by-example.org/constants)
- [Current ETH Gas Prices](https://etherscan.io/gastracker)
- Don't stress about gas optimizations! (yet)
- Naming Conventions
- [Someone make this!](https://github.com/smartcontractkit/full-blockchain-solidity-course-js/issues/13)### Custom Errors
_[⌨️ Custom Errors](https://updraft.cyfrin.io/courses/solidity/fund-me/solidity-custom-errors)_
- [Custom Errors Introduction](https://blog.soliditylang.org/2021/04/21/custom-errors/)
### Receive & Fallback Functions
_[⌨️ Receive & Fallback Functions](https://updraft.cyfrin.io/courses/solidity/fund-me/receive-fallback)_
- [Solidity Docs Special Functions](https://docs.soliditylang.org/en/latest/contracts.html?highlight=fallback#special-functions)
- [Fallback](https://solidity-by-example.org/fallback)
- [Receive](https://docs.soliditylang.org/en/latest/contracts.html?highlight=fallback#receive-ether-function)## Section 3 Recap
_[⌨️ Section 3 Recap](https://updraft.cyfrin.io/courses/solidity/fund-me/recap-congratulations-fundme)_
## Solidity 101 Section 3 NFTs
- [zkSync](https://explorer.zksync.io/address/0x598c64586d890222c085eCb3a01Db36237D6ccE4)
- [Sepolia](https://sepolia.etherscan.io/address/0x1b30DA2a868704483143A4D46865Ac9585629fd0#code)(back to top) ⬆️
# Solidity 101 Section 4: AI Prompting, Asking Questions, and Getting Help
DO NOT SKIP THIS!!
_[⭐️ Section 4 | AI Prompting](https://updraft.cyfrin.io/courses/solidity/ai-prompting/ai-and-forums)_
## Intro
- [Deep Learning for Python Engineers](https://learn.deeplearning.ai/)
## 7 Tips for this Course
- [Original Video](https://www.youtube.com/watch?v=IS5dAkFSo_Y)
## Setting up GitHub
_[⌨️ Setting up GitHub](https://updraft.cyfrin.io/courses/solidity/ai-prompting/setting-up-github)_
## Formatting a question
_[⌨️ Formatting a question](https://updraft.cyfrin.io/courses/solidity/ai-prompting/formatting-a-question)_
- [markdown](https://www.markdownguide.org/basic-syntax/)
* It's a good idea to ask your AI buddy to format your questions in markdown \*
## SpeedRunEthereum
_[⌨️ SpeedRunEthereum](https://updraft.cyfrin.io/courses/solidity/ai-prompting/speedrun)_
- Special Guest [Austin](https://twitter.com/austingriffith)
## Solidity 101 Section 4 NFTs
- [zkSync](https://explorer.zksync.io/address/0x687C1d191ccD64777dF009942A148fBF7F52F006#contract)
- [Sepolia](https://sepolia.etherscan.io/address/0x4b3a7F293091708dDD6B8748179aeAF80E9c1bA2#code)(back to top) ⬆️
# Course: Foundry Fundamentals
# Foundry Fundamentals Section 1: Foundry Simple Storage
💻 Code: [https://github.com/Cyfrin/foundry-simple-storage-cu](https://github.com/Cyfrin/foundry-simple-storage-cu)
## Introduction
_[⭐️ Foundry Simple Storage Introduction](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/introduction-foundry-simple-storage?lesson_format=video)_
## Installation & Setup (MacOS & Linux)
_[⌨️ Installation & Setup (MacOS & Linux) ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/development-environment-setup-mac-linux)_
- [Visual Studio Code](https://code.visualstudio.com/)
- [Crash Course](https://www.youtube.com/watch?v=WPqXP_kLzpo)
- [VSCode Keybindings](https://code.visualstudio.com/docs/getstarted/keybindings)
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- [What is a terminal?](https://code.visualstudio.com/docs/editor/integrated-terminal)### Windows Setup (WSL)
_[⌨️ (Windows Setup (WSL) ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/development-environment-setup-windows)_
- Special Guest [Vasiliy](https://twitter.com/cromewar)
- [WSL](https://docs.microsoft.com/en-us/windows/wsl/install)
- When working in WSL, use Linux commands instead of Windows commands
- [TroubleShooting](https://docs.microsoft.com/en-us/windows/wsl/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 ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/introduction-to-gitpod)_
- [Gitpod](https://www.gitpod.io/)
- **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
- `code .` to open VSCode in a new VSCode window## Foundry Install
_[⌨️ Foundry Install ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/foundry-setup)_
- [https://getfoundry.sh](https://getfoundry.sh)
## VSCode Setup II
_[⌨️ VSCode Setup II ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/vscode-setup)_
- CoPilot
- Copilot labs
- Hardhat Solidity Extension
- VSCodium
- `mkdir foundry-cu`
- `cd foundry-cu`
- `mkdir foundry-simple-storage-cu`## Foundry Setup
_[⌨️ Foundry Setup ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/foundry-setup)_
_[⌨️ Foundry Setup II (WSL)](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/foundry-setup-wsl)_- FreeCodeCamp Bash
## Formatting Solidity in VSCode
_[⌨️ Formatting Solidity in VSCode ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/vscode-solidity-setup)_
- Format your solidity code with in your `settings.json`
```json
"[solidity]": {
"editor.defaultFormatter": "NomicFoundation.hardhat-solidity"
},
"[javascript]":{
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
```## Compiling in Foundry
_[⌨️ Compiling in Foundry ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/compiling-a-smart-contract-foundry)_
## Compiling to zkSync in foundry-zksync
- [foundry-zksync](https://github.com/matter-labs/foundry-zksync)
## Deploying to a local chain I (Anvil or Ganache)
_[⌨️ Deploying to a local chain I (Anvil or Ganache)](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/deploy-smart-contract-locally)_
- [Ganache](https://trufflesuite.com/ganache/)
## Adding another network to Metamask
_[⌨️ Adding another network to Metamask](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/how-to-add-a-new-network-to-metamask)_
- [ETH JSON RPC](https://ethereum.github.io/execution-apis/api-documentation/)
## Deploying to a local chain II (Forge Create)
_[⌨️ Deploying to a local chain II (Forge Create)](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/deploying-locally-forge-foundry)_
- 2 Ways to deploy:
- 1. `forge create`
- 2. `forge script`## Private Key Rant I
_[⌨️ Private Key Rant I](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/private-key-safety)_
- `history -c`
## Deploying to a local chain III (Forge Script)
_[⌨️ Deploying to a local chain III (Forge Script)](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/deploying-locally-anvil)_
## What is a transaction (But actually)
_[⌨️ What is a transaction (But actually)](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/what-is-a-transaction)_
```bash
cast --to-base 0x01 dec
```## Private Key Rant II
_[⌨️ Private Key Rant II ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/private-key-safety-part-2)_
- `cast send`
- `source .env`## Can you Encrypt a Private Key -> a keystore in foundry yet??
Can you Encrypt a Private Key -> a keystore in foundry yet??
- A: ~~No~~ Yes, try the new feature by
```
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 --rpc-url <rpc_url> --account <account_name> --sender <address> --broadcast
```- [The .env pledge](https://github.com/Cyfrin/foundry-full-course-cu/discussions/5)
## Never use a Env File
_[⌨️ Never use a Env File ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/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 deployThe idea is you never want to have
your private key or password
ANYWHERE written in plain text
(Aka, you always want it encrypted)
```- [Someone fix this please](https://github.com/foundry-rs/foundry/issues/3818)
## Deploying to a testnet or a mainnet
_[⌨️ Deploying to a testnet Spolia ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/deploying-smart-contract-testnet-sepolia)_
- [Alchemy](https://alchemy.com/?a=673c802981)
- Other node as a service:
- [Quicknode](https://www.quicknode.com/endpoints)
- [Infura](https://www.infura.io/)## Verifying a contract the manual way
_[⌨️ Verifying a contract the manual way ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/verify-smart-contract-etherscan)_
- [Example verified contract](https://sepolia.etherscan.io/address/0xe2e9f468eb7f063aa01670bb4bce4119fb6e4b65#code)
## Cleaning up the project
_[⌨️ Cleaning up the project ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/cleaning-up-the-project)_
- `forge fmt`
- `README.md`## Foundry Zksync
- _[⌨️ Foundry Zksync ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/foundry-zksync)_
- _[⌨️ Compiling Foundry Zksync ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/compiling-foundry-zksync)_
- _[⌨️ Zksync Local Node ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/zksync-local-node)_
- _[⌨️ Zksync Local Deploy ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/zksync-local-deploy)_
- _[⌨️ Tx Types ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/tx-types)_
- _[⌨️ Why L2 ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/why-l2)_## Alchemy and the mempool
_[⌨️ Alchemy and the mempool ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/introduction-to-alchemy)_
- Special Guest [Vitto](https://twitter.com/VittoStack)
- [Alchemy](https://alchemy.com/?a=673c802981)## Summary
_[⌨️ Summary ](https://updraft.cyfrin.io/courses/foundry/foundry-simple-storage/summary-congratulations?lesson_format=video)_
## Foundry Fundamentals Section 1 NFTs
- [zkSync](https://explorer.zksync.io/address/0xbe19357f00B8A80154bB927a95d82888Ee70F6F8#contract)
- [Sepolia](https://sepolia.etherscan.io/address/0x6c4791c3a9E9Bc5449045872Bd1b602d6385E3E1#code)<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>
## Foundry Fundamentals Section 2: Foundry Fund Me
_[⭐️ Foundry Fund Me](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/introduction)_
💻 Code: [https://github.com/Cyfrin/foundry-fund-me-cu](https://github.com/Cyfrin/foundry-fund-me-cu)
## Introduction
_[⌨️ Introduction ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/introduction)_
## Setup
_[⌨️ Setup ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/fund-me-project-setup)_
## Testing Introduction
_[⌨️ Testing Introduction ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/smart-contract-testing-introduction)_
## Setup Continued
_[⌨️ Setup Continued ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/finshing-the-setup)_
- [Chainlink Brownie Contracts Github Repo](https://github.com/smartcontractkit/chainlink-brownie-contracts)
```bash
forge install smartcontractkit/[email protected] --no-commit
```
- [Dependencies](https://book.getfoundry.sh/projects/dependencies)
- [remappings](https://book.getfoundry.sh/reference/forge/forge-remappings)
- [Chainlink Brownie Contracts](https://github.com/smartcontractkit/chainlink-brownie-contracts)## Tests
_[⌨️ Tests ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/writing-tests-for-solidity-smart-contracts)_
- [foundry tests](https://book.getfoundry.sh/forge/writing-tests)
- [console.log](https://book.getfoundry.sh/reference/forge-std/console-log?highlight=con#console-logging)## Debugging Tests I
_[⌨️ Debugging Tests I ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/debugging-tests)_
## Advanced Deploy Scripts I
_[⌨️ Advanced Deploy Scripts I ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/advanced-deploy-scripts)_
## Forked Tests
_[⌨️ Forked Tests ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/forked-tests)_
- The test option `-m` regex is deprecated. Please use `--match-test` or `--mt` instead.
```bash
forge test -m testPriceFeedVersionIsAccurate -vvv
```is deprecated. Please use
```
forge test --match-test testPriceFeedVersionIsAccurate -vvv
```- 4 types of testing:
```
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)
```- [forking in foundry](https://book.getfoundry.sh/forge/fork-testing?highlight=fork#forking-cheatcodes)
- [forge coverage](https://book.getfoundry.sh/reference/forge/forge-coverage?highlight=cover#description)## Refactoring I: Testing Deploy Scripts
_[⌨️ Refactoring I: Testing Deploy Scripts ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/refactoring-testing)_
## Refactoring II: Helper Config
_[⌨️ Refactoring II: Helper Config ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/refactoring-helper)_
- [block.chainid](https://docs.soliditylang.org/en/v0.8.19/units-and-global-variables.html)
- [Chain ID List](https://chainlist.org/)
- 11155111 is ETH Sepolia
- 1 is ETH Mainnet## Refactoring III: Mocking
_[⌨️ Refactoring III: Mocking ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/refactoring-mocks)_
- [Mocking](https://stackoverflow.com/questions/2665812/what-is-mocking)
- [Chainlink Github](https://github.com/smartcontractkit/chainlink)
- Multiple Versions of Solidity## Magic Numbers
_[⌨️ Magic Numbers ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/magic-numbers)_
- [Style Guide](https://docs.soliditylang.org/en/v0.8.17/style-guide.html)
- [Magic Numbers](https://codeburst.io/software-anti-patterns-magic-numbers-7bc484f40544)## Refactoring III: Mocking (continued)
_[⌨️ Refactoring III: Mocking (continued) ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/refactoring-mocks-2)_
## More Cheatcodes
_[⌨️ More Cheatcodes ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/foundr-tests-cheatcodes)_
- [foundry cheatcodes](https://book.getfoundry.sh/forge/cheatcodes)
- [forge std cheats](https://book.getfoundry.sh/reference/forge-std/)
- [vm.expectRevert](https://book.getfoundry.sh/cheatcodes/expect-revert?highlight=expectRevert#expectrevert)
- [vm.prank](https://book.getfoundry.sh/cheatcodes/prank?highlight=prank#prank)
- [makeAddr](https://book.getfoundry.sh/reference/forge-std/make-addr?highlight=makeAddr#makeaddr)
- [deal](https://book.getfoundry.sh/cheatcodes/deal?highlight=deal#deal)## More Coverage
_[⌨️ More Coverage ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/more-coverage)_
- [State tree testing](https://twitter.com/PaulRBerg/status/1624763320539525121?s=20)
- Arrange, Act, Assert
- [hoax](https://book.getfoundry.sh/reference/forge-std/hoax?highlight=hoax#hoax)
- uint160 -> address
- [vm.startPrank](https://book.getfoundry.sh/cheatcodes/start-prank?highlight=startPrank#startprank)## Chisel
_[⌨️ Chisel ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/introduction-to-foundry-chisel)_
- [Chisel](https://book.getfoundry.sh/reference/chisel/?highlight=chisel#chisel)
## Gas: Cheaper Withdraw
_[⌨️ Gas: Cheaper Withdraw ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/calculate-solidity-function-gas-costs)_
- [Gas Reporter](https://book.getfoundry.sh/forge/gas-reports)
- `forge snapshot`
- `vm.txGasPrice`
- `gasLeft()`
- `tx.getprice`## Storage
_[⌨️ Storage ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/solidity-storage-optimization)_
- ** Advanced **
- [Storage Layout](https://docs.soliditylang.org/en/latest/internals/layout_in_storage.html)
- [Purpose of the memory keyword](https://stackoverflow.com/questions/33839154/in-ethereum-solidity-what-is-the-purpose-of-the-memory-keyword)```
cast storage
```- [Opcodes](https://ethereum.org/en/developers/docs/evm/opcodes/)
- [Opcodes by Gas](https://github.com/crytic/evm-opcodes)
- [Opcodes by Gas](https://evm.codes/)
- Append `s_` to storage variables
- Append `i_` to immutable variables
- Caps lock and underscore constant variables
- [Chainlink Solidity Style Guide](https://github.com/smartcontractkit/full-blockchain-solidity-course-js/issues/13)## Gas: Cheaper Withdraw (continued)
_[⌨️ Gas: Cheaper Withdraw (continued) ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/optimise-solidity-function-gas-costss)_
- [evm.codes](https://www.evm.codes/)
- [Style Guide](https://docs.soliditylang.org/en/latest/style-guide.html)
- [Chainlink Style Guide](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/STYLE_GUIDE.md)
- [NatSpec](https://docs.soliditylang.org/en/latest/natspec-format.html)## Interactions.s.sol
_[⌨️ Interactions.s.sol ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/solidity-integration-tests)_
- [foundry devops](https://github.com/Cyfrin/foundry-devops)
- [Best README Template](https://github.com/othneildrew/Best-README-Template)
- [ffi](https://book.getfoundry.sh/cheatcodes/ffi?highlight=ffi#ffi)## Makefile
_[⌨️ Makefile ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/makefile)_
- [Install make](https://stackoverflow.com/questions/39892692/how-to-implement-make-install-in-a-makefile)
- [Install make Ubuntu](https://linuxhint.com/install-use-make-ubuntu/).
- [Etherscan API Key](https://docs.etherscan.io/getting-started/viewing-api-usage-statistics)## Zksync Devops
_[⌨️ Zksync Devops ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/zksync-devops)_
## Pushing to GitHub
_[⌨️ Pushing to GitHub ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/pushing-to-github)_
- Add these to your `.gitignore`
- `.env`
- `lib/`
- `broadcast/`
- [Git Docs](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- [GitHub docs](https://docs.github.com/en)
- [Github Quickstart](https://docs.github.com/en/get-started/quickstart)
- [What is Git?](https://www.git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F)
- [The quickstart that we follow in the video](https://docs.github.com/en/get-started/importing-your-projects-to-github/importing-source-code-to-github/adding-locally-hosted-code-to-github#adding-a-local-repository-to-github-using-git)
- [Learn about git and GitHub](https://www.youtube.com/watch?v=RGOj5yH7evk)## 🐸🐦 [Tweet Me (add your repo in)!](https://twitter.com/intent/tweet?text=I%20just%20made%20my%20first%20Smart%20Contract%20repo%20using%20@solidity_lang,%20foundry,%20@chainlink,%20@AlchemyPlatform,%20and%20more!%0a%0aThanks%20@PatrickAlphaC%20and%20@cyfrinupdraft!!)
_[⌨️ (2:34:56) | Tweet Me (add your repo in)! ](https://youtu.be/sas02qSFZ74?t=9296)_
## Section 2: Recap
_[⌨️ Section 2: Recap ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/section-recap)_
## Foundry Fundamentals Section 2 NFTs
- [zkSync](https://explorer.zksync.io/address/0xDBb7cFfb41261D9a445b09E7c5dF28De18254D5B#contract)
- [Sepolia](https://sepolia.etherscan.io/address/0xD7D127991c6A89Df752FC3daeC17540aE8B86101#code)<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](ht)_
💻 Code: [https://github.com/Cyfrin/html-fund-me-cu](https://github.com/Cyfrin/html-fund-me-cu)
- [More in-depth Javascript & Full Stack introduction video](https://www.youtube.com/watch?v=pdsYCkUWrgQ)
## Introduction
## Setup
_[⌨️ Setup ](https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/fund-me-project-setup)_
- [Live Server Extension](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)
## How Metamask works with your browser
<!-- TODO: Replace with Correct updraft sections -->
_[⌨️ How Metamask works with your browser ]()_- [Metamask Docs](https://docs.metamask.io/)
- [Ethers Docs](https://docs.ethers.org/v5/)## Introduction to function selectors
_[⌨️ Introduction to function selectors ]()_
- [Function selector](https://ethereum.stackexchange.com/questions/49996/what-is-the-function-selector-of-the-fallback-function?rq=1)
- [cast sig](https://book.getfoundry.sh/reference/cast/cast-sig?highlight=sig#cast-sig)## Recap
_[⌨️ Recap ]()_
- [More in-depth Javascript & Full Stack introduction video](https://www.youtube.com/watch?v=pdsYCkUWrgQ)
## Foundry Fundamentals Section 3 NFTs
- **IPFS hash for website** - ipfs://QmdCBj5B188qzXgG1LUCD6aKe6RJHqbSgu7YfPyncDirzh
<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](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/introduction?lesson_format=video)_
💻 Code: [https://github.com/Cyfrin/foundry-smart-contract-lottery-cu](https://github.com/Cyfrin/foundry-smart-contract-lottery-cu)
## Introduction
_[⌨️ Introduction ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/introduction?lesson_format=video)_
## Raffle.sol Setup
_[⌨️ Raffle.sol Setup ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/setup)_
- Raffle.sol Setup
## Solidity Contract Layout
_[⌨️ Solidity Contract Layout ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/solidity-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 ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/solidity-custom-errors)_
- Custom Errors in Solidity
## Events
_[⌨️ Events ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/solidity-events)_
- Introduction to Events
* Events & Logging Video
* Events & Logging in Hardhat## block.timestamp
_[⌨️ block.timestamp ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/solidity-random-number-block-timestamp)_
## Chainlink VRF
_[⌨️ Chainlink VRF ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/solidity-random-number-chainlink-vrf)_
- Introduction to Chainlink VRF
* Special Guest [Richard](https://twitter.com/RGottleber)
### Sub-Section: Chainlink VRF
> - Chainlink VRFv2 Docs
> - Chainlink VRFv2 Walkthrough
> - Chainlink Contracts## Implementing Chainlink VRF - Introduction
_[⌨️ Implementing Chainlink VRF - Introduction ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/implementing-chainlink-vrf)_
- Implementing Chainlink VRF
* [Get Sepolia Testnet LINK tokens](https://faucets.chain.link/)
* [Chainlink docs - create a random number](https://docs.chain.link/vrf/v2/subscription/examples/get-a-random-number#create-and-fund-a-subscription)
* [Chainlink Brownie Contracts](https://github.com/smartcontractkit/chainlink-brownie-contracts)```bash
forge install smartcontractkit/[email protected] --no-commit
```## Modulo
_[⌨️ Modulo ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/solidity-modulo-operation)_
- Modulo
## Enum
_[⌨️ Enum ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/solidity-enum-lottery-state)_
## Resetting an array
_[⌨️ Resetting an array ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/resetting-array)_
## Note on building
_[⌨️ Note on building ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/note-on-building)_
## CEI (Checks, Effects, Interactions)
_[⌨️ CEI (Checks, Effects, Interactions) ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/cei-method-checks-effects-interactions)_
## Introduction to Chainlink Automation
_[⌨️ Introduction to Chainlink Automation ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/chainlink-automation)_
- Chainlink Automation Docs
- Chainlink Automation Walkthrough## Implementing Chainlink Keepers - checkUpkeep
_[⌨️ Implementing Chainlink Keepers - checkUpkeep ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/implementing-automation-2)_
### Enums
- Enum
## Implementing Chainlink Keepers - checkUpkeep continued
- block.timestamp
## Custom Error
_[⌨️ Custom Error ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/custom-error)_
## Mid-Section Recap
_[⌨️ Mid-Section Recap ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/lottery-mid-lesson-recap)_
## Tests & Deploy Script Setup
_[⌨️ Tests & Deploy Script Setup ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/tests-and-deploy)_
## Deploy Script
_[⌨️ Script Setup ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/deploy-script)_
### Mock Chainlink VRF Coordinator
_[⌨️ Mock Chainlink VRF Coordinator ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/deploy-mock-chainlink-vrf)_
## Tests & Deploy Script Continued
_[⌨️ Tests & Deploy Script Continued ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/tests-and-deploy-2)_
## Lots of Tests
_[⌨️ Lots of Tests ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/setup-solidity-lottery-tests)_
## Headers
_[⌨️ Headers ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/headers)_
## Adding more tests.
_[⌨️ Adding more tests ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/more-tests)_
### Testing Events in Foundry
_[⌨️ Testing Events in Foundry ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/testing-events-solidity)_
### vm.roll & vm.warp
_[⌨️ vm.roll & vm.warp ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/vm-roll-warp)_
## Create Subscription Script
_[⌨️ Create Subscription Script ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/create-subscriptions)_
- [eth signature database](https://openchain.xyz/signatures)
## Create Subscription from the UI
_[⌨️ Create Subscription from the UI ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/subscription-ui)_
## Fund Subscription Script
_[⌨️ Fund Subscription Script ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/fund-subscription)_
- [Link Token](https://chain.link/)
- [Link Token Addresses](https://docs.chain.link/resources/link-token-contracts)
- [Solmate](https://github.com/transmissions11/solmate)
- [Openzeppelin](https://www.openzeppelin.com/)## Add Consumer Script
_[⌨️ Add Consumer Script ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/add-consumer)_
## More Tests
_[⌨️ More Tests ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/even-more-tests)_
- `forge coverage --report debug`
## Coverage Report
_[⌨️ Coverage Report ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/coverage-report)_
## PerformUpkeep Tests
_[⌨️ PerformUpkeep Tests ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/test-and-refactor-perform-upkeep)_
- Expecting Custom Errors
## Getting Event Data into Foundry Scripts
_[⌨️ Getting Event Data into Foundry Scripts ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/event-data)_
- `vm.recordLogs`
## Intro to Fuzz tests
_[⌨️ Intro to Fuzz tests ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/intro-smart-contract-fuzz-testing)_
## One Big Test
_[⌨️ One Big Test ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/one-big-test)_
## Passing the private key to vm.startBroadcast
_[⌨️ Passing the private key to vm.startBroadcast ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/passing-private-key)_
## Integrations Test
_[⌨️ Integrations Test ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/solidity-integration-tests)_
## Testnet Demo - Optional
_[⌨️ Testnet Demo - Optional ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/testnet-demo)_
## Console.log Debugging
_[⌨️ Console.log Debugging ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/solidity-console-log-debug)_
## forge test --debug
_[⌨️ forge test --debug ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/forge-test-debug)_
## Recap
_[⌨️ Recap ](https://updraft.cyfrin.io/courses/foundry/smart-contract-lottery/recap)_
### Recommended LINK amounts for Sepolia Staging Test:
- Chainlink VRF: 2 LINK
- Chainlink Keepers: 8 LINK## Foundry Fundamentals Section 4 NFTs
- [zkSync](https://explorer.zksync.io/address/0xEFA0f9Ca73f5C2f4b735eEDf63d49B1680054158#contract)
- [Sepolia](https://sepolia.etherscan.io/address/0x33e1fD270599188BB1489a169dF1f0be08b83509#code)<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](https://updraft.cyfrin.io/courses/advanced-foundry)_
💻 Code: [https://github.com/Cyfrin/foundry-erc20-cu](https://github.com/Cyfrin/foundry-erc20-cu)
## What is an ERC? What is an EIP?
- What is an EIP?
- EIPs codebase## What is an ERC20?
_[⌨️ What is an ERC20? ](https://updraft.cyfrin.io/courses/advanced-foundry/How-to-create-an-erc20-crypto-currency/erc-and-erc20-fundamentals)_
- [Video (using brownie/python)](https://www.youtube.com/watch?v=8rpir_ZSK1g)
- EIP-20
- ERC-677
- EIP-777## Manually Creating an ERC20 Token
_[⌨️ Manually Creating an ERC20 Token ](https://updraft.cyfrin.io/courses/advanced-foundry/How-to-create-an-erc20-crypto-currency/create-an-erc20)_
- `.github`
## ERC20 Token - Openzeppelin
_[⌨️ ERC20 Token - Openzeppelin ](https://updraft.cyfrin.io/courses/advanced-foundry/How-to-create-an-erc20-crypto-currency/erc20-open-zeppelin)_
- Openzeppelin
- [Openzeppelin Wizard](https://wizard.openzeppelin.com/)
- [Openzeppelin Contracts](https://github.com/OpenZeppelin/openzeppelin-contracts)
- [Solmate (Openzeppelin alternative)](https://github.com/transmissions11/solmate)## Deploy Script
_[⌨️ Deploy Script ](https://updraft.cyfrin.io/courses/advanced-foundry/How-to-create-an-erc20-crypto-currency/erc20-deploy-script)_
## AI Tests
_[⌨️ AI Tests ](https://updraft.cyfrin.io/courses/advanced-foundry/How-to-create-an-erc20-crypto-currency/erc20-ai-tests-and-recap)_
- [Token Approvals](https://etherscan.io/tokenapprovalchecker)
## Advanced Foundry Section 1 NFTs
- [zkSync](https://explorer.zksync.io/address/0x475d9da05E73e283EB5B490c89cfDf36B0Bca5fc)
- [Sepolia](https://sepolia.etherscan.io/address/0xE0aE410a16776BCcb04A8d4B0151Bb3F25035994#code)<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>
# Advanced Foundry Section 2: Foundry NFTs | MoodNFT
_[⭐️ Section 2: NFTs](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/introduction-to-nfts)_
💻 Code: [https://github.com/Cyfrin/foundry-nft-cu](https://github.com/Cyfrin/foundry-nft-cu)
## Introduction
## What is an NFT?
_[⌨️ What is an NFT? ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/what-is-a-nft)_
- [Video](https://www.youtube.com/watch?v=9yuHz6g_P50)
- Optional: All on Chain SVG NFT
- EIP-721## Foundry Setup
_[⌨️ Foundry Setup ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/foundry-setup)_
- TokenURI
- Pudgy Penguin Example## IPFS
_[⌨️ IPFS ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/what-is-ipfs)_
- [What is IPFS](https://www.youtube.com/watch?v=5Uj6uR3fp-U)
## Using IPFS
_[⌨️ Using IPFS ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/upload-data-on-IPFS)_
## Basic NFT: Deploy Script
_[⌨️ Basic NFT: Deploy Script ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/nfts-deployment-script)_
## Basic NFT: Tests
_[⌨️ Basic NFT: Tests ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/basic-nft-tests)_
- Comparing strings in solidity
- `chisel`## Basic NFT: Interactions
_[⌨️ Basic NFT: Interactions ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/interact-with-solidity-smart-contracts)_
## Basic NFT: Testnet Demo
_[⌨️ Basic NFT: Testnet Demo ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/deploy-nfts-on-testnet)_
## The issue with IPFS & HTTPS TokenURI NFTs
_[⌨️ The issue with IPFS & HTTPS TokenURI NFTs ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/pin-nfts-images-using-pinata)_
- [pinata](https://pinata.cloud/)
- [SVG NFT Video](https://www.youtube.com/watch?v=9oERTH9Bkw0)## What is an SVG?
_[⌨️ What is an SVG? ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/what-is-svg)_
- [svg](https://www.w3schools.com/graphics/svg_intro.asp)
- [vscode extension](https://marketplace.visualstudio.com/items?itemName=vitaliymaz.vscode-svg-previewer)
- [base64 encoding](https://www.base64encode.org/)## SVG NFT: Introduction
_[⌨️ SVG NFT: Introduction ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/create-dynamic-nft)_
## SVG NFT: Encoding the NFT
_[⌨️ SVG NFT: Encoding the NFT ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/svg-onchain-encoding)_
- [base64 openzeppelin](https://docs.openzeppelin.com/contracts/4.x/utilities)
## SVG NFT: Flipping the mood
_[⌨️ SVG NFT: Flipping the mood ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/change-on-chain-nft-image)_
## SVG NFT: Deploy Script
_[⌨️ SVG NFT: Deploy Script ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/dynamic-nft-collection-deployment-script)_
- [readFile Cheat](https://github.com/foundry-rs/foundry/issues/2153)
## SVG NFT: Debugging practice & some notes
_[⌨️ SVG NFT: Debugging practice & some notes ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/debug-solidity-smart-contract)_
## SVG NFT: Anvil Demo
_[⌨️ SVG NFT: Anvil Demo ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/svg-anvil)_
- [arweave](https://www.arweave.org/)
- [filecoin](https://filecoin.io/)
- [nft.storage](https://nft.storage/)
- [Patrick video on Filecoin](https://www.youtube.com/watch?v=Cj9r3pKI2L8)## NFTS: Filecoin & Arweave
_[⌨️ NFTS: Filecoin & Arweave ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/introduction-to-filecoin-arweave)_
## Advanced: EVM Opcodes, Encoding, and Calling
_[⌨️ Advanced: EVM Opcodes, Encoding, and Calling ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/evm-opcodes-advanced)_
### abi.encode & abi.encodePacked
- abi.encode
- abi.encodePacked
Thanks to [Alex Roan](https://twitter.com/alexroan) for his help on this session!
- Example Contract Creation Transaction
What REALLY is the ABI?
- EVM Opcodes
- More EVM Opcodes
- Solidity Cheatsheet
- abi.encode vs abi.encodePacked### Introduction to Encoding Function Calls Directly
_[⌨️ Introduction to Encoding Function Calls Directly ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/evm-encoding)_
### Introduction to Encoding Function Calls Recap
_[⌨️ Introduction to Encoding Function Calls Recap ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/avanced-evm-recap)_
### Encoding Function Calls Directly
_[⌨️ Encoding Function Calls Directly ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/evm-signatures-selectors)_
- Function Selector
- Function Signature## Verifying Metamask Transactions
_[⌨️ Verifying Metamask Transactions ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/verifying-transaction-metamask)_
1. Check the address
2. Check the function selector
3. Decode the calldata- [joinfire.zxyz](https://app.joinfire.xyz/)
## Section 2 Recap
_[⌨️ (10:36:31) | Section 2 Recap ](https://updraft.cyfrin.io/courses/advanced-foundry/how-to-create-an-NFT-collection/nft-and-andvanced-evm-recap)_
- [ENS](https://ens.domains/)
## Advanced Foundry Section 2 NFTs
- [zkSync](https://explorer.zksync.io/address/0x9085b18f712A7F26DC2f4C2F485ffCd1D0a10433#contract)
- [Sepolia](https://sepolia.etherscan.io/address/0x93c7A945af9c453a8c932bf47683B5eB8C2F8792#code)<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](https://github.com/Cyfrin/foundry-defi-stablecoin-cu)
## Introduction
_[⭐️ Section 3: DeFi Stablecoins](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-introduction)_
## What is DeFi?
- [What is DeFi?](https://chain.link/education/defi)
- [DefiLlama](https://defillama.com/)
- [Bankless](https://www.bankless.com/)
- [MEV](https://www.flashbots.net/)
- [Aave](https://aave.com/)
- [My Previous Aave Video on Shorting Assets](https://www.youtube.com/watch?v=TmNGAvI-RUA)
- [DAI](https://makerdao.com/en/)
- [Uniswap](https://app.uniswap.org/)
- [Maximal Extractable Value (MEV)](https://ethereum.org/en/developers/docs/mev/)## Code Walkthrough
_[⌨️ Code Walkthrough](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-code-walkthrough)_
- [What is a smart contract audit](https://www.youtube.com/watch?v=aOqhQvWhUG0)
## What is a stablecoin (But actually)
_[⌨️ What is a stablecoin (But actually)](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-stablecoins)_
- [Video](https://www.youtube.com/watch?v=XeqQf08PDlA)
- [MakerDAO Forums](https://start.makerdao.com/)## DecentralizedStableCoin.sol
_[⌨️ DecentralizedStableCoin.sol](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-decentralized-stablecoin)_
- [What is a smart contract audit](https://www.youtube.com/watch?v=aOqhQvWhUG0)
- `super`## DSCEngine.sol Setup
_[⌨️ DSCEngine.sol Setup ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-dscengine-setup)_
- [liquidations](https://docs.aave.com/faq/liquidations)
- [nonreentrant](https://docs.openzeppelin.com/contracts/4.x/api/security)
- [reentrancy](https://solidity-by-example.org/hacks/re-entrancy/)## Deposit Collateral
_[⌨️ Deposit Collateral ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-deposit-collateral)_
- Other DeFi Examples:
- [Aave V2 Docs](https://docs.aave.com/developers/v/2.0/)
- [Aave NPM](https://www.npmjs.com/package/@aave/protocol-v2)## Mint DSC
### Getting the value of our collateral
_[⌨️ Getting the value of our collateral ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-mint-dsc)_
- [Aave Borrowing FAQs](https://docs.aave.com/faq/borrowing)
- [Health Factor](https://docs.aave.com/faq/borrowing#what-is-the-health-factor)
- [Aave Risk Parameters](https://docs.aave.com/risk/asset-risk/risk-parameters)### Health Factor
_[⌨️ Health Factor ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-health-factor)_
- [Liquidation Threshold](https://docs.aave.com/risk/asset-risk/risk-parameters)
### Minting the DSC
_[⌨️ Minting the DSC ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-wrap-mint-function)_
## Testing while developing
### Deploy Script
_[⌨️ Deploy Script ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-deploy-script)_
- [WETH Token Sepolia Etherscan](https://sepolia.etherscan.io/address/0xdd13E55209Fd76AfE204dBda4007C227904f0a81)
- [WETH Token Mainnet](https://etherscan.io/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2)### Tests
_[⌨️ Tests ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/test-defi-protocol)_
## depositCollateralAndMintDsc
_[⌨️ depositCollateralAndMintDsc ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-deposit-and-mint-function)_
## redeemCollateral
_[⌨️ redeemCollateral ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-how-to-redeem-collateral)_
## Liquidate
### Setup
_[⌨️ Setup ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-liquidation-setup)_
### Refactoring
_[⌨️ Refactoring ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-liquidation-refactor)_
## Leveling up your testing skillz
_[⌨️ Leveling up your testing skillz ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-protocols-advanced-testings-testing)_
### Challenge: Get DSCEngine.sol test coverage above 85%
## Fuzz (Invariant) Testing
_[⌨️ Fuzz (Invariant) Testing ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-writing-fuzz-tests)_
- [Video](https://www.youtube.com/watch?v=juyY-CTolac)
## Open-based Fuzz tests
_[⌨️ Open-based Fuzz tests ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/create-fuzz-tests-handler)_
## Handler-based Fuzz tests
### revert_on_fail = true
_[⌨️ revert_on_fail = true ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/create-fuzz-tests-handler-part-2)_
### Create the collateral redeemal handler
_[⌨️ Create the collateral redeemal handler](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-handler-deposit-collateral)_
### DeFi Handler Deposit Collateral
_[⌨️ DeFi Handler Deposit Collateral](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-handler-redeeming-collateral)_
### Minting DSC
_[⌨️ Minting DSC ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-handler-minting-dsc)_
### Debugging Fuzz Tests
_[⌨️ Debugging Fuzz Tests ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-handler-fuzz-debugging)_
- [Ghost Variables](https://mirror.xyz/horsefacts.eth/Jex2YVaO65dda6zEyfM_-DXlXhOWCAoSpOx5PLocYgw)
### Challenge: Find out why `mintDsc` is never being called on our Handler.sol
## Price Feed Handling
_[⌨️ Price Feed Handling ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-price-feed-handler)_
## OracleLib
_[⌨️ OracleLib ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/managing-oracles-connections)_
## Note on audit preparedness
_[⌨️ Note on audit preparedness ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/preparing-your-protocol-for-an-audit)_
- [Simple security checklist](https://github.com/nascentxyz/simple-security-toolkit)
## Recap
_[⌨️ Recap ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/defi-recap)_
## Lens Protocol
_[⌨️ Lens Protocol ](https://updraft.cyfrin.io/courses/advanced-foundry/develop-defi-protocol/introduction-to-lens-protocol)_
- Special Guest [Nader](https://twitter.com/dabit3)
- [Lens Protocol](https://www.lens.xyz/)### More DeFi Learnings:
- [Defi-Minimal](https://github.com/smartcontractkit/defi-minimal/tree/main/contracts)
- [Defi Dad](https://www.youtube.com/channel/UCatItl6C7wJp9txFMbXbSTg)## Advanced Foundry Section 3 NFTs
- [zkSync](https://explorer.zksync.io/address/0xC4C177DEa09d046D68b0Ad2E0d8003090f0FD832#contract)
- [Sepolia](https://sepolia.etherscan.io/address/0xe5760847db2f10A74Fc575B4803df5fe129811C1#code)<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](https://github.com/Cyfrin/foundry-merkle-airdrop-cu)
## Introduction to Merkle Airdrops and Code Walkthrough
_[⌨️ Introduction ](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/introduction)_## Project Setup
_[⌨️ Project Setup ](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/project-setup)_
## Merkle Proofs
_[⌨️ Merkle Proofs ](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/merkle-proofs)_
## Base Airdrop Contract
_[⌨️ Base Airdrop Contract](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/base-airdrop-contract)_
- Second preimage attack articles [[1](https://flawed.net.nz/2018/02/21/attacking-merkle-trees-with-a-second-preimage-attack/), [2](https://www.rareskills.io/post/merkle-tree-second-preimage-attack)]
## Already Claimed Check
_[⌨️ Already Claimed Check](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/already-claimed-check)_
## Merkle Tree Scripts
_[⌨️ Merkle Tree Scripts](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/merkle-tree-script)_
## Writing the Tests
_[⌨️ Writing the Tests](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/writing-the-tests)_
## Deployment Script
_[⌨️ Deployment Script](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/deployment-script)_
## Adding Signature Verification
_[⌨️ Adding Signature Verification](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/adding-signature-verification)_
## Signature Standards
_[⌨️ Signature Standards](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/signature-standards)_
- [EIP-191](https://eips.ethereum.org/EIPS/eip-191)
- [EIP-712](https://eips.ethereum.org/EIPS/eip-712)
- [Signature standards article](https://www.cyfrin.io/blog/understanding-ethereum-signature-standards-eip-191-eip-712)## ECDSA Signatures
_[⌨️ ECDSA Signatures](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/ecdsa-signatures)_
- [ECDSA signatures article](https://www.cyfrin.io/blog/elliptic-curve-digital-signature-algorithm-and-signatures)
- [Signature Malleability - Section 4 of the Replay Attacks Article](https://www.cyfrin.io/blog/replay-attack-in-ethereum)---
## Transaction Types Introduction
_[⌨️ Transaction Types Introduction](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/transaction-types-introduction)_
## Transaction Types
_[⌨️ Transaction Types](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/transaction-types)_
- [Ethereum transaction types](https://ethereum.org/en/developers/docs/transactions/#typed-transaction-envelope)
- [zkSync transaction types](https://docs.zksync.io/zk-stack/concepts/transaction-lifecycle#transaction-types)## Blob Transactions
_[⌨️ Blob Transactions](https://updraft.cyfrin.io/courses/advanced-foundry/merkle-airdrop/blob-transactions)_
- [Blob transactions article](https://www.cyfrin.io/blog/what-is-eip-4844-proto-danksharding-and-blob-transactions)
---
- Type 113 Transactions
- Implementing Signatures
- Modifying the Tests
- Test on zkSync (optional)
- Create Claiming Script
- Creating a Signature
- Splitting a Signature
- Executing the Anvil Script
- Deploy and Claim on zkSync Local Node
- Deploy and Claim on zkSync Sepolia
- Summary## Advanced Foundry Section 4 NFTs (TBD)
# Advanced Foundry Section 5: Foundry Upgrades
💻 Code: [https://github.com/Cyfrin/foundry-upgrades-cu](https://github.com/Cyfrin/foundry-upgrades-cu)
## Introduction
_[⭐️ Section 5: Upgradable Contracts & Proxies](https://updraft.cyfrin.io/courses/advanced-foundry/upgradeable-smart-contracts/introduction-to-upgradeable-smart-contracts)_
## Upgradable Smart Contracts Overview
- [Optional Video](https://www.youtube.com/watch?v=bdXJmWajZRY)
## Types of Upgrades
1. Parameter
2. Social Migrate
3. Proxy
1. Proxy Gotchas
1. [Function Collisions](https://blog.openzeppelin.com/the-state-of-smart-contract-upgrades/#diamonds)
2. [Storage Collisions](https://blog.openzeppelin.com/the-state-of-smart-contract-upgrades/#diamonds)
2. [Metamorphic Upgrades](https://github.com/PatrickAlphaC/hardhat-metamorphic-upgrades-fcc)
3. [Transparent](https://blog.openzeppelin.com/the-transparent-proxy-pattern/)
4. [UUPS](https://forum.openzeppelin.com/t/uups-proxies-tutorial-solidity-javascript/7786)
5. [Diamond](https://eips.ethereum.org/EIPS/eip-2535)## Delegatecall
_[⌨️ Delegatecall ](https://updraft.cyfrin.io/courses/advanced-foundry/upgradeable-smart-contracts/solidity-delegate-call)_
- [delegatecall (solidity-by-example)](https://solidity-by-example.org/delegatecall)
- [Yul](https://docs.soliditylang.org/en/latest/yul.html)## Small Proxy Example
_[⌨️ Small Proxy Example ](https://updraft.cyfrin.io/courses/advanced-foundry/upgradeable-smart-contracts/what-is-eip-1967)_
- [EIP 1967](https://eips.ethereum.org/EIPS/eip-1967)
## Universal Upgradable Smart Contract
### Setup
_[⌨️ UUPS Setup ](https://updraft.cyfrin.io/courses/advanced-foundry/upgradeable-smart-contracts/introduction-to-uups-proxies)_
- [UUPS vs Transparent](https://docs.openzeppelin.com/contracts/4.x/api/proxy#transparent-vs-uups)
- Abstract Contracts### Deploy
_[⌨️ Deploy ](https://updraft.cyfrin.io/courses/advanced-foundry/upgradeable-smart-contracts/deploy-upgreadable-smart-contracts)_
- [ERC-1967](https://eips.ethereum.org/EIPS/eip-1967)
### UpgradeBox
_[⌨️ Upgradebox ](https://updraft.cyfrin.io/courses/advanced-foundry/upgradeable-smart-contracts/uups-upgrade)_
### Test/Demo
_[⌨️ (5:53:48) | Test/Demo ](https://youtu.be/wUjYK5gwNZs?t=21228)_
## Testnet Demo
_[⌨️ Testnet Demo ](https://updraft.cyfrin.io/courses/advanced-foundry/upgradeable-smart-contracts/testnet-demos)_
## Advanced Foundry Section 5 NFTs
- [zkSync](https://explorer.zksync.io/address/0xaf3697C1B7e686a7f83dcbb753AcbBA4c2A940aB#contract)
- [Sepolia](https://sepolia.etherscan.io/address/0xaFa4150818b7843345A5E54E430Bd0cAE31B5c0C#code)<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](https://github.com/Cyfrin/minimal-account-abstraction)
## What is account abstraction?
_[⌨️ Account Abstraction Introduction](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/introduction)_
- What is native account abstraction?
- How does zkSync do account abstraction?
- What is EIP-4337?
- What are zkSync system contracts?## Code Overview
_[⌨️ Code Overview](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/code-overview)_
## Ethereum Setup
_[⌨️ Etheren Account Abstraction](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/eth-setup)_
## PackedUserOperation
_[⌨️ PackedUserOperation](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/packed-user-op)_
## Validate UserOp
_[⌨️ Validate UserOp](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/validate-user-op)_
## EntryPoint Contract
_[⌨️ EntryPoint Contract](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/entrypoint)_
## Execute Function Ethereum
_[⌨️ Execute](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/execute)_
## Deployment Script for an Ethereum Account
_[⌨️ Deploy Script](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/deploy)_
## Tests Owner can Execute
_[⌨️ Tests Owner can Execute](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/owner-execute-test)_
## Unsigned PackedUserOperation Test
_[⌨️ Get Unsigened PackedUserOperation](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/unsigned-packed-user-op)_
## Signed UserOp Test
_[⌨️ Signed PackedUserOperation](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/signed-user-op)_
## Using unlocked accounts for local development
_[⌨️ Local Dev Unlocked](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/signed-user-op)_
## Test Validation of User Ops
_[⌨️ Test Validate UserOps](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/signed-user-op)_
## Test Entry Point
_[⌨️ Test Entry Point](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/test-entry)_
## Advanced Debugging
_[⌨️ Advanced Debugging](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/advanced-debugging)_
## Mid-session Recap
_[⌨️ Mid Session Recap](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/mid-session-recap)_
## Live Demo on Arbitrum
_[⌨️ Live Demo](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/live-demo-eth)_
## ZkSync Native Account Abstraction
_[⌨️ ZkSync Setup](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/zksync-setup)_
## IAccount
_[⌨️ IAccount](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/iaccount)_
## System Contracts
_[⌨️ System Contracts](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/system-contracts)_
## Type 113 LifeCycle
_[⌨️ TxType 113 Lifecycle](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/life-cycle)_
## Mid-zkSync Recap
_[⌨️ ZkSync Accounts Recap](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/zksync-recap)_
## System Contract Call zkSync Simulations
_[⌨️ ZkSync Transaction Simulations](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/zksync-simulations)_
## Validate Transaction zkSync
_[⌨️ ValidateTransaction](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/validate-tx)_
## Execute Function Zksync
_[⌨️ executeTransaction](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/execute-tx)_
## Pay For Transaction zkSync
_[⌨️ payForTransaction](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/pay-for-tx)_
## Execute Transaction From Outside
_[⌨️ executeTransactionFromOutside](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/execute-tx-from-out)_
## zkSync Tests
_[⌨️ zkSync Tests](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/execute-tx-from-out)_
## Building a Transaction Struct
_[⌨️ Transaction Struct](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/tx-struct)_
## Via Ir
_[⌨️ --via-ir](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/via-ir)_
## Validate Transaction Test
_[⌨️ Validate Transaction Test](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/validate-tx-test)_
## Clean Up zkSync
_[⌨️ Clean up](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/clean-up-zk)_
## Testnet zkSync Demo
_[⌨️ Testnet Demo](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/testnet-last)_
## Rcap & End
_[⌨️ Recap End](https://updraft.cyfrin.io/courses/advanced-foundry/account-abstraction/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](https://github.com/Cyfrin/foundry-dao-cu)
## Introduction
_[⭐️ Section 14 | DAOs & Governance](https://updraft.cyfrin.io/courses/advanced-foundry/daos/introduction-to-dao)_
- [Plutocracy is bad](https://vitalik.eth.limo/general/2018/03/28/plutocracy.html)
- [DAOs are not corporations](https://vitalik.eth.limo/general/2022/09/20/daos.html)## What is a DAO?
- [What is a DAO?](https://www.youtube.com/watch?v=X_QKZzd68ro)
- Special Guest [Juliette](https://twitter.com/_juliettech)## How to build a DAO
## DAOs toolings - Introduction to Aragon
_[⌨️ DAOs tooling - Special Guest from Aragon](https://updraft.cyfrin.io/courses/advanced-foundry/daos/introduction-to-aragon-dao)_
## Project Setup
_[⌨️ Build your own DAO Setup](https://updraft.cyfrin.io/courses/advanced-foundry/daos/introduction-to-aragon-dao)_
- [How to build a DAO](https://www.youtube.com/watch?v=AhJtmUqhAqg)
- That's Patrick
- [PY Code](https://github.com/brownie-mix/dao-mix)
- [Python Video](https://www.youtube.com/watch?v=rD8AxZ_wBA4)## Governance Token
_[⌨️ Governance Tokens](https://updraft.cyfrin.io/courses/advanced-foundry/daos/governance-tokens)_
- [Openzeppelin Governance](https://docs.openzeppelin.com/contracts/4.x/api/governance)
- [Compound Governance](https://compound.finance/governance)
- [Contract Wizard](https://wizard.openzeppelin.com/)### Governor
_[⌨️ Creating the Governor Contract](https://updraft.cyfrin.io/courses/advanced-foundry/daos/create-governor-contract)_
- [CastVoteBySig](https://forum.openzeppelin.com/t/what-is-votecastbysig/17069/2)
## Tests
_[⌨️ Testing the Governor Contract](https://updraft.cyfrin.io/courses/advanced-foundry/daos/tests)_
## Wrap up
_[⌨️ Section Recap](https://updraft.cyfrin.io/courses/advanced-foundry/daos/daos-section-recap)_
## Bonus: Gas optimization tips
- Special Guest [Harrison](https://twitter.com/PopPunkOnChain)
## Advanced Foundry Section 7 NFTs
- [zkSync](https://explorer.zksync.io/address/0xC63704f836505F6967d8e6Ee8A1678B57f7b5Ec9)
- [Sepolia](https://sepolia.etherscan.io/address/0x46F3fE2C8aC9e9AE4DEDE1a7a29Ab3BdcFa7eaFc#code)<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](https://updraft.cyfrin.io/courses/security).🖥️ Code: https://github.com/PatrickAlphaC/denver-security
## Introduction
_[⭐️ Section 6 | Security & Auditing](https://updraft.cyfrin.io/courses/advanced-foundry/security/intro)_
- [Readiness Checklist](https://github.com/nascentxyz/simple-security-toolkit)
## What is a smart contract audit?
_[⌨️ What is a smart contract audit?](https://updraft.cyfrin.io/courses/advanced-foundry/security/what-is-smart-contract-audit)_
- [What is a smart contract audit Cyfrin Channel Video](https://www.youtube.com/watch?v=aOqhQvWhUG0)
## Tools
_[⌨️ What tools do security professionals use?](https://updraft.cyfrin.io/courses/advanced-foundry/security/top-smart-contract-security-tools)_
## Manual Review
_[⌨️ Intro to Manual review](https://updraft.cyfrin.io/courses/advanced-foundry/security/smart-contract-manual-review)_
### Static Analysis
- [Slither](https://github.com/crytic/slither#how-to-install)
- [4nlyzer](https://github.com/Picodes/4naly3er)### Dynamic Analysis
### Formal Verification
### Symbolic Execution
- [Manticore](https://github.com/trailofbits/manticore)
- [Mythril](https://github.com/ConsenSys/mythril)
- [hevm](https://github.com/ethereum/hevm)
- [Comparison](https://hackmd.io/@SaferMaker/EVM-Sym-Exec)### Fuzzing
- [Echidna](https://github.com/crytic/echidna)
- [Foundry](https://getfoundry.sh/)
- [Consensys](https://fuzzing.diligence.tools/login)### Formal Verification (& Symbolic Execution)
- [Comparisons](https://twitter.com/palinatolmach/status/1653030270684270592)
### Other security stuff
- [solcurity](https://github.com/transmissions11/solcurity)
## What does the process of manual review look like?
_[⌨️ Manual Review with Tincho](https://updraft.cyfrin.io/courses/advanced-foundry/security/smart-contract-manual-review)_
- [Tincho finds $100,000 ENS bug](https://www.youtube.com/watch?v=A-T9F0anN1E)
## Formal Verification
_[⌨️ Formal Verification](https://updraft.cyfrin.io/courses/advanced-foundry/security/formal-verification)_
- [Formal Verification & Symbolic Execution | W/ Trail Of Bits](https://www.youtube.com/watch?v=izpoxfTSaFs)
## Closing Thoughts
_[⌨️ Wrap. Up](https://updraft.cyfrin.io/courses/advanced-foundry/security/congratulations)_
- [Common Attacks](https://blog.sigmaprime.io/solidity-security.html)
- [Best Practices](https://consensys.github.io/smart-contract-best-practices/)
- [Attacks](https://consensys.github.io/smart-contract-best-practices/attacks/)
- [Oracle Attacks](https://hackernoon.com/how-dollar100m-got-stolen-from-defi-in-2021-price-oracle-manipulation-and-flash-loan-attacks-explained-3n6q33r1)
- [Damn Vulnerable Defi](https://www.damnvulnerabledefi.xyz/)
- [Ethernaut](https://ethernaut.openzeppelin.com/)
- [Top Smart Contract Auditors](https://patrickalphac.medium.com/top-7-smart-contract-auditors-bec7bd70dd9f)
- Some Smart Contract Auditors:
- [Cyfrin](https://cyfrin.io/)
- [OpenZeppelin](https://openzeppelin.com/)
- [SigmaPrime](https://sigmaprime.io/)
- [Trail of Bits](https://www.trailofbits.com/)
- [Spearbit](https://spearbit.com/)
- [Dedaub](https://dedaub.com/)
- [Trust](https://www.trust-security.xyz/)
- [More](https://patrickalphac.medium.com/top-7-smart-contract-auditors-bec7bd70dd9f)## Advanced Foundry Section 8 NFTs
- [zkSync](https://explorer.zksync.io/address/0xb54B64B3BB587b39F189797c68A6bd183fFB4379#contract)
- [Sepolia](https://sepolia.etherscan.io/address/0x766a74f8924C7B07df088fDB0F7D7DbaDd330Fb3#code)<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
- [Top 10 learning resources](https://patrickalphac.medium.com/top-10-smart-contract-solidity-developer-learning-resources-cb9d60dd1146)
- [Patrick Collins](https://www.youtube.com/channel/UCn-3f8tw_E1jZvhuHatROwA)
- [CryptoZombies](https://cryptozombies.io/)
- [Alchemy University](https://www.alchemy.com/dapps/alchemy-university)
- [Speed Run Ethereum](https://speedrunethereum.com/)
- [Ethereum.org](https://ethereum.org/en/)### Community
- [Twitter](https://twitter.com/PatrickAlphaC)
- [Ethereum Discord](https://ethereum.org/en/)
- [Reddit ethdev](https://www.reddit.com/r/ethdev/)### Hackathons
- [CL Hackathon](https://chain.link/hackathon)
- [ETH Global](https://ethglobal.co/)
- [ETH India](https://twitter.com/ETHIndiaco)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
- [Matter Labs (zkSync)](https://zksync.io/)
- [Arbitrum Foundation](https://arbitrum.foundation/)
- [Chainlink Labs](https://chainlinklabs.com/)
- [BadgerDAO](https://badger.com/)
- [Optimism RPGF Round 3](https://community.optimism.io/docs/governance/retropgf-3/)<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](https://www.cyfrin.io/) 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](https://github.com/cyfrin/foundry-full-course-cu/blob/main/LICENSE).
[![Cyfrin Twitter](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/cyfrinupdraft)
[![Cyfrin YouTube](https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@CyfrinAudits)
[![Cyfrin LinkedIn](https://img.shields.io/badge/Linkedin-0e76a8?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/school/cyfrin-updraft/)<p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p>