Logging

Overview

Our logging system provides a standardised approach to event tracking across the protocol. Through a centralised Logger contract, we maintain consistent event emission for all actions and administrative changes, creating an immutable audit trail of system activities.

Logger Contract

The Logger contract serves as the core logging infrastructure, implementing two primary event types:

Action Events

  • Tracks all protocol operations

  • Includes caller address and standardised log ID

  • Contains encoded operational data

Administrative Events

  • Records governance and configuration changes

  • Uses a structured ID system for categorisation

  • Administrative log IDs follow a pattern:

    • 1XX: Proposals

    • 2XX: Grants

    • 3XX: Cancellations

    • 4XX: Removals

Log Types

The system defines standardised log types through an enumeration:

  1. Balance Update

    • Records deposit/withdrawal operations

    • Tracks balance changes and fee collections

    • Used across all protocol integrations

  2. Protocol-Specific Logs

    • Buy Cover operations

    • Curve pool swaps

    • ParaSwap exchanges

    • Token transfers

Integration Pattern

All action contracts inherit from ActionBase, which provides standardised logging functionality:

LOGGER.logActionEvent(
    LogType.BALANCE_UPDATE,
        encodeBalanceUpdate(
            strategyId,
            poolId,
            balanceBefore,
            balanceAfter,
            feeInTokens
        )
    );

Benefits

  1. Standardisation

    • Consistent event structure across all operations

    • Type-safe log identification

    • Structured data encoding

  2. Auditability

    • Centralised event stream

    • Clear categorisation of administrative changes

    • Comprehensive operation tracking

  3. Development Experience

    • Simple integration through base contract

    • Type-safe log enumeration

    • Standardised encoding patterns

Last updated