-
Notifications
You must be signed in to change notification settings - Fork 0
Reentrancy Guards #11
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 a Dev, I want to prevent reentrancy attacks during transfers.
Description
- Implement a lock pattern for functions that send tokens to prevent reentrancy attacks.
Files to Create / Edit
- contracts/geev-core/src/
- utils.rs
Functional Requirements
-
Lock
- Set a temporary flag before execution
-
Unlock
- Remove flag after execution
Suggested Implementation
-
Function:
with_reentrancy_guard(env, lambda)- Check if
'Lock'key exists in Temporary Storage. If so,panic! - Set
'Lock'key totrue - Execute the lambda function (the main logic)
- Remove
'Lock'key
- Check if
Acceptance Criteria
- Applied to
distribute_prizeandwithdraw_aid
Submission Guidelines
- Branch:
security/reentrancy
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