Add a tool to view upgradeable contracts
Clarification and motivation
On-chain representation of upgradeable contracts is quite obfuscated because nearly everything is packed and stored as bytes. Because of that it is hard to inspect storage (logic and data) of an upgradeable contract using general block explorers and Tezos tooling (mainly tezos-client
).
I think we can implement a tool to view contents of an arbitrary upgradeable contract (as long as it uses our common upgradeable contract template or something similar).
Acceptance criteria
Add an executable to morley-upgradeable
which is able to inspect data of an arbitrary upgradeable contract. I think it should use RPC (!198 (merged)) and maybe tezos-client
bindings (#54 (closed)). Tentative interface:
-
print-entrypoint <name>
prints lambda that implements entrypoint with given name. -
print-field <name>
prints a field value fromUStore
that corresponds to given name. -
print-map-value <name> <key>
prints a value corresponding to submap<name>
and key<key>
.
Also all this commands obviously need to know the address of the contract in question.