Skip to content

feat: implement issues #187, #207, #208, #209#214

Merged
Chuks-coderr merged 2 commits into
SoroStream:mainfrom
Lost-Z:feat/issues-187-207-208-209
Jun 29, 2026
Merged

feat: implement issues #187, #207, #208, #209#214
Chuks-coderr merged 2 commits into
SoroStream:mainfrom
Lost-Z:feat/issues-187-207-208-209

Conversation

@Lost-Z

@Lost-Z Lost-Z commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the following issues:

Changes

  • contracts/proxy: New proxy contract
  • contracts/stream: Extended with new storage, interface, events, and error handling
  • contracts/treasury: New treasury contract
  • tests: Added test coverage for new functionality

Testing

All changes verified with cargo test.

Closes #187
Closes #207
Closes #208
Closes #209

…SoroStream#209

Closes SoroStream#187
Closes SoroStream#207
Closes SoroStream#208
Closes SoroStream#209

## SoroStream#187 — Test: cancel_stream with zero withdrawals
- Added test_cancel_stream_with_zero_withdrawals in test.rs
- Asserts full deposit refunded to sender, recipient gets 0,
  stream storage entry removed, StreamCancelled event emitted
  with correct refund_amount and recipient_amount=0

## SoroStream#207 — Upgradeable proxy contract
- New contracts/proxy crate with ProxyContract
- Stores implementation WASM hash + storage version in instance storage
- upgrade(new_impl_hash, expected_version, new_version) enforces
  storage layout compatibility; reverts on StorageVersionMismatch
- upgrade_proxy() upgrades the proxy's own WASM
- migrate() forwards migrate(from, to) call to implementation contract
- Admin-controlled via set_admin; emits ProxyInitialized / ProxyUpgraded /
  ProxyMigrated events
- Includes unit tests for all upgrade paths including rollback

## SoroStream#208 — Protocol fee distribution with configurable treasury split
- Treasury contract: add set_lp_pool, set_treasury_split, distribute()
- distribute() splits accumulated fees between treasury wallet and LP
  reward pool according to treasury_bps (basis points); emits FeeDistributed
- Stream contract: add fee exemption list (add_fee_exempt, remove_fee_exempt,
  is_fee_exempt); exempt recipients skip protocol fee deduction on withdrawal
- Exemption check applied in withdraw, transfer_recipient, batch_withdraw

## SoroStream#209 — Emergency pause with guardian/governance asymmetry + auto-unpause
- New pause() function: only guardian address may call; sets 72-hour
  auto-unpause expiry via set_pause_expiry; emits Paused(guardian, timestamp)
- New unpause() function: only governance address may call; clears pause and
  expiry; emits Unpaused(governance, timestamp)
- is_paused_or_auto_unpause() helper auto-clears paused state when expiry
  is reached — all entry-point guards use this instead of is_paused()
- set_guardian / get_guardian / set_governance / get_governance admin ops
- emergency_pause / emergency_resume (admin path) also set 72-hour expiry
- errors.rs: fixed duplicate discriminant values (25/26/27/28/29/30)
- types.rs: fixed duplicate use declarations
- events.rs: fixed truncated stream_archived function body
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Lost-Z 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

@Chuks-coderr Chuks-coderr merged commit 1413e38 into SoroStream:main Jun 29, 2026
0 of 6 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