Skip to content

Release v1.1.0: Event Log System, Multicall Utility & Metrics Aggregation#95

Merged
tahseen-ccprotocol merged 30 commits intomainfrom
develop
Apr 2, 2026
Merged

Release v1.1.0: Event Log System, Multicall Utility & Metrics Aggregation#95
tahseen-ccprotocol merged 30 commits intomainfrom
develop

Conversation

@tahseen-ccprotocol
Copy link
Copy Markdown
Contributor

Summary

  • Introduced shared event types (EventFilterOptions, DecodedEventLog, RawLog, EventWatchHandler) and decodeEventLog re-export from viem to support event handling across the SDK.

  • Implemented full event log fetching, decoding, and real-time watching for all 8 contract entities: GlobalParams, CampaignInfoFactory, TreasuryFactory, CampaignInfo, PaymentTreasury, AllOrNothing, KeepWhatsRaised, and ItemRegistry.

  • Every ABI event in every contract now has a get*Logs() method for historical log queries (defaults to searching from genesis), a decodeLog() method for raw receipt log parsing, and a watch*() method for real-time subscriptions.

  • Updated all *Events type interfaces with full JSDoc coverage for the new methods.

  • Added unit tests for all new event methods, maintaining 100% code coverage across statements, branches, functions, and lines.

  • Multicall utility: Added an ergonomic multicall function that batches multiple entity read calls into a single RPC round-trip via Multicall3. Accepts lazy closures (() => gp.getProtocolFeePercent()) instead of raw ABI descriptors, aligning with the existing entity read pattern. Enabled viem's batch.multicall transport on the provider so all concurrent readContract calls are automatically aggregated. Exposed as both a standalone utility (multicall(...)) and a client convenience method (oak.multicall(...)).

  • Metrics module: Implemented three aggregation functions — getPlatformStats, getCampaignSummary, and getTreasuryReport — that combine multiple on-chain reads into structured reports. Supports all three treasury types (all-or-nothing, keep-whats-raised, payment-treasury) with correct ABI resolution for each.

  • Tests & docs: Added comprehensive unit tests for the multicall utility and all three metrics functions with 100% coverage. Updated README.md with dedicated Multicall and Metrics sections, usage examples, doc links, and the exported entry points table.

mahabubAlahi and others added 25 commits April 1, 2026 16:18
- Introduced new types for event filtering and decoded logs in events.ts, including EventFilterOptions, DecodedEventLog, and RawLog.
- Added decodeEventLog function to viem/index.ts for processing event logs.
- Updated index.ts to export new event-related types for broader accessibility.
- Added functions to fetch and decode event logs for various events in the AllOrNothing contract, including Receipt, RefundClaimed, and WithdrawalSuccessful.
- Introduced a watcher mechanism for real-time event monitoring.
- Updated AllOrNothingEvents interface to include new methods for retrieving and watching event logs.
- Enhanced the decode functionality for raw logs to improve event handling capabilities.
… in AllOrNothing

