Overview
Some invoices require explicit approval from a set of co-signers before funds can be released — even if fully funded. Implement a configurable N-of-M multi-sig approval flow as part of InvoiceOptions.
Requirements
- Extend
InvoiceOptions with optional cosigners: Option<Vec<Address>> and cosigner_threshold: Option<u32>
- Add
approve_release(env, invoice_id, cosigner) entry point — records approval, checks if threshold reached
release must gate on co-signer approval when cosigners is set
- Store approvals under
cosign_key(invoice_id) with a Vec<Address> of approvers
- Emit
CosignerApproved event on each approval, CosignerThresholdReached when quorum met
- Write tests: threshold met → release succeeds; threshold not met → release panics; non-cosigner call → panics; duplicate approval → panics
Acceptance Criteria
Definition of Done
All CI checks must pass before the PR is reviewed.
Overview
Some invoices require explicit approval from a set of co-signers before funds can be released — even if fully funded. Implement a configurable N-of-M multi-sig approval flow as part of
InvoiceOptions.Requirements
InvoiceOptionswith optionalcosigners: Option<Vec<Address>>andcosigner_threshold: Option<u32>approve_release(env, invoice_id, cosigner)entry point — records approval, checks if threshold reachedreleasemust gate on co-signer approval whencosignersis setcosign_key(invoice_id)with aVec<Address>of approversCosignerApprovedevent on each approval,CosignerThresholdReachedwhen quorum metAcceptance Criteria
approve_releaseentry point implementedcosign_keycargo test --workspacepasses with zero failurescargo clippy --all-targets -- -D warningsproduces zero warningsDefinition of Done
All CI checks must pass before the PR is reviewed.