Skip to content

fix(contracts): address issues #234, #235, #236, #237 - #438

Merged
dark-sarge merged 1 commit into
arflexx:mainfrom
ScriptedBro:fix/issues-234-235-236-237
Oct 17, 2026
Merged

dark-sarge merged 1 commit into
arflexx:mainfrom
ScriptedBro:fix/issues-234-235-236-237

Conversation

@ScriptedBro

Copy link
Copy Markdown
Contributor

Description

This pull request resolves four contract issues across contracts/escrow and contracts/marketplace:

1. Escrow create_listing validates maximum expiry window (Fixes #234)

  • Enforces an upper-bound expiry duration MAX_EXPIRY_SECS: u64 = 30 * 24 * 60 * 60 (30 days).
  • Returns ContractError::InvalidExpiry if expires_at > now + MAX_EXPIRY_SECS.
  • Added unit tests verifying upper-bound rejection and boundary acceptance.

2. Marketplace cancel_and_refund depositor verification (Fixes #235)

  • Ensures buyer argument matches the actual depositor recorded in listing.buyer.
  • Returns ContractError::Unauthorized if mismatched.
  • Added unit test verifying rejection of unauthorized buyer address during refund.

3. Admin transfer / ownership handover functionality (Fixes #236)

  • Implemented transfer_admin(env, new_admin) on both EscrowContract and MarketplaceContract.
  • Requires current admin authentication (admin.require_auth()).
  • Emits topics: ["admin", "transfer"] event containing (old_admin, new_admin).
  • Added unit tests covering authorized transfer, unauthorized invocation rejection, and confirming the new admin can execute admin operations immediately.

4. Escrow release_payment event topic correction (Fixes #237)

  • Defined dedicated topic_released() (symbol_short!("released")) for individual sub-escrow releases.
  • Emits topic_released upon each sub-escrow release.
  • Only publishes topic_completed when the trade status transitions to TradeStatus::Completed.
  • Added unit test asserting event topics across both partial release and completion stages.

Related Issues

…rflexx#237

- arflexx#234: Enforce MAX_EXPIRY_SECS (30 days) upper-bound window in escrow create_listing
- arflexx#235: Verify buyer parameter matches actual depositor in marketplace cancel_and_refund
- arflexx#236: Add transfer_admin function with auth checks and events to escrow and marketplace
- arflexx#237: Define topic_released for partial sub-escrow releases and emit topic_completed only on trade completion
@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@ScriptedBro Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@dark-sarge
dark-sarge merged commit 0b8eefb into arflexx:main Oct 17, 2026
4 of 12 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

2 participants