Skip to content

[CT-15] Standardize event emission across all assetsup contract modules in opsce crate #814

@yusuftomilola

Description

@yusuftomilola

Problem

Event emission in contracts/assetsup/src/ is inconsistent across modules. Some modules emit events; others silently mutate state. Backend services and indexers cannot reliably track on-chain state changes without consistent events.

Proposed Solution

Create contracts/opsce/src/events.rs that defines a standardized emit_event() helper and a complete set of typed event structs for all assetsup operations.

Acceptance Criteria

  • Typed event structs defined for: AssetRegistered, AssetTransferred, AssetRetired, TokensMinted, TokensBurned, TokensTransferred, DividendsDistributed, VoteCast, LeaseCreated, LeaseReturned
  • Each struct uses contracttype and has named fields (not raw bytes)
  • emit_event(env, event) is a generic helper that calls env.events().publish()
  • All modules in assetsup/src/ are updated to use the new event structs (or clearly document which modules still need updating)
  • Unit tests verify that each event is emitted with the correct field values after the corresponding function call

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions