Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
barnjamin opened this issue Aug 16, 2022 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@barnjamin
Copy link
Contributor

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.

@barnjamin barnjamin added enhancement New feature or request help wanted Extra attention is needed labels Aug 16, 2022
@ernestosperanza
Copy link

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?

@barnjamin
Copy link
Contributor Author

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

@ernestosperanza
Copy link

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

@barnjamin
Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants