pub type Bounties = Pallet<Runtime>;
Aliased Type§
struct Bounties(/* private fields */);
Implementations
Source§impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
Sourcepub fn propose_bounty(
origin: <T as Config>::RuntimeOrigin,
value: <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance,
description: Vec<u8>,
) -> Result<(), DispatchError>
pub fn propose_bounty( origin: <T as Config>::RuntimeOrigin, value: <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance, description: Vec<u8>, ) -> Result<(), DispatchError>
Propose a new bounty.
The dispatch origin for this call must be Signed.
Payment: TipReportDepositBase
will be reserved from the origin account, as well as
DataDepositPerByte
for each byte in reason
. It will be unreserved upon approval,
or slashed when rejected.
curator
: The curator account whom will manage this bounty.fee
: The curator fee.value
: The total payment amount of this bounty, curator fee included.description
: The description of this bounty.
Sourcepub fn approve_bounty(
origin: <T as Config>::RuntimeOrigin,
bounty_id: u32,
) -> Result<(), DispatchError>
pub fn approve_bounty( origin: <T as Config>::RuntimeOrigin, bounty_id: u32, ) -> Result<(), DispatchError>
Approve a bounty proposal. At a later time, the bounty will be funded and become active and the original deposit will be returned.
May only be called from T::SpendOrigin
.
§Complexity
- O(1).
Sourcepub fn propose_curator(
origin: <T as Config>::RuntimeOrigin,
bounty_id: u32,
curator: <<T as Config>::Lookup as StaticLookup>::Source,
fee: <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance,
) -> Result<(), DispatchError>
pub fn propose_curator( origin: <T as Config>::RuntimeOrigin, bounty_id: u32, curator: <<T as Config>::Lookup as StaticLookup>::Source, fee: <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance, ) -> Result<(), DispatchError>
Sourcepub fn unassign_curator(
origin: <T as Config>::RuntimeOrigin,
bounty_id: u32,
) -> Result<(), DispatchError>
pub fn unassign_curator( origin: <T as Config>::RuntimeOrigin, bounty_id: u32, ) -> Result<(), DispatchError>
Unassign curator from a bounty.
This function can only be called by the RejectOrigin
a signed origin.
If this function is called by the RejectOrigin
, we assume that the curator is
malicious or inactive. As a result, we will slash the curator when possible.
If the origin is the curator, we take this as a sign they are unable to do their job and they willingly give up. We could slash them, but for now we allow them to recover their deposit and exit without issue. (We may want to change this if it is abused.)
Finally, the origin can be anyone if and only if the curator is “inactive”. This allows anyone in the community to call out that a curator is not doing their due diligence, and we should pick a new curator. In this case the curator should also be slashed.
§Complexity
- O(1).
Sourcepub fn accept_curator(
origin: <T as Config>::RuntimeOrigin,
bounty_id: u32,
) -> Result<(), DispatchError>
pub fn accept_curator( origin: <T as Config>::RuntimeOrigin, bounty_id: u32, ) -> Result<(), DispatchError>
Accept the curator role for a bounty. A deposit will be reserved from curator and refund upon successful payout.
May only be called from the curator.
§Complexity
- O(1).
Sourcepub fn award_bounty(
origin: <T as Config>::RuntimeOrigin,
bounty_id: u32,
beneficiary: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn award_bounty( origin: <T as Config>::RuntimeOrigin, bounty_id: u32, beneficiary: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Award bounty to a beneficiary account. The beneficiary will be able to claim the funds after a delay.
The dispatch origin for this call must be the curator of this bounty.
bounty_id
: Bounty ID to award.beneficiary
: The beneficiary account whom will receive the payout.
§Complexity
- O(1).
Sourcepub fn claim_bounty(
origin: <T as Config>::RuntimeOrigin,
bounty_id: u32,
) -> Result<(), DispatchError>
pub fn claim_bounty( origin: <T as Config>::RuntimeOrigin, bounty_id: u32, ) -> Result<(), DispatchError>
Claim the payout from an awarded bounty after payout delay.
The dispatch origin for this call must be the beneficiary of this bounty.
bounty_id
: Bounty ID to claim.
§Complexity
- O(1).
Sourcepub fn close_bounty(
origin: <T as Config>::RuntimeOrigin,
bounty_id: u32,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn close_bounty( origin: <T as Config>::RuntimeOrigin, bounty_id: u32, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
Cancel a proposed or active bounty. All the funds will be sent to treasury and the curator deposit will be unreserved if possible.
Only T::RejectOrigin
is able to cancel a bounty.
bounty_id
: Bounty ID to cancel.
§Complexity
- O(1).
Sourcepub fn extend_bounty_expiry(
origin: <T as Config>::RuntimeOrigin,
bounty_id: u32,
_remark: Vec<u8>,
) -> Result<(), DispatchError>
pub fn extend_bounty_expiry( origin: <T as Config>::RuntimeOrigin, bounty_id: u32, _remark: Vec<u8>, ) -> Result<(), DispatchError>
Extend the expiry time of an active bounty.
The dispatch origin for this call must be the curator of this bounty.
bounty_id
: Bounty ID to extend.remark
: additional information.
§Complexity
- O(1).
Sourcepub fn approve_bounty_with_curator(
origin: <T as Config>::RuntimeOrigin,
bounty_id: u32,
curator: <<T as Config>::Lookup as StaticLookup>::Source,
fee: <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance,
) -> Result<(), DispatchError>
pub fn approve_bounty_with_curator( origin: <T as Config>::RuntimeOrigin, bounty_id: u32, curator: <<T as Config>::Lookup as StaticLookup>::Source, fee: <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance, ) -> Result<(), DispatchError>
Approve bountry and propose a curator simultaneously.
This call is a shortcut to calling approve_bounty
and propose_curator
separately.
May only be called from T::SpendOrigin
.
bounty_id
: Bounty ID to approve.curator
: The curator account whom will manage this bounty.fee
: The curator fee.
§Complexity
- O(1).
Source§impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
Sourcepub fn do_try_state() -> Result<(), DispatchError>
pub fn do_try_state() -> Result<(), DispatchError>
Ensure the correctness of the state of this pallet.
This should be valid before or after each state transition of this pallet.
Source§impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
Sourcepub fn treasury_block_number() -> <<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber
pub fn treasury_block_number() -> <<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber
Get the block number used in the treasury pallet.
It may be configured to use the relay chain block number on a parachain.
Sourcepub fn calculate_curator_deposit(
fee: &<<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance,
) -> <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance
pub fn calculate_curator_deposit( fee: &<<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance, ) -> <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance
Calculate the deposit required for a curator.
Sourcepub fn account_id() -> <T as Config>::AccountId
pub fn account_id() -> <T as Config>::AccountId
The account ID of the treasury pot.
This actually does computation. If you need to keep using it, then make sure you cache the value and only call this once.
Sourcepub fn bounty_account_id(id: u32) -> <T as Config>::AccountId
pub fn bounty_account_id(id: u32) -> <T as Config>::AccountId
The account ID of a bounty account
Trait Implementations
Source§impl<T, I> BeforeAllRuntimeMigrations for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> BeforeAllRuntimeMigrations for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
Source§impl<T, I> Benchmarking for Pallet<T, I>
impl<T, I> Benchmarking for Pallet<T, I>
Source§fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
Source§fn run_benchmark(
extrinsic: &[u8],
c: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32,
) -> Result<Vec<BenchmarkResult>, BenchmarkError>
fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>
Source§impl<T, I> Callable<T> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Callable<T> for Pallet<T, I>where
T: Config<I>,
I: 'static,
type RuntimeCall = Call<T, I>
Source§impl<T, I> DispatchViewFunction for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> DispatchViewFunction for Pallet<T, I>where
T: Config<I>,
I: 'static,
fn dispatch_view_function<O>(
id: &ViewFunctionId,
input: &mut &[u8],
output: &mut O,
) -> Result<(), ViewFunctionDispatchError>where
O: Output,
Source§impl<T, I> GetStorageVersion for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> GetStorageVersion for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn in_code_storage_version() -> <Pallet<T, I> as GetStorageVersion>::InCodeStorageVersion
fn in_code_storage_version() -> <Pallet<T, I> as GetStorageVersion>::InCodeStorageVersion
storage_version
attribute, or
NoStorageVersionSet
if the attribute is missing.Source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
Source§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
in_code_storage_version
and will be removed after March 2024.Self::current_storage_version
instead. Read moreSource§impl<T, I> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn try_state(
_n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Result<(), DispatchError>
fn try_state( _n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Result<(), DispatchError>
Source§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
Source§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
Source§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
). Read moreSource§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read moreSource§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Source§fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
Source§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
Source§fn integrity_test()
fn integrity_test()
Source§impl<T, I> IntegrityTest for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> IntegrityTest for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn on_finalize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
)
fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )
Hooks::on_finalize
.Source§impl<T, I> OnGenesis for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnGenesis for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn on_genesis()
fn on_genesis()
Source§impl<T, I> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn on_initialize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Weight
fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight
Hooks::on_initialize
.Source§impl<T, I> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> OnRuntimeUpgrade for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnRuntimeUpgrade for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Hooks::pre_upgrade
.Source§fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
Hooks::post_upgrade
.Source§fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
pre_upgrade
->
on_runtime_upgrade
-> post_upgrade
hooks for a migration. Read moreSource§impl<T, I> PalletInfoAccess for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> PalletInfoAccess for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn module_name() -> &'static str
fn module_name() -> &'static str
Source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Source§impl<T, I> PalletsInfoAccess for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> PalletsInfoAccess for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> SpendFunds<T, I> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> SpendFunds<T, I> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> StorageInfoTrait for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> StorageInfoTrait for Pallet<T, I>where
T: Config<I>,
I: 'static,
fn storage_info() -> Vec<StorageInfo>
Source§impl<T, I> TryDecodeEntireStorage for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> TryDecodeEntireStorage for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
Ok(bytes_decoded)
if success.Source§impl<T, I> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> ViewFunctionIdPrefix for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> ViewFunctionIdPrefix for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> WhitelistedStorageKeys for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> WhitelistedStorageKeys for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey>
indicating the storage keys that
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.