Skip to content

Implement get_campaign_backers Functionality in Contract #15

@0xdevcollins

Description

@0xdevcollins

Overview

Implement the logic to retrieve campaign backers in the smart contract for the Boundless platform. This function is crucial for allowing users to view all the backers of a given campaign.

🗂 Background

The function to be implemented is located in:

  • File: contracts/boundless/src/logic/campaign.rs
  • Relevant trait in: contracts/boundless/src/interface.rs
  • Data types are defined in: contracts/boundless/src/datatypes.rs

🛠️ Requirements

  • Location: Implement the logic inside CampaignManagement trait for BoundlessContract.

  • Logic Steps:

    1. Retrieve the campaign from storage using the provided campaign_id.
    2. Extract and return the list of backers from the campaign data.
    3. Properly handle error cases (e.g., when the campaign does not exist).
  • Current Placeholder: Currently, the function returns an empty vector using a placeholder Ok(Vec::new(&env)).

📌 Technical Considerations

  • Ensure that the function correctly interacts with the existing storage mechanism for retrieving campaign data.
  • Maintain consistency with the error handling as defined by BoundlessError in the project.
  • Validate input parameters as necessary.
  • Consider potential edge cases such as a campaign with no backers.

✅ Definition of Done

  • The function successfully retrieves and returns a list of backers for a given campaign.
  • Proper error handling is implemented when the campaign is not found or other errors occur.
  • Code is reviewed and merged following project guidelines.

- All new functionality is covered by tests.

Metadata

Metadata

Assignees

Labels

contractgood first issueGood for newcomersonlydust-waveContribute to awesome OSS repos during OnlyDust's open source week

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions