Questions tagged [gas-estimate]

351 questions
2
votes
1 answer

Gas consumed by function invoking event?

I have a function to emit event. When I check Ganache, I find that gas used is 23078. Doesn't the event consume less gas than function with contract state change operations? function log() { CheckUserAccess("John_Wick","Create",false); }
1
vote
1 answer

How can I estimate gas on a transaction with custom data?

How can I estimate the gas I need for a string which may be quite long? I've found an example here, but in this estimate, it doesn't include any custom data. In my app I would like to save a string on-chain, though the estimateGas's data property…
joe
  • 269
  • 2
  • 12
0
votes
1 answer

Why are all "safe low" transactions mined eventually?

On the website ethgasstation.info you see the current fees for fast, standard and safe low transactions, assuming that there are always more safe low transactions waiting to be mined than standard or fast transactions, and that there are always more…
rraallvv
  • 145
  • 5
0
votes
1 answer

Gas cost when calling multiple contracts

If contract a was to call one or more contracts when running it, would the gas cost be the sum of both contract's gas cost?
0
votes
0 answers

How to estimate gas for subsequent contract interaction in the same call

I have the same issue as here: Can I estimate the total gas limit of several dependent transactions? But i need to know the result on the fly in my react application. Anyone has an idea?
Oliver
  • 1
0
votes
1 answer

Smart contract which uses more gas than estimated

I need to create a smart contract for which it would be hard to estimate gas usage. Specifically, if I estimate execution gas usage at 90 000 gas, I want to consume e.g. 110 000 gas, so that the transaction will fail if I execute it with a 100 000…
0
votes
1 answer

Gas estimation failed:"transfer amount exceeds spender allowance"

I want to execute function Tip and transfer IERC20 Token. However, this message is shown. Uni::transferFrom: transfer amount exceeds spender allowance { "originalError": { "code": 3, "data":…