treasury
checkStatus(index: u32)
interface:
treasury.checkStatussummary: Check the status of the spend and remove it from the storage if processed.
Dispatch Origin
Must be signed.
Details
The status check is a prerequisite for retrying a failed payout. If a spend has either succeeded or expired, it is removed from the storage by this function. In such instances, transaction fees are refunded.
Parameters
index: The spend index.
Events
Emits [
Event::PaymentFailed] if the spend payout has failed. Emits [Event::SpendProcessed] if the spend payout has succeed.
payout(index: u32)
interface:
treasury.payoutsummary: Claim a spend.
Dispatch Origin
Must be signed
Details
Spends must be claimed within some temporal bounds. A spend may be claimed within one [
Config::PayoutPeriod] from thevalid_fromblock. In case of a payout failure, the spend status must be updated with thecheck_statusdispatchable before retrying with the current function.Parameters
index: The spend index.
Events
Emits [
Event::Paid] if successful.
removeApproval(proposal_id: Compact<u32>)
interface:
treasury.removeApprovalsummary: Force a previously approved proposal to be removed from the approval queue.
Dispatch Origin
Must be [
Config::RejectOrigin].Details
The original deposit will no longer be returned.
Parameters
proposal_id: The index of a proposal
Complexity
O(A) where
Ais the number of approvals
Errors
[
Error::ProposalNotApproved]: Theproposal_idsupplied was not found in the approval queue, i.e., the proposal has not been approved. This could also mean the proposal does not exist altogether, thus there is no way it would have been approved in the first place.
spend(asset_kind: FrameSupportTokensFungibleUnionOfNativeOrWithId, amount: Compact<u128>, beneficiary: MultiAddress, valid_from: Option<u32>)
interface:
treasury.spendsummary: Propose and approve a spend of treasury funds.
Dispatch Origin
Must be [
Config::SpendOrigin] with theSuccessvalue being at leastamountofasset_kindin the native asset. The amount ofasset_kindis converted for assertion using the [Config::BalanceConverter].Details
Create an approved spend for transferring a specific
amountofasset_kindto a designated beneficiary. The spend must be claimed using thepayoutdispatchable within the [Config::PayoutPeriod].Parameters
asset_kind: An indicator of the specific asset class to be spent.amount: The amount to be transferred from the treasury to thebeneficiary.beneficiary: The beneficiary of the spend.valid_from: The block number from which the spend can be claimed. It can refer to the past if the resulting spend has not yet expired according to the [Config::PayoutPeriod]. IfNone, the spend can be claimed immediately after approval.
Events
Emits [
Event::AssetSpendApproved] if successful.
spendLocal(amount: Compact<u128>, beneficiary: MultiAddress)
interface:
treasury.spendLocalsummary: Propose and approve a spend of treasury funds.
Dispatch Origin
Must be [
Config::SpendOrigin] with theSuccessvalue being at leastamount.Details NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the beneficiary.
Parameters
amount: The amount to be transferred from the treasury to thebeneficiary.beneficiary: The destination account for the transfer.
Events
Emits [
Event::SpendApproved] if successful.
voidSpend(index: u32)
interface:
treasury.voidSpendsummary: Void previously approved spend.
Dispatch Origin
Must be [
Config::RejectOrigin].Details
A spend void is only possible if the payout has not been attempted yet.
Parameters
index: The spend index.
Events
Emits [
Event::AssetSpendVoided] if successful.