I am curious to know about, how the updation of field variables in solidity is happening ?. Whether world state is maintaining for each variable in the contract as like account balance?. And one more thing, As ethereum is immutable, can we get the value of the variable at particular time or block Number in past?.
1 Answer
Can we get the value of the variable at a particular block number?
Yes, for example, using web3.js v1.2.1:
const variableValue = await contractInstance.methods.variableName().call(null, blockNumber);