Smart Contracts
Programs that run on-chain and power everything after money.
Code that is the agreement
A smart contract is a program whose state and execution are enforced by a blockchain. When someone calls it, the network applies the same rules to determine the resulting state rather than relying on one application server.
Contract bytecode and on-chain state are public, while readable source code is available only when a project publishes and verifies it. Deterministic execution is powerful, but bugs and unsafe permissions are enforced just as reliably as intended behavior.
Gas: paying for computation
Running contract code isn't free. Each operation costs gas, and you pay the total in the chain's native token. Gas both compensates validators and stops anyone from clogging the network with infinite loops.
When the network is busy, gas prices rise - the same transaction can cost cents one hour and dollars the next.
Self-check
Check your understanding
Try each question before opening the answer.
What is a smart contract?
- A.A legal PDF stored on-chain
- B.A program deployed on-chain that runs exactly as written when called
- C.A type of wallet
- D.An insurance policy
Reveal answer
B. A program deployed on-chain that runs exactly as written when called
It's code on the blockchain that executes deterministically for everyone who calls it, no middleman required.
What is gas?
- A.A stablecoin
- B.The fee paid for the network to process your transaction
- C.A staking reward
- D.A type of NFT
Reveal answer
B. The fee paid for the network to process your transaction
Gas is the fee that pays for the computation and storage your transaction uses.
Continue this track