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.
Concept map · schematic
What a swap actually consumes
Available depth along the execution route—not headline TVL—determines price impact.
- 01
Trade size
How much the user wants to exchange
- 02
Available depth
Executable liquidity at successive prices or bins
- 03
Execution
Output depends on fees, depth and route
Important: Pool TVL alone cannot determine slippage; request a fresh executable quote.
Self-check
Check your understanding
Choose an answer for each question, then check the results and explanations.
Primary references
Documentation and standards
References added
Official technical references for further verification. A source link is not a guarantee that every earlier editorial sentence has been reverified; provider specifications may also change over time.
The curriculum predates this reference index. These sources are offered to check technical details; no original publication date has been inferred.
- ERC-20 token and allowance specificationEthereum Improvement ProposalsRead source ↗
- Uniswap v3 swap mechanicsUniswapRead source ↗
Apply what you learned
Related practical guides
ERC-20 Approvals, Explained
Understand what a token allowance permits, why unlimited approvals increase exposure and what to check before approving or revoking one.
Read guide →Revoke an ERC-20 Approval
A short process for finding a live allowance, confirming the spender and sending the revoke transaction from your own wallet.
Read guide →Unlimited vs. Exact Token Approvals
Compare the convenience of reusable allowances with the smaller exposure of approvals limited to a specific trade amount.
Read guide →
Continue learning