diff --git a/src/guards.rs b/src/guards.rs deleted file mode 100644 index e497682..0000000 --- a/src/guards.rs +++ /dev/null @@ -1,19 +0,0 @@ -use soroban_sdk::Env; - -use crate::types::{ContractError, DataKey}; - -/// Returns `Err(ContractPaused)` if the contract is currently paused. -/// -/// Called at the top of every state-changing entry point so that a paused -/// contract immediately rejects all mutations without reaching business logic. -pub fn require_not_paused(env: &Env) -> Result<(), ContractError> { - if env - .storage() - .instance() - .get::(&DataKey::Paused) - .unwrap_or(false) - { - return Err(ContractError::ContractPaused); - } - Ok(()) -}