Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

default fundable hook per-app #209

Merged
merged 9 commits into from
Jan 24, 2021
Merged

Conversation

YaronWittenstein
Copy link
Contributor

@YaronWittenstein YaronWittenstein commented Jan 13, 2021

Motivation

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants