Skip to content

feat(farming-pool): expose distribution history, pending admin, whitelist and peak stake - #591

Merged
ritaifeoluwa merged 1 commit into
SmartDropLabs:mainfrom
medunrebecca-dot:feat/farming-pool-feature-improvements
Oct 20, 2026
Merged

ritaifeoluwa merged 1 commit into
SmartDropLabs:mainfrom
medunrebecca-dot:feat/farming-pool-feature-improvements

Conversation

@medunrebecca-dot

Copy link
Copy Markdown
Contributor

Closes #566
Closes #567
Closes #568
Closes #569

Summary

The four assigned "farming-pool: add feature N improvement" issues all ask for a feature improvement in contracts/farming-pool/src/lib.rs without naming a specific API. Each one is implemented here as a read-only getter over state the contract already maintains, so no storage layout or existing behaviour changes.

Issue Function Returns
#566 get_distribution_history(offset, limit) DistributionHistoryPage { events, total }, a paginated audit trail of distribute_bulk_rewards calls
#567 get_pending_admin() Option<Address> for the admin proposed via propose_admin that has not yet accepted
#568 is_whitelist_enabled() bool for the current whitelist gate state
#569 get_peak_total_staked() i128 peak total staked ever recorded

Each getter follows the existing conventions: require_initialized, bump_instance, and the same offset/limit paging used by get_credit_rate_history.

Notes

  • DistributionHistoryPage is a new contracttype in types.rs, mirroring CreditRateHistoryPage.
  • The unique-user counter is not included. It is incremented on new stakes but never decremented on full unstake, so a getter over it would report an inaccurate "current" value. That is a separate fix.

Tests

New tests in test.rs under "Feature improvements: #566, #567, #568, #569":

  • test_get_distribution_history_pages_bulk_rewards
  • test_get_pending_admin_tracks_handoff
  • test_is_whitelist_enabled_reflects_toggle
  • test_get_peak_total_staked_survives_unstake

These have not been compiled or run in this PR. The new tests will write new test_snapshots/*.json files the first time cargo test runs, and those files should be committed with the PR.

…list and peak stake

Add read-only getters over state the contract already maintains:

- get_distribution_history(offset, limit): paginated audit trail of bulk
  reward distributions (SmartDropLabs#566)
- get_pending_admin(): the admin proposed via propose_admin that has not yet
  accepted, or None (SmartDropLabs#567)
- is_whitelist_enabled(): current whitelist gate state (SmartDropLabs#568)
- get_peak_total_staked(): highest total staked amount ever recorded (SmartDropLabs#569)

No storage layout or existing behaviour changes.
@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@medunrebecca-dot Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@netlify

netlify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for sdcontracts ready!

Name Link
🔨 Latest commit bd724b7
🔍 Latest deploy log https://app.netlify.com/projects/sdcontracts/deploys/6ad7f785e901474d83622f73
😎 Deploy Preview https://deploy-preview-591--sdcontracts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ritaifeoluwa
ritaifeoluwa merged commit ed2282a into SmartDropLabs:main Oct 20, 2026
4 checks 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

2 participants