Focus mode
Code from video: https://solidity-by-example.org/view-and-pure-functions/
View: Indicates that the function will read data from the blockchain but not modify it.
View functions ensure that state variables are not changed. If the following statements are present in the function, it is considered to be changing state, and the compiler issues a warning.
Pure: It states that the function will neither read nor modify data from the blockchain.
Pure functions ensure that data is not read and not modified. If the following statements are present in the function, it is considered to be changing state, and the compiler issues a warning.
Resources:
You can find detailed further information from Solidity Official documentation (in English):
https://docs.soliditylang.org/en/v0.8.15/types.html#function-types
https://www.tutorialspoint.com/solidity/solidity_view_functions.htm
https://www.geeksforgeeks.org/solidity-view-and-pure-functions/
https://github.com/itublockchain/web3-bootcamp/tree/master/1x1_Functions
Programs to Accelerate Your Progress in a Software Career
Join our 4-8 month intensive Patika+ bootcamps, start with the fundamentals and gain comprehensive knowledge to kickstart your software career!
You need to enroll in the course to be able to comment!