Skip to content

Cover every state transition with an event #58

Description

@luchobonatti

User story / Problem statement

An operator dashboard, an indexer and the app's history view all read the same thing: events. Nobody has checked that every state transition emits one. This is a known failure mode with OpenZeppelin's token internals: the *_internal helpers emit nothing, because emission lives in the high-level wrappers, so a contract that calls the internal directly gets silence.

Expected outcome

Every state transition an operator needs is emitted and documented.

Acceptance criteria

  • a pass over every state-changing entrypoint, listing what it emits today
  • request, fulfill, claim and cancel emit on both sides, with the controller, the amounts and the generation
  • claim_cancel_deposit_request and claim_cancel_redeem_request emit — today they are the only two state-changing entrypoints in the contract that emit nothing, so a cancelled-and-returned position has no derivable settlement date
  • a strike emits the NAV it struck at and the resulting struck_assets
  • deploy_capital emits the amount and the custodian
  • pause, unpause, ripcord and every role change emit
  • the event surface documented: name, fields, and what a consumer reconstructs from it
  • the app's history view is built from these, not from polling state

Technical notes

Check the OpenZeppelin internals rather than assuming. Some *_internal helpers emit nothing, because emission lives in the high-level wrappers, and a contract that calls the internal directly gets silence.

The three public solvency figures are readable state, not events. An indexer still needs the transitions to explain how they got there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions