Repository navigation
fix(farming-pool): credit total_deposits and guard it in lock_assets - #594
Merged
ritaifeoluwa merged 2 commits intoOct 21, 2026
Conversation
✅ Deploy Preview for sdcontracts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@goldandrew 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! 🚀 |
lock_assets never added the deposit to TotalDeposits, although the field is documented as tracking deposits from both stake and lock_assets. That left total_deposits and the tvl_ratio in get_pool_analytics understating the pool's deposits. lock_assets now checks the pool-wide deposit total for overflow before any write, matching stake, and credits TotalDeposits alongside total_staked and total_locked. Refs SmartDropLabs#464, SmartDropLabs#465, SmartDropLabs#466, SmartDropLabs#467
goldandrew
force-pushed
the
fix/farming-pool-stake-validation-hardening
branch
from
October 21, 2026 00:32
f551d71 to
d069f91
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
closes #464, closes #465, closes #466, closes #467 (all four issues describe the same farming-pool stake validation problem; their bodies do not name a specific defect, so this PR is scoped to the concrete gap found by reading the code).
Changes
lock_assetsnow creditsTotalDeposits. The field is documented as tracking deposits from bothstakeandlock_assets, butlock_assetsnever updated it, sototal_depositsand thetvl_ratioinget_pool_analyticsunderstated the pool's deposits.lock_assetschecks the pool-wide deposit total for overflow before any write, the same pre-write guardstakealready uses, returningExceedsMaxStakeinstead of trapping inadd_total_deposits.test_lock_assets_credits_total_depositsandtest_lock_assets_overflowing_total_deposits_returns_typed_error_without_writing_state.Testing
Not run in this environment: build and test commands were excluded by request. Please run
make testbefore merging.