Functions and visibility
Functions declare visibility and can read or write state.
What you will be able to do
- Use external/public for callers.
- Use view for reads.
- Use pure for no state access.
In plain English
Functions declare visibility and can read or write state.
- Use external/public for callers.
- Use view for reads.
- Use pure for no state access.
pragma solidity ^0.8.24;
contract Math {
function add(uint256 a, uint256 b) public pure returns (uint256) {
return a + b;
}
}Your turn
EasyExplain it back
Answer from memory: Which mutability means no state is read or written?
TEXT · starter
Your answer…Check your understanding before moving on.
Knowledge checkQuestion 1
Which mutability means no state is read or written?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.