feat(treasury): implement internal balance tracking and atomic account#106
Closed
Amas-01 wants to merge 0 commit intoMissBlue00:mainfrom
Closed
feat(treasury): implement internal balance tracking and atomic account#106Amas-01 wants to merge 0 commit intoMissBlue00:mainfrom
Amas-01 wants to merge 0 commit intoMissBlue00:mainfrom
Conversation
|
@Amas-01 is attempting to deploy a commit to the missblue00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Amas-01 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! 🚀 |
Owner
|
@Amas-01 the ci/cd checks failed, please resolve |
a607f80 to
9b3e0a8
Compare
9b3e0a8 to
cf8b8a5
Compare
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.
PR Description: Treasury Internal Balance Tracking (#26)
Summary
This PR implements a robust, atomic internal ledger for treasury balance tracking in the
stellar-payAPI. It introduces a serialised accounting system that prevents common vulnerabilities like double-spending and over-minting in the current in-memory architecture.Changes
1. Atomic Accounting Core
BigIntIntegration: Switched tobigint(stroop-precision) for all balance calculations to eliminate floating-point precision risks.2. Invariant Enforcement
available_balance + reserved_balance == total_minted - total_burned3. Service & API Integration
4. Developer Experience
npx pnpmfor compatibility with environments wherepnpmis not in the global PATH.Verification Results
Automated Tests
TreasuryBalanceErrors: 95.8%Key Scenarios Tested
Related Issues
Closes #26