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
I propose generalizing the way how payments are released to the beneficiary.
The core feature of payments pallet is being able to hold funds until the sender is satisfied with an event happening off-chain(e.g. when receiving goods). To support more use cases, like when there is more trust between paying parties that conduct businesses regularly, an automated way to release funds progressively becomes very useful.
We can add a parameter to pay that accepts the "release strategy" represented as an enum.
enumRelease<T>{// Beneficiary must call `release` manually this many times// `Release::Manual(1)` matches current behaviorManual(NonZeroU8),// Whenever beneficiary calls (new)`claim` it can unlock up to the amount that the schedule allows// E.g:// `Release::Auto{ duration: "30day".into(), start: "-10day".into(), initial: 5 }`// A payment of `100 abc` the 10th of the month would on day 0 have 5% of the total amount unlocked// the remaining 95% is split evenly along the duration, calling `claim` right after the creation// would unlock 10 days worth of pay(on top of the 5%) Auto{duration:BlockNumberOf<T>,start:i32,// relative to the time of creation to allow tx to be resubmitted without changesinitial:Percent,}}
The text was updated successfully, but these errors were encountered:
olanod
changed the title
Payment release strategy
Generalized payment release strategy
Apr 19, 2024
NOTE: We use request_refund to cancel from the sender perspective and cancel for beneficiaries to return funds immediately, with the updated release strategy the semantics of "request refund" change, for simplicity I think we can deprecate request_refund and have only cancel for both sender and beneficiary.
I propose generalizing the way how payments are released to the beneficiary.
The core feature of payments pallet is being able to hold funds until the sender is satisfied with an event happening off-chain(e.g. when receiving goods). To support more use cases, like when there is more trust between paying parties that conduct businesses regularly, an automated way to release funds progressively becomes very useful.
We can add a parameter to
pay
that accepts the "release strategy" represented as an enum.The text was updated successfully, but these errors were encountered: