Skip to content

feat(vault): add getter functions and state documentation#396

Merged
Jayy4rl merged 1 commit into
StellarYield:mainfrom
rayvorden:feat/contract-getters-357-358-359-366
Apr 29, 2026
Merged

feat(vault): add getter functions and state documentation#396
Jayy4rl merged 1 commit into
StellarYield:mainfrom
rayvorden:feat/contract-getters-357-358-359-366

Conversation

@rayvorden
Copy link
Copy Markdown
Contributor

Summary

Implements four contract getter functions and documentation to enable UIs to perform non-mutating checks and epoch-based claim mechanics.

Changes

  • Add user_shares_at_epoch(user, epoch) getter for retrieving per-epoch share snapshots
  • Add can_deposit(user, amount) view to check single-user deposit eligibility without mutation
  • Add can_withdraw(user, assets) view to validate withdrawal conditions with explicit reason codes
  • Document Closed vault state semantics, migration requirements, and TBD cleanup behavior

Testing

  • Code compiles without warnings (clippy: -D warnings)
  • Existing vault unit tests pass (339 passed)
  • Lint and formatting verified with cargo fmt/clippy

Closes #357
Closes #358
Closes #359
Closes #366

- Add user_shares_at_epoch(user, epoch) to enable per-epoch UI mechanics
- Add can_deposit(user, amount) as single-user wrapper for deposit checks
- Add can_withdraw(user, assets) to validate withdrawal eligibility
- Document Closed state semantics and migration requirements

Refs #357
Refs #358
Refs #359
Refs #366
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 29, 2026

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

@Jayy4rl Jayy4rl merged commit 1755703 into StellarYield:main Apr 29, 2026
3 of 5 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