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 a first manual hookpoint #95

Closed
deep-ink-ventures opened this issue Apr 18, 2023 · 0 comments
Closed

Add a first manual hookpoint #95

deep-ink-ventures opened this issue Apr 18, 2023 · 0 comments
Assignees
Labels

Comments

@deep-ink-ventures
Copy link
Owner

We are creating a manual hookpoint here that is a hardcoded contract call. We will abstract this in the subsequent tickets, once we have this worked out.

After the token balance is calculated here, do the following:

  • check if the DAO owner address has a register_specific_ink_callback for the id ON_VOTING_CALC, if not check if the DAO owner address has a register_global_ink_callback on that address, if not do nothing
  • if there is a contract, call it using https://crates.parity.io/pallet_contracts/pallet/struct.Pallet.html#method.bare_call, just use reasonable max limits that work for gas limits etc.; encode the params as defined in our trait and expect a return value as expected in our trait
  • if there is any kind of error or unexpected return, emit an event and otherwise ignore and continue with the original value
  • if no error is, continue with the returned value.

Note that use-ink/ink#1674 is discussing taking this one step further: Instead of us manually encoding and decoding between values, there is a way to automate this. We may want to take this ticket and implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants