Skip to content

feat: add standardized event emission for lending contract#236

Merged
ONEONUORA merged 4 commits intoFracverse:masterfrom
dinahmaccodes:issue233
Feb 26, 2026
Merged

feat: add standardized event emission for lending contract#236
ONEONUORA merged 4 commits intoFracverse:masterfrom
dinahmaccodes:issue233

Conversation

@dinahmaccodes
Copy link
Contributor

@dinahmaccodes dinahmaccodes commented Feb 26, 2026

Closes #233

This pull request introduces a comprehensive event logging system to the borrowing contract, allowing key actions such as borrowing, repaying, and liquidating loans to be tracked via structured events. These changes improve contract transparency, enable easier integration with off-chain systems, and provide better observability for users and developers. The implementation includes new event types, emits events at relevant contract actions, and updates test snapshots to validate event outputs.

Event system enhancements:

  • Added four new event structs (BorrowEvent, RepayEvent, LiquidationEvent, and InterestAccrualEvent) to define the structure of contract events for loan actions in lib.rs.
  • Integrated event emission in contract logic: now emits a borrow event when a loan is created, a repay event when a loan is repaid, and a liquidation event when a loan is liquidated. [1] [2] [3]

Testing and validation:

  • Updated test snapshots to include the new event outputs for borrowing, repaying, and liquidating loans, ensuring that event emission is correctly validated in various scenarios. [1] [2] [3] [4] [5] [6] [7]

Codebase improvements:

  • Refactored imports in lib.rs to include symbol_short for event topic encoding and improved clarity in loan creation logic by using .clone() for struct fields. [1] [2]

These changes lay the foundation for robust contract event tracking and pave the way for future improvements in analytics and off-chain integrations.

Copy link
Contributor

@ONEONUORA ONEONUORA left a comment

Choose a reason for hiding this comment

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

Great job @dinahmaccodes

@ONEONUORA ONEONUORA merged commit 5cef5ba into Fracverse:master Feb 26, 2026
2 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.

[Soroban] Standardized Event Emission 2

2 participants