Add Pool Close Function After Disbursement (#16)#48
Merged
martinvibes merged 1 commit intoWeb3Novalabs:mainfrom Jan 28, 2026
Merged
Add Pool Close Function After Disbursement (#16)#48martinvibes merged 1 commit intoWeb3Novalabs:mainfrom
martinvibes merged 1 commit intoWeb3Novalabs:mainfrom
Conversation
…ll disbursement or cancellation, with optional storage cleanup for resource efficiency on Stellar.
martinvibes
approved these changes
Jan 28, 2026
Contributor
martinvibes
left a comment
There was a problem hiding this comment.
Nice Implementation @vestor-dev
LGTM!
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.
Add Pool Close Function After Disbursement (#16)
Summary
Implements an admin/creator function to mark pools as closed after full disbursement or cancellation, with optional storage cleanup for resource efficiency on Stellar.
closes #16
Changes
Core Implementation
Closedstate toPoolStateenumclose_pool(pool_id, caller): Marks a pool as closed (admin-only)is_closed(pool_id): View function to check if a pool is closedpool_closedevent emitted when a pool is closedPoolAlreadyClosed: Prevents closing an already closed poolPoolNotDisbursedOrRefunded: Ensures pools can only be closed after disbursement or cancellationBusiness Logic
DisbursedorCancelledstateTesting
Added comprehensive test suite (
close_pool_test.rs) with 16 tests covering: