feat: implement family wallet contract#31
Merged
Baskarayelu merged 2 commits intoRemitwise-Org:mainfrom Jan 29, 2026
Merged
Conversation
Contributor
|
@davedumto Please fix the pipeline |
Contributor
Author
|
hey @Baskarayelu I have fixed it |
Contributor
Author
|
hi @Baskarayelu I am still waiting |
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.
Implement Family Wallet Smart Contract
Summary
This PR implements the Family Wallet smart contract that manages family members, roles, and spending limits for the RemitWise platform.
Closes #5
Changes
New Files
family_wallet/Cargo.toml- Package configurationfamily_wallet/src/lib.rs- Contract implementation (320 lines)family_wallet/src/test.rs- Comprehensive test suite (513 lines)Modified Files
Cargo.toml- Addedfamily_walletto workspace membersImplementation Details
Core Functionality ✅
All required functions implemented:
initialize(owner: Address) → booladd_member(owner, address, name, spending_limit, role) → boolget_member(address: Address) → Option<FamilyMember>Noneif not foundget_all_members() → Vec<FamilyMember>update_spending_limit(owner, address, new_limit) → boolfalseif member not foundcheck_spending_limit(address, amount) → boolfalseif member not found or exceeds limitData Structures ✅
Storage:
Map<Address, FamilyMember>+Vec<Address>for iterationSecurity Features ✅
require_auth()MemberAdded,MemberUpdated,SpendingLimitUpdated)panic!with descriptive messagesEdge Cases Handled ✅
Testing
Test Coverage: 20 tests, 100% passing ✅
Required Tests (8):
Additional Tests for 100% Coverage (12):
Test Results
cargo test --package family_walletWASM Build ✅
Result: Build successful, artifact at
target/wasm32-unknown-unknown/release/family_wallet.wasm(6.3KB)Acceptance Criteria
All requirements met:
Pattern Consistency
This implementation follows the exact same patterns as existing contracts in the repository:
require_auth()+ owner verificationpanic!with clear messages#[contracttype]with owner trackingNotes
##Screenshots

How to Test