Learn Solidity, Blockchain Development, & Smart Contracts | Powered By AI - Full Course (7 - 11)
Вставка
- Опубліковано 6 чер 2024
- This course will give you a full introduction into all of the core concepts related to blockchain, smart contracts, Solidity, ERC20s, full-stack Web3 dapps, decentralized finance (DeFi), Chainlink, Ethereum, upgradable smart contracts, DAOs, aave, IPFS, and more. Follow along with the videos and you'll be a blockchain wizard in no time!
Join Cyfrin Updraft to see this in a NOT giant UA-cam video: updraft.cyfrin.io/
This is lessons 7 - 11
🦊 Part 1, Lesson 0 - 6: • Learn Solidity, Blockc...
🐶 Part 2, Lesson 7 - 11: • Learn Solidity, Blockc...
🌋 Part 3, Lesson 12 - 15: • Learn Solidity, Blockc...
🐸 Web3Education.dev: web3education.dev/
💻 Code, resources, and support forum: github.com/Cyfrin/foundry-ful...
Please reference the repo for anything you need and feel free to leave issues and participate in the discussions.
⭐️ (0:00:00) | Lesson 7: Foundry Fund Me
⭐️ (2:37:02) | Lesson 8: HTML Fund Me
⭐️ (3:04:09) | Lesson 9: Smart Contract Lottery
⭐️ (7:08:04) | Lesson 10: ERC20s
⭐️ (7:40:56) | Lesson 11: NFTs
Special thanks to @CyfrinAudits for sponsoring this video!
✅✅ Donate ✅✅
I use donated funds to spend money on making fun & informational videos.
ETH/Arbitrum/Polygon/EVM Chains Wallet address:
0x9680201d9c93d65a3603d2088d125e955c73BD65
😸😸Follow Patrick!😸😸
Cyfrin: www.cyfrin.io/
UA-cam: www.youtube.com/@PatrickAlpha...
Twitter: / patrickalphac
Medium: / patrickalphac
TikTok: / patrickalphac
Twitch Stream Uploads & Shorts: / @patrickalphac-alt
All thoughts and opinions are my own. - Наука та технологія
For any of you who are having trouble trying to run a particular test, forge test -m is deprecated, use forge test --match-test (or forge test --mt) instead
I was just running the whole test file thanks for the information!!
Thanks mate
Shortcut: `forge test --mt `
thank you!!
Thank u
This is everything I've been looking for since diving into Web3! I'm extremely grateful and looking forward to jump in the trenches with the rest of the Web3 Security Researchers. This is gold and Patrick is a God Send
Just finished the vid! Thanks Patrick!!! The only comprehensive Solidity course on the internet
This is a very good course. The way it is set up allows you to get some victories along the way to encourage you to keep pushing forward until completion.
Patrick is a very good instructor and a wealth of knowledge and best practices.
Timestamps for Lessons 8 & 9!!! :3
Lesson 8: HTML Fund Me
(2:37:02) | Lesson Start
(2:38:59) | Setup
(2:40:25) | How Metamask works with your browser
(2:52:34) | Introduction to function selectors
(3:00:00) | Recap
Lesson 9: Smart Contract Lottery
(3:04:09) | Lesson Start
(3:08:16) | Raffle.sol Setup
(3:15:53) | Solidity Contract Layout
(3:17:37) | Custom Errors
(3:22:00) | Events
(3:33:29) | block.timestamp
(3:37:13) | Chainlink VRF
(3:47:21) | Implementing Chainlink VRF
(4:03:32) | Modulo
(4:08:57) | Enum
(4:13:04) | Resetting an array
(4:14:31) | Note on building
(4:16:00) | CEI (Checks, Effects, Interactions)
(4:18:31) | Introduction to Chainlink Automation
(4:33:47) | Implementing Chainlink Keepers - checkUpkeep
(4:40:10) | Implementing Chainlink Keepers - performUpkeep
(4:43:00) | Mid-Lesson Recap
*Don't forget to take a break!!! ^v^ *
(4:44:08) | Tests & Deploy Script Setup
(4:52:02) | Mock Chainlink VRF Coordinator
(4:56:25) | Tests & Deploy Script Continued
(5:04:50) | Lots of Tests
(5:09:37) | Testing Events in Foundry
(5:12:37) | vm.roll & vm.warp
(5:15:21) | Create Subscription Script
(5:26:41) | Create Subscription from the UI
(5:30:19) | Fund Subscription Script
(5:42:29) | Add Consumer Script
(5:52:44) | More Tests
(5:59:12) | PerformUpkeep Tests
(6:03:23) | Getting Event Data into Foundry Scripts
(6:11:48) | Intro to Fuzz tests
(6:15:41) | One Big Test
(6:26:30) | Passing the private key to vm.startBroadcast
(6:41:08) | Integrations Test
(6:44:42) | Testnet Demo - Makefile setup
(6:52:33) | Testnet Demo - The Demo
(6:59:30) | Console.log Debugging
(7:01:06) | forge test --debug
(7:02:07) | Recap
Decided to post the timestamps so you don't have to jump back and forth from the github :> Thanks based fren patrick for the free knowledge!
thanks man
Thanks for sharing such a amazing course! It gives me a door to a brand new world!
Thank you so much Patrick 🙏🏾. Just finished this massive lesson. Only way is up from here 🚀
i have 0 knowledge in coding, i studied medicine, for 5 years brah. Thought this was gonna be impossible to achive at my age(34) but im doing quite good. Hope a can get there this year.
Thanks a lot for all the lessons, really really high value on this videos. Good luck in everything man
Thank you for these high quality tutorials Patrick! I have learned a great deal with them. Awesome job! I am indeed very grateful.
Patrick is a very competent instructor - explained all concepts well and clearly, the course has helped provide an intermediate starting point for understanding programming in Solidity, Foundry Book, Chainlink Api-Docs, Automation-Subscription and AlchemyApi- which certainly will prove useful gaining a sound Solidity Knowledge Foundation. Pace - excellent, content - superb, good use of theory and very hands-on, thank you very much! Exactly what I wanted albeit puzzling at times rewatching the videos and coding persistently really helps. looking forward to lesson 10 and beyond...Thanks Again🚀
Thank you for the kind words !!!
Woow .. This is the course what I was looking for . Thank you again @patric for this wonderful resource .. I bet this course is a Gold standard in Web3 learning
It is fren :)
Thanks for watching!
Phenomenal videos Patrick
Details and technique are so simple and shown
your tutorials are always unique
Thank you for the lesson. Onwards and upwards🚀
Am do happy with this course I start right away
No ice cream! If you need a break, go hit the gym!@!@
Love the course Patrick. 3rd time through. Really sinking in, especially the programmatic deployment and fuzz tests. Thank you.
Timeline
(0:00:00) chapter - 7
(0:00:08) - introduction
(0:02:51) - Setup
(0:04:41) - Testing introduction
(0:06:15) - setup continued
(0:11:55) - tests
(0:20:45) - Debugging Tests 1
(0:23:17) - Advanced Deployed Scripts I
(0:25:46) - Forked Tests
(0:34:19) - Refactoring I: Testing deploy scripts
(0:41:30) - Refactoring II: Helper Config
(0:54:33) - Refactoring III: Mocks
(0:58:42) - Magic Numbers
(1:00:45) - Refactoring III: Mocking continued
(1:05:06) - More Cheatcodes
(1:17:38) - More coverage
(1:32:25) - Chisel
(1:33:50) - Gas: Cheaper Withdraw
(1:38:37) - Storage
(1:45:03) - Back to video after excerpt
(1:48:22) - Cheaper Withdraw (continued)
(1:56:13) - Interactions.s.sol
(2:10:56) - Makefile
(2:19:13) - Push to Github
(2:35:11) - Recap
Thank you!! Can you add these to the GitHub repo?
@@PatrickAlphaC ya sure I would love to that
Bro this is way underrated
For me this three videos are acting as a course that I am doing to get job and internships and hopefully will soon grab one if able to complete 👌💯the whole three videos
how the things did go?
Did you get a job or an internship in the meantime?
These video are so valuable lession. thank u patrick
Aside from all the unnecessary scripts for chainlink stuff which makes the course 100x more difficult for beginners, this is an absolute gem, thanks Patrick for all the work !
I love the fact that you mentioned beginners difficulty. This course it no joke, especially the tests.
I am coming from maybe intermediate python and can read pretty much most code. After lesson 7 I was drained, had to take a day off even looking at solidity to gain more motivation. I guess it will be worse in the other lessons but I'm determined to finish it.
can you tell me what parts of chainlink stuff can I skip through? @mim2598
I went through lessons 0-6 without much problem but im feeling really lost in the lesson 7, any tips?
I wouldn't call it unnecessary scripts and link stuff.. how else do you want to learn to interact with other smartcontracts and token? It was quite helpful for me personally
Thanks Patrick. Learned a LOT!
Thankyou. I'm learning a lot with you.
I am new to web3 and just finished the first video. Very addictive. Thank you sooooo much Patrick for this awesome lecture series. If there's someone who is still learning and like to team up just reply me here. Thanks.
@@georgewkushco Hi, thank you for your response. Please let me know the best way to contact you so we can discuss teaming up.
I can't wait to get up to this point!
i will come after this cours comes first watched blockchain cours ever
These three videos are the best things that have happened to me in the last 3 months 🥳
Just wait till you finish them and you life levels up even more
Hang in there buddy (although these are indeed great videos)
@@PatrickAlphaC these videos based on ethereum 2.0 ?
@@hammadsaleem7554 yes! Although it’s known as “the merge” now
Timestamps for Lessons 10 & 11 ( ͡° ͜ʖ ͡°)
Lesson 10: ERC20s
(7:08:04) | Lesson Start
(7:10:42) | What is an ERC20?
(7:12:06) | Manually Creating an ERC20 Token
(7:19:01) | ERC20 Token - Openzeppelin
(7:22:58) | Deploy Script
(7:25:48) | AI Tests
Lesson 11: NFTs
(7:40:56) | Lesson Start
(7:43:21) | What is an NFT?
(7:49:54) | Foundry Setup
(8:00:24) | IPFS
(8:07:30) | Using IPFS
(8:13:59) | Basic NFT: Deploy Script
(8:15:25) | Basic NFT: Tests
(8:25:31) | Basic NFT: Interactions
(8:28:24) | Basic NFT: Testnet Demo
(8:34:32) | The issue with IPFS & HTTPS TokenURI NFTs
(8:38:30) | What is an SVG?
(8:45:54) | SVG NFT: Introduction
(8:50:03) | SVG NFT: Encoding the NFT
(9:06:41) | SVG NFT: Flipping the mood
(9:08:44) | SVG NFT: Deploy Script
(9:25:46) | SVG NFT: Debugging practice & some notes
(9:31:29) | SVG NFT: Anvil Demo
(9:36:58) | Filecoin & Arweave
(9:44:02) | Advanced: EVM Opcodes, Encoding, and Calling
(10:06:27) | Introduction to Encoding Function Calls Directly
(10:12:16) | Introduction to Encoding Function Calls Recap
(10:14:15) | Encoding Function Calls Directly
(10:28:45) | Verifying Metamask Transactions
(10:36:31) | Lesson 11 Recap
🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
!!!Completed Video 2!!! :D :D :D
🎊🎊🎊🎊🎊🎊🎊🎊🎊🎊
If you made it this far congrats! :>
You are now obliged to get some Ice Cream like what Patrick said 🍦🍦🍦
you should put an empty line between each line so it's easier to click each timestamp, avoid mis-clicking
The shorter version of `forge test --match-test` is `forge test --mt `
Learning tip for terminal commands: Although Patrick uses the button for up to access previously typed commands, do NOT use that. Instead, keep in your mind that by pressing the up button you can go through previous terminal commands but try to type them out manually during the course, they will stick in your mind much better than if you type them once and then just use the upper arrow to access them.
Similarly, I avoided installing the Github AI helper for the same reason. The more one repeats manually commands, writing of functions, variables etc during the course, the more will stay with him or her and you will learn to THINK instead of relying on the AI. I plan to install the AI helper AFTER the course though.
Great suggestion
I also take my time, 100% much more than the average person to go through this course because besides from being able to type code, I want to deeply understand as much as possible by repeating certain segments, stopping the video and coding the contracts entirely on my own after a lesson. Uninstalling MS code and/or Foundry and re-installing it on my own, creating directories, deleting directories, remaking directories, moving from one directory to the other etc, running scripts and commands etc on my own so I can learn to think by myself and to solve problems by myself without needing my hand held. If someone really wants to learn, I heartily recommend it. @@PatrickAlphaC
hello, mind if i email you?
So many hours of hanging out with Patrick!
You get to hang with me more
Hello everyone, just finished the first video and it is a great starting point. Patrick has done a phenomenal job in these videos!!
If there's anyone who'd wanna team up to complete this series then please do reply!!
Boom!!
Let's do it
Hey I also need : )
please!
After about 2 weeks, finally got wsl to work on a borrowed system.
Can't wait to enter the market as a Blockchain dev. 🙏
LETS GO
I also have the same problem lol
WE LOVE YOU PATRICK COLLINS!
big thanks fren :)
This is Uncle Bob level quality!!!
Who is that
This is soo good
Lets goooooooooo! I am so happy that I am crying 😭
Us
You gonna make me cry
@@PatrickAlphaC thank you for everything Patrick
Personal tracking
10:23:10
9:45:52
8:47:38
8:33:35
7:41:01
6:23:57
6:11:49
5:55:04
5:20:13
I am seriously thinking right now about the choice of using the UI or doing all that Script work especially if you are a solo dev on the project
Patrick, I am in the middle of the second part and I am already In love with smart contracts, and with your way of teaching. I will finish this course and ethical hacking for sure. On 3:24:50 you mention a new full-stack course in web3. Are you going to publish it?
Probably end of the year :)
Great course, loving it so far. Has anyone else had an error with the 'testFundUpdatesFundedDataStructure' test in lesson 7? My code is identical to Patricks, however I keep getting revert errors, not sure what to do
could you ask in the github repo? Thanks!
Are we supposed to create the subscription manually for sepolia and other testnets? Because, I see, we only covered the create subscription code for Anvil. And Patrick created the subscription from UI and pasted the id in the code.
At 1:19:48 does the second vm.prank(USER) spin up another user address? i.e line 69 and line 73 are different addresses?
Phenomenal course, thanks a for your work Patrick and team!
Btw using string.concat seems to be a little bit more gas efficient (based on test provided).
contract Test {
function abiEncodePackedTest() public pure returns (string memory) {
return string(abi.encodePacked(stringA, stringB));
}
function stringConcatTest() public pure returns (string memory){
return string.concat(stringA, stringB);
}
}
Boom! Thanks for letting me know :)
Fooorge 💪
(2:52:34) Does anyone know what version of MetaMask this is? I have MetaMask v10.33 and it looks nothing like this. I do not find the Hex information, is there a setting to turn it on?
Hey, I wanna learn js too, should I watch your freecodecamp js edition video's front end part after the contract coding?
yes :)
Thanks man
@@FinanceCrypto. I'll appreciate
The lesson 9 has became more of a chainlink tutorial , has increased the complexity
Thank you so much for this amazing content, is there going to be a follow-up full stack course using more modern FE technologies?
Perhaps
@@PatrickAlphaC 🙏
Knack is back baby
nfts session , not all nfts on open sea has read contracts so we must choose these with read contract
Do you suggest that using sepholia default rpc instead of alchemy node? I tried fork test with default node and it worked but it is bit slow.
Use alchemy IMO
Hi Mr. Collins, after finishing this course, where can I practice my skills before joining the audits? thanks a lot
CodeHawks.com !!
Hey Patrick, is there a course for Ethers JS or Typescript coming up?
End of the year, yes. Full stack course
phew~ lesson 8!! :D
Keep it up!!
takin mandatory break time :) in the middle of Lesson 9.
@@LareienHan mandatory break time!!
5:52:12 I did take a break 😅
Hi, I have a question about foundry, can we make Dapps with it or we need to pass with hardhad and so on?
You can make dapps with foundry!
At what point did we setup the .env file? I tried to copy what patrick has @6:30:22 but it must be specific to my machine. How do I find the right url and private key for sepolia?
Could you ask in the GitHub discussions?
I noticed that alchemy doesn't have an option for Binance chain (smart chain). why is that? A lot of defi projects are on BSC
I am using the hardhat foundry plugin to write tests in the foundry. Is it good?
that works! We've seen some top protocols do this
Isn't that big test at the end more of an integration test? I don't think it should be with the unit tests.
P.S. Many many thanks for providing so much value for free Patrick.
5:50:43 had me all 🥳🎉💥🎊🎉🎈🎖
Patrick's comedy is underrated.
Where do i get that blue emoji bruh
34:00 Refactoring
1:57:00 Ineractions
mapping can be used to store tha players that endered. then we use the random number to get the player base on its id storedPlayers[random] will return the players address
There will be no need to loop through the array of players.
uint256 private s_playerCount;
mapping(uint256 => address payable) private s_playerIndex;
function enterRaffle() external payable {
if (msg.value < i_entranceFee) {
revert Raffle__NotEnoughEthSent();
}
s_playerIndex[s_playerCount] = payable(msg.sender);
s_playerCount++;
}
I didn't understand the purpose of using Interactions to call the fund and withdraw methods. Why can't we directly make calls to these methods from the FundMe contract? Why do we need the Interactions.s.sol?
same question
Are you using an alias @27:20? I can only get the full --match-test flasg to work. I get this error when I use the -m flag, error: unexpected argument '-m' found.
They recently updated it to --mt over -m
There is an error on result of modulo operation. 2 % 3 = 2 not 1 and so on
0:27:27 - forge test --mt testVersion
Oh boy! Chat gpt knows nothing about -m error :(
thanks!Where i find those changees?
@@bambatsa xxxxx --help
Hi @Patrick
Thanks for the wonderful course
I would like to know at 22:55
Has anyone been able to determine the source or origin of the address "0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38"? It seems to be unrelated to the generated addresses provided in the foundry.
What do you mean? The source or origin?
Lottery contract - using mapping for all data store and array for store who is the winner since you use array to store all the keys we can use array to store the winner or winners i do not know if that make sense
Lesson 7 : Foundry Fund Me
00:02:51 setup
00:04:40 testing introduction
00:06:16 setup continued
00:11:56 tests
00:20:46 debugging tests l
00:23:16 advanced deploy scripts l
00:25:47 forked tests
00:34:18 Refactoring l : testing deploy scripts
Great course as usual but when i want pratict with your code nothing works, everytime vsc code ask me for some parameter but on your course you dont need them. I've try with different fundMe code from different course but same prob
Thanks for the feedback. Could you make a discussion in the github discussion with exactly the issue you're running into?
at 1:52:37 you can actually make the function cheaper by creating an array in memory and copying s_funders to it, so that way you can loop through memory array. Instead of SLOAD for fundersLength times, you will MLOAD this amount of times, which can save a lot of gas.
Actually, since we have to call SLOAD each time we have to access an element, it’s less gas efficient to drop it into memory and then loop. Since we only access each element once in the loop, it’s better to just use storage instead of making an extra call to load it into memory
7:39:35 - line 66 says vm.prank(msg.sender) . What is the reason for pranking here if you want to set it as msg.sender ? Isn't that what happens by default ?
…you’re probably right ahah. Could you ask in the GitHub discussions?
Please when you coding in vscode zoom out a bit like 20% this give us a better picture 🙏🙏💙💙
Hi Patrick i completed till 7th lesson,I want to become developer first and then I will try smart contract security,can I start foundry 8th lesson or go to javascript edition 8th lesson and use foundry in the place of hardhat.
If you want to do security, finish this course! Foundry is the go-to tool for security researchers
I have sirius problem in Foundry FundMe Interaction Part that we write code in script and test files. I really didn't understand anything. What should I do is theese parts are improtant ?
Could you ask your questions in the GitHub ?
4:55:48 Why setting a keyHash for the anvil network dont really matter ? Is it because on the local network (anvil) gasprice default to 0 ?
It doesn’t really matter ahah
@@PatrickAlphaC Iam a little bit confuse but i guess it doesnt really matter :)
2:00:00 why are we doing interaction test , what is the purpose of it? is normal testing not enough? Please answer
Ensures that our contracts work together as intended (interactions between different smart contracts).
Got it , thanks 👍
Chainlink VRF creating random lines could belong in a modern art expo
What background knowledge do one need to follow this course?
none!
I think I may replace chainlink solutions with my own custom solutions for practice. I am sure I can find a way for randomness and also time automatations(maybe blocks). I suggest you do that too
hello, mind if i mail you?
@@Victor...P1 why?
@@urus_gre1035 i figured since we both did this course we might have shared interest,
Also would like to learn more whilst improving collaborative skill.
@@urus_gre1035 I figured since we both did this course we might have shared interest,
I would also like to learn from you whilst improving collaborative skills.
Part one done. Part Two Here I come.
Why not use thirdweb SDK for the html part?
Easier to use anvil IMO
I'm experiencing some issues with the 'Lesson 8: Html/Js Fund Me' section. Can anyone assist me?
(1) The problem I'm facing is that the app doesn't produce an error when I use the 'fund' function, even if I haven't deployed the contract locally using the 'make deploy' command. Consequently, the 'withdraw' function doesn't seem to work.
(2) Additionally, I'm not receiving the 'onlyOwner' error(2:59:07) when I attempt to use the 'withdraw' function with a non-owner wallet.
can you ask in the github repo? thank you!
The more I go on with this course The more it becomes Interesting Thank you for this amazing course It's by far the best Course I have seen for solidity and foundry
Glad to hear it!! Love how you're on #2
At 1:32:15 he exactly says what I was wondering
Can I get a sneak peek, please, I really don't know how to improve my rankings
Today you’ll get more than that
Damn, difficulty really ramps up for me around lesson 7 near 2:08:20, nonetheless I will carry on and finish 😇
Hi sir, what is the situation now? Difficulty ramped up for me also around 0:46, I'm struggling to understand and slowed down. Did you finish the course?
@@cemturkoglu135 I'm at 7:25:03 now
@@cemturkoglu135 I think the best advice I could give would be you need to be comfortable at times with not knowing what's going on, many of the concepts like abi encoding or keccak hashing didn't click for me until a day or 2 later after hearing about it for the first time
@@cemturkoglu135 hey, how you guys doing now? Difficulty ramped up for me 0:00, I didn't even clicked the video yet, any progress on your side?
2:05:00
is lesson 8's ipfs broke for anybody else on solve?
i think i m facing the same issue
make mint command at 8:33:00 is not working for me. Did anyone else had issue with it?
i also have this issue
i couldnt verify my contract and i dont know why?
What else should we learn to find a job after finish this three videos course?
Security & Auditing, Assembly & Formal Verification on Cyfrin Updraft :)
Does anyone feel that it is a lot of hard work to generate random numbers?
It is a lot of hard work ahah
I think Patrick makes this Fundme a little bit more complex
Thanks for the feedback! It does ramp up a little quick. Perhaps I need a buffer project before that
Hi @PatrickAlphaC, thank you so much for this course-it's awesome! I appreciate you paving the way for the rest of us. I'm currently at 2:00:00, and I'm feeling a bit lost as the difficulty ramped up quite steeply. I'll keep moving but a buffer project would be great for everyone else coming behind. Thank you!!
569th... Thanks Patrick
What course do you recommend after this course?
None. Go out there and start building. Go to a hackathon, a competitive audit (like codehawks.com!) etc
@@PatrickAlphaC Thank you Patrick.
why we are suing mock aggregator contract here?
To deploy locally to anvil
Patrick, thanks for the course and everything, but your naming of contracts and other entities makes it 100x more confusing. 02:06:44
should I first learn solidity then come to this video ? Actually i am very beginner in blockchain
Go to part 1! (see my other video in this playlist)
Can anyone tell me how to connect to the etherscan from the foundry terminal in vscode? To check an already deployed contract?
I guess you should copy paste your 'recently deployed contract address' to etherscan's search button
@@0x0-Issa I don't think u got the qns sir. I wanted to read the storage layout from my bash terminal in vscode. Of a deloyed contract on a testnet for a ctf challenge. Foundry has a cast etherscan-source command which let's u read a contract on chain. So i was wondering how can i do the same for testnet.