Skip to content

fix: extend pause circuit-breaker to all privileged entry points (Closes #313) - #359

Open
laurentketterle-hub wants to merge 2 commits into
Heliobond:mainfrom
laurentketterle-hub:fix/issue-313-pause-guards
Open

fix: extend pause circuit-breaker to all privileged entry points (Closes #313)#359
laurentketterle-hub wants to merge 2 commits into
Heliobond:mainfrom
laurentketterle-hub:fix/issue-313-pause-guards

Conversation

@laurentketterle-hub

Copy link
Copy Markdown

Summary

Extends the pause circuit-breaker to every privileged state-mutating entry point.

Problem

require_not_paused was only enforced in fund_project, deposit, and withdraw. Every other fund-moving or share-minting/burning entry point (multi-sig funding, batch funding, yield distribution, insurance payouts, bridge mint/burn, cross-chain completion, flash loans, and carbon-credit transfers) ignored the Paused flag entirely, so pause()/emergency_pause() did not actually stop capital from moving through those paths.

Change

  • Adds require_not_paused to 11 functions: fund_project_with_approvals, batch_fund_projects, receive_yield, claim_yield, claim_insurance, claim_insurance_with_approvals, bridge_mint, bridge_burn, complete_bridge_transfer, execute_flash_loan, transfer_carbon_credits.
  • Documents the exact coverage on pause().

Note

This branch is stacked on the compilation-restoring fix in PR #356 (issues #310/#311/#314), which must merge first.

Closes #313

…oses Heliobond#310, Heliobond#311, Heliobond#314)

The withdrawal-window merge (Heliobond#36) left the crate non-compiling: get_withdrawal_window and get_volume_fee_tier were missing closing braces, the withdrawal_window_set and funding_round_ended event functions were missing closing braces, check_deposit_lock referenced an undefined last_seq and merged two incompatible lock models, and VaultError had three variants sharing discriminant 41.

This change adds a LastDepositSeq(Address) storage key recorded by lock_deposit, rewrites check_deposit_lock to enforce the ledger-sequence sliding window (Heliobond#36), renumbers FundingRoundActive to 42 and InvestmentCapExceeded to 43, and restores all missing closing braces.

Signed-off-by: laurentketterle-hub <laurentketterle-hub@users.noreply.github.com>
 Heliobond#313)

require_not_paused was only enforced in fund_project, deposit, and withdraw. Every other fund-moving or share-minting/burning entry point (multi-sig funding, batch funding, yield distribution, insurance payouts, bridge mint/burn, cross-chain completion, flash loans, and carbon-credit transfers) ignored the Paused flag entirely.

This adds require_not_paused to all 11 listed functions and documents the coverage on pause().

Signed-off-by: laurentketterle-hub <laurentketterle-hub@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pause circuit-breaker only guards 3 of ~15 privileged state-mutating entry points

2 participants