Skip to content

Conversation

@Yunusabdul38
Copy link
Contributor

@Yunusabdul38 Yunusabdul38 commented Jul 26, 2025

Implement User Data Fetching and Bounty Calculation Features

📌 Issue Overview

This PR addresses the enhancement requirements for the FortiChain platform by implementing new functionality for user data fetching and comprehensive bounty calculations.

🛠️ Completed Tasks

Fetch User Project and Reports

  • Implemented project fetching functions:
    • get_single_project(project_id) - Fetch a specific project by ID
    • get_projects_by_owner(owner_address) - Fetch all projects created by a project owner
  • Implemented report fetching functions:
    • get_single_report(report_id) - Fetch a specific report by ID
    • get_reports_by_researcher(researcher_address) - Fetch all reports submitted by a researcher

Write Tests

  • Comprehensive test suite covering all new functionality

Calculate Total Bounty Received

  • Implemented get_total_bounty_received() function:
    • Calculates total bounties received by validators
    • Calculates total bounties received by researchers
    • Returns aggregated bounty data
  • Corresponding test coverage included

Calculate Total Bounty Paid

  • Implemented get_total_bounty_paid() function:
    • Calculates total bounties paid out by project owners
    • Tracks payment history and totals
  • Full test coverage for payment calculations

Contract Deployment Limitation

Important Note: I was unable to complete the Starknet testnet deployment task as I do not have admin/owner privileges for the contract. The deployment requires contract owner permissions to upgrade the existing contract using the deployment hash specified in deployment.md.

This PR successfully implements all requested functionality except for the contract deployment, which requires elevated permissions. All code is production-ready and thoroughly tested.

If you have any questions about the implementation or need assistance with the deployment process, please don't hesitate to reach out.

closes: #28

Copy link
Contributor

@ONEONUORA ONEONUORA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice implementation @Yunusabdul38 Keep up the good work

@ONEONUORA ONEONUORA merged commit 7ef3ccf into skill-mind:main Jul 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SMART CONTRACT] #IMPLEMENT THE GET USER PROJECT AND REPORT FUNCTION

2 participants