moonbeam-foundation / crowdloan-rewards

Substrate pallet that enables parachains to issue rewards to crowdloan contributors in parachain-native tokens.
12 stars 16 forks source link

Remove VestingPeriod to provide the ending block relay number at initialization #25

Closed girazoki closed 3 years ago

girazoki commented 3 years ago

This PR does a couple of things:

JoshOrndorff commented 3 years ago

I think the pallet is better with this PR than without it. So in that sense I approve. I also think we could make the initialization workflow even nicer.

What if we have two different extrinsics that are both useful for setting up the initial state, submit_initial_contribution_batch, and complete_initialization. The first one can be called many times and is just given a Vec of contributions (probably bounded to some max length) No more need for manually tracked indices etc. Then when all of the contributions have been submitted, a single call is made to complete_initialization. That call contains any only-needs-specified-once information such as the vesting period (or vestin end block, I have no preference).

Once copmlete_initialization is called, initial payouts are made and claims can start to be made. After this point any calls to either of the initialization extrinsics are invalid.

girazoki commented 3 years ago

Sounds good to me. You would include then the ending block number in the complete_initialization extrinsic?

girazoki commented 3 years ago

The PR has been adapted to this last idea. Let me know what you think!

JoshOrndorff commented 3 years ago

we would need a storage migration to fix the Moonriver deployment (right?)

This was already answered in chat, but I'll repeat it here. We won't need to migrate anything on Monriver because the crowdloan rewards haven't been initialized yet.