Quiz Entry - updated: 2026.07.30
What does the contract keyword do, and what is a Solidity contract most like?
contract declares a smart contract — the top-level container for state and functions — and it behaves much like a class in an object-oriented language.
contract SimpleStorage {
// state variables and functions live here
}
Everything inside the curly braces belongs to the contract. Like a Java or Python class, it groups data (state variables) with the code that operates on that data (functions), and it can be instantiated (deployed) — each deployment gets its own address on the blockchain, just as an object gets its own identity. Deploying a contract is itself a state-changing transaction: it modifies the blockchain to hold this new code.
Go deeper:
Solidity docs: structure of a contract — what may live inside the braces.
Smart contract (Wikipedia) — the general concept and its history.