Skip to content

feat: Add governed beneficiary rotation#545

Merged
mikewheeleer merged 2 commits into
Liquifact:mainfrom
Glam26:feature/rotate-beneficiary
Jun 28, 2026
Merged

feat: Add governed beneficiary rotation#545
mikewheeleer merged 2 commits into
Liquifact:mainfrom
Glam26:feature/rotate-beneficiary

Conversation

@Glam26

@Glam26 Glam26 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

closes #249

I have completed the task and pushed the implementation for governed
beneficiary rotation!

Here is a summary of the work done:

  1. Repository & Branching: Ensured the work was committed to the
    feature/rotate-beneficiary branch.
  2. Feature Implementation ( lib.rs ):
    • Added rotate_beneficiary to the LiquifactEscrow contract with a
    dual-consent requirement ( sme_address.require_auth() and admin.
    require_auth() ).
    • Restricted execution to non-terminal states using guard_status_in
    (via ensure helper for 0 and 1 ).
    • Prevented rotating to the current SME address, introducing the
    EscrowError::NewSmeSameAsCurrent variant.
    • Preserved invariants: after the storage update, only the new SME has
    withdrawal/settlement authority.
    • Published the BeneficiaryRotated event properly tracking old_sme
    and new_sme .
  3. Refactoring & Compilation Cleanup:
    • Consolidated EscrowError to remove all the redundant
    #[contracterror] definitions that were causing trait implementation
    conflicts ( E0119 , E0428 ).
    • Initialized tier_lock_secs cleanly across all fund branches to
    resolve a pre-existing E0381 compiler error.
  4. Testing ( admin.rs ):
    • Added functional tests: test_rotate_beneficiary_success .
    • Added access/invariant tests:
    test_rotate_beneficiary_same_address_panics and
    test_rotate_beneficiary_wrong_state .
    • Used cargo test test_rotate_beneficiary to isolate and run these
    specific tests successfully, as the rest of the existing test suite has
    pre-existing unclosed delimiter bugs.
  5. Documentation: The implementation natively aligns with the
    docs/ESCROW_BENEFICIARY_ROTATION.md specifications that was correctly
    modeled with dual consent.

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Glam26 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

@mikewheeleer

Copy link
Copy Markdown
Contributor

well done — in it goes 👍

@mikewheeleer mikewheeleer merged commit 8569f60 into Liquifact:main Jun 28, 2026
1 check failed
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.

Add beneficiary rotation entrypoint to change sme_address before settlement

3 participants