GAS and GAS_PRICE setting The problem


GAS and GAS_PRICE What does it matter? After I set GAS separately, I found that the call was unsuccessful。

And what does it stand for in AE? What does it do?


hey @Baixin.chain, the concept of gas is simple:

Very simple explanation: The more you are trying to do, the more gas you need.

Simple explanation: The more computation and storage your contract execution will need, the more gas is consumed. Like a truck that needs more gas if it carries more goods.

Normal explanation: In order to prevent spam, the total amount of computations performed in a block are capped by a maximum amount of gas that all transactions can consume. Plus, in order to prevent the chain size from growing too quickly, writing to the chain costs gas, too.

In practice that means: Just adding 2 + 2 and writing the result to the contract state will cost less gas than heavy computations and lots of written data.

Your transaction probably went out of gas , as the amount of gas you’ve sent along with your transaction wasn’t enough for what you were trying to do.

The gas price is the amount of aetto s (smallest fraction of AE) that you are willing to pay per gas.

Important: The gas you send along but is not consumed by the TX is returned to you again. It is recommended though to not send way too much gas though.

The total transaction cost is: Consumed Gas * Gas Price


Thanks @nikitafuchs.chain

@Baixin.chain you will also find more detail regarding gas here :