feat: add project terminate feature #67
Merged
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.
Description
Add Project Termination Feature
This pull request introduces functionality to manage project termination within the
Budgetmodule, including the ability to mark projects as terminated and enforce project status checks across various operations. It also updates the test suite to accommodate these changes.Below are the key changes grouped by theme:
Core Functionality Enhancements
project_statusmapping to track the active or terminated state of projects (src/budgetchain/Budget.cairo).terminate_projectfunction to allow admins to terminate projects and emit aProjectTerminatedevent (src/budgetchain/Budget.cairo)._assert_project_activehelper function to ensure operations are only performed on active projects (src/budgetchain/Budget.cairo).🔴 Project Termination System
New Functions:
terminate_project()- Allows admin to terminate projectsassert_status()- Check project active/terminated statusis_project_terminated()- Query project termination state_assert_project_active()- Internal validation for active projectsProject Status Tracking:
project_statusstorage mapping for tracking project statestrue) when created viaallocate_project_budget🔒 Security Enhancements
Project Termination Safeguards
Function Protection: Added termination checks to:
create_fund_request()- Cannot request funds for terminated projectscreate_milestone()- Cannot create milestones for terminated projects (optional)release_funds()- Cannot release funds for terminated projectsStatus Integrity:
Admin Controls
New Error Messages
Interface Updates
IBudgetinterface to includeterminate_projectandassert_statusfunctions for project management (src/interfaces/IBudget.cairo).Technical Details
Storage Changes:
Function Modifications:
Test Suite Updates
setup_project_with_milestoneshelper, ensuring projects are initialized with proper status checks (tests/test_budgetchain.cairo). [1] [2] [3]tests/test_budgetchain.cairo).Testing Status
Closes #51