Description
THIS IS FOR VERY PRELIMINARY DISCUSSION ONLY
As a user
I want the ability to install scripts on-chain (let's call them "dumb" contracts)
so that I can automate sequences of operations on-chain
.
Additional Context (optional)
Ideally we would have the ability to write small scripts (turing-completeness not necessary) that leverage conditionals, loops (bounded) the ability to store (a limited amount of) data on-chain and call BitShares platform ops.
Scripts would be installed as sub-accounts under the account creating them and accessed with a sort of name-spacing mechanism for user-friendliness (e.g. account name: clockwork::dividend-script)
Scripts can have different entry points depending on the operation that impacts them to allow for complete functionalities and better performance while we also allow owner accounts to explicitly call methods on them via a new op i.e. call_script_method(script_account,method_name,[params]).
e.g. in pseudocode
script some_simple_script {
init() {
// state loaded, common housekeeping when ran
}
chain_callable function onTransferIn(from, amount,asset) {
// do stuff when a transfer comes in
}
user_callable function setSomeData(data) {
// update state based on owner input
}
etc...
}
The main issue I see here is that the block-producing nodes don't have access to the full database which severely limits functionality. E.g. I can't query the list of holders of a certain asset inside a script for example.
Still there are use cases I can see this kind of functionality being helpful.
CORE TEAM TASK LIST
- Evaluate / Prioritize Feature Request
- Refine User Stories / Requirements
- Define Test Cases
- Design / Develop Solution
- Perform QA/Testing
- Update Documentation