Gate stake, unstake, and set_boost behind pool pause guard#48
Merged
prodbycorne merged 2 commits intoJun 27, 2026
Merged
Conversation
Closes SmartDropLabs#28 by blocking boost/stake operations during an emergency pause while keeping admin functions like set_global_multiplier callable.
6 tasks
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.
Overview
This PR fixes an inconsistency in the farming-pool emergency pause behavior. Previously,
pauseonly blockedlock_assetsandunlock_assets, while the boost/stake system (stake,unstake,set_boost) remained callable. This change enforces a unified pause invariant so paused pools cannot accept new stakes or boost changes.Related Issue
Closes #28
Changes
🛡️ Pause Guard Enforcement
soroban/contracts/farming-pool/src/lib.rspool_is_pausedguard tostakepool_is_pausedguard tounstakepool_is_pausedguard toset_boostset_global_multiplier,pause, andunpauseungated so admins can act during emergenciespausedocumentation to list all blocked functions🧪 Tests
[MODIFY]
soroban/contracts/farming-pool/src/test.rsAdded
test_pause_blocks_stakeandtest_unpause_restores_stakeAdded
test_pause_blocks_unstakeandtest_unpause_restores_unstakeAdded
test_pause_blocks_set_boostandtest_unpause_restores_set_boostAdded
test_set_global_multiplier_callable_while_pausedto confirm admin ops still work while paused[ADD]
soroban/contracts/farming-pool/test_snapshots/test/*.jsonAdded test snapshots for the new pause-guard coverage
Verification Results
stakeblocked when pool is pausedunstakeblocked when pool is pausedset_boostblocked when pool is pausedset_global_multiplierremains callable while pausedTest plan
cargo test -p farming-pooland confirm all tests passstake,unstake, andset_boostrevert while pausedunpauseset_global_multiplierstill works while paused