Make it possible for users of the funding pallet to avoid having to bond PLMC when participating, and instead pay a fee to have the treasury bond its own PLMC
Why?
Participants no longer need to hold any PLMC to participate, especially if we allow paying extrinsics with USDT/C/DOT
Better UI/UX
How?
Add a new pallet called proxy-bonding.
This pallet exposes a function called bond_on_behalf_of which takes the account, bond amount, fee asset id, derivation path (project id), and the hold reason.
The function does a transfer_on_hold of the bond amount from the treasury, into a sub account generated using the derivation path, and pays the fee from the account to the sub_account,.
A function called set_release_type decides whether the the fee will go to the configured fee recipient, or will be refunded. Also decides if the bond can be immediately send back to the treasury, or after a set block
A function refund_fee refunds the fee of a certain user/bond if the release type was configured as refunded.
An extrinsic transfer_bonds_back_to_treasury does what the name entails, and checks the release type for when it can be done successfully
An extrinsic transfer_fees_to_recipient does what the name entails, only if the release type is Locked(n) and not Refunded
Testing?
One for each release type.
Anything Else?
If the design is approved by the reviewers, I can include the integration tests in a separate PR after this.
What?
Why?
How?
bond_on_behalf_of
which takes the account, bond amount, fee asset id, derivation path (project id), and the hold reason.set_release_type
decides whether the the fee will go to the configured fee recipient, or will be refunded. Also decides if the bond can be immediately send back to the treasury, or after a set blockrefund_fee
refunds the fee of a certain user/bond if the release type was configured as refunded.transfer_bonds_back_to_treasury
does what the name entails, and checks the release type for when it can be done successfullytransfer_fees_to_recipient
does what the name entails, only if the release type isLocked(n)
and notRefunded
Testing?
One for each release type.
Anything Else?
If the design is approved by the reviewers, I can include the integration tests in a separate PR after this.