Quiz Entry - updated: 2026.07.30
What is a constructor in Solidity?
A special function that runs exactly once, automatically, in the transaction that deploys the contract, used to set the contract's initial state.
It takes no function keyword. A classic use is owner = msg.sender, which permanently records the deployer as owner — the foundation for access control like "only the owner may withdraw."