Crate pallet_crowdloan_rewards
source ·Expand description
Crowdloan Rewards Pallet
This pallet issues rewards to citizens who participated in a crowdloan on the backing relay chain (eg Kusama) in order to help this parrachain acquire a parachain slot.
Monetary Policy
This is simple and mock for now. We can do whatever we want. This pallet stores a constant “reward ratio” which is the number of reward tokens to pay per contributed token. In simple cases this can be 1, but needs to be customizeable to allow for vastly differing absolute token supplies between relay and para. Vesting is also linear. No tokens are vested at genesis and they unlock linearly until a predecided block number. Vesting computations happen on demand when payouts are requested. So no block weight is ever wasted on this, and there is no “base-line” cost of updating vestings. Like I said, we can anything we want there. Even a non-linear reward curve to disincentivize whales.
Payout Mechanism
The current payout mechanism requires contributors to claim their payouts. Because they are paying the transaction fees for this themselves, they can do it as often as every block, or wait and claim the entire thing once it is fully vested. We could consider auto payouts if we want.
Sourcing Contribution Information
The pallet can learn about the crowdloan contributions in several ways.
- *Through the initialize_reward_vec extrinsic
The simplest way is to call the initialize_reward_vec through a democracy proposal/sudo call. This makes sense in a scenario where the crowdloan took place entirely offchain. This extrinsic initializes the associated and unassociated stoerage with the provided data
- ReadingRelayState
The most elegant, but most complex solution would be for the para to read the contributions directly from the relay state. Blocked by https://github.com/paritytech/cumulus/issues/320 so I won’t pursue it further right now. I can’t decide whether that would really add security / trustlessness, or is just a sexy blockchain thing to do. Contributors can always audit the democracy proposal and make sure their contribution is in it, so in that sense reading relay state isn’t necessary. But if a single contribution is left out, the rest of the contributors might not care enough to delay network launch. The little guy might get censored.
Re-exports
pub use weights::WeightInfo;
pub use pallet::*;
Modules
- The
pallet
module in each FRAME pallet hosts the most important items needed to construct this pallet. - Autogenerated weights for pallet_crowdloan_rewards