Programming Incentives

Learn some algorithmic strategies to incentivize the execution of transactions that can't be automated

No automated execution in Solidity

The execution of any operation in a smart contract must be initiated by an externally owned account. Contracts can never initiate transactions by themselves. So, in Solidity, there is no possibility to schedule automated code execution, as we would do with a cron job A Cron Job is a Linux command for scheduling a task (command). Cron Jobs allow you to automate specific commands or scripts on your server to complete repetitive tasks automatically. in other languages.

Press + to interact

However, some practical problems can require scheduling the automated execution of code. There are typically two things that we may want to use as triggers:

  • Time-based triggers: Some computations may need to be initiated after some time delay.

    • Example 1: Calculating loan interest (say incrementing the amount to be paid by 10% every month).

    • Example 2: Calculating the number of winners at the end of a time-constrained game ...