Skip to content

Commit f678758

Browse files
committed
1 parent 9afaa03 commit f678758

File tree

1 file changed

+8
-3
lines changed
  • public/content/developers/docs/transactions

1 file changed

+8
-3
lines changed

public/content/developers/docs/transactions/index.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,20 @@ The base fee will be burned **-0.00399 ETH**
160160

161161
Validator keeps the tip **+0.000210 ETH**
162162

163-
In case of an interaction with a smart contract there is 2 cases possible:
164-
1. A `view` or `pure` function (as described in [solidity documentation](https://docs.soliditylang.org/en/v0.8.23/contracts.html#view-functions)) is called from an EOA. In that specific case, no gas will be paid by the caller and the result will be returned. The underlying RPC call for this scenario is [eth_call](https://ethereum.org/en/developers/docs/apis/json-rpc#eth_call)
165-
2. In any other cases gas will be paid by the caller. Which mean: calling a `view` or `pure` function internally (ie: not from an EAO) will cost gas.
166163

167164
![Diagram showing how unused gas is refunded](./gas-tx.png)
168165
_Diagram adapted from [Ethereum EVM illustrated](https://takenobu-hs.github.io/downloads/ethereum_evm_illustrated.pdf)_
169166

170167
Any gas not used in a transaction is refunded to the user account.
171168

169+
### Smart contract interactions {#smart-contract-interactions}
170+
171+
Gas is required for any transaction that alters the state of a smart contract.
172+
173+
Therefore, calling a [`view`](https://docs.soliditylang.org/en/latest/contracts.html#view-functions) or [`pure`](https://docs.soliditylang.org/en/latest/contracts.html#pure-functions) function from an EOA will not require any gas. The underlying RPC call for this scenario is [`eth_call`](/developers/docs/apis/json-rpc#eth_call)
174+
175+
However calling a `view` or `pure` function internally (ie: from the contract itself or from another contract) will cost gas.
176+
172177
## Transaction lifecycle {#transaction-lifecycle}
173178

174179
Once the transaction has been submitted the following happens:

0 commit comments

Comments
 (0)