メインコンテンツへスキップ

How gas fees, limits, and network fees work

注記

仮想通貨やweb3は初めてですか?

MetaMask Learnで、web3を初めて使う人のために特別に設計された分かりやすい学習体験を提供しています。 完全に無料で、複数の言語で利用することができ、MetaMaskに慣れるためのシミュレーションなどの便利なツールも含まれています。

Gas (or network fees) is the unit of measurement for how much computational work is required to process transactions and smart contracts. いわばトランザクション手数料であり、イーサリアムに由来する用語です。そこでは、イーサリアム仮想マシン(EVM)で行われる計算を指します。 イーサリアムの登場後、数多くのEVM互換(およびEVM非互換)の ネットワークが登場し、似たようなモデルを採用してきました。

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.

この用語は、車のエンジンを動かすガソリンのように変動し、場合によっては高額な運用コストなります。 スマートコントラクトが複雑になればなるほど、計算により多くのガスが必要になります。これは大きくパワフルな車が、より多くのガソリンを必要とするようなものです。

ガス代を計算する方法は、ネットワークによってさまざまです。 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. 基本料金に加え、優先手数料もガス1単位ごとに追加します。優先手数料の額は、どの程度迅速にトランザクションの処理を望むかによって決まります。

使用可能な幅広いEVM互換ネットワークで、ガス、あるいはガスの代わりとなる同様の機能を果たす手数料は、基本的にトランザクションコストを計算する標準的な方法となりました。 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.

詳細は、こちらをご覧ください。

イーサリアムでガスがどのように機能するかについて、詳しく知りたい場合は、こちらをご覧ください。

ヒント

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)

ガスリミットとは、トランザクションあるいはEVM操作を実行するために支払う意思のある最大のガスユニット数のことです。 操作によって必要なガスユニットの量も異なります。 ETHやトークンを送金するための通常のトランザクションは、通常21,000ガスの費用がかかる一方、ERC-20トークン承認には45,000が必要です。 EVM互換ブロックチェーンであるHarmonyのような多くのネットワークでは、標準のトランザクションに21,000ガスが必要な、同じモデルを使用しています。

情報

ガスリミットを編集する必要はありますか?

いいえ! MetaMaskは、実行しようとしているトランザクションに応じて、ガスリミットを自動的に設定します。 ほとんどの場合、トランザクションを完了するのにこれで十分です。 ガス代を確認または編集するには、高度なガス管理がオンになっていることを確認し、トランザクション承認画面のガス情報の隣にある、「市場価格」、「低め」、または「高め」と表示されたボタンを押します。

The base fee

イーサリアムネットワークのすべてのブロックには、ネットワーク需要によって決定される基本料金があります。基本料金はその前のブロックサイズに基づいており、ターゲットブロックサイズ (サイズはブロックに含まれるすべてのトランザクションに使用されたガスの総量を指す) と比較されています。 前のブロックサイズがターゲットを超える場合、次のブロックの基本手数料は12.5%増加し、ユーザー (またはユーザーのウォレット) は、次のブロックの基本料金に関して絶対的な確実性を得ることができます。 ブロックに含まれるには、ガス代の合計がこの価格を満たす必要があります。

The priority fee

_優先手数料_は「マイナーチップ」とも呼ばれ、トランザクションを優先的に行うインセンティブとなります。

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

最大手数料とは、トランザクションに対して支払う総額のことです。 これは次のように計算されます: (基本料金+優先手数料)× 使用されるガスのユニット数。 MetaMaskは、あらかじめこれまでのブロックの履歴に基づきこの金額を設定します。 ただし、この金額はカスタム設定で編集できます(下記を参照)。 ガスごとの最大料金と (基本料金+ガスごとの最大優先手数料) の差額がユーザーに「返金」されます。


Basefee

Additional Concepts

Gwei

Gweiはイーサの単位であり、最小単位ギガウェイ (10億) の略です。 Gweiは、ガス代、つまりユーザーがイーサリアムブロックチェーン上でトランザクションを処理・検証するのに必要な計算エネルギーに対して支払う代金です。

他のネットワークでも、gweiを使用して料金を計算する傾向にあります。例えば、Fantom、Harmony、Avalancheなどです。

Slippage

スリッページとは、気配値と約定価格の予測される差の割合です。

Gas fee

ガス_代_とは、イーサリアムブロックチェーンでのトランザクション手数料のことを指します。 トランザクションの検証や完了に支払う代金です。

Base fee

プロトコルによって生成されます。 トランザクションをブロックに含めるために (すなわち、トランザクションが完了するために) 必要な最小「gasUsed」(使用ガス) 乗数を指します。 これは、バーンされるトランザクション手数料の一部です。

Advanced gas controls

ガスコントロールの細かな部分にまで踏み込みたい場合 (例えばDAppをテストする場合に役立ちます) も、MetaMaskにお任せください! 記事全体はこちらをご覧ください。

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?