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

default fundable hook per-app #209

merged 9 commits into from Jan 24, 2021


Copy link

@YaronWittenstein YaronWittenstein commented Jan 13, 2021


Each app written using the SVM SDK should have exactly one fundable hook marked as the default one.
When an endpoint/ctor is annotated with #[fundable] without specifying an explicit fundable hook name - the default one will be used.

Moreover, when sending coins using a simple-coin transaction to an App account - SVM will execute the logic of the default fundable hook (giving a chance for the running app to update its internal storage).

Future apps that will be written without using the SVM Rust SDK will have to expose a Wasm function named svm_fund.
This function's signature is fn () -> (). In other words, the function expects no input and it returns nothing.
The SVM SDK will auto-generate the svm_fund export behind the scenes.

@YaronWittenstein YaronWittenstein marked this pull request as ready for review January 18, 2021 12:21
@YaronWittenstein YaronWittenstein merged commit c47b929 into master Jan 24, 2021
@YaronWittenstein YaronWittenstein deleted the default-before-fund-hook branch January 24, 2021 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants