-
Notifications
You must be signed in to change notification settings - Fork 748
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 #6994
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can open the PR as a draft until it is ready.
Or ping when it is ready.
substrate/frame/opf/src/types.rs
Outdated
pub use super::*; | ||
|
||
pub use frame_support::{ | ||
pallet_prelude::*, | ||
traits::{ | ||
fungible, | ||
fungible::{Inspect, Mutate, MutateHold}, | ||
fungibles, | ||
schedule::{ | ||
v3::{Anon as ScheduleAnon, Named as ScheduleNamed}, | ||
DispatchTime, MaybeHashed, | ||
}, | ||
tokens::{Precision, Preservation}, | ||
Bounded, DefensiveOption, EnsureOrigin, LockIdentifier, OriginTrait, QueryPreimage, | ||
StorePreimage, | ||
}, | ||
transactional, PalletId, Serialize, | ||
}; | ||
pub use pallet_conviction_voting::Conviction; | ||
pub use frame_system::{pallet_prelude::*, RawOrigin}; | ||
pub use scale_info::prelude::vec::Vec; | ||
pub use sp_runtime::traits::{ | ||
AccountIdConversion, BlockNumberProvider, Convert, Dispatchable, Saturating, StaticLookup, Zero, | ||
}; | ||
pub use sp_std::boxed::Box; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we reexport all those types publicly, I think the doc would be more clear if we only export the types specific for the library.
pub trait Config: frame_system::Config { | ||
type RuntimeCall: Parameter | ||
+ Dispatchable<RuntimeOrigin = Self::RuntimeOrigin> | ||
+ From<Call<Self>> | ||
+ IsType<<Self as frame_system::Config>::RuntimeCall> | ||
+ From<frame_system::Call<Self>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we no longer need to introduce a new associated type, you can bound those additional constraint direclty on the system::Config::RuntimeCall
pub trait Config: frame_system::Config { | |
type RuntimeCall: Parameter | |
+ Dispatchable<RuntimeOrigin = Self::RuntimeOrigin> | |
+ From<Call<Self>> | |
+ IsType<<Self as frame_system::Config>::RuntimeCall> | |
+ From<frame_system::Call<Self>>; | |
pub trait Config: frame_system::Config<RuntimeCall: From<Call<Self>> { |
Description
This PR is related to this issue .
Through the introduction of the OPF pallet and the DISTRIBUTION pallet, we are handling 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.
Integration
Review Notes
Terminology
The constants available in the runtime for the OPF Pallet:
Spends
.Functions
register_project
: Register by OpenGov, should take AccountId and project Purpose.unregister_project
: Unregister by OpenGovclaim
: To claim a spendChecklist
pallet-opf