0

There're some smart contracts that only checks whether certain conditions are met. On the other hand, there're some other contracts that keep some state and the state changes by transactions calling them.

Assume we have a smart contract simulating some token, like here. So the contract only keeps a balance (who has how much), which is an array: balance = [b_1, b_2...].

Then, each time person A transfers some token to B, the balance is changed (i.e. the value corresponding to A decreases and for B increases in "balance" array).

I think we need to make a transaction and request such token transfer.

Question: Where and How is the new state (e.g. balance) stored?

Am I right that the new state of the contract is a part of the transaction invoking it, so new state is stored in the block containing this transaction?

  • This is a duplicate. Find the answer here. – Paul Aug 10 '17 at 16:48
  • Thank for your comment. I think my question is more detailed. But I can delete it if you'd like too. – user153465 Aug 10 '17 at 17:09

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.