4

I am new to ethereum. We understand that whenever some new transaction made Contract state changes. What does it mean exactly by state change. Where they get stored.Are they called distributed ledger. Except transaction are there any events which cause state changes.

4

What does it mean exactly by state change.

State change in a smart contract refers to a Transaction, which means two parties involved in the transaction will have some changes. For instance, if you send some money from one account to another - there will be changes on both sides. Similarly, it applies to data related transactions as well.

If you want to update the value of a variable defined in the smart contract then since you are going to use blockchain storage, so updating the variable is a state change here because you are making a transaction to make it happen. While this update/addition transaction, you will end up spending some gas.

Where they get stored.

The state changes get stored on the blockchain itself in terms of the transaction on distributed ledger.

Are they called distributed ledger.

Distributed ledger are not state or state changes, but on distributed ledger, you will have blocks of all transactions(state-changes) which happen on blockchain

Except transaction are there any events which cause state changes.

No, only transactions are the only way to state change on the blockchain.

1

What does it mean exactly by state change. Where they get stored.

State change of a contract means the values of the variables that are stored on the blockchain as part of the contract are changed.

Except transaction are there any events which cause state changes.

Transactions are the only way to change the state of a contract.

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.