Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimistic Project Funding #5162

Open
wants to merge 191 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 182 commits
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
8537c9e
Started with the pallet structure
ndkazu Jul 23, 2024
dcaa52c
changed Cargo.toml
ndkazu Jul 23, 2024
b781695
Basic pallet structure
ndkazu Jul 27, 2024
527787b
Types, Storages, and naming
ndkazu Jul 27, 2024
f6b8fa8
Basic pallet structure
ndkazu Jul 27, 2024
c1c442d
Update
ndkazu Jul 27, 2024
674c5f1
Helper functions
ndkazu Jul 27, 2024
8f42432
Spnedings creation from projects list
ndkazu Jul 28, 2024
8667321
Spending status change
ndkazu Jul 28, 2024
5fb830e
Funds unlock and transfer
ndkazu Jul 30, 2024
08a56f5
Added an Event
ndkazu Jul 30, 2024
100c26b
Preparation for testing and minor corrections
ndkazu Jul 30, 2024
2be7fb9
Update substrate/frame/distribution/src/lib.rs
ndkazu Jul 30, 2024
76fe14b
Update substrate/frame/distribution/src/lib.rs
ndkazu Jul 30, 2024
5d0f7ba
Update substrate/frame/distribution/src/lib.rs
ndkazu Jul 30, 2024
503f3d3
Update substrate/frame/distribution/src/lib.rs
ndkazu Jul 30, 2024
aaea1fe
Update substrate/frame/distribution/src/types.rs
ndkazu Jul 30, 2024
01c826c
Update umbrella/Cargo.toml
ndkazu Jul 30, 2024
a305d80
Made some corrections
ndkazu Jul 30, 2024
c4e6ae4
First test
ndkazu Jul 30, 2024
9ba1083
Additional event & testing
ndkazu Jul 30, 2024
0268623
Merge branch 'paritytech:master' into Optimist
ndkazu Jul 30, 2024
dab155d
Update branch
ndkazu Jul 30, 2024
990a2f6
Second test: funds locked
ndkazu Jul 30, 2024
119206a
Minor corrections
ndkazu Jul 30, 2024
c9c9c4f
More tests...
ndkazu Jul 30, 2024
d11cbc1
Corrected some terms
ndkazu Jul 31, 2024
fb73b68
Pallet OPF basic structure. No storage yet.
ndkazu Aug 1, 2024
aa7b249
WhiteListed Projects storage
ndkazu Aug 1, 2024
2406b8f
Helper function for voting
ndkazu Aug 1, 2024
26f3958
modified storage
ndkazu Aug 1, 2024
8e10f21
Adding type for freeze
ndkazu Aug 1, 2024
abde432
Voting action + voter funds hold/release
ndkazu Aug 1, 2024
ad4d675
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 1, 2024
114e430
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 2, 2024
245cf90
New constant added
ndkazu Aug 2, 2024
617ee5e
Helper for rewards calculation & distribution
ndkazu Aug 3, 2024
93e3b31
Updated pallet-distribution tests
ndkazu Aug 3, 2024
5fc4beb
In-code documention, extrinsics, and a few corrections
ndkazu Aug 4, 2024
27524ed
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 4, 2024
3ba0121
Documentation for pallet distribution
ndkazu Aug 4, 2024
82bf13d
Merge branch 'Optimist' of github.com:ndkazu/polkadot-sdk into Optimist
ndkazu Aug 4, 2024
f21ba3c
Documentation edit
ndkazu Aug 4, 2024
8cedc42
Restricted some storages visibility
ndkazu Aug 4, 2024
f95b070
Used checked_add instead of saturating_add
ndkazu Aug 4, 2024
2699fd2
Some corrections
ndkazu Aug 4, 2024
843f558
Logic to be used in pallet-opf hook added
ndkazu Aug 5, 2024
b69cfff
Distribution pallet README
ndkazu Aug 5, 2024
9faf586
README corrections
ndkazu Aug 5, 2024
758e681
README corrections
ndkazu Aug 5, 2024
00fe62b
Remove unfunded projects from whitelist
ndkazu Aug 6, 2024
46ea061
Use on_idle hook in OPF Pallet
ndkazu Aug 6, 2024
876db00
Correction
ndkazu Aug 6, 2024
7445d0f
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 7, 2024
442df1e
Update README.md
ndkazu Aug 7, 2024
238bae5
Update lib.rs
ndkazu Aug 7, 2024
76f31b3
Create README.md
ndkazu Aug 7, 2024
fa8f9c2
User's funds release after rewards calculation
ndkazu Aug 7, 2024
145858c
Benchmarking_begin
ndkazu Aug 8, 2024
1db8e95
Changed Sepnding(s) to Spend(s)
ndkazu Aug 8, 2024
c3ba04e
Changed VotingRoundsNumber to VotingRoundNumber
ndkazu Aug 8, 2024
92eabcd
Correction
ndkazu Aug 8, 2024
6216b5e
Preparing OPF testing
ndkazu Aug 9, 2024
b5c02ab
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 9, 2024
fb76ceb
Stopped using the system block number
ndkazu Aug 10, 2024
945fbb2
corrected block numbers for tests
ndkazu Aug 10, 2024
04c0646
Added events
ndkazu Aug 11, 2024
bdd88c1
First tests and corresponding corrections
ndkazu Aug 11, 2024
6742a58
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 11, 2024
0eb2e5c
Rewards distribution test
ndkazu Aug 11, 2024
d1fac2f
Tests and corrections
ndkazu Aug 11, 2024
7bf608a
Removed dev-mode and some warnings
ndkazu Aug 12, 2024
ba869d6
More OPF testing
ndkazu Aug 12, 2024
bc4c6de
Added benchmarking test suite
ndkazu Aug 12, 2024
32a2296
Extrinsic call not executed in benchmark???
ndkazu Aug 12, 2024
065039e
some corrections
ndkazu Aug 12, 2024
48d5d62
Tests are passing
ndkazu Aug 12, 2024
08c7518
Removed dev mode + clippy & fmt
ndkazu Aug 13, 2024
7b874a1
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 13, 2024
3389e6a
Benchmarking is now working for pallet distribution
ndkazu Aug 13, 2024
0592915
Pallet distribution ready for review
ndkazu Aug 13, 2024
e7956af
Re-wrote distribution benchmark and started opf benchmark
ndkazu Aug 14, 2024
5c25742
Benchmarking done
ndkazu Aug 15, 2024
a8f6d0c
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 15, 2024
ec08801
Fixing CLI errors
ndkazu Aug 15, 2024
d723478
Fixing errors
ndkazu Aug 15, 2024
67ddbb8
Fixing errors
ndkazu Aug 15, 2024
b960b3c
PRdoc
ndkazu Aug 15, 2024
53c31aa
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 15, 2024
ca65abb
Editing the prdoc
ndkazu Aug 15, 2024
b94e3f9
Merge branch 'Optimist' of github.com:ndkazu/polkadot-sdk into Optimist
ndkazu Aug 15, 2024
6a918ad
Editing the prdoc
ndkazu Aug 15, 2024
8ed0b87
Editing the prdoc
ndkazu Aug 15, 2024
2878e5e
Editing the prdoc
ndkazu Aug 15, 2024
ab2ab73
Editing the prdoc->patch instead of minor
ndkazu Aug 15, 2024
40bdd68
Editing the prdoc
ndkazu Aug 15, 2024
d0dac4b
Editing the prdoc
ndkazu Aug 15, 2024
eb1ba63
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 15, 2024
a3be78b
Update prdoc/pr_5162.prdoc
ndkazu Aug 15, 2024
a5f0018
Fix prdoc
ndkazu Aug 15, 2024
39214cc
Merge branch 'Optimist' of github.com:ndkazu/polkadot-sdk into Optimist
ndkazu Aug 15, 2024
fd40298
Fix semver
ndkazu Aug 15, 2024
79a29cc
Fix semver
ndkazu Aug 15, 2024
0c24a47
Corrected README
ndkazu Aug 16, 2024
b5c86d6
Use take instead of get & remove
ndkazu Aug 16, 2024
a3a59a2
Some suggested changes implemented.
ndkazu Aug 16, 2024
1a2139c
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 16, 2024
6bab58b
More OPF tests
ndkazu Aug 17, 2024
bf22c86
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 17, 2024
18fce0f
More tests and some in-code comments
ndkazu Aug 19, 2024
9718231
Merge branch 'Optimist' of github.com:ndkazu/polkadot-sdk into Optimist
ndkazu Aug 19, 2024
1546392
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 19, 2024
8e76dd7
Merge branch 'master' into Optimist
Ank4n Aug 21, 2024
704c2fe
Conviction implemented, and funds unlock extrinsic added. New extrins…
ndkazu Aug 23, 2024
5695675
License added
ndkazu Aug 23, 2024
24cd606
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 23, 2024
7d80bfb
Review related corrections
ndkazu Aug 23, 2024
d9fc656
Merge branch 'Optimist' of github.com:ndkazu/polkadot-sdk into Optimist
ndkazu Aug 23, 2024
baedd94
fix failing benchmark
ndkazu Aug 23, 2024
0d4a587
cargo fmt
ndkazu Aug 23, 2024
0cd321a
New extrinsic benchmark added
ndkazu Aug 23, 2024
73d0f5f
update
ndkazu Aug 23, 2024
1e38a51
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 24, 2024
4bec5f4
Type miss in ReadMe
ndkazu Aug 24, 2024
e1580cd
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 25, 2024
df41d42
Merge branch 'paritytech:master' into Optimist
ndkazu Aug 26, 2024
304a76d
Corrected Distribution pallet based on reviews
ndkazu Aug 27, 2024
bf8ba94
Error handling correction in Distribution pallet
ndkazu Aug 27, 2024
19dc1d9
added some corrections to the OPF pallet
ndkazu Aug 27, 2024
a2ff644
Removed unbounded map iter
ndkazu Aug 27, 2024
980226e
Further improvements in Distribution pallet
ndkazu Aug 27, 2024
ecbf739
Removing use of iter()
ndkazu Aug 28, 2024
b7ab820
Refactored try_vote function and removed iter()
ndkazu Aug 29, 2024
c29ffe8
cargo fmt
ndkazu Aug 29, 2024
c9dcc86
resolving conflict
ndkazu Aug 30, 2024
492a0d3
Merge branch 'master' into Optimist
ndkazu Aug 30, 2024
87d1c1e
Merge branch 'master' into Optimist
ndkazu Aug 31, 2024
8d4657d
Merge branch 'master' into Optimist
ndkazu Sep 3, 2024
5c5b8ad
opf-test correction
ndkazu Sep 3, 2024
98a0ae4
Merge branch 'paritytech:master' into Optimist
ndkazu Sep 5, 2024
98217d9
Renamed variable & removed some unecessary code
ndkazu Sep 6, 2024
77ae32e
Renamed some variables in pallet-opf
ndkazu Sep 6, 2024
8cb1b18
Updates vote_removal and corresponding tests
ndkazu Sep 6, 2024
ed56b2e
Clearing storages after a voting round ended in pallet-opf
ndkazu Sep 6, 2024
47fe97f
Debugging and additional tests
ndkazu Sep 6, 2024
3e2f2a1
cargo +nightly fmt
ndkazu Sep 6, 2024
8dfbcf3
Merge branch 'master' into Optimist
ndkazu Sep 6, 2024
556551d
Merge branch 'master' into Optimist
ndkazu Sep 7, 2024
effa3d9
Merge branch 'master' into Optimist
ndkazu Sep 8, 2024
2b5e0cd
Comments correction
ndkazu Sep 8, 2024
6942a86
Merge branch 'master' into Optimist
ndkazu Sep 9, 2024
1849512
Merge branch 'master' into Optimist
ndkazu Sep 11, 2024
72a8085
Merge branch 'master' into Optimist
ndkazu Sep 12, 2024
bb82af4
Merge branch 'master' into Optimist
ndkazu Sep 13, 2024
d2804b7
Merge branch 'master' into Optimist
ndkazu Sep 13, 2024
c847381
Reverted unwanted changes from cargo fmt
ndkazu Sep 13, 2024
2c0aa9b
Removed last unwanted format change
ndkazu Sep 13, 2024
511e8bc
Merge branch 'master' into Optimist
ndkazu Sep 13, 2024
bddabc8
Merge branch 'master' into Optimist
ndkazu Sep 14, 2024
5a13c98
Merge branch 'master' into Optimist
ndkazu Sep 16, 2024
e02fe4b
Correct import
ndkazu Sep 17, 2024
576a5b3
Merge branch 'master' into Optimist
ndkazu Sep 18, 2024
5760f9b
Merge branch 'master' into Optimist
ndkazu Sep 18, 2024
6e1c9ab
Merge branch 'master' into Optimist
ndkazu Sep 18, 2024
989be08
Corrected the respectives README's
ndkazu Sep 18, 2024
c62e265
toml format
ndkazu Sep 18, 2024
56e8676
rust-feature-propagation
ndkazu Sep 18, 2024
db2506b
Merge branch 'master' into Optimist
ndkazu Sep 18, 2024
12fbf3c
Rust features propagation
ndkazu Sep 18, 2024
c59b159
Merge branch 'master' into Optimist
ndkazu Sep 18, 2024
7412d46
Rust features propagation
ndkazu Sep 18, 2024
18f92fc
toml format
ndkazu Sep 19, 2024
840d64a
toml format
ndkazu Sep 19, 2024
cac2449
format toml
ndkazu Sep 19, 2024
8f0fd86
format toml
ndkazu Sep 19, 2024
4507209
fix umbrella error
ndkazu Sep 19, 2024
fb51be2
Fix Wasm error
ndkazu Sep 19, 2024
eef451c
Merge branch 'master' into Optimist
ndkazu Sep 19, 2024
f38806c
Merge branch 'master' into Optimist
ndkazu Sep 20, 2024
d21f4d8
Update Cargo.toml
ndkazu Sep 20, 2024
936cfd7
Update Cargo.toml
ndkazu Sep 20, 2024
7728824
Update Cargo.toml
ndkazu Sep 20, 2024
38718e5
Update cargo.toml
ndkazu Sep 20, 2024
99b3be4
Merge branch 'master' into Optimist
ndkazu Sep 20, 2024
f079db6
First round of corrections
ndkazu Sep 20, 2024
b61ddc6
Merge branch 'Optimist' of github.com:ndkazu/polkadot-sdk into Optimist
ndkazu Sep 20, 2024
a4edbac
Second round of corrections
ndkazu Sep 20, 2024
635526e
Fix umbrella
ndkazu Sep 20, 2024
fa30adb
Revert some modifications
ndkazu Sep 20, 2024
2cf44db
changed max_weight in opf
ndkazu Sep 20, 2024
fa6a553
Fix format
ndkazu Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ members = [
"substrate/frame/core-fellowship",
"substrate/frame/delegated-staking",
"substrate/frame/democracy",
"substrate/frame/distribution",
ndkazu marked this conversation as resolved.
Show resolved Hide resolved
"substrate/frame/election-provider-multi-phase",
"substrate/frame/election-provider-multi-phase/test-staking-e2e",
"substrate/frame/election-provider-support",
Expand Down Expand Up @@ -387,6 +388,7 @@ members = [
"substrate/frame/nomination-pools/test-transfer-stake",
"substrate/frame/offences",
"substrate/frame/offences/benchmarking",
"substrate/frame/opf",
"substrate/frame/paged-list",
"substrate/frame/paged-list/fuzzer",
"substrate/frame/parameters",
Expand Down Expand Up @@ -912,6 +914,7 @@ pallet-default-config-example = { path = "substrate/frame/examples/default-confi
pallet-delegated-staking = { path = "substrate/frame/delegated-staking", default-features = false }
pallet-democracy = { path = "substrate/frame/democracy", default-features = false }
pallet-dev-mode = { path = "substrate/frame/examples/dev-mode", default-features = false }
pallet-distribution = { path = "substrate/frame/distribution", default-features = false }
pallet-election-provider-multi-phase = { path = "substrate/frame/election-provider-multi-phase", default-features = false }
pallet-election-provider-support-benchmarking = { path = "substrate/frame/election-provider-support/benchmarking", default-features = false }
pallet-elections-phragmen = { path = "substrate/frame/elections-phragmen", default-features = false }
Expand Down Expand Up @@ -949,6 +952,7 @@ pallet-nomination-pools-benchmarking = { path = "substrate/frame/nomination-pool
pallet-nomination-pools-runtime-api = { path = "substrate/frame/nomination-pools/runtime-api", default-features = false }
pallet-offences = { path = "substrate/frame/offences", default-features = false }
pallet-offences-benchmarking = { path = "substrate/frame/offences/benchmarking", default-features = false }
pallet-opf = { path = "substrate/frame/opf", default-features = false }
pallet-paged-list = { path = "substrate/frame/paged-list", default-features = false }
pallet-parachain-template = { path = "templates/parachain/pallets/template", default-features = false }
pallet-parameters = { path = "substrate/frame/parameters", default-features = false }
Expand Down
2 changes: 2 additions & 0 deletions docs/sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ pallet-scheduler = { workspace = true, default-features = true }
pallet-referenda = { workspace = true, default-features = true }
pallet-broker = { workspace = true, default-features = true }
pallet-babe = { workspace = true, default-features = true }
pallet-distribution = { workspace = true, default-features = true }
pallet-opf = { workspace = true, default-features = true }

# Primitives
sp-io = { workspace = true, default-features = true }
Expand Down
23 changes: 23 additions & 0 deletions prdoc/pr_5162.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: "Optimistic Project Funding"

doc:
- audience: Runtime Dev
description: |
the combination of the OPF pallet and the DISTRIBUTION pallet handles the Optimistic Project Funding.
It allows users to nominate projects (whitelisted in OpenGov) with their DOT. This mechanism will be funded with a constant stream of DOT taken directly from inflation and distributed to projects based on the proportion of DOT that has nominated them.
The project rewards distribution is handled by the **Distribution Pallet**

crates:
- name: pallet-distribution
bump: patch
- name: pallet-opf
bump: patch
- name: frame-support
bump: none
- name: polkadot-sdk
bump: patch
- name: polkadot
bump: none
43 changes: 43 additions & 0 deletions substrate/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2186,6 +2186,41 @@ impl pallet_broker::Config for Runtime {
type PriceAdapter = pallet_broker::CenterTargetPrice<Balance>;
}

parameter_types! {
pub const PotId: PalletId = PalletId(*b"py/potid");
pub const Period:BlockNumber = 5*MINUTES;
ndkazu marked this conversation as resolved.
Show resolved Hide resolved
ndkazu marked this conversation as resolved.
Show resolved Hide resolved
pub const MaxProjects:u32 = 50;
pub const EpochDurationBlocks: BlockNumber = EPOCH_DURATION_IN_BLOCKS;
}

impl pallet_distribution::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type NativeBalance = Balances;
type PotId = PotId;
type RuntimeHoldReason = RuntimeHoldReason;
type BufferPeriod = Period;
type MaxProjects = MaxProjects;
type EpochDurationBlocks = EpochDurationBlocks;
type BlockNumberProvider = System;
type WeightInfo = pallet_distribution::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const MaxWhitelistedProjects: u32 = 64;
pub const TemporaryRewards: Balance = 100000 * DOLLARS;
pub const TotalPeriod:BlockNumber = 30 * DAYS;
pub const LockPeriod:BlockNumber = 10 * DAYS;
}
ndkazu marked this conversation as resolved.
Show resolved Hide resolved

impl pallet_opf::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type VoteLockingPeriod = LockPeriod;
type VotingPeriod = TotalPeriod;
type MaxWhitelistedProjects = MaxWhitelistedProjects;
type TemporaryRewards = TemporaryRewards;
type WeightInfo = pallet_opf::weights::SubstrateWeight<Runtime>;
}
ndkazu marked this conversation as resolved.
Show resolved Hide resolved

parameter_types! {
pub const MixnetNumCoverToCurrentBlocks: BlockNumber = 3;
pub const MixnetNumRequestsToCurrentBlocks: BlockNumber = 3;
Expand Down Expand Up @@ -2528,6 +2563,12 @@ mod runtime {

#[runtime::pallet_index(80)]
pub type Revive = pallet_revive::Pallet<Runtime>;

#[runtime::pallet_index(81)]
pub type Distribution = pallet_distribution::Pallet<Runtime>;

#[runtime::pallet_index(82)]
pub type OptimisticProjectFunding = pallet_opf::Pallet<Runtime>;
}

/// The address format for describing accounts.
Expand Down Expand Up @@ -2692,6 +2733,8 @@ mod benches {
[pallet_safe_mode, SafeMode]
[pallet_example_mbm, PalletExampleMbms]
[pallet_asset_conversion_ops, AssetConversionMigration]
[pallet_distribution, Distribution]
[pallet_opf, OptimisticProjectFunding]
);
}

Expand Down
77 changes: 77 additions & 0 deletions substrate/frame/distribution/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[package]
authors.workspace = true
description = "FRAME pallet to distribute funds to whitelisted projects"
edition.workspace = true
homepage = "https://substrate.io"
license = "Apache-2.0"
name = "pallet-distribution"
readme = "README.md"
repository.workspace = true
version = "0.1.0"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { workspace = true, default-features = false }
frame-benchmarking = { optional = true, workspace = true, default-features = false }
frame-support = { workspace = true, default-features = false }
frame-system = { workspace = true, default-features = false }
log = { workspace = true }
scale-info = { features = [
"derive",
], workspace = true, default-features = false }
sp-core = { workspace = true, default-features = false }
sp-io = { workspace = true, default-features = false }
sp-runtime = { workspace = true, default-features = false }

[dev-dependencies]
pallet-assets = { workspace = true, default-features = true }
pallet-balances = { workspace = true, default-features = true }
pallet-sudo = { workspace = true, default-features = true }
pallet-timestamp = { workspace = true, default-features = true }
pallet-transaction-payment = { workspace = true }
pallet-transaction-payment-rpc-runtime-api = { workspace = true }

[features]
default = ["std"]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-sudo/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
std = [
"codec/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-assets/std",
"pallet-balances/std",
"pallet-sudo/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-assets/try-runtime",
"pallet-balances/try-runtime",
"pallet-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"sp-runtime/try-runtime",
]
32 changes: 32 additions & 0 deletions substrate/frame/distribution/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Distribution Pallet
## Overview

The **Distribution Pallet** handles the distribution of whitelisted projects rewards.

For now only one reward distribution pattern has been implemented, but the pallet could be extended
to offer to the user claiming rewards for a project, a choice between more than one distribution pattern.

The **Distribution Pallet** receives a list of Whitelisted/Nominated Projects with
their respective calculated rewards. For each project, it will create a corresponding
spend that will be stored until the project reward can be claimed.
At the moment, the reward claim period start corresponds to:
[beginning of an ***Epoch_Block*** + ***BufferPeriod***] (The ***BufferPeriod*** can be configured in the runtime).

### Terminology

- **PotId:** Pot containing the funds used to pay the rewards.
- **BufferPeriod:** minimum required buffer time period between project nomination and reward claim.

## Interface

### Dispatchable Functions

#### Public

These calls can be made from any externally held account capable of creating
a signed extrinsic.

Basic actions:
- `claim_reward_for` - From this extrinsic any user can claim a reward for a nominated/whitelisted project.

License: Apache-2.0
Loading
Loading