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?.


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);

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.