cashscript
cashscript copied to clipboard
Add support for reusable function definition / invocation (2026 network upgrade)
The 2026 network upgrade will add OP_DEFINE and OP_INVOKE which allows us to define and invoke reusable functions. We should add a syntax to the CashScript language that allows users to define these "internal" functions and call them inside other contract functions.
This is related to https://github.com/CashScript/cashscript/issues/153. We may want to take some ideas from that issue, such as "libraries" which only contain "internal" functions that can be imported into smart contracts.