Skip to content

feat(reward-pool): add fund_pool function for USDC deposits - #30

Merged
Kaylahray merged 1 commit into
learnault:mainfrom
Cedarich:feat/vault-deposit
Mar 8, 2026
Merged

feat(reward-pool): add fund_pool function for USDC deposits#30
Kaylahray merged 1 commit into
learnault:mainfrom
Cedarich:feat/vault-deposit

Conversation

@Cedarich

@Cedarich Cedarich commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

Description

Implements the fund_pool function to allow Protocol Admins and NGO Partners to deposit USDC into the main RewardPool contract, providing liquidity for daily tier 1 learner rewards.

Changes

  • lib.rs:

    • Added PoolFunded event
    • Implemented fund_pool(env, donor, amount) function
    • Transfers USDC from donor to contract using token::Client
  • test.rs:

    • Added 6 comprehensive tests covering all scenarios
    • Tests verify balance changes, event emission, and edge cases

Acceptance Criteria ✅

  • ✅ Contract's USDC balance increases when funded
  • ✅ Donor's USDC balance decreases accordingly
  • ✅ Proper authentication required (donor.require_auth())
  • ✅ PoolFunded event emitted with donor and amount

Testing

All tests passing:

  • test_fund_pool_success
  • test_fund_pool_emits_event
  • test_fund_pool_not_initialized
  • test_fund_pool_multiple_donors
  • test_fund_pool_multiple_times
  • test_fund_pool_zero_amount

Related Issue

User Story: Protocol Admin/NGO Partner can deposit USDC into RewardPool

closes #24

@Cedarich

Cedarich commented Mar 8, 2026

Copy link
Copy Markdown
Contributor Author

@Kaylahray please review

@Kaylahray Kaylahray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔥🔥

@Kaylahray
Kaylahray merged commit fbb0127 into learnault:main Mar 8, 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.

[RewardPool] Vault Deposit (Funding)

3 participants