- Introduced methods to fetch and decode Approval and ApprovalForAll event logs in the AllOrNothing contract.
- Added watcher functions for Approval, ApprovalForAll, and several other events to enable real-time monitoring.
- Updated the AllOrNothingEvents interface to include new methods for improved event handling.
- Added functions to fetch and decode event logs for various CampaignInfo events, including DeadlineUpdated, GoalAmountUpdated, LaunchTimeUpdated, PlatformInfoUpdated, SelectedPlatformUpdated, OwnershipTransferred, Paused, and Unpaused.
- Introduced watcher functions for real-time monitoring of these events.
- Updated CampaignInfoEvents interface to include new methods for improved event handling and log decoding capabilities.
- Implemented functions to fetch and decode event logs for CampaignInfoFactory events, including CampaignCreated, CampaignInitialized, and OwnershipTransferred.
- Introduced watcher functions for real-time monitoring of these events.
- Updated CampaignInfoFactoryEvents interface to include new methods for improved event handling and log decoding capabilities.
- Implemented functions to fetch and decode event logs for various GlobalParams events, including PlatformEnlisted, PlatformDelisted, and others.
- Introduced watcher functions for real-time monitoring of these events.
- Updated GlobalParamsEvents interface to include new methods for improved event handling and log decoding capabilities.
- Implemented functions to fetch and decode ItemAdded event logs, including a watcher for real-time monitoring.
- Updated ItemRegistryEvents interface to include new methods for improved event handling and log decoding capabilities.
- Enhanced the decode functionality for raw logs to support the new event structure.
- Implemented functions to fetch and decode event logs for various KeepWhatsRaised events, including Receipt, RefundClaimed, WithdrawalWithFeeSuccessful, and others.
- Introduced watcher functions for real-time monitoring of these events.
- Updated KeepWhatsRaisedEvents interface to include new methods for improved event handling and log decoding capabilities.
- Implemented functions to fetch and decode event logs for various PaymentTreasury events, including PaymentCreated, PaymentCancelled, PaymentConfirmed, and others.
- Introduced watcher functions for real-time monitoring of these events.
- Updated PaymentTreasuryEvents interface to include new methods for improved event handling and log decoding capabilities.
- Implemented functions to fetch and decode event logs for TreasuryFactory events, including TreasuryFactoryTreasuryDeployed, TreasuryImplementationRegistered, TreasuryImplementationRemoved, and TreasuryImplementationApproval.
- Introduced watcher functions for real-time monitoring of these events.
- Updated TreasuryFactoryEvents interface to include new methods for improved event handling and log decoding capabilities.
- Added a testTimeout property to the Jest configuration to allow for longer-running tests, improving test reliability in scenarios that require more time to complete.
- Updated event tests for AllOrNothing, CampaignInfo, CampaignInfoFactory, GlobalParams, KeepWhatsRaised, PaymentTreasury, and TreasuryFactory contracts to verify the presence of event helper methods.
- Expanded the README.md to include detailed sections on event handling capabilities for various contracts, including methods for fetching historical logs, decoding raw logs, and watching live events.
- Documented available events for GlobalParams, CampaignInfoFactory, TreasuryFactory, CampaignInfo, PaymentTreasury, AllOrNothing Treasury, and KeepWhatsRaised Treasury contracts, enhancing developer understanding of event interactions.
- Introduced a new `multicall` function to enable batching of multiple entity read calls into a single RPC request, improving efficiency.
- Updated `provider.ts` to enable `batch.multicall` in the JSON RPC provider configuration.
- Exported the new `multicall` function from the utils index for easy access.
- Implemented a new `multicall` method in the `OakContractsClient` interface to facilitate batching of multiple entity read calls into a single RPC request.
- Updated the `create.ts` file to include the `multicall` function, enhancing the client’s functionality and efficiency in handling multiple asynchronous calls.
- Added `getCampaignSummary` function to aggregate financial data from the CampaignInfo contract, including total raised, refunded, and goal status.
- Introduced `getTreasuryReport` function for per-treasury reporting, supporting AllOrNothing, KeepWhatsRaised, and PaymentTreasury contracts.
- Updated types to reflect new options and return structures for campaign and treasury reports.
- Enhanced documentation with examples for both functions to improve usability.
- Introduced tests for the `multicall` utility, verifying concurrent execution of closures and error propagation.
- Expanded the `getPlatformStats`, `getCampaignSummary`, and `getTreasuryReport` functions with comprehensive tests to ensure accurate financial data aggregation and reporting.
- Implemented mock client for testing contract interactions, improving test coverage and reliability.
- Introduced a new section on Multicall, detailing its usage for batching multiple entity read calls into a single RPC request, with examples for standalone utility and client convenience methods.
- Added a Metrics section, outlining pre-built aggregation functions for platform statistics, campaign summaries, and treasury reports, complete with usage examples.
- Updated the exported entry points to include the new multicall and metrics functionalities for improved accessibility.
- Introduced a constant for the canonical Multicall3 address, ensuring consistency across supported chains.
- Updated Celo Mainnet and Celo Sepolia chain definitions to include the Multicall3 contract address and block creation details, enhancing interoperability for multicall functionalities.
Add comprehensive event log handling across all contract entities
Add multicall utility and metrics aggregation module
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aaf37dcb0e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/contracts/src/lib/viem/provider.ts
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41b18acefc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/contracts/src/contracts/all-or-nothing/events.ts
@tahseen-ccprotocol tahseen-ccprotocol changed the title Release: Event Log System, Multicall Utility & Metrics Aggregation Release v1.1.0: Event Log System, Multicall Utility & Metrics Aggregation Apr 2, 2026
@tahseen-ccprotocol tahseen-ccprotocol merged commit 4b5673f into main Apr 2, 2026
12 checks passed
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.

4 participants