Using the Chainlink Keepers Job Scheduler To Automate 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 “keepers,” 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 Keepers Job Scheduler—a new UI that enables smart contract developers to quickly, securely, and reliably schedule time-based automation jobs in seconds. If you’d like to immediately get started with the Keepers Job Scheduler, go to the Chainlink Keepers 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.

A diagram showing how unreliable keeper systems can compromise smart contract security
Creating and maintaining centralized infrastructure such as cron jobs for smart contract automation introduces significant security risks.

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 Keepers Job Scheduler for Time-Based Smart Contract Automation Tasks

Chainlink Keepers enable developers to automate their smart contract functions in a decentralized, cost-efficient, and highly secure manner.

Developers can specify predefined conditions for Chainlink Keepers to continuously check, and when those conditions are met, Keepers issue an on-chain transaction that triggers the smart contract to autonomously execute.

The Chainlink Keepers Job Scheduler is a new, no-code UI that allows developers to schedule all their time-based smart contract automation jobs on the Chainlink Keepers Network in seconds. Using the Keepers 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 Keepers and Chainlink Data Feeds.

Developers can save critical development time, decentralize their protocol or dApp, and increase security and uptime by using the Chainlink Keepers Job Scheduler to easily automate the execution of time-based Solidity functions in a decentralized manner. Rather than expending valuable resources building in-house infrastructure, developers can use the Keepers Job Scheduler as a ready-made solution for decentralized smart contract automation based on time intervals.

Key benefits of the Chainlink Keepers 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 Keepers Job Scheduler provides increased security, reliability, and uptime guarantees to the contracts it automates.
  • Security—Chainlink Keepers sign on-chain transactions themselves, enabling smart contract execution without exposing private keys in a Cron script.
  • Gas efficiency—The Keepers Solidity Scheduler eliminates the need for gas-intensive time checks on-chain.

How to Get Started

Start by navigating to the Chainlink Keepers App and selecting “Register new Upkeep”.

Input the target contract address which contains the function you want automated.

Register new Upkeep

Select the function you wish to call and specify any function inputs as necessary.

Contract call

Specify your preferred schedule

Specify time schedule

Register your Upkeep on the Chainlink Keeper Network after specifying an Upkeep name, gas limit, and starting LINK balance.

Upkeep details

Finally, confirm the transactions to deploy the CRON job contract and register your time-based Upkeep to the Chainlink Keepers Network. After registering your contract as an Upkeep on the Keepers Registry, the Keepers Network monitors the Upkeep and executes your functions.

Deploy CRON job contract

View and manage your Upkeeps from the dashboard.

Chainlink Keepers dashboard

And you’re done! It’s that easy to start automating any smart contract function with Chainlink Keepers. 

Chainlink Keepers Job Scheduler Example Use Cases

Chainlink Keepers are already empowering Solidity developers on Ethereum, Polygon, Avalanche, and BNB Chain 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 Keepers, read this post.

Below are just a few examples of the many time-based smart contract automation use cases unlocked by the Chainlink Keepers 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 a keeper network to monitor the passage of time and trigger certain events at specific intervals. The Keepers 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.

Rewards Payouts

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 Keepers 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.

Rebasing Tokens

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 Keepers 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

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 automation tasks, the Keepers Job Scheduler is the perfect tool to upgrade NFTs based on predefined time-based conditions. Learn more in this Chainlink Engineering Tutorial.

Summary

The Chainlink Keepers Job Scheduler enables developers to securely and easily automate 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 Keepers, 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.

To learn more, visit chain.link, subscribe to the Chainlink newsletter, and follow Chainlink on Twitter, YouTube, and Reddit.

More on This Topic