Why is the gas used by Txn different when using the same function in the same smart contract?

I have seen some transactions in etherscan.io.But, I found that even referring to the same function in the same smart contract, the gas used by txn is different. I am trying to find what the original data might be leading to it. Really?

+3


source to share


1 answer


Every time you call a function in a contract that requires a state change in the block it will cost x the amount of gas, so every time you call another or the same function in a contract that requires a state change, you will see that x the gas quantity is deducted along with its tax ID. This is the reason why you see different Txn for the same function.



Learn more about gas and transactions in the link below. http://solidity.readthedocs.io/en/develop/introduction-to-smart-contracts.html

-1


source







All Articles