I have finished a course on solidity and the blockchain itself and there are some concepts I don't have clear yet. Could anyone confirm these assumptions?:
- When we deploy a smart contract, its code becomes immutable but a chunk of memory is assigned to it that is the so called storage memory.
- When someone wants to make a call to a contract function, a new transaction is queued into the trasaction pool for someone to "execute it" (By incluiding it in a mined block in POW). When a miner does this, the contract funcion is executed and it could change the state of the contract (storage memory we talked before).
Beside these 2 questions there's one about updating contracts that I'm confused about:
If we want to update our contract, we can't update the contract code we deployed before because it is inmutable. So, a new contract must be deployed and a new address for the contract will be generated. But, what happens with all the data (storage) we had in the previous contract? Is it all lost? Is there anyway to migrate it to the new contract?