The Yellow Paper discussed the EXTCODECOPY instruction, which lets you copy the code of an external contract to memory. Does this include the state of the variables in the contract? Is it possible to read or hash the state of a contract such that a change can be detected?
Asked
Active
Viewed 467 times
1 Answers
5
No, EXTCODECOPY only copies the bytecode.
Can a contract access another contract's storage? No, a contract cannot read the state or storage of another arbitrary contract. If you're writing a contract, you can provide a function that when invoked, will let other contracts know if your contract's state has changed.