Repository navigation
feat: add multi asset transfer support - #17
Merged
phertyameen merged 2 commits intoJan 22, 2026
Merged
phertyameen merged 2 commits into
phertyameen merged 2 commits into
Conversation
phertyameen
approved these changes
Jan 22, 2026
phertyameen
left a comment
Contributor
There was a problem hiding this comment.
This is so, perfect. I will just add a few tests... Extra points coming up in a few days! I won't forget but you can remind me lattest a day after the wave has ended. telegram handle: @teemahbee
5 tasks
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.
Multi-Asset Transfer Support Implementation
Summary
This PR implements comprehensive multi-asset transfer support for the ephemeral account contract, replacing the previous single-asset limitation with a flexible multi-asset system while maintaining backward compatibility and security guarantees.
Changes Overview
storage.rslib.rsevents.rserrors.rstest.rsDetailed Changes
Storage Layer Updates (
storage.rs)PaymentAmount,PaymentAssetfieldsMap<Address, Payment>structurePaymentstruct with asset, amount, timestampset_payment_amount(),get_payment_amount()add_payment(),get_all_payments(),get_total_payments()Key Changes:
Paymentstruct with fields:asset: Address,amount: i128,timestamp: u64Core Function Updates (
lib.rs)record_payment()sweep()get_info()expire()Implementation Details:
Event System Enhancements (
events.rs)PaymentReceivedamount: i128,asset: AddressMultiPaymentReceivedasset: Address,amount: i128SweepExecuteddestination: Address,amount: i128,asset: AddressSweepExecutedMultidestination: Address,payments: Vec<Payment>Error Handling Expansion (
errors.rs)DuplicateAssetTooManyPaymentsTest Coverage (
test.rs)Technical Specifications
Payment Storage Structure
Storage Access Patterns
Atomicity Guarantees
Backward Compatibility
Performance Characteristics
Security Considerations
Testing Results
Migration Impact
Future Enhancements
This implementation provides a foundation for future improvements:
The implementation maintains the high security and reliability standards of the existing codebase while adding powerful new multi-asset capabilities.