Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Partial Locker Approval for Withdrawals #1

Open
Lomet opened this issue Mar 16, 2025 · 0 comments
Open

Implement Partial Locker Approval for Withdrawals #1

Lomet opened this issue Mar 16, 2025 · 0 comments

Comments

@Lomet
Copy link
Owner

Lomet commented Mar 16, 2025

Description
Currently, the contract requires either the owner's signature or approval from all lockers to authorize a withdrawal. This needs to be changed to support M-of-N approval, where a subset of lockers (e.g., 2 out of 3 or 3 out of 5) can authorize withdrawals without requiring unanimous consent.

Acceptance Criteria
✅ Allow withdrawals if at least M out of N lockers approve.
✅ Keep existing functionality where the owner’s signature alone can approve.
✅ Ensure security: Attackers should not be able to bypass the required quorum.

Proposed Solution
Introduce a threshold (M) parameter when opening a safe.
Modify _validateOpenData to check if M out of N lockers have signed.
Use an efficient counting mechanism to verify M valid approvals.
Example Cases
3 out of 5 lockers approve → Withdrawal allowed ✅
2 out of 5 lockers approve → Withdrawal denied ❌ (if M=3)
Owner signs → Withdrawal allowed (no lockers needed) ✅
No owner, but all M required lockers approve → Withdrawal allowed ✅

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

No branches or pull requests

1 participant