Summary
Keywords
Full Transcript
#solidity #ethereum #blockchain Solidity Programming Course - Part 16 β€οΈ Storage, Memory, & Calldata use in solidity. This video (0:00) introduces the crucial concept of data locations in Solidity programming, specifically explaining how data is stored on the blockchain and the associated costs. The video covers the three main types of data storage: Storage (2:00): Data stored permanently on the blockchain state. It is the most expensive type of storage. Variables defined at the contract level are storage by default. Memory (2:44): Temporary storage used for data within a function's scope. It is cheaper than storage and commonly used for complex types like strings and arrays (3:38) to hold data temporarily during execution. Calldata (3:38): A special, immutable data location used to hold function arguments. It is the cheapest option and is ideal for data that only needs to be read and not modified (10:08). Code Examples and Execution (5:25 - 17:16): Storage Usage: Demonstrated using a struct (UserData) within a mapping to permanently store and retrieve user data (5:25). Calldata Usage: Showcases using calldata for string arguments in an updateUserData function to save gas (10:08). Memory Usage: Illustrates using memory when retrieving and returning struct data from the mapping (12:04). The video concludes with a practical demonstration using the Remix Editor to compile, deploy, and interact with the contract, highlighting the gas optimization benefits of choosing the right data location (14:10). Solidity Course Link π₯: https://youtube.com/playlist?list=PLTqJEAOVD7brZG5sLww_XuGEJTYRv1hm1&si=RGu7w3U2ZGII1iSO β€οΈβ€οΈ Resources πβ€οΈβ€οΈ Github: https://github.com/akshaykurhekar/solidity-programming β€οΈβ€οΈ Topic Covered πβ€οΈ 1. Storage 2. Memory 3. Calldata Timeline: 0:00 - Intro 0:46 - Data location definition 2:00 - Storage definition 2:44 - Memory definition 3:38 - Calldata definition 5:25 - Storage code explanation 10:08 - Calldata code explanation 12:04 - Memory code explanation 14:10 - Code Execution 17:16 - Keynote Playlists πβ€οΈ: https://www.youtube.com/playlist?list=PLTqJEAOVD7bpHR2CTaFVd9mJMZQYDF7ah https://www.youtube.com/playlist?list=PLTqJEAOVD7brZG5sLww_XuGEJTYRv1hm1 https://youtube.com/playlist?list=PLTqJEAOVD7boUDVH0WHY6zdY2VpZNQmh5&si=U6X8P3hzIButcslF https://www.youtube.com/playlist?list=PLTqJEAOVD7bqy7ll24DQeS2rs9WtDHQiC https://www.youtube.com/playlist?list=PLTqJEAOVD7bqEUavfK3e2Np2vHhKtBXO- β€οΈπ Social Handleβ€οΈπ You can Follow me on: IinkedIn : https://www.linkedin.com/in/akshay-kurhekar-64438a168/ Instagram: https://www.instagram.com/akshay_kurhekar/ Dev Community: https://dev.to/akshaykurhekar So, what are you waiting for? Hit the subscribe π button, share π this video with your friends, and don't forget to smash that like π button. I'll see you in the next video. Until then, β€οΈJAI HIND! β€οΈ
