Using the Chainlink Automation Job Scheduler To Trigger Time-Based Smart Contract Functions
Smart contracts are deterministic programs that run on blockchains and execute when certain predefined conditions are met. The initial use cases for smart contracts mostly involved issuing blockchain-based tokens, with developers later leveraging oracle networks to create hybrid smart contracts that use external data and computation to create more sophisticated applications.
One key piece of external computation infrastructure for developers looking to build advanced smart contract applications are “Upkeeps,” which trigger on-chain transactions when various predefined conditions occur, enabling developers to automate key smart contract functions.
In this post, we’ll explore the Chainlink Automation Job Scheduler—a new UI that enables smart contract developers to quickly, securely, and reliably schedule time-based Upkeep jobs in seconds. If you’d like to immediately get started with the Automation Job Scheduler, go to the Chainlink Automation App and register a new time-based Upkeep.
Smart Contracts Cannot Autonomously Execute
An often-overlooked characteristic of smart contracts is that they cannot execute on their own—they need an external entity to trigger their internal logic.
To overcome this issue, developers can manually trigger their contracts or build centralized scripts to trigger them on their behalf. However, these methods present centralization risks and efficiency bottlenecks, introduce smart contract security vulnerabilities, and take up precious development time and resources that could otherwise be used to advance the protocol.
In addition, developers looking to automate time-based executions of their smart contract functions typically have to make their contracts compatible with an automation service, redeploy contracts and migrate users, perform gas-intensive time checks, and register each automation job separately.
Using the Chainlink Automation Job Scheduler for Triggering Time-Based Smart Contract Tasks
Chainlink Automation enables developers to automate their smart contract functions in a decentralized, cost-efficient, and highly secure manner.
Developers can specify predefined conditions for Chainlink Automation to continuously check, and when those conditions are met, nodes issue an on-chain transaction that triggers the smart contract to autonomously execute.
The Chainlink Automation Job Scheduler is a new, no-code UI that allows developers to schedule all their time-based smart contract Upkeep jobs on the Chainlink Automation Network in seconds. Using the Automation Job Scheduler, developers can easily and reliably execute smart contract automation jobs based on time or scheduling using the same decentralized oracle networks that power Chainlink Automation and Chainlink Data Feeds.
Developers can save critical development time, decentralize their protocol or dApp, and increase security and uptime by using the Chainlink Automation Job Scheduler to easily trigger time-based Solidity functions in a decentralized manner. Rather than expending valuable resources building in-house infrastructure, developers can use the Automation Job Scheduler as a ready-made solution for decentralized smart contract execution based on time intervals.
Key benefits of the Chainlink Automation Job Scheduler include:
- Easy-to-use—Automate your smart contracts in seconds using an easy-to-use, no-code UI.
- Decentralization—By leveraging a decentralized network of nodes to execute Upkeep jobs, the Automation Job Scheduler provides increased security, reliability, and uptime guarantees to the contracts it automates.
- Security—Chainlink Automation nodes sign on-chain transactions themselves, enabling smart contract execution without exposing private keys in a Cron script.
- Gas efficiency—The Automation Solidity Scheduler eliminates the need for gas-intensive time checks on-chain.
How to Get Started
Start by navigating to the Chainlink Automation App and selecting “Register new Upkeep”.
Input the target contract address which contains the function you want automated.
Select the function you wish to call and specify any function inputs as necessary.
Specify your preferred schedule
Register your Upkeep on the Chainlink Automation Network after specifying an Upkeep name, gas limit, and starting LINK balance.
Finally, confirm the transactions to deploy the CRON job contract and register your time-based Upkeep to the Chainlink Automation Network. After registering your contract as an Upkeep on the Automation Registry, the Automation Network monitors the Upkeep and executes your functions.
View and manage your Upkeeps from the dashboard.
And you’re done! It’s that easy to start executing any smart contract function with Chainlink Automation.
Chainlink Automation Job Scheduler Example Use Cases
Chainlink Automation is already empowering Solidity developers on Avalanche, BNB Chain, Ethereum, Fantom, and Polygon, to build fully featured dApps that are decentralized and fully automated end to end. If you’re looking for a deep dive into the vast array of smart contract automation use cases enabled by Chainlink Automation, read this post.
Below are just a few examples of the many time-based smart contract automation use cases unlocked by the Chainlink Automation Job Scheduler.
Starting and Stopping Game Rounds
Smart contract applications such as prediction markets and no-loss savings games have functions that need to be triggered at specific time intervals, such as starting, stopping, or pausing games or rounds.
These dApps need an automation network to monitor the passage of time and trigger certain events at specific intervals. The Automation Job Scheduler can reliably automate these calls to the application smart contract in order to trigger the start or end of different rounds or game phases.
Many DeFi and NFT platforms aim to attract liquidity and encourage user participation through financial incentives. Protocols that periodically distribute rewards to a specific set of users can use the Chainlink Automation Job Scheduler to automate the reward distribution process in a reliable and decentralized manner.
The Job Scheduler helps ensure that the rewards are distributed to users at predefined intervals without any manual input required, creating a frictionless user experience and simplifying smart contract management for developer teams.
Elastic supply tokens periodically adjust their outstanding supply through a mechanism called rebasing to achieve the desired functionality—typically, maintaining a peg with a target index.
Automating the rebasing mechanism of elastic supply tokens is a smart contract maintenance task that has to be periodically performed to achieve the desired peg. Here, the Chainlink Automation Job Scheduler can periodically call smart contracts and initiate the rebasing mechanism for elastic supply tokens in a highly reliable and decentralized manner.
Dynamic NFTs are non-fungible tokens (NFTs) that evolve and acquire new attributes based on external data. NFT projects can update their NFTs with real-world data by using Chainlink Data Feeds or connecting to any external API using custom-built External Adapters.
As a reliable decentralized scheduler for time-based smart contract management tasks, the Automation Job Scheduler is the perfect tool to upgrade NFTs based on predefined time-based conditions. Learn more in this Chainlink Engineering Tutorial.
The Chainlink Automation Job Scheduler enables developers to securely and easily trigger time-based smart contract functions in a decentralized manner. Developers can use the Solidity Scheduler to replace centralized Cron jobs, enhance the security and uptime of their protocol, and free up development capacity within their operations.
If you’re a developer and want to quickly get your application integrated with Chainlink Automation, visit the developer documentation and join the technical discussion in Discord. If you want to schedule a call to discuss the integration more in-depth, reach out here.