Skip to content

feat: add aggregate operation count getters for farming-pool, factory, and vesting-wallet - #266

Merged
ritaifeoluwa merged 2 commits into
SmartDropLabs:mainfrom
drips-projects:no-lock-operation-count-getter-in-farmingpool
Aug 28, 2026
Merged

feat: add aggregate operation count getters for farming-pool, factory, and vesting-wallet#266
ritaifeoluwa merged 2 commits into
SmartDropLabs:mainfrom
drips-projects:no-lock-operation-count-getter-in-farmingpool

Conversation

@Joeloo1

@Joeloo1 Joeloo1 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds aggregate operation count metrics across FarmingPool, Factory, and VestingWallet contracts to support protocol usage tracking, analytics, governance monitoring, and churn metrics.

Changes Included

  1. FarmingPool: Lock Operation Count (Closes No lock operation count getter in FarmingPool #260)

    • Added DataKey::LockCount storage key in farming-pool/src/types.rs.
    • Maintained a running count incremented on every lock_assets invocation (initial locks and top-ups).
    • Exposed lock_count(env: Env) -> Result<u32, PoolError> and get_lock_count(env: Env) -> Result<u32, PoolError>.
    • Added unit test test_lock_count_increments_on_every_lock_operation.
  2. Factory: Admin Transfer Count (Closes No admin transfer count getter in Factory #261)

    • Added DataKey::AdminTransferCount storage key in factory/src/types.rs.
    • Maintained a running count incremented on each successful transfer_admin execution.
    • Exposed admin_transfer_count(env: Env) -> Result<u32, FactoryError> and get_admin_transfer_count(env: Env) -> Result<u32, FactoryError>.
    • Added unit test test_admin_transfer_count_increments_on_transfer.
  3. FarmingPool: Unstake Operation Count (Closes No unstake operation count getter in FarmingPool #262)

    • Added DataKey::UnstakeCount storage key in farming-pool/src/types.rs.
    • Maintained a running count incremented on each unstake invocation.
    • Exposed unstake_count(env: Env) -> Result<u32, PoolError> and get_unstake_count(env: Env) -> Result<u32, PoolError>.
    • Added unit test test_unstake_count_increments_on_every_unstake_operation.
  4. VestingWallet: Release Count (Closes No release count getter in vesting wallet #263)

    • Added DataKey::ReleaseCount storage key in vesting-wallet/src/types.rs.
    • Maintained a running count incremented during release whenever tokens are released to the beneficiary (releasable > 0).
    • Exposed release_count(env: Env) -> Result<u32, VestingError> and get_release_count(env: Env) -> Result<u32, VestingError>.
    • Added unit test test_release_count_increments_on_release.

Testing

All feature unit tests pass:

  • cargo test -p farming-pool -- test_lock_count
  • cargo test -p factory -- test_admin_transfer_count
  • cargo test -p farming-pool -- test_unstake_count
  • cargo test -p vesting-wallet -- test_release_count

@netlify

netlify Bot commented Aug 28, 2026

Copy link
Copy Markdown

Deploy Preview for sdcontracts ready!

Name Link
🔨 Latest commit f3bf87a
🔍 Latest deploy log https://app.netlify.com/projects/sdcontracts/deploys/6a920676312ae5000899de85
😎 Deploy Preview https://deploy-preview-266--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.

@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@Joeloo1 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

@ritaifeoluwa
ritaifeoluwa merged commit 5678460 into SmartDropLabs:main Aug 28, 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