Skip to content

feat: emit distinct emergency withdraw event - #1440

Open
silentgeckoaudit3801 wants to merge 3 commits into
LabsCrypt:mainfrom
silentgeckoaudit3801:event-emergency-withdraw-signal
Open

feat: emit distinct emergency withdraw event#1440
silentgeckoaudit3801 wants to merge 3 commits into
LabsCrypt:mainfrom
silentgeckoaudit3801:event-emergency-withdraw-signal

Conversation

@silentgeckoaudit3801

Copy link
Copy Markdown

Fixes #1140.

This PR adds a machine-distinguishable EmergencyWithdraw event for the contracts/lending_pool/src/lib.rs::emergency_withdraw path while leaving normal Withdraw emission and fund-movement mechanics unchanged.

Changes:

  • defines events::emergency_withdraw in contracts/lending_pool/src/events.rs
  • emits it only after a successful emergency redemption
  • adds a focused test that verifies the emergency path publishes the distinct event

Validation: static GitHub API/source inspection only; local Soroban/Rust tests were not run in this environment to avoid installing or executing additional toolchains.

@ogazboiz ogazboiz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this one is still a real gap, main's emergency_withdraw emits no distinct event, so the approach is right. but the branch is based on the old function signature:

  1. rebase onto main and adapt to the new emergency_withdraw(..., min_assets_out) signature (it now forwards to redeem_shares with min_assets_out).
  2. update the test's emergency_withdraw call accordingly.
  3. consider including the withdrawn asset amount in the event data alongside shares_burned, for parity with the regular Withdraw event.

if you want to keep contributing, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0

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.

[Contracts] LendingPool emergency_withdraw emits the same Withdraw event as normal withdraw - add a distinct event for the pause+cooldown bypass

2 participants