Feature/milestone app#194
Open
akinboyewaSamson wants to merge 2 commits into
Open
Conversation
…s, metrics tracking, and event handling - Add ConnectionEventEmitter for managing connection-related events. - Introduce HealthChecker for periodic health checks on RPC endpoints. - Create ConnectionMetrics for tracking performance and reliability metrics. - Develop RpcPool for managing multiple RPC endpoints with failover and load balancing. - Implement tests for health checks, circuit breakers, connection metrics, and event emissions.
- Removed unnecessary initialization from test_transfer.1.json and updated balances. - Introduced test_batch_transfer_multiple_recipients.1.json to validate batch transfer functionality. - Added test_batch_transfer_rejects_insufficient_balance_before_moving_tokens.1.json to ensure proper error handling for insufficient balances. - Created test_batch_transfer_rejects_invalid_amount.1.json to check for invalid transfer amounts. - Implemented test_batch_transfer_while_paused_returns_error.1.json to verify that transfers are rejected when the contract is paused.
|
@akinboyewaSamson Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
closes #177
Summary
This PR hardens the bc-forge token contract against integer overflow/underflow by replacing unsafe arithmetic with checked operations, adds invariant checks, fixes allowance/storage helpers and test-file corruption, and adds property-based tests to validate arithmetic invariants.
Type of Change
🐛 Bug fix (non-breaking change that fixes an issue)
🔧 Smart contract improvement
🧪 Test coverage improvement
✨ New feature (non-breaking change that adds functionality)
💥 Breaking change (fix or feature that would cause existing functionality to change)
📝 Documentation update
🏗️ CI/Build improvement
Related Issue
Closes #
Changes Made
Replaced all vulnerable +/- arithmetic in core token flows with checked_add() / checked_sub() and explicit error handling.
Added debug_assert! invariants (balance conservation, supply precision, non-negativity) across hardened functions.
Fixed read_allowance() type-comparison bug (u32/u64 mismatch) and corrected allowance expiration logic.
Removed corrupting .set() calls in read_allowance_info() and fixed write_allowance() storage.
Cleaned DataKey enum duplicate variants (removed duplicate Allowance variant).
Fixed admin contract Proposal construction (removed invalid action_type field reference).
Restored and repaired test.rs (fixed unclosed delimiters and helper mismatches).
Added property-based tests in proptest.rs covering transfer, mint/burn, transfer_from and lock/withdraw invariants.
Testing
How has this been tested?
Rust unit tests pass for the token crate (cargo test -p bc-forge-token)
Manual compile of contract crate succeeded (cargo build -p bc-forge-token)
SDK compiles (npm run build in sdk) — run as needed
New property-based tests added (proptest) — ready to run
Manual testing against Soroban testnet (optional)
Test commands run:
# Contract unit tests (token crate)cd contracts/tokencargo test -p bc-forge-token --lib# Full repo build for token cratecargo build -p bc-forge-token# (Optional) Run all workspace testscargo test
Observed quick verification output:
test result: ok. 5 passed; 0 failed; for token unit tests after fixes.
Checklist
My code follows the project's style guidelines (kept changes minimal and consistent)
I have added NatSpec-style comments to new Rust functions where applicable
I have added JSDoc comments to new TypeScript functions (if any)
I have updated the README if needed (none required)
My branch follows the naming convention: feature/-
I have not modified files outside the scope of this issue
Drips.network Contributor Info
Drips Profile:
Issue Claimed: #