Skip to content

farming-pool: pause does not block set_boost, set_global_multiplier, or admin functions #28

Description

@prodbycorne

Problem

The pool_is_paused guard is only checked in lock_assets and unlock_assets. Several other functions that should be restricted during an emergency pause are not gated:

Function Paused check?
lock_assets Yes
unlock_assets Yes
stake No
unstake No
set_boost No
set_global_multiplier No

This means a paused pool continues to accept new stakes and boost changes through the boost/stake system, defeating the purpose of the emergency pause.

Analysis

The pause was likely designed to block both staking systems. The inconsistency exists because the lock/unlock system and the boost/stake system were implemented at different times without a unified pause invariant.

Fix

Add assert!(!pool_is_paused(&env), "pool is paused"); (or the typed-error equivalent after issue #10 is resolved) to:

  • stake
  • unstake
  • set_boost

set_global_multiplier, pause, unpause, and transfer_admin should not be gated — the admin must be able to act even while paused.

Acceptance Criteria

  • stake blocked when pool is paused
  • unstake blocked when pool is paused
  • set_boost blocked when pool is paused
  • set_global_multiplier remains callable while paused (admin op)
  • Test for each function: paused → call → expect rejection
  • Test: unpause → call → expect success

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't workingcorrectnessLogic correctness and invariant enforcementfarming-poolFarmingPool contract

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions