0

In all sources it's stated that transactions cost gas. Since the distinction between a transaction and a message (some name it an internal transaction) is not so clear it couldn't be sure if messages between contracts cost any gas.

There's a gas limit field in messages but I couldn't find any source explicitly stating messages do consume gas.

If messages consume gas, then I presume this is supplied by the ether balance of the contract account

Thanks

1

As a rule of thumb, everything costs gas inside the system. A contract calling another contract costs gas.

All smart contract executions within Ethereum are initiated by some end-user account. This account is the one who pays for all the used gas. So even if you send a transaction to just one contract, the contract may send internal transactions to other contracts and do whatever. You must pay for all this computation with your account's Ethers.

If you do not provide a big enough gas limit and the transaction is complicated enough that it runs out of gas, the whole transaction is reverted and you are back to the beginning with less Ether in your account but no results.

  • "All smart contract executions within Ethereum are initiated by some end-user account" this is the key point for me, thanks! – kuzdogan Jul 24 '18 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.