Summary
Keywords
Full Transcript
#solidity #ethereum #blockchain Solidity Programming Course - Part 17 β€οΈ This video, Part 17 of a Solidity Programming Series by Akshay Kurhekar, introduces the fundamentals of Functions in Solidity (0:00). Due to the complexity of the topic, the video is divided into two parts, with this one focusing on Function Definition, Code Execution, and basic Parameters (0:20).Function Components: (1:25) Functions in Solidity are composed of several logical parts: Function Name Parameters Visibility Return Statements Body Writing Functions: (2:40) The basic syntax requires the function keyword, a name, parentheses for parameters, visibility specifiers, and curly braces for the code body (2:49). An example is provided for setting a global variable using msg.sender (4:01).Functions with Parameters: (5:00) When defining functions with parameters, you must specify the data type and a name for each parameter (6:03). The video demonstrates storing these parameters into global variables within the function body (7:05).Return Statements (Type 1): (8:02) To return data, use the returns keyword followed by the expected data types (9:08). The sequence of the data types in the returns statement must precisely match the sequence of variables returned in the function body (11:58).Return Statements (Type 2 - Named Returns): (12:35) A second method allows you to name the return variables directly in the returns statement (13:05). This approach enables you to assign values to these named variables in the function body without using the return keyword explicitly (13:19).Code Execution & Testing: (15:09) The video concludes by deploying the Smart Contract in Remix IDE to test the different function types, demonstrating how msg.sender is captured and how returned values appear based on the chosen return method (16:20). β€οΈβ€οΈ Resources πβ€οΈβ€οΈ Github: https://github.com/akshaykurhekar/solidity-programming β€οΈβ€οΈ Topic Covered πβ€οΈ 1. Function Definition 2. Ways of writing function. 3. Code execution. 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! β€οΈ
