automation-upkeep

Implements deterministic, idempotent Chainlink-style checkUpkeep and performUpkeep automation for smart contract phase transitions.

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/IagoPrandi/zeroclaw-plugin --skill automation-upkeep-iagoprandi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: automation-upkeep
Source: https://github.com/IagoPrandi/zeroclaw-plugin/tree/main/.claude/skills/automation-upkeep
Command: npx skills add https://github.com/IagoPrandi/zeroclaw-plugin --skill automation-upkeep-iagoprandi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Smart contract automation often fails through non-deterministic upkeep checks, duplicate executions that corrupt state, or reliance on off-chain data. This Skill provides a canonical pattern for building keeper automation that is read-only, idempotent, and safe to retry. ## Core Features & Use Cases - Deterministic checkUpkeep: Enforces read-only checks based solely on on-chain state and stored timestamps, never external systems or mempool data. - Idempotent performUpkeep: Re-validates preconditions before executing one encoded action per call, with deterministic revert reasons like NOT_NEEDED or ALREADY_REQUESTED. - Manual fallback: Keeps public functions available so protocol progress never depends on keeper availability. - Use Case: When building a lottery or phased protocol that needs automated phase advancement, VRF draw requests, and scheduled day open/close logic, apply this pattern to ensure repeated keeper calls never double-request draws or corrupt day state. ## Quick Start Use the automation-upkeep skill to implement checkUpkeep and performUpkeep for my contract's phase transitions with idempotent retries and manual fallback functions.

Frequently Asked Questions about automation-upkeep

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement Chainlink checkUpkeep and performUpkeep for phase automation?▼

Define a small action enum encoded in performData, make checkUpkeep read-only and deterministic using only on-chain state and timestamps, and have performUpkeep decode the action, re-check preconditions, and execute at most one action per call.

How to make performUpkeep idempotent in Solidity?▼

Re-validate all preconditions inside performUpkeep before executing: correct phase, deadline passed, draw not already requested, day not already opened or closed. Repeated calls then become safe no-ops or deterministic reverts instead of corrupting state.

Can checkUpkeep call external APIs or oracles?▼

No. checkUpkeep must only use on-chain state and timestamps or deadlines stored on-chain. Depending on external systems, mempool data, latest blockhash, or off-chain prices makes upkeep non-deterministic and unreliable.

What happens if the keeper stops running my upkeep?▼

Automation should be optional. Keep manual public functions for advancing phases, requesting draws, and opening or closing days so the protocol can still progress without any keeper, guarded by the same phase checks.

Why does my automation spam VRF requests when a draw is pending?▼

checkUpkeep is missing an already-requested guard. Track draw request state on-chain and return upkeepNeeded false while a VRF request is pending, so repeated checks do not trigger duplicate requests.