4

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?

4

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.

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.