Feat/admin transfer ci dependabot pause tests#469
Merged
ogazboiz merged 5 commits intoMay 28, 2026
Merged
Conversation
…vent Add transfer_admin(env, current_admin, new_admin) to lib.rs that: - Requires the current admin's auth - Verifies the caller matches the stored admin - Updates ProtocolConfig.admin to the new address - Emits AdminTransferredEvent with previous_admin and new_admin Also adds paused/paused_at fields to Stream struct and pause_stream/resume_stream entry points with corresponding StreamPausedEvent/StreamResumedEvent events. Updates calculate_claimable to freeze accrual at paused_at when stream is paused, and withdraw to reject calls on paused streams. Refs: LabsCrypt#459, LabsCrypt#462
…rios - Successful admin transfer, non-admin rejected, not-initialized rejected - New admin can call update_fee_config, old admin cannot - AdminTransferredEvent emitted with correct payload - Pause stops accrual (frozen at paused_at) - Withdraw on paused stream returns StreamInactive - Resume adjusts last_update_time to skip pause window - Cancel paused stream settles at paused_at, not current time - Cancel emits correct refunded_amount when paused - Resume then cancel settles correctly across pause boundary - StreamPausedEvent and StreamResumedEvent emitted with correct payloads Refs: LabsCrypt#459, LabsCrypt#462
Add .github/workflows/ci.yml with: - cargo fmt --all -- --check (formatting gate) - cargo clippy --all-targets --target wasm32-unknown-unknown -- -D warnings - WASM release build step - cargo test --all for unit tests - rustfmt and clippy components in toolchain setup - Cargo cache for faster builds Triggers on push/PR to main and develop when contracts/ files change. Refs: LabsCrypt#460
Add .github/dependabot.yml with package-ecosystem entries for: - npm (root, /frontend, /backend) - cargo (/contracts) - github-actions (/) Configured with weekly schedule (Monday), sensible PR limits, and grouped minor/patch updates to reduce PR noise. Refs: LabsCrypt#461
5 tasks
ogazboiz
added a commit
that referenced
this pull request
May 29, 2026
…mpiles again PR #469's merge left duplicate struct fields, functions, event fields, and a stray brace across the stream contract. Kept the Option<u64>/status-based pause-resume design (the one the test suite asserts on), removed the duplicate u64-sentinel implementation, and fixed StreamResumedEvent to match. Also: - fuzz test now skips zero-rate inputs (rejected by the zero-rate guard) - cancel-paused test asserts the balanced 400/600 settlement accounting - cleared clippy lints (redundant cfg(test), unwrap_or_default, same-type casts) - fixed contracts CI clippy gate (was targeting wasm, which can't build tests) Closes #499
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses multiple contract, infrastructure, and testing issues to improve protocol safety and automate code quality checks.
Changes
transfer_adminfunctionality to allow rotating protocol ownership safely, emitting anAdminTransferredEvent. (Closes [Contracts] Add transfer_admin so protocol ownership can be rotated #459)pausedandpaused_atstate to streams. Implementedpause_streamandresume_stream. Fixed accrual calculation during paused periods so thatcancel_streamcorrectly settles the recipient's accrued tokens up to the paused timestamp. Added comprehensive unit tests. (Closes [Testing] Add contract tests for cancelling and withdrawing paused streams #462)cargo fmt --checkandcargo clippygates. (Closes [Infra] Add cargo fmt --check and clippy gates to contracts CI #460)Closes #459
Closes #460
Closes #461
Closes #462