Scripts
As already mentioned, dfinance supports transaction scripting. It means users can compile and execute scripts. Different between modules here is that you can't publish script and use it again in the future, each script executing by new transaction every time.
The Move Book also has a section about scripts in Move language.
Write a script
Let's write a basic script, accepts two arguments, a and b values, and then using module math make a sum from these two numbers and then fire events.
Replace {{sender}}
with the address you used during publish of the module in the previous part of current documentation.
The script accepts two arguments in function "main", then calculate sum with provided arguments, and fire event with this sum. Both arguments are u64 integers.
Compile the script using dncli:
And then execute with arguments:
You can verify execution with querying transaction by id.
There will be even fired event, that will contain "keep" status and the resulting sum, like:
Last updated