Skip to content

New Template: Keeper Bot#40

Open
ejacquier wants to merge 5 commits intomainfrom
new-keeper-bot-template
Open

New Template: Keeper Bot#40
ejacquier wants to merge 5 commits intomainfrom
new-keeper-bot-template

Conversation

@ejacquier
Copy link
Contributor

New Template: Keeper Bot

  • Cron-based smart contract maintenance.
  • Reads needsUpkeep() every 5 minutes, triggers on-chain execution when interval elapses.
  • Contract self-increments a counter. Simplest write-path template, teaches the universal cron → read → check → write pattern.

@ejacquier ejacquier requested a review from a team as a code owner March 17, 2026 12:53
@github-actions
Copy link

👋 ejacquier, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

### 2. Run Tests

```bash
cd my-workflow && bun test
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing cd contracts && bun install && cd ..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

throw new Error(`Keeper TX failed: ${writeResult.errorMessage || writeResult.txStatus}`)
}

const txHash = bytesToHex(writeResult.txHash || new Uint8Array(32))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could check receiver contract execution status here:

if (
  writeResult.receiverContractExecutionStatus !== undefined &&
  writeResult.receiverContractExecutionStatus !== 0
) {
  throw new Error(`Receiver contract execution failed: status ${writeResult.receiverContractExecutionStatus}`)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants