algorandfoundation/beaker

Add method to check that you're interacting with an app that matches the spec

barnjamin opened this issue · 4 comments

In the case that something with the contract changes (schema, logic) it'd be good to offer a method to verify that the app being interacted with matches what you expect.

How you can archive this without storing a hash or summary of the state of the contract?
May be checking the approval hash? Do you have any thoughts on this?

We should be able to generate the hash of the approval/clear programs you have locally. We can then retrieve the app id of the one you intend to interact with, hash it, and compare.

This will not account for simple things like scratch var index variance across compiles of the otherwise same contract

Great, where it's been compiled the program to get the hash? It's generating a teal file? Or just text.
And where should I place this feature?
Thanks

I think the application client is a reasonable spot, I've not thought much about the interface but for now just a method like verify_something that compares the local approval/clear binary and schemas with the remote one given the app Id. Wdyt?