Treasury¶
Calls¶
approve_proposal¶
Approve a proposal. At a later time, the proposal will be allocated to the beneficiary and the original deposit will be returned.
May only be called from T::ApproveOrigin
.
# <weight>
- Complexity: O(1).
- DbReads: Proposals
, Approvals
- DbWrite: Approvals
# </weight>
Attributes¶
Name | Type |
---|---|
proposal_id | ProposalIndex |
Python¶
call = substrate.compose_call(
'Treasury', 'approve_proposal', {'proposal_id': 'u32'}
)
propose_spend¶
Put forward a suggestion for spending. A deposit proportional to the value is reserved and slashed if the proposal is rejected. It is returned once the proposal is awarded.
# <weight>
- Complexity: O(1)
- DbReads: ProposalCount
, origin account
- DbWrites: ProposalCount
, Proposals
, origin account
# </weight>
Attributes¶
Name | Type |
---|---|
value | BalanceOf<T, I> |
beneficiary | <T::Lookup as StaticLookup>::Source |
Python¶
call = substrate.compose_call(
'Treasury', 'propose_spend', {
'beneficiary': {
'Address20': '[u8; 20]',
'Address32': '[u8; 32]',
'Id': 'AccountId',
'Index': 'u32',
'Raw': 'Bytes',
},
'value': 'u128',
}
)
reject_proposal¶
Reject a proposed spend. The original deposit will be slashed.
May only be called from T::RejectOrigin
.
# <weight>
- Complexity: O(1)
- DbReads: Proposals
, rejected proposer account
- DbWrites: Proposals
, rejected proposer account
# </weight>
Attributes¶
Name | Type |
---|---|
proposal_id | ProposalIndex |
Python¶
call = substrate.compose_call(
'Treasury', 'reject_proposal', {'proposal_id': 'u32'}
)
Events¶
Awarded¶
Some funds have been allocated.
Attributes¶
Name | Type | Composition |
---|---|---|
proposal_index | ProposalIndex |
u32 |
award | BalanceOf<T, I> |
u128 |
account | T::AccountId |
AccountId |
Burnt¶
Some of our funds have been burnt.
Attributes¶
Name | Type | Composition |
---|---|---|
burnt_funds | BalanceOf<T, I> |
u128 |
Deposit¶
Some funds have been deposited.
Attributes¶
Name | Type | Composition |
---|---|---|
value | BalanceOf<T, I> |
u128 |
Proposed¶
New proposal.
Attributes¶
Name | Type | Composition |
---|---|---|
proposal_index | ProposalIndex |
u32 |
Rejected¶
A proposal was rejected; funds were slashed.
Attributes¶
Name | Type | Composition |
---|---|---|
proposal_index | ProposalIndex |
u32 |
slashed | BalanceOf<T, I> |
u128 |
Rollover¶
Spending has finished; this is the amount that rolls over until next spend.
Attributes¶
Name | Type | Composition |
---|---|---|
rollover_balance | BalanceOf<T, I> |
u128 |
Spending¶
We have ended a spend period and will now allocate funds.
Attributes¶
Name | Type | Composition |
---|---|---|
budget_remaining | BalanceOf<T, I> |
u128 |
Storage functions¶
Approvals¶
Proposal indices that have been approved but not yet awarded.
Python¶
result = substrate.query(
'Treasury', 'Approvals', []
)
Return value¶
['u32']
ProposalCount¶
Number of proposals that have been made.
Python¶
result = substrate.query(
'Treasury', 'ProposalCount', []
)
Return value¶
'u32'
Proposals¶
Proposals that have been made.
Python¶
result = substrate.query(
'Treasury', 'Proposals', ['u32']
)
Return value¶
{
'beneficiary': 'AccountId',
'bond': 'u128',
'proposer': 'AccountId',
'value': 'u128',
}
Constants¶
Burn¶
Percentage of spare funds (if any) that are burnt per spend period.
Value¶
0
Python¶
constant = substrate.get_constant('Treasury', 'Burn')
MaxApprovals¶
The maximum number of approvals that can wait in the spending queue.
NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
Value¶
100
Python¶
constant = substrate.get_constant('Treasury', 'MaxApprovals')
PalletId¶
The treasury's pallet id, used for deriving its sovereign account ID.
Value¶
'0x7063782f74727379'
Python¶
constant = substrate.get_constant('Treasury', 'PalletId')
ProposalBond¶
Fraction of a proposal's value that should be bonded in order to place the proposal. An accepted proposal gets these back. A rejected proposal does not.
Value¶
50000
Python¶
constant = substrate.get_constant('Treasury', 'ProposalBond')
ProposalBondMaximum¶
Maximum amount of funds that should be placed in a deposit for making a proposal.
Value¶
10000000000
Python¶
constant = substrate.get_constant('Treasury', 'ProposalBondMaximum')
ProposalBondMinimum¶
Minimum amount of funds that should be placed in a deposit for making a proposal.
Value¶
1000000000
Python¶
constant = substrate.get_constant('Treasury', 'ProposalBondMinimum')
SpendPeriod¶
Period between successive spends.
Value¶
86400
Python¶
constant = substrate.get_constant('Treasury', 'SpendPeriod')
Errors¶
InsufficientProposersBalance¶
Proposer's balance is too low.
InvalidIndex¶
No proposal or bounty at that index.
TooManyApprovals¶
Too many approvals in the queue.