Enabling automated NFT lotteries with Chainlink Keepers and VRF

CZodiac’s novel use of Chainlink Keepers for the ‘VRF sandwich’ saving over 150 dev hours.

What is CZodiac?

How CZodiac uses Chainlink Keepers

What is the VRF Sandwich feature?

How CZodiac DeFi Bank integrated Chainlink Keepers

https://github.com/chinese-zodiac/rabbit-catch

Creating our Keepers-compatible contract

Our checkUpkeep function below uses the checkData to determine the type of checkUpkeep requested, whether the upkeep type is to request the VRF or whether it is to request the final mint.

performUpkeep Function: Contains the logic that should be executed on-chain when checkUpkeep returns true.

Similarly, performUpkeep accepts a performData that includes the type of Keeper request as returned by checkUpkeep, then routes the request to the appropriate logic in the smart contract to either request the VRF or to mint the NFT.

After writing our Keepers-compatible contract, we simply registered on the Chainlink Keepers app by following the tutorial here.

Our LSDT_VRF Upkeep registered on the Chainlink Keepers App

Advice for other developers integrating Chainlink Keepers

Results from the integration

Why CZodiac chose Chainlink Keepers

About CZodiac DeFi Bank

The Global Defi Investment Bank.

Passive income NFTs. Yields from assets backing CZUSD burn CZF, with profits building a rising price floor. See more at https://czodiac.com or trade CZodiac Official tokens and partner tokens directly on https://cz.cash.

About Chainlink Keepers

Automate your smart contracts using Chainlink Keepers, the decentralized, secure and highly reliable smart contract automation service.

Relying on Chainlink Keepers will help you reduce time spent on DevOps, eliminate automation infrastructure costs, build faster and more efficiently and unlock new dApp capabilities

Learn more about Chainlink Keepers:

Try the App: https://keepers.chain.link/

Docs: https://docs.chain.link/docs/chainlink-keepers/introduction/

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
CZodiac DeFi Bank

CZodiac uses POL game theory to develop novel Defi 2.0 technologies that protect farmers and stakers.