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

Bug - Adding contracts with wrong signature/interface breaks templateLauncher#handleTemplateAdded #92

Closed
adamazad opened this issue Aug 5, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@adamazad
Copy link
Collaborator

adamazad commented Aug 5, 2021

Context

TemplateLauncher.addTempate(address templateAddress) expects, in good faith, that the received contract is implementing the method templateName -- which names the template.

Transaction 0x59398c2374b35 adds, by mistaken, a FixedPriceSale sale module to TemplateLauncher. The call emits TemplateAdded, the subgraph picks up the event. However, when trying to process the event, the signature/method templateName does not exist on . and the subgraph fails to sync any further blocks.

Solution

Contract-level

Check the address interface for matching signature before adding the template. This is also critical to document for people building on top of Aqua.

Subgraph-

Check if the address implements the templateName method. A try/catch could help.

@adamazad
Copy link
Collaborator Author

Closed via cryptonative-ch/aqua-smartcontracts#123

@adamazad adamazad unpinned this issue Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant