Say I have a public variable called:

uint256 testInt;
  1. When I call a function that reads from testInt and then modifies testInt, it will be pending.

  2. Now I submit a new transaction with a higher gas price. It calls the same function. This transaction will process before the pending function.

My question is that will the testInt that is read in 1. be the one modified by 2?


Transactions happen in a defined order. If transaction #2 runs before transaction #1, then transaction #1 will see the value as it is after transaction #2.

| improve this answer | |

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.