Expand description

Parachain Crowdloaning pallet

The point of this pallet is to allow parachain projects to offer the ability to help fund a deposit for the parachain. When the crowdloan has ended, the funds are returned.

Each fund has a child-trie which stores all contributors account IDs together with the amount they contributed; the root of this can then be used by the parachain to allow contributors to prove that they made some particular contribution to the project (e.g. to be rewarded through some token or badge). The trie is retained for later (efficient) redistribution back to the contributors.

Contributions must be of at least MinContribution (to account for the resources taken in tracking contributions), and may never tally greater than the fund’s cap, set and fixed at the time of creation. The create call may be used to create a new fund. In order to do this, then a deposit must be paid of the amount SubmissionDeposit. Substantial resources are taken on the main trie in tracking a fund and this accounts for that.

Funds may be set up during an auction period; their closing time is fixed at creation (as a block number) and if the fund is not successful by the closing time, then it can be dissolved. Funds may span multiple auctions, and even auctions that sell differing periods. However, for a fund to be active in bidding for an auction, it must have had at least one bid since the end of the last auction. Until a fund takes a further bid following the end of an auction, then it will be inactive.

Contributors will get a refund of their contributions from completed funds before the crowdloan can be dissolved.

Funds may accept contributions at any point before their success or end. When a parachain slot auction enters its ending period, then parachains will each place a bid; the bid will be raised once per block if the parachain had additional funds contributed since the last bid.

Successful funds remain tracked (in the Funds storage item and the associated child trie) as long as the parachain remains active. Users can withdraw their funds once the slot is completed and funds are returned to the crowdloan account.

Re-exports

Modules

  • The pallet module in each FRAME pallet hosts the most important items needed to construct this pallet.

Structs

  • Information on a funding effort for a pre-existing parachain. We assume that the parachain ID is known as it’s used for the key of the storage item for which this is the value (Funds).

Enums

Traits