Atla ve ana içeriğe git

How gas fees, limits, and network fees work

not

Kripto paralar ve web3 konularında yeni misiniz?

Web3'e yeni başlayanlar için özel olarak hazırlanmış kolay bir öğrenim deneyimi için MetaMask Öğren adresine gidin. Bu eğitim tamamen ücretsizdir ve birçok dilde mevcuttur; ayrıca MetaMask'e uyum sağlamanıza yardımcı olacak simülasyonlar gibi yararlı araçlar da içerir.

Gas (or network fees) is the unit of measurement for how much computational work is required to process transactions and smart contracts. Esasen işlem ücreti anlamına gelen bu terim Ethereum'dan gelir ve bu bağlamda Ethereum Sanal Makinesi (EVM) üzerinde yürütülen hesaplamaya işaret eder. Ethereum kurulduğundan bu yana, EVM ile uyumlu (ve EVM ile uyumlu olmayan!) pek çok ağ ortaya çıkmış ve benzer modelleri benimsemiştir.

Other networks

Other networks like Solana and Bitcoin also have network fees, though they may be calculated differently. Luckily, MetaMask automatically calculates the network fee for you when you confirm a transaction, taking the guesswork out of it.

Bu terim, bir araba motoruna güç veren yakıttan gelmektedir; değişken ve bazen de pahalı olan operasyon maliyetidir. Nasıl ki daha büyük, daha güçlü arabalar çalışmak için daha fazla yakıta ihtiyaç duyuyorsa daha karmaşık akıllı sözleşmeler de hesaplamalarına güç vermesi için daha fazla gaza ihtiyaç duyar.

Gaz ücretlerini hesaplama yöntemi ağa bağlı olarak değişiklik gösterir. For example, on Ethereum Mainnet, you pay a base fee for every unit of gas, which is burned (read: it is deleted, and disappears) upon successful completion of the transaction. Baz ücretin üzerine, yine gaz birimi başına bir öncelik ücreti eklersiniz; bu ücretin değeri işlemin ne kadar hızlı gerçekleştirilmesini istediğinize bağlı olarak değişir.

EVM ile uyumlu geniş ağ yelpazesinde gaz veya benzer şekilde işlev gösteren alternatifler işlem maliyetlerini hesaplamak için kullanılan standart yöntem haline gelmiştir. Fees are paid in the network's native token: for example, any transaction on Ethereum requires ETH; using BSC requires BNB; using Polygon requires POL (previously MATIC). Some networks have adopted Ethereum's EIP-1559 model wholesale, such as Polygon, while others have made adjustments, including Avalanche, for their C-Chain (which burns both the base fee and priority fee, rather than just the former).

Gas included transactions

On Ethereum Mainnet, BNB Smart Chain, Polygon, Arbitrum, and Base, MetaMask allows you to pay the network fee using different tokens. This means you do not need to have enough of the network's native token to cover the network fee, but can do so using other tokens.

On the backend, MetaMask will swap your selected token for the network's native token, and then use that to pay the network fee. MetaMask uses the simplest, cheapest method to do this.

On the frontend, you won't need to worry about swapping a token for the network's native token, because MetaMask will do it for you. Simply select the token you want to use to pay the network fee, and MetaMask will handle the rest.

Daha fazla bilgi için buraya göz atın.

Ethereum'da gaz sisteminin nasıl çalıştığına dair daha derin bir inceleme için buraya göz atın.

ipucu

In MetaMask, you'll see 'Network fee' in the transaction confirmation screen. This is the gas fee.

Here are some details for dealing with gas:

The gas limit (units of gas used)

Gaz limiti, bir işlemi veya EVM operasyonunu gerçekleştirmek için ödemek istediğiniz maksimum gaz birimi sayısıdır. Farklı operasyonlar, farklı miktarda gas birimi gerektirir. ETH veya bir token'ın gönderildiği normal bir işlemde normalde 21.000 gaz gerekirken ERC-20 token onayında ise 45.000 gerekir. EVM ile uyumlu blokzinciri Harmony gibi birçok ağ, benzer şekilde standart işlemlerde 21.000 gaz gerektiren modeli kullanır.

bilgi

Gaz limitini düzenlemem gerekiyor mu?

Hayır! MetaMask, yapmaya çalıştığınız işleme bağlı olarak gaz limitinizi otomatik olarak belirler. Çoğu durumda bu, işleminizi tamamlamak için yeterli olacaktır. Bunu kontrol etmek veya düzenlemek istiyorsanız gelişmiş gaz kontrollerinin açık olduğundan emin olun ve işlem onay ekranında gaz bilgilerinin yanında yer alan 'Piyasa', 'Düşük' veya 'Agresif' yazan düğmeye basın.

