feat: add will finalization, witness verification, and update restrictions#358
Merged
ONEONUORA merged 2 commits intoFracverse:masterfrom Mar 27, 2026
Merged
Conversation
|
@dinahmaccodes 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
Author
|
@ONEONUORA |
Contributor
|
@dinahmaccodes Pls fix conflict |
3c30fbc to
0dc858c
Compare
Contributor
Author
|
Fixed Conflicts @ONEONUORA |
ONEONUORA
approved these changes
Mar 27, 2026
Contributor
ONEONUORA
left a comment
There was a problem hiding this comment.
Great job @dinahmaccodes
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
Will Finalization, Witness Verification & Update Restrictions
Closes #319
Closes #320
Closes #321
This PR implements the final layer of legal enforceability for wills in the InheritX inheritance contract — finalization locking, witness attestation, and immutability enforcement.
What's changed
finalize_will(owner, vault_id, version)permanently locks a will version. It requires the owner to have signed the will and all assigned witnesses to have signed before finalization is allowed. Once finalized, the version is immutable and no new versions can be created. AWillFinalizedevent is emitted on success.add_witnesslets the plan owner assign one or more third-party witness addresses to a vault.sign_as_witnessallows each registered witness to attest to the will using their wallet. Both actions emit events (WitnessAdded,WitnessSigned). Duplicate witness registration and double-signing are rejected.create_will_versionnow checks whether the currently active version is finalized before allowing a new version to be created, enforcing the update restriction from issue #321.New query functions:
is_will_finalized,get_will_finalized_at,get_witnesses,get_witness_signature.Error codes
WillAlreadyFinalized = 49andWillNotVerified = 50replace the previousSignatureAlreadyUsedandInvalidSignatureto stay within Soroban's 50-variant XDR limit for#[contracterror]enums.24 new tests cover all happy paths, failure cases, event emissions, and edge cases across all three issues.
Checklist
finalize_willonly callable after owner signature is presentWillFinalized(vault_id, version)WitnessSigned(vault_id, witness)