I am new to blockchain. I have some idea about blockchain and solidity. Smart contract get stored on blockchain as byte code. And the state variables we create also stored in blockchain. How is it possible to change the state variable once we have deployed the contract ?

1 Answer 1


The state variables can be changed. What is immutable in itself is the contract, or its bytecode.

You cannot add, remove, modify functions or content (events,modifier, ...). Since that would modify the bytecode. State variables' state are stored in storage. That's what is modified, the storage not the actual bytecode.

You cannot add sate variables once deployed, only modify the stored value of existing ones or delete them (resetting their value to the default zero value actually) if you have created the necessary functionalities.

Here are good explanations of how it all works, EVM, memory , storage, stack ...



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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