Script Lifecycle

Scripts are born, work hard and then die. A bit like us.
Each script is created, executed and, eventually, revoked. Here we'll show in detail how to do it.

Creation

Anyone with a Web3 wallet can create script on Daemons. You'll need to go to "My Page" and click on the "Add New Script Button"
Here you'll see a list of actions on the left side. By selecting any of them, you'll see it appearing in the center of the screen
Once you have set up your action, you can choose some conditions on the bottom left part. Conditions will be added just below the action once they are clicked.
Once you're done with the script, click on the "Review and sign" button to go to the overview page. Here, you will be able to... Review and sign it using your wallet.
In case some allowance is needed, here is the place where you'll be prompted for it.
Once you've signed the script, it will be added to Daemons, and it will become executable whenever the conditions you set became true.

Chaining

Chaining is a powerful mechanism of Daemons that allows executing a script after another. This allows the creation of complex procedures, starting from basic actions.
Chaining scripts looks as lot like creating them, but instead of pressing "Review and Sign", press "Chain another script" whenever you are done with a script.
This will clean the workbench and allow you to create more scripts. You'll see a button on the top right that will indicate how many scripts are currently in the chaining queue.
Once you are done, simply press the "Review and sign" button. You'll see all your script chained in the order you created them.
Pressing the button "Sign & deploy script" will trigger the signing, chaining and deployment of all your scripts.
Voilà, you've chained some scripts!

Execution

Executing scripts can happen in two ways, as you can:
  • execute your own scripts, or
  • execute any other user's scripts
The former is done in the "My Page". Here you'll see a list of all your scripts and, whenever they are executable, they will have a big green button that will prompt you to run them.
That's not it, as you can also execute scripts of any other user of the platform, always if these are executables at that moment. To do so, go to the "Execute" page and click on the green, inviting, button.
Executing scripts will give you DAEM rewards, that you can sell, stake or use to pay tips in your own scripts.

Revocation

By revoking a script, you make it non-executable. While creating a script is free, revoking has a little cost, as it needs to send data to the script executor contract in the blockchain. This is done to avoid malicious actors from saving your script locally and keep executing it after it has been removed from Daemons. As the script has been revoked at the source, no one will be able to execute it any more.
To revoke a script, click on the X button. This will prompt your wallet to send a cheap transaction to the script executor contract to revoke forever this script.