invoice-canister
invoice-canister copied to clipboard
[SEC-F30] Funds can get stuck in invoice accounts
Observation
if invoice is paid again after the invoice was verified, the money is locked. TODO: expand on this
Recommendations
Offer a new method:
type AmountConsolidated = Nat;
consolidate_account({accountIdentifier: AccountIdentifier}) : AmountConsolidated
changed recommendation - instead, use the invoice id as the lookup. Do no allow the consolidation if the invoice has not yet been satisfied.
Would adding a "parity refund" method resolve this?
Any funds in an invoice subaccount would be transferred to the specific account identifier address passed in (less the transfer cost, unless the balance of that invoice subaccount is less than the transfer fee, in which case there's not much that can be done without losing more value than it's worth which would naturally return as an error).
Should this require a new permission or just be limited to the particular invoice creator and those who can add and remove principals from the creation allow list (ie at least the original deployer-er)?