Skip to content

Conversation

fmonper1
Copy link
Contributor

@fmonper1 fmonper1 commented Aug 22, 2025

This pull request adds a new on-chain write workflow that integrates off-chain and on-chain data using EVM smart contracts. The main changes include introducing contract ABIs, implementing a cron-triggered workflow, and providing logic to read from and write to EVM contracts. Below are the most important changes grouped by theme:

Smart Contract ABI Definitions

  • Added STORAGE_ABI and CALCULATOR_CONSUMER_ABI constants in abi.ts to define the interfaces for the storage and calculator consumer smart contracts, enabling contract interaction in the workflow.

Workflow Implementation

  • Implemented a new workflow in on-chain-write.ts that:
    • Defines a configuration schema for scheduling and EVM connection parameters.
    • Fetches off-chain data via HTTP, reads on-chain data from the storage contract, combines the results, and writes the final result to the calculator consumer contract.
    • Uses a cron trigger to schedule workflow execution.

EVM Contract Interaction

  • Added logic to encode/decode function calls and results using the provided ABIs, including dry-run validation of results and transaction submission to the calculator consumer contract.

Error Handling and Logging

  • Included error handling for missing configuration and anomalous results, as well as logging at key steps for easier debugging and monitoring.

Workflow Entrypoint

  • Provided a main function to initialize and run the workflow, registering the cron trigger handler and ensuring proper startup sequence.

@fmonper1 fmonper1 requested a review from a team as a code owner August 22, 2025 14:54
Copy link

👋 fmonper1, 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!

ernest-nowacki
ernest-nowacki previously approved these changes Aug 25, 2025
@ernest-nowacki ernest-nowacki merged commit 2aed3b3 into main Aug 25, 2025
4 checks passed
@ernest-nowacki ernest-nowacki deleted the write-onchain-report branch August 25, 2025 14:15
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