feat: add co-ownership support for pets#148
Open
Majormaxx wants to merge 2 commits intoDogStark:mainfrom
Open
Conversation
- Replace owner: Address in Pet and PetProfile with primary_owner and owners: Vec<Address> - Add DataKey::CoOwners(u64) for per-pet co-owner storage - Add require_any_owner_auth helper and replace pet.owner.require_auth() calls - Add add_co_owner, remove_co_owner, and get_co_owners functions - Update accept_pet_transfer and registration functions - Add missing Pet/PetProfile fields (archived, notes) - Fix pre-existing DataKey medication variants and missing string_to_species helper Closes DogStark#120
- Add test_coownership.rs covering co-owner addition, removal, and permissions - Verify primary_owner removal restriction - Ensure multi-owner auth logic works correctly
llinsss
approved these changes
Feb 20, 2026
llinsss
approved these changes
Feb 20, 2026
Contributor
|
you hAVE MERGE conflicts that needs to be resolved |
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 implements co-ownership support for the PetChain contracts, allowing multiple owners to share custody and management of a pet.
Key Changes
PetandPetProfilestructs to supportprimary_ownerand aVec<Address>forowners.require_any_owner_authmechanism. Any registered owner can now perform administrative actions.add_co_owner: Allows an owner to add another co-owner.remove_co_owner: Allows an owner to remove co-owners (primary owner removal is protected).get_co_owners: Public view function for ownership lists.archivedandnotesfields toPetandPetProfile.DataKeyvariant issues for medications.require_admindefinition and a missingstring_to_specieshelper.src/test_coownership.rswith comprehensive test coverage for all new functionality.Related Issue
Closes #120
Checklist