1

Is it possible for contract X to read the storage of contract Y without making a transaction?

I think I understand how I can make X call a function on Y using a callback pattern. But since I only want to read the storage of Y - and they are on the same ledger - the data should be readily available to X without making any transactions?

2

It is not possible for a contract X to access the storage of contract Y against Y's will. The main reason to forbid this is to prevent ticket steal. For contract Y, allowing contract X to read some part of the storage is typically done using the view pattern of TZIP 4 but in the future first-class views might be added to Michelson.

1
  • It could be done through an explicit unpair which would protect against stealing tickets. – FFF Mar 24 at 0:07

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.