The base fee

Ethereum ağındaki her blokun, ağ talebi tarafından belirlenen bir baz ücreti vardır: baz ücret, bir hedef blok boyutuna kıyasla, önceki blokun boyutu temel alınarak belirlenir (burada boyut, blok içindeki tüm işlemler için kullanılan toplam gaz miktarını belirtir). Önceki blokun boyutu hedefi aşıyorsa sonraki blok için baz ücret %12,5 artırılır; bu şekilde kullanıcı yani siz (veya cüzdanınız) gelecek blokun baz ücretini mutlak kesinlikle bilirsiniz. Bloğa dahil edilmek için, toplam gaz ücretiniz, en az bu fiyat kadar olmalıdır.

The priority fee

Öncelik ücreti, diğer adıyla "madenci bahşişi", işleminizi önceliklendirmesi için madenciyi teşvik eder.

Naturally, whether this does actually go to a miner depends on the consensus mechanism they use: Ethereum Mainnet became a Proof of Stake network following the Merge in September 2022, so the priority fee goes to validators instead of miners.

The max fee

Maksimum ücret, işleminiz için ödenen toplam genel miktardır. Şöyle hesaplanır: (baz ücret + öncelik ücreti) x kullanılan gaz birimi. MetaMask başlangıçta bu tutarı önceki blokun geçmişine göre belirler. Bununla birlikte, kullanıcılar bu miktarı özel ayarlar üzerinden düzenleyebilir (aşağıya göz atın). Gaz başına maksimum ücret ve (baz ücret + gaz başına maksimum öncelik ücreti) arasındaki fark kullanıcıya “iade edilir”.


Basefee

Additional Concepts

Gwei

Gwei, gigawei (ya da 1.000.000.000) anlamına gelen en küçük değerdeki bir ether birimidir. Gwei, gaz ücretleri için ya da Ethereum blokzinciri üzerinde işlemleri gerçekleştirmek ve doğrulamak için gereken hesaplama enerjisini tazmin etmek üzere kullanıcılar tarafından yapılan ödemeler için kullanılır.

Fantom, Harmony ve Avalanche gibi diğer ağlar da maliyetleri gwei kullanarak hesaplama eğilimindedir.

Slippage

Kayma, teklif edilen ve uygulanan fiyat arasında yüzde olarak beklenen farktır.

Gas fee

Gaz ücreti, Ethereum blokzinciri üzerindeki işlem ücretini ifade eder. Kullanıcıların işlemlerini doğrulamak veya tamamlamak için ödedikleri tutardır.

Base fee

Protokol tarafından belirlenir. Bir işlemin bloka dahil edilmesi (yani işlemin tamamlanması) için gereken minimum 'gasUsed' çarpanını temsil eder. Bu, işlem ücretinin yakılan kısmıdır.

Advanced gas controls

Gaz kontrollerinizin özüne inmek istiyorsanız (örneğin bir dapp testi yapıyorsanız bu size yardımcı olabilir) MetaMask bunu yapabilir! Makalenin tamamını buradan görebilirsiniz.

Out of gas errors

A problem you may encounter is a transaction failing with an "out of gas" error like in the screenshot below.

out of gas error

This means that all the gas units up to the limit you set were used up before the transaction could be fully processed.

To avoid another "out of gas" error, you will need to increase the gas limit of your next transaction. This can be done just before sending your next transaction by customizing gas settings.

MetaMask gas limit recommendations

The vast majority of the time, the gas limit that MetaMask automatically sets for your transaction will be sufficient.

Selecting a gas limit is mostly a personal preference, but it may be helpful to review recent successful transactions of the executing smart contract to understand what is a sufficient gas limit for your transaction.

Recommended steps:

  1. While reviewing your transaction with the "out of gas" error on Etherscan, click the link to the Contract address in the "To:" section directly above the out of gas error
  2. Scroll down to the list of Transactions and click on the Txn Hash of any completed transaction (non-pending)
  3. Ensure that the transaction shows Status as Success. If not, go back and choose another transaction.
  4. Click on Click to show more
  5. Make a note of the Gas Limit that was chosen for the transaction
  6. Optional: repeat steps 1-4 to better estimate a gas limit that will be sufficient for your transaction
  7. Once you have a good idea of a value for your gas limit, make sure to adjust the gas limit when sending out your next transaction.
Was this helpful?