-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
contractgood first issueGood for newcomersGood for newcomersonlydust-waveContribute to awesome OSS repos during OnlyDust's open source weekContribute to awesome OSS repos during OnlyDust's open source week
Description
📚 Overview
Implement the fund release logic for campaigns as part of the milestone-based funding system. This feature will allow the platform to release funds when a milestone is met, updating the milestone status and emitting a release event.
🛠️ Task Requirements
- File to update:
contracts/boundless/src/logic/campaign.rs - Interface: Update the
release_fundsfunction defined in theCampaignManagementtrait located incontracts/boundless/src/interface.rs.
Steps to Implement:
-
Retrieve Campaign & Milestone Information:
- Get the campaign using the provided
campaign_id. - Retrieve the milestone details using
milestone_id.
- Get the campaign using the provided
-
**Validate Milestone Eligibility:
- Check that the milestone is in a state that allows release (e.g., status is
Approved).
- Check that the milestone is in a state that allows release (e.g., status is
-
**Update Milestone Status:
- Change the milestone status to
Released.
- Change the milestone status to
-
**Emit a Release Event:
- Trigger an event that logs the release of funds with relevant details.
-
**Error Handling:
- Return a detailed error if any validation fails or if any step in the process encounters an issue.
⚙️ Technical Considerations
- Follow the structure and error handling patterns in the existing contract code.
- Use the enums and datatypes defined in
contracts/boundless/src/datatypes.rsfor consistency. - Ensure the implementation is compliant with the smart contract's logic for security and transparency.
🎯 Acceptance Criteria
- The
release_fundsfunction correctly retrieves and validates the campaign and milestone. - Milestone status updates to
Releasedonce conditions are met. - A release event is emitted successfully.
- Adequate error handling throughout the process.
- All new functionality is covered by tests.
Metadata
Metadata
Assignees
Labels
contractgood first issueGood for newcomersGood for newcomersonlydust-waveContribute to awesome OSS repos during OnlyDust's open source weekContribute to awesome OSS repos during OnlyDust's open source week