Skip to content

Feat: Implement Funding Operations#5

Merged
0xdevcollins merged 7 commits intoboundlessfi:mainfrom
psychemist:feat/implement-funding-operations
May 16, 2025
Merged

Feat: Implement Funding Operations#5
0xdevcollins merged 7 commits intoboundlessfi:mainfrom
psychemist:feat/implement-funding-operations

Conversation

@psychemist
Copy link
Contributor

@psychemist psychemist commented May 1, 2025

🚀 Boundless Project Funding Pull Request


📌 Type of Change

  • Documentation (updates to README, docs, or comments)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

📝 Changes description

This PR implements a comprehensive multi-token funding system for the Boundless platform. The implementation provides a robust, flexible framework for project creators to receive funding in various token types while ensuring proper accounting and refund mechanisms.

Key Features Implemented:

  1. Multi-Token Support:

    • Projects can now accept funding in multiple whitelisted tokens
    • Token-specific contributions are tracked separately
    • Total funding is aggregated across all tokens
  2. Flexible Token Whitelisting:

    • Admin can whitelist tokens for each project
    • Validation mechanism ensures only approved tokens can be used
    • Storage-efficient token tracking
  3. Enhanced Backer Management:

    • Track backers' contributions by token type
    • Support for multiple contributions from the same backer
    • Maintain aggregated view of total backer support
  4. Token-Specific Refunds:

    • Process refunds for each token separately
    • Efficient refund mechanism to minimize gas costs
    • Protection against duplicate refunds
  5. Secure Contribution Handling:

    • Validation of funding periods
    • Proper authentication for all financial operations
    • Clear error handling for funding failures
  6. Storage Optimizations:

    • Efficient storage structure for token contributions
    • Minimal storage overhead for multi-token support
    • Clear separation of token-specific data
  7. Comprehensive Testing:

    • Added tests for all multi-token scenarios
    • Edge case handling for token-specific operations
    • Verification of proper accounting across tokens

Technical Implementation Details:

  • Added token validation against whitelisted tokens
  • Implemented separate storage for token-specific contributions
  • Updated refund logic to process token-specific refunds
  • Improved error handling for token-related operations
  • Added utility functions for token contribution management

📸 Evidence (A photo is required as evidence)

  • stellar contract build
Screenshot 2025-05-13 at 20 20 57
  • cargo build
Screenshot 2025-05-13 at 20 20 42
  • cargo test
Screenshot 2025-05-13 at 20 20 11

🌌 Comments

Challenges Faced

  • Implementing token-specific contribution tracking while maintaining a coherent total funding view required careful design of the storage model.

  • The refund process needed significant updates to handle token-specific refunds while preventing double refunds and ensuring proper accounting.

  • Supporting multiple contributions from the same backer across different tokens presented challenges in contribution aggregation and reporting.

Future Improvements

  1. Project Total Funded Amount: This should be refactored to track total contributions per project

  2. Token Value Normalization: Add support for normalizing contributions across different tokens based on real-time exchange rates.

  3. Partial Refunds: Implement partial refund functionality for specific scenarios where full refunds are not required.

  4. Token Allowlist Management: Create a more sophisticated token allowlist system with time-based restrictions or volume caps.

  5. Enhanced Token Metadata: Store additional token metadata for better UI/UX in the client applications.

  6. Advanced Analytics: Add features to track funding patterns across different tokens.

The implementation follows Soroban contract best practices and includes extensive testing to ensure reliability and security of the multi-token funding system.


@0xdevcollins
Copy link
Collaborator

Any progress @psychemist

@psychemist
Copy link
Contributor Author

@0xdevcollins i'll push some changes tonight

@0xdevcollins
Copy link
Collaborator

Hi any update?

@psychemist
Copy link
Contributor Author

@0xdevcollins yes. still testing. how do i reach out on TG?

@0xdevcollins
Copy link
Collaborator

https://t.me/devcollinss

@psychemist psychemist marked this pull request as ready for review May 13, 2025 19:36
@psychemist
Copy link
Contributor Author

@0xdevcollins reasdy for review

@0xdevcollins
Copy link
Collaborator

@psychemist I will review and merge today. Thanks

@0xdevcollins 0xdevcollins merged commit 50c373d into boundlessfi:main May 16, 2025
2 of 3 checks passed
@psychemist psychemist changed the title Feat: implement funding operations Feat: Implement Funding Operations May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Funding Operations in Boundless Contract

2 participants