Gas Nedir
Hesaplama için ödeme
Gas Nedir, CoddyKit'te ücretsiz bir Web3 & DApp Development Fundamentals dersidir. Bu, 4 dersinin 1. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Web3 & DApp Development Fundamentals öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Web3 & DApp Development Fundamentals kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
Why Computation Costs Money
Every operation on Ethereum runs on thousands of nodes worldwide. To prevent abuse and pay for this work, the network charges gas.
Gas is the unit that measures computational effort.
What Is Gas?
Gas is a unit of measurement for the work required to execute operations on the EVM.
Sending ETH, calling a contract, or storing data each consume a specific amount of gas based on their complexity.
Gas Units per Operation
Different operations cost different amounts of gas. Simple operations are cheap; storage is expensive.
ADD -> 3 gas
MUL -> 5 gas
SLOAD -> 2100 gas (read storage)
SSTORE -> 20000 gas (new storage)
base tx -> 21000 gasGas vs Gas Price
Keep two ideas separate:
- Gas used — how much computation the transaction needs (units)
- Gas price — how much you pay per unit, measured in gwei
Total fee = gas used multiplied by gas price.
Gwei: The Fee Unit
Gas prices are quoted in gwei, a tiny fraction of ETH. One gwei equals one billionth of an ETH (10^-9).
Quoting in gwei keeps numbers readable instead of writing many leading zeros.
1 ETH = 1,000,000,000 gwei
1 gwei = 1,000,000,000 wei
1 wei = smallest unit of ETHCalculating a Fee
The transaction fee is straightforward arithmetic. Multiply the gas your transaction consumes by the price you pay per unit of gas.
gasUsed = 21000
gasPrice = 20 gwei
fee = 21000 * 20 = 420000 gwei
= 0.00042 ETHWhy Gas Exists
Gas serves two purposes:
- Spam prevention — attackers cannot flood the network for free
- Resource pricing — heavy computation costs more, encouraging efficient code
The Halting Problem Solution
Gas also stops infinite loops. Each step consumes gas, and when a transaction runs out, execution halts.
This guarantees the EVM always terminates — you cannot freeze the network with a runaway loop.
while (true) {
// each iteration burns gas
}
// eventually: OUT OF GAS -> revertsWho Receives the Fee?
Gas fees compensate the validators who include and execute your transaction.
Under EIP-1559, part of the fee is actually burned (destroyed), and a smaller tip goes to the validator. We cover this in a later lesson.
Gas and Smart Contracts
Complex smart contract calls cost more gas than simple transfers because they execute many operations.
Efficient contract code directly lowers user costs — gas optimization is a core skill for Solidity developers.
Putting It Together
Gas measures computational work; gas price (in gwei) sets the cost per unit. Their product is your fee.
Gas prevents spam, prices resources fairly, and guarantees execution always terminates.
Quick Check
Test your understanding of gas.
Recap: What Is Gas
You learned that:
- Gas measures computational work on the EVM
- Gas price is paid per unit in gwei
- Fee = gas used multiplied by gas price
- Gas prevents spam and stops infinite loops
Next: the full lifecycle of a transaction.
Sıkça Sorulan Sorular
“Gas Nedir” dersi ücretsiz mi?
Evet — “Gas Nedir” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Web3 & DApp Development Fundamentals kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Web3 & DApp Development Fundamentals kursu toplamda 4 dersten oluşur.
“Gas Nedir” dersinde ne öğreneceğim?
Hesaplama için ödeme Web3 & DApp Development Fundamentals ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Web3 & DApp Development Fundamentals öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Web3 & DApp Development Fundamentals, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 1. dersidir.
“Gas Nedir” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Web3 & DApp Development Fundamentals dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Web3 & DApp Development Fundamentals dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.