Skip to content

Comments

feat: implement get_campaign_fee_history (#95)#132

Merged
Akshola00 merged 1 commit intoWeb3Novalabs:mainfrom
EDOHWARES:feature/get-campaign-fee-history
Feb 21, 2026
Merged

feat: implement get_campaign_fee_history (#95)#132
Akshola00 merged 1 commit intoWeb3Novalabs:mainfrom
EDOHWARES:feature/get-campaign-fee-history

Conversation

@EDOHWARES
Copy link
Contributor

PR Summary: Track Campaign Fees Generation (#95)

Objective: Implements a persistent counter to track the total platform fees generated by individual campaigns.

Key Changes:

  • Storage: Added CampaignFeeHistory to StorageKey for cross-invocation persistence.
  • Logic (donate): Intercepts each new donation, calculates the assumed platform fee (currently set at a 1% model), and increments the dedicated tracker counter mapping for that specific campaign.
  • 🔍 Query Function: Added get_campaign_fee_history(env, campaign_id) to allow fetching the exact amount earned from any specific campaign.
  • Testing: Added test_get_campaign_fee_history which actively verifies that multiple successive donations correctly calculate, increment, and compound into the tracker variable appropriately.

Closes #95

@Akshola00
Copy link
Contributor

looks good to me, thank you for your contribution

@Akshola00 Akshola00 merged commit a4063e1 into Web3Novalabs:main Feb 21, 2026
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.

[FUNCTION] implement get_campaign_fee_history

2 participants