Skip to content

Add vesting schedule getter, pool aggregate credits, and create_pool failure docs - #239

Merged
ritaifeoluwa merged 2 commits into
SmartDropLabs:mainfrom
ScriptedBro:fix/vesting-factory-farming-improvements
Aug 28, 2026
Merged

Add vesting schedule getter, pool aggregate credits, and create_pool failure docs#239
ritaifeoluwa merged 2 commits into
SmartDropLabs:mainfrom
ScriptedBro:fix/vesting-factory-farming-improvements

Conversation

@ScriptedBro

Copy link
Copy Markdown

Summary

Four improvements across the vesting-wallet, farming-pool, and factory contracts.

vesting-wallet (#224)

Adds get_vesting_schedule() which returns all schedule parameters (beneficiary, token, total_amount, start_ledger, cliff_ledger, end_ledger, revocable) in a single call, so frontends no longer need a series of individual getters. Returns NotInitialized on an uninitialized wallet.

farming-pool (#221)

Adds total_distributed_credits() — a protocol-wide aggregate of credits committed to users since pool initialization. The counter grows as credits are banked at each checkpoint (stake, lock, unlock, unstake, boost) across both the flexible-stake and locked-position systems, and is initialized at pool creation.

farming-pool (#223)

Documents the multiplier-source behavior shared by get_credits and checkpoint: accrual since the last checkpoint is split across the stake's recorded multiplier snapshot (pre-change) and the current global multiplier (post-change), so both paths read from the same multiplier source. Adds a regression test proving an un-checkpointed read equals exactly what the next checkpointing operation banks after a global multiplier change.

factory (#222)

Documents that create_pool emits no event on failure: a validation failure reverts the invocation, and Soroban discards contract events published by reverted calls. Callers must handle the returned FactoryError directly; off-chain monitors can detect failed creation attempts via failed-transaction diagnostics.

Testing

  • cargo build --workspace --target wasm32v1-none --release passes.
  • New tests cover the vesting schedule getter (all parameters, beneficiary transfer, uninitialized wallet), the credits aggregate (zero init, checkpoint/position accrual, multi-user accumulation), and the get_credits and checkpoint use different multiplier sources #223 regression.
  • farming-pool: 135/135 tests pass.
  • vesting-wallet: all tests pass except a pre-existing failure (test_compute_vested_is_safe_at_maximum_duration_and_ceiling) that also fails on main (storage TTL overflow at maximum duration) and is unrelated to these changes.
  • factory: test results match main (a set of pre-existing failures where unit-test assets are generated addresses that do not pass validate_asset; unrelated to this PR).

Closes #221
Closes #222
Closes #223
Closes #224

vesting-wallet: add get_vesting_schedule() returning all schedule
parameters (beneficiary, token, total_amount, start/cliff/end ledger,
revocable) in one call for frontends (SmartDropLabs#224)

farming-pool: add total_distributed_credits() aggregation counter that
grows as credits are banked on checkpoint/checkpoint_position, spanning
both the flexible-stake and locked-position systems (SmartDropLabs#221)

farming-pool: document that get_credits and checkpoint share the same
multiplier-based accrual path, with a regression test proving an
un-checkpointed read equals the next checkpointed amount after a global
multiplier change (SmartDropLabs#223)

factory: document that create_pool emits no event on failure since the
reverted invocation discards contract events; callers must handle the
returned FactoryError (SmartDropLabs#222)
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@ScriptedBro 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 Aug 28, 2026

Copy link
Copy Markdown

Deploy Preview for sdcontracts ready!

Name Link
🔨 Latest commit 078b96f
🔍 Latest deploy log https://app.netlify.com/projects/sdcontracts/deploys/6a919ce1da9b150008e62718
😎 Deploy Preview https://deploy-preview-239--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 3ec827a into SmartDropLabs:main Aug 28, 2026
3 of 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