feat: Add governed beneficiary rotation#545
Merged
Merged
Conversation
|
@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! 🚀 |
Contributor
|
well done — in it goes 👍 |
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.
closes #249
I have completed the task and pushed the implementation for governed
beneficiary rotation!
Here is a summary of the work done:
feature/rotate-beneficiary branch.
• 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 .
• 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.
• 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.
docs/ESCROW_BENEFICIARY_ROTATION.md specifications that was correctly
modeled with dual consent.