I have an interesting phenomena EDIT: on the Fantom network, sorry if this is the wrong place to ask which I do not understand, so maybe someone is able to explain this:
When I send a transaction with e.g. 400000 gas limit to execute my contract method, X amount of gas is used. When I send the exact same transaction with only 250000 limit, a much lower amount of gas is used.
Example 1:
Gas Limit: 400,000
Gas Used by Transaction: 80,726 (20.18%)
Gas Price: 0.0000002455336 FTM (245.5336 Gwei)
Example2:
Gas Limit: 250,000
Gas Used by Transaction: 65,726 (26.29%)
Gas Price: 0.0000002310364 FTM (231.0364 Gwei)
Note: The method executes exactly the same code in both transactions, so there is no condition different or so.
Why is that so?
EDIT:
I just tried another sequence, first with lower gas, then with higher gas limit:
Example 3:
Gas Limit: 350,000
Gas Used by Transaction:72,650 (20.76%)
Example 4:
Gas Limit: 450,000
Gas Used by Transaction: 82,650 (18.37%)