You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a smart-contract issue for the GrantFox FWC26 campaign. Bring cancel_emergency_withdrawal in line with the other emergency entrypoints' guard patterns.
Requirements and Context
contracts/finchippay-contract/src/lib.rs — cancel_emergency_withdrawal (≈ line 1940):
It does not hold ReentrancyGuard::acquire (no external transfer, so lower risk — but inconsistent).
It does not call require_initialized (relies on get_admin which panics "Contract not initialized" anyway — acceptable).
It validates admin == get_admin (legacy single admin) while initiate_emergency_withdrawal/approve_emergency_withdrawal use the admin-signer set. Batch-3 feat(contract): add / to the Pauser role (currently only admin can pause) #58 flagged the privileged-entrypoint governance gap generally; this issue is the specific remaining asymmetry: a single legacy key can cancel any pending withdrawal that required N-of-M signer approvals, and can cancel others' withdrawals at will.
Objectives
Add ReentrancyGuard::acquire(&env) to cancel_emergency_withdrawal for consistency.
Decide and enforce the caller policy: require an admin signer (via get_admin_signers) OR document that the legacy admin may cancel; align with the initiate/approve caller model.
Add tests for non-signer cancel attempts and guard parity.
Suggested Execution
Fork and branch: git checkout -b fix/emergency-cancel-guards.
Labels:
Official Campaign | FWC26GrantFox OSSMaybe RewardedcontractsorobangovernancebugRequirements and Context
contracts/finchippay-contract/src/lib.rs—cancel_emergency_withdrawal(≈ line 1940):ReentrancyGuard::acquire(no external transfer, so lower risk — but inconsistent).require_initialized(relies onget_adminwhich panics "Contract not initialized" anyway — acceptable).admin == get_admin(legacy single admin) whileinitiate_emergency_withdrawal/approve_emergency_withdrawaluse the admin-signer set. Batch-3 feat(contract): add / to the Pauser role (currently only admin can pause) #58 flagged the privileged-entrypoint governance gap generally; this issue is the specific remaining asymmetry: a single legacy key can cancel any pending withdrawal that required N-of-M signer approvals, and can cancel others' withdrawals at will.Objectives
ReentrancyGuard::acquire(&env)tocancel_emergency_withdrawalfor consistency.get_admin_signers) OR document that the legacy admin may cancel; align with theinitiate/approvecaller model.Suggested Execution
git checkout -b fix/emergency-cancel-guards.cancel_emergency_withdrawalinsrc/lib.rs.cargo fmt --check && cargo clippy -- -D warnings && cargo test.Acceptance Criteria
cancel_emergency_withdrawalholds the reentrancy guard.cargo test+wasm32v1-nonebuild pass.Guidelines
Timeframe: 24 hours