Skip to content

Feature/platform fee calculator#172

Merged
Akshola00 merged 5 commits intoWeb3Novalabs:mainfrom
Benalex8797:feature/platform-fee-calculator
Feb 25, 2026
Merged

Feature/platform fee calculator#172
Akshola00 merged 5 commits intoWeb3Novalabs:mainfrom
Benalex8797:feature/platform-fee-calculator

Conversation

@Benalex8797
Copy link
Contributor

close #91

…port

- Add internal helper function to calculate platform fees
- Support basis points (e.g., 250 bps for 2.5%)
- Include overflow protection with checked arithmetic
- Add comprehensive test suite covering:
  - Small and large amounts
  - Edge cases and overflow scenarios
  - Realistic crowdfunding scenarios
  - Precision and rounding behavior
  - Stellar XLM amount calculations

Closes #[issue-number]
- Explain basis points concept
- Provide usage examples and integration guide
- Document safety features and error handling
- Include test coverage details
- Add best practices and future enhancements
- Align struct field comments properly
- Remove extra blank line in overflow check
- Ensure consistent spacing per rustfmt rules
- Change function visibility from private to pub(crate) for testing
- Add extern crate std for vec! macro in tests
- Fixes E0624 compilation errors in test suite
- Replace vec! with std::vec! for explicit namespace
- Ensures proper macro resolution in Soroban test environment
@Akshola00
Copy link
Contributor

thanks fr your contribution @Benalex8797

Copy link
Contributor

@Akshola00 Akshola00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Akshola00 Akshola00 merged commit eb26026 into Web3Novalabs:main Feb 25, 2026
1 check passed
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.

[FUNCTION] implement calculate_platform_fee

2 participants