Skip to content

Commit c121786

Browse files
JuaniRioslrazovic
authored andcommitted
Remove contribution/remainder leftovers
1 parent 654ba18 commit c121786

File tree

6 files changed

+38
-312
lines changed

6 files changed

+38
-312
lines changed

integration-tests/chopsticks/src/transfers/PolimecToHub.ts

+1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export class PolimecToHubTransfer extends BaseTransferTest {
167167
location.value.interior.value.type === 'Parachain' &&
168168
location.value.interior.value.value === ParaId[Chains.PolkadotHub],
169169
);
170+
170171
if (!xcmsToPHub) {
171172
throw new Error('Could not find xcm to polimec');
172173
}

pallets/funding/README.md

+34-114
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,48 @@
1-
# Funding Pallet
1+
<!-- cargo-rdme start -->
22

3-
Polimec's main business logic. It allows credentialed users to create,
4-
evaluate, and fund projects.
3+
# Funding Pallet
54

6-
It rewards project evaluators and contributors with `Contribution Tokens`. These
7-
tokens can be redeemed for a project's native tokens, after their
8-
para-{chain/thread} is deployed on mainnet.
5+
Polimec's main business logic. It allows users to create, evaluate, and fund projects.
96

10-
> **Warning** 👷 Work in progress 🏗️
11-
>
12-
> **Warning** Expect major changes between PRs
7+
Participants get contribution tokens. Contribution tokens are tokens issued by projects which successfully raised
8+
funds on Polimec. They are distributed to evaluators and participants who contributed to the project’s successful
9+
funding round. Contribution tokens are transferability-locked in the wallet of participants or evaluators after
10+
distribution and are automatically converted to the project’s transferable mainnet token at launch.
1311

