Recall & Review
beginner
What is a contract in blockchain programming?
A contract is a set of rules and code that runs on the blockchain to manage digital agreements automatically.
Click to reveal answer
beginner
Name the basic parts of a smart contract structure.
A smart contract usually has: 1) Contract declaration, 2) State variables, 3) Functions, 4) Events, and 5) Constructor.
Click to reveal answer
beginner
What is the purpose of the constructor in a contract?
The constructor runs once when the contract is created. It sets initial values or settings for the contract.
Click to reveal answer
beginner
How do you define a function in a smart contract?
A function is defined with the keyword
function, followed by its name, parameters, and code block inside curly braces.Click to reveal answer
beginner
What is the role of state variables in a contract?
State variables store data permanently on the blockchain and keep the contract's state between function calls.
Click to reveal answer
Which keyword starts the definition of a smart contract?
✗ Incorrect
The keyword
contract is used to declare a smart contract.What does the constructor in a contract do?
✗ Incorrect
The constructor runs once when the contract is deployed to set initial values.
Where are state variables stored?
✗ Incorrect
State variables are stored permanently on the blockchain to keep contract data.
Which symbol is used to group code inside functions?
✗ Incorrect
Curly braces
{} group the code inside functions.What is the main purpose of events in a contract?
✗ Incorrect
Events help log information that external apps can listen to and react.
Describe the main parts of a smart contract and their roles.
Think about what each part does in managing data and actions.
You got /5 concepts.
Explain how a constructor differs from other functions in a contract.
Focus on when and how often it runs.
You got /4 concepts.