Label: complexity: high
Points: 200
Description
Creators with no skin in the game can abandon invoices without consequence. This issue adds optional stake_amount: i128 to create_invoice() — the creator deposits USDC as a reputation bond. If the invoice is cancelled by the creator, the stake is distributed equally among payers as compensation.
Technical Context
Involves types.rs (add stake_amount: i128) and lib.rs. In create_invoice(), if stake_amount > 0, transfer from creator to contract. In cancel_invoice() (Issue 4), if stake exists, distribute stake_amount / unique_payer_count to each unique payer. On successful release, return stake to creator.
Acceptance Criteria
Label: complexity: high
Points: 200
Description
Creators with no skin in the game can abandon invoices without consequence. This issue adds optional
stake_amount: i128tocreate_invoice()— the creator deposits USDC as a reputation bond. If the invoice is cancelled by the creator, the stake is distributed equally among payers as compensation.Technical Context
Involves
types.rs(addstake_amount: i128) andlib.rs. Increate_invoice(), ifstake_amount > 0, transfer from creator to contract. Incancel_invoice()(Issue 4), if stake exists, distributestake_amount / unique_payer_countto each unique payer. On successful release, return stake to creator.Acceptance Criteria
create_invoice()transfers stake from creator whenstake_amount > 0stake_amount = 0produces identical behaviour to current implementationcargo clippypasses with zero warnings