1412
## Overview
15-
16-
The official logic for Polimec's blockchain can be found at our
17-
[whitepaper](https://polimec.link/whitepaper).
13+
The official logic for Polimec's blockchain can be found in our [knowledge hub](https://hub.polimec.org/).
1814

1915
There are 3 types of users in Polimec:
20-
2116
- **Issuers**: They create projects and are responsible for their success.
22-
- **Evaluators**: They evaluate projects and are rewarded for their due diligence.
23-
- **Contributors**: They contribute financially to projects and are rewarded on
24-
the basis of their contribution
25-
26-
A contributor, depending on their investor profile, can participate in different
27-
rounds of a project's funding.
28-
29-
There are 3 types of contributors:
17+
- **Evaluators**: They are incentivized to assess projects accurately by locking their PLMC. If at least 10% of its
18+
target funding (in USD) is locked in PLMC, a project is given access to the funding round. Evaluators are either
19+
rewarded in contribution tokens if the project gets funded, or have their PLMC slashed otherwise.
20+
- **Bidders**: They contribute financially to projects by locking PLMC and paying out USDT/USDC/DOT, and are rewarded in contribution tokens.
3021

22+
Users need to go through a KYC/AML by a third party in order to use the protocol. This process classifies them
23+
into one of the following categories, based on their investment experience and financial status:
3124
- **Institutional**
3225
- **Professional**
3326
- **Retail**
3427

3528
Basic flow of a project's lifecycle:
36-
37-
| Step | Description | Resulting Project State |
38-
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
39-
| Creation | Issuer creates a project with the [`create()`](Pallet::create) extrinsic. | [`Application`](ProjectStatus::Application) |
40-
| Evaluation Start | Issuer starts the evaluation round with the [`start_evaluation()`](Pallet::start_evaluation) extrinsic. | [`EvaluationRound`](ProjectStatus::EvaluationRound) |
41-
| Evaluation Submissions | Evaluators assess the project information, and if they think it is good enough to get funding, they bond Polimec's native token PLMC with [`bond_evaluation()`](Pallet::bond_evaluation) | [`EvaluationRound`](ProjectStatus::EvaluationRound) |
42-
| Evaluation End | Evaluation round ends automatically after the [`Config::EvaluationDuration`] has passed. This is achieved by the [`on_initialize()`](Pallet::on_initialize) function. | [`AuctionInitializePeriod`](ProjectStatus::AuctionInitializePeriod) |
43-
| Auction Start | Issuer starts the auction round within the [`Config::AuctionInitializePeriodDuration`], by calling the extrinsic [`start_auction()`](Pallet::start_auction) | [`AuctionOpening`](ProjectStatus::AuctionOpening) |
44-
| Bid Submissions | Institutional and Professional users can place bids with [`bid()`](Pallet::bid) by choosing their desired token price, amount, and multiplier (for vesting). Their bids are guaranteed to be considered | [`AuctionOpening`](ProjectStatus::AuctionOpening) |
45-
| Closing Auction Transition | After the [`Config::AuctionOpeningDuration`] has passed, the auction goes into closing mode thanks to [`on_initialize()`](Pallet::on_initialize) | [`AuctionClosing`](ProjectStatus::AuctionClosing) |
46-
| Bid Submissions | Institutional and Professional users can continue bidding, but this time their bids will only be considered, if they managed to fall before the random ending block calculated at the end of the auction. | [`AuctionClosing`](ProjectStatus::AuctionClosing) |
47-
| Community Funding Start | After the [`Config::AuctionClosingDuration`] has passed, the auction automatically. A final token price for the next rounds is calculated based on the accepted bids. | [`CommunityRound`](ProjectStatus::CommunityRound) |
48-
| Funding Submissions | Retail investors can call the [`contribute()`](Pallet::contribute) extrinsic to buy tokens at the set price. | [`CommunityRound`](ProjectStatus::CommunityRound) | |
49-
| Funding End | If all tokens were sold, or after the [`Config::RemainderFundingDuration`] has passed, the project automatically ends, and it is calculated if it reached its desired funding or not. | [`FundingEnded`](ProjectStatus::FundingEnded) |
50-
| Evaluator Rewards | If the funding was successful, evaluators can claim their contribution token rewards with the [`TBD`]() extrinsic. If it failed, evaluators can either call the [`failed_evaluation_unbond_for()`](Pallet::failed_evaluation_unbond_for) extrinsic, or wait for the [`on_idle()`](Pallet::on_initialize) function, to return their funds | [`FundingEnded`](ProjectStatus::FundingEnded) |
51-
| Bidder Rewards | If the funding was successful, bidders will call [`vested_contribution_token_bid_mint_for()`](Pallet::vested_contribution_token_bid_mint_for) to mint the contribution tokens they are owed, and [`vested_plmc_bid_unbond_for()`](Pallet::vested_plmc_bid_unbond_for) to unbond their PLMC, based on their current vesting schedule. | [`FundingEnded`](ProjectStatus::FundingEnded) |
52-
| Buyer Rewards | If the funding was successful, users who bought tokens on the Community or Remainder round, can call [`vested_contribution_token_purchase_mint_for()`](Pallet::vested_contribution_token_purchase_mint_for) to mint the contribution tokens they are owed, and [`vested_plmc_purchase_unbond_for()`](Pallet::vested_plmc_purchase_unbond_for) to unbond their PLMC, based on their current vesting schedule | [`FundingEnded`](ProjectStatus::FundingEnded) |
53-
54-
## Interface
55-
56-
All users who wish to participate need to have a valid credential, given to them
57-
on the KILT parachain, by a KYC/AML provider.
58-
59-
### Extrinsics
60-
61-
- `create` : Creates a new project.
62-
- `edit_metadata` : Submit a new Hash of the project metadata.
63-
- `start_evaluation` : Start the Evaluation round of a project.
64-
- `start_auction` : Start the auction round of a project.
65-
- `bond_evaluation` : Bond PLMC on a project in the evaluation stage. A sort of
66-
"bet" that you think the project will be funded
67-
- `failed_evaluation_unbond_for` : Unbond the PLMC bonded on a project's
68-
evaluation round for any user, if the project failed the evaluation.
69-
- `bid` : Perform a bid during the auction round.
70-
- `contribute` : Buy contribution tokens if a project during the Community or
71-
Remainder round
72-
- `vested_plmc_bid_unbond_for` : Unbond the PLMC bonded on a project's auction round for any user, based on their vesting schedule.
73-
- `vested_plmc_purchase_unbond_for` : Unbond the PLMC bonded on a project's
74-
Community or Remainder Round for any user, based on their vesting schedule.
75-
- `vested_contribution_token_bid_mint_for` : Mint the contribution tokens for a
76-
user who participated in the Opening or Closing Auction Round, based on their
77-
vesting schedule.
78-
- `vested_contribution_token_purchase_mint_for` : Mint the contribution tokens
79-
for a user who participated in the Community or Remainder Round, based on
80-
their vesting schedule.
81-
82-
### Storage Items
83-
84-
- `NextProjectId` : Increasing counter to get the next id to assign to a
85-
project.
86-
- `NextBidId`: Increasing counter to get the next id to assign to a bid.
87-
- `Nonce`: Increasing counter to be used in random number generation.
88-
- `Projects`: Map of the assigned id, to the main information of a project.
89-
- `ProjectsInfo`: Map of a project id, to some additional information required
90-
for ensuring correctness of the protocol.
91-
- `AuctionsInfo`: Double map linking a project-user to the bids they made.
92-
- `EvaluationBonds`: Double map linking a project-user to the PLMC they bonded
93-
in the evaluation round.
94-
- `BiddingBonds`: Double map linking a project-user to the PLMC they bonded in
95-
the auction round.
96-
- `ContributingBonds`: Double map linking a project-user to the PLMC they bonded
97-
in the Community or Remainder round.
98-
- `Contributions`: Double map linking a project-user to the contribution tokens
99-
they bought in the Community or Remainder round.
100-
101-
## Usage
102-
103-
You can circumvent the extrinsics by calling the do_* functions that they call
104-
directly. This is useful if you need to make use of this pallet's
105-
functionalities in a pallet of your own, and you don't want to pay the
106-
transaction fees twice.
107-
108-
## Credentials
109-
110-
The pallet will only allow users with certain credential types, to execute
111-
certain extrinsics.:
112-
113-
| Extrinsic | Issuer | Retail Investor | Professional Investor | Institutional Investor |
114-
| --------------------------------------------- | ------ | --------------- | --------------------- | ---------------------- |
115-
| `create` | X | | | |
116-
| `edit_metadata` | X | | | |
117-
| `start_evaluation` | X | | | |
118-
| `start_auction` | X | | | |
119-
| `bond_evaluation` | | X | X | X |
120-
| `failed_evaluation_unbond_for` | | X | X | X |
121-
| `bid` | | | X | X |
122-
| `contribute` | | X | X* | X* |
123-
| `vested_plmc_bid_unbond_for` | | | X | X |
124-
| `vested_plmc_purchase_unbond_for` | | X | X | X |
125-
| `vested_contribution_token_bid_mint_for` | | | X | X |
126-
| `vested_contribution_token_purchase_mint_for` | | X | X | X |
127-
128-
_* They can call contribute only if the project is on the remainder round._
29+
1) **Project Creation**: Issuer creates a project with the [`create_project`](Pallet::create_project) extrinsic.
30+
2) **Evaluation Start**: Issuer starts the evaluation round with the [`start_evaluation`](Pallet::start_evaluation) extrinsic.
31+
3) **Evaluate**: Evaluators bond PLMC to evaluate a project with the [`evaluate`](Pallet::evaluate) extrinsic.
32+
4) **Evaluation End**: Anyone can end the evaluation round with the [`end_evaluation`](Pallet::end_evaluation) extrinsic after the defined end block.
33+
5) **Auction Start**: If the project receives at least 10% of its target funding (in USD) in PLMC bonded, the auction starts immediately after `end_evaluation` is called.
34+
6) **Bid**: Investors can place bids on the project using the [`bid`](Pallet::bid) extrinsic. The price starts at the issuer-defined minimum, and increases by increments of 10% in price and bucket size.
35+
7) **Funding End**: Anyone can end the project with the [`end_project`](Pallet::end_project) extrinsic after the defined end block.
36+
The project will now be considered Failed if it reached <=33% of its target funding in USD, and Successful otherwise.
37+
8) **Settlement Start**: Anyone can start the settlement process with the [`start_settlement`](Pallet::start_settlement) extrinsic after the defined end block.
38+
9) **Settle Evaluation**: Anyone can now settle an evaluation with the [`settle_evaluation`](Pallet::settle_evaluation) extrinsic.
39+
This will unlock the PLMC bonded, and either apply a slash to the PLMC, or reward CTs to the evaluator.
40+
10) **Settle Bid**: Anyone can now settle a bid with the [`settle_bid`](Pallet::settle_bid) extrinsic.
41+
This will set a vesting schedule on the PLMC bonded, and pay out the funding assets to the issuer. It will also issue refunds in case the bid failed,
42+
or the price paid was higher than the weighted average price.
43+
11) **Settlement End**: Anyone can now mark the project settlement as finished by calling the [`mark_project_as_settled`](Pallet::mark_project_as_settled) extrinsic.
44+
12) **Migration Start**: Once the issuer has tokens to distribute on mainnet, he can start the migration process with the [`start_offchain`](Pallet::start_offchain_migration) extrinsic.
45+
13) **Confirm Migration**: The issuer has to mark each participant's CTs as migrated with the [`confirm_offchain_migration`](Pallet::confirm_offchain_migration) extrinsic.
46+
14) **Migration End**: Once all participants have migrated their CTs, anyone can mark the migration as finished with the [`mark_project_ct_migration_as_finished`](Pallet::mark_project_ct_migration_as_finished) extrinsic.
47+
48+
<!-- cargo-rdme end -->

0 commit comments

Comments
 (0)