0

How can I calculate the cost of running my contract and running each function?

I've noticed in Ethereum when a transaction is successful we have a transaction cost and a execution cost, what the difference?

If I calculate all the execution cost of my functions, will that be the total for my whole contract?

  • What do you mean by "running my contract"? What do you mean by "the total for my whole contract"? How are we supposed to answer this question when there is no code provided, and no description of what tools you are planning to use (for example, web3.js)??? – goodvibration Aug 7 at 7:04
  • By running the contract I mean deploying it either on a java script VM or using testrpc, regarding tools I've mentioned in my tags solidity and remix already. Regarding total for my whole contract I mean gas running cost. – user51821 Aug 7 at 7:59
  • "total for my whole contract" is still unclear. You can run each function an infinite number of times, what would be "the total of your contract" then? – goodvibration Aug 7 at 8:00
  • In-other words, how can I know the exact amount of gas to put in for the contract to run without running out of gas. – user51821 Aug 7 at 8:50
  • If it's your contract, then just put the maximum (block gas-limit). You will not be charged more than what will be used. Similar question here, by the way. In the answer to that question, the relevant part to your question is at the bottom of the answer: – goodvibration Aug 7 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.