Is there any reliable way to determine how much gas your smart contract will consume based on the current gas price? That's the one piece that still confuses me.
RE: Ethereum "Gas" - How it Works
You are viewing a single comment's thread from:
Ethereum "Gas" - How it Works
It depends. Gas price is set for each instruction in the EVM, and you can see exactly which instructions will be run in a smart contract. In this sense, you can absolutely know how much gas a function in a contract will cost. The tricky part is that there can be loops/jumps that will change how many times a function runs, and that can't be known sometimes.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit