-
Notifications
You must be signed in to change notification settings - Fork 0
Implement Pause/Unpause #10
Copy link
Copy link
Open
Labels
@geevapp/app/wave2Moving to the app repo, as the contracts repo was not accepted for Drips Wave 2Moving to the app repo, as the contracts repo was not accepted for Drips Wave 2
Description
User Story
- As an Admin, I want to pause the contract to stop attacks.
Description
-
A global switch that prevents public actions when activated, effectively stopping any unwanted or malicious activity.
-
⚠️ This function must be strictly guarded and callable only by the stored Admin address.
Files to Create / Edit
- contracts/geev-core/src/
- lib.rs
Functional Requirements
-
Storage
is_paused(bool)
-
Modifier / Check
- Check
is_pausedat the start of every public function - Panic with error
"ContractPaused"if true
- Check
-
Admin Function:
set_paused(env, val)- Require Admin authentication
- Set
Pausedkey toval
Suggested Implementation
-
Function:
set_paused(env, val)- Authenticate Admin
- Write
valtoPausedkey in storage
-
Helper / Modifier:
check_paused(env)- Read
Pausedkey from storage - If
true,panic!("ContractPaused")
- Read
Acceptance Criteria
- Public users cannot create or enter when paused
- Admin can still perform actions
Submission Guidelines
- Branch:
feat/pause-logic
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@geevapp/app/wave2Moving to the app repo, as the contracts repo was not accepted for Drips Wave 2Moving to the app repo, as the contracts repo was not accepted for Drips Wave 2