I am wondering if this is even a problem. So I have a function that calls another contract. After the first call to the external contract I call it again. I am not just reading data on each one of these calls, I am writing. My question is, will I have an issue if I call two writing methods on an external contract all within a single function.

Note I am also using some of the data from the first method call to call the second method. Is the transaction time between the two going to use to much gas, or what?


No, there will be no issue. The calls will be properly ordered and the state doesn't need any time to update.

The calls don't actually cause new transactions, they are just part of the bigger transaction

| improve this answer | |
  • You are correct. That is because each transaction includes a nonce value. This value start at 0 and is increaded by 1 for each new transaction. So transactions will be processed in order. – Ismael Apr 4 '17 at 16:56
  • No, this is not why. The nonce will not increase because these are not separate transactions. – Tjaden Hess Apr 4 '17 at 16:57
  • You are right again. My bad, I was thinking they were two separate transactions. – Ismael Apr 4 '17 at 17:19

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.