AElf.Contracts.Treasury
Treasury contract.
Used for distributing bonus’ to voters and candidates during the election process.
Implement AElf Standards ACS1 and ACS10.
Contract Methods
Method Name |
Request Type |
Response Type |
Description |
---|---|---|---|
InitialTreasuryContract |
Initialize treasury contract. |
||
InitialMiningRewardProfitItem |
Initialize the sub-item of the bonus scheme. |
||
DonateAll |
Donate all tokens owned by the sender. |
||
SetDividendPoolWeightSetting |
Set the dividend weight of the sub-item of the dividend item. |
||
SetMinerRewardWeightSetting |
Set the miner reward weight. |
||
SetProfitsReceiver |
Set collect profits receiver address. |
||
UpdateMiningReward |
Set the reward for mining. |
||
ChangeTreasuryController |
Change the governance authority information for treasury contract. |
||
RecordMinerReplacement |
AEDPoS Contract can notify Treasury Contract to aware miner replacement happened. |
||
GetWelfareRewardAmountSample |
Used to estimate the revenue weight of 10000 tokens voted by users. |
||
GetTreasurySchemeId |
Get the scheme id of treasury. |
||
GetDividendPoolWeightProportion |
Query the weight percentage of dividend pool items. |
||
GetMinerRewardWeightProportion |
Query the weight percentage of the dividend item for miner. |
||
GetTreasuryController |
Query the governance authority information. |
||
GetProfitsReceiver |
Get profits receiver,If not set,return the candidate’s address. |
||
GetProfitsReceiverOrDefault |
Get profits receiver,If not set,return null. |
||
ReplaceCandidateProfitsReceiver |
Query the governance authority information. |
AElf.Standards.ACS1
Method Name |
Request Type |
Response Type |
Description |
---|---|---|---|
SetMethodFee |
Set the method fees for the specified method. Note that this will override all fees of the method. |
||
ChangeMethodFeeController |
Change the method fee controller, the default is parliament and default organization. |
||
GetMethodFee |
Query method fee information by method name. |
||
GetMethodFeeController |
Query the method fee controller. |
AElf.Standards.ACS10
Method Name |
Request Type |
Response Type |
Description |
---|---|---|---|
Donate |
Donates tokens from the caller to the treasury. If the tokens are not native tokens in the current chain, they will be first converted to the native token. |
||
Release |
Release dividend pool according the period number. |
||
SetSymbolList |
Set the token symbols dividend pool supports. |
||
GetSymbolList |
Query the token symbols dividend pool supports. |
||
GetUndistributedDividends |
Query the balance of undistributed tokens whose symbols are included in the symbol list. |
||
GetDividends |
Query the dividend information according to the height. |
Contract Types
AElf.Contracts.Treasury
Treasury.DividendPoolWeightProportion
Field |
Type |
Description |
Label |
---|---|---|---|
citizen_welfare_proportion_info |
The proportion of citizen welfare. |
||
backup_subsidy_proportion_info |
The proportion of candidate nodes. |
||
miner_reward_proportion_info |
The proportion of miner |
Treasury.DividendPoolWeightSetting
Field |
Type |
Description |
Label |
---|---|---|---|
citizen_welfare_weight |
The dividend weight of citizen welfare. |
||
backup_subsidy_weight |
The dividend weight of candidate nodes. |
||
miner_reward_weight |
The dividend weight of miner. |
Treasury.DonateAllInput
Field |
Type |
Description |
Label |
---|---|---|---|
symbol |
The token symbol to donate. |
Treasury.GetWelfareRewardAmountSampleInput
Field |
Type |
Description |
Label |
---|---|---|---|
value |
Token lock time. |
repeated |
Treasury.GetWelfareRewardAmountSampleOutput
Field |
Type |
Description |
Label |
---|---|---|---|
value |
The weight calculated. |
repeated |
Treasury.MinerReElectionInformation
Field |
Type |
Description |
Label |
---|---|---|---|
continual_appointment_times |
The reappointment information for miner. |
repeated |
Treasury.MinerReElectionInformation.ContinualAppointmentTimesEntry
Field |
Type |
Description |
Label |
---|---|---|---|
key |
|||
value |
Treasury.MinerRewardWeightProportion
Field |
Type |
Description |
Label |
---|---|---|---|
basic_miner_reward_proportion_info |
The proportion of the basic income of the miner. |
||
votes_weight_reward_proportion_info |
The proportion of the vote of the miner. |
||
re_election_reward_proportion_info |
The proportion of the reappointment of the miner. |
Treasury.MinerRewardWeightSetting
Field |
Type |
Description |
Label |
---|---|---|---|
basic_miner_reward_weight |
The dividend weight of the basic income of the miner. |
||
votes_weight_reward_weight |
The dividend weight of the vote of the miner. |
||
re_election_reward_weight |
The dividend weight of the reappointment of the miner. |
Treasury.RecordMinerReplacementInput
Field |
Type |
Description |
Label |
---|---|---|---|
old_pubkey |
|||
new_pubkey |
|||
current_term_number |
Treasury.SchemeProportionInfo
Field |
Type |
Description |
Label |
---|---|---|---|
scheme_id |
The scheme id. |
||
proportion |
Dividend weight percentage. |
Treasury.SetProfitsReceiverInput
Field |
Type |
Description |
Label |
---|---|---|---|
pubkey |
The candidate’s public key. |
||
profits_receiver_address |
The address of profits receiver. |
Treasury.ReplaceCandidateProfitsReceiverInput
Field |
Type |
Description |
Label |
---|---|---|---|
old_pubkey |
The old candidate’s public key. |
||
new_pubkey |
The new candidate’s public key. |
AElf.Standards.ACS1
acs1.MethodFee
Field |
Type |
Description |
Label |
---|---|---|---|
symbol |
The token symbol of the method fee. |
||
basic_fee |
The amount of fees to be charged. |
acs1.MethodFees
Field |
Type |
Description |
Label |
---|---|---|---|
method_name |
The name of the method to be charged. |
||
fees |
List of fees to be charged. |
repeated |
|
is_size_fee_free |
Optional based on the implementation of SetMethodFee method. |
AElf.Standards.ACS10
acs10.Dividends
Field |
Type |
Description |
Label |
---|---|---|---|
value |
The dividends, symbol -> amount. |
repeated |
acs10.Dividends.ValueEntry
Field |
Type |
Description |
Label |
---|---|---|---|
key |
|||
value |
acs10.DonateInput
Field |
Type |
Description |
Label |
---|---|---|---|
symbol |
The token symbol to donate. |
||
amount |
The amount to donate. |
acs10.DonationReceived
Field |
Type |
Description |
Label |
---|---|---|---|
from |
The address of donors. |
||
pool_contract |
The address of dividend pool. |
||
symbol |
The token symbol Donated. |
||
amount |
The amount Donated. |
acs10.ReleaseInput
Field |
Type |
Description |
Label |
---|---|---|---|
period_number |
The period number to release. |
acs10.SymbolList
Field |
Type |
Description |
Label |
---|---|---|---|
value |
The token symbol list. |
repeated |
AElf.Types
aelf.Address
Field |
Type |
Description |
Label |
---|---|---|---|
value |
aelf.BinaryMerkleTree
Field |
Type |
Description |
Label |
---|---|---|---|
nodes |
The leaf nodes. |
repeated |
|
root |
The root node hash. |
||
leaf_count |
The count of leaf node. |
aelf.Hash
Field |
Type |
Description |
Label |
---|---|---|---|
value |
aelf.LogEvent
Field |
Type |
Description |
Label |
---|---|---|---|
address |
The contract address. |
||
name |
The name of the log event. |
||
indexed |
The indexed data, used to calculate bloom. |
repeated |
|
non_indexed |
The non indexed data. |
aelf.MerklePath
Field |
Type |
Description |
Label |
---|---|---|---|
merkle_path_nodes |
The merkle path nodes. |
repeated |
aelf.MerklePathNode
Field |
Type |
Description |
Label |
---|---|---|---|
hash |
The node hash. |
||
is_left_child_node |
Whether it is a left child node. |
aelf.SInt32Value
Field |
Type |
Description |
Label |
---|---|---|---|
value |
aelf.SInt64Value
Field |
Type |
Description |
Label |
---|---|---|---|
value |
aelf.ScopedStatePath
Field |
Type |
Description |
Label |
---|---|---|---|
address |
The scope address, which will be the contract address. |
||
path |
The path of contract state. |
aelf.SmartContractRegistration
Field |
Type |
Description |
Label |
---|---|---|---|
category |
The category of contract code(0: C#). |
||
code |
The byte array of the contract code. |
||
code_hash |
The hash of the contract code. |
||
is_system_contract |
Whether it is a system contract. |
||
version |
The version of the current contract. |
aelf.StatePath
Field |
Type |
Description |
Label |
---|---|---|---|
parts |
The partial path of the state path. |
repeated |
aelf.Transaction
Field |
Type |
Description |
Label |
---|---|---|---|
from |
The address of the sender of the transaction. |
||
to |
The address of the contract when calling a contract. |
||
ref_block_number |
The height of the referenced block hash. |
||
ref_block_prefix |
The first four bytes of the referenced block hash. |
||
method_name |
The name of a method in the smart contract at the To address. |
||
params |
The parameters to pass to the smart contract method. |
||
signature |
When signing a transaction it’s actually a subset of the fields: from/to and the target method as well as the parameter that were given. It also contains the reference block number and prefix. |
aelf.TransactionExecutingStateSet
Field |
Type |
Description |
Label |
---|---|---|---|
writes |
The changed states. |
repeated |
|
reads |
The read states. |
repeated |
|
deletes |
The deleted states. |
repeated |
aelf.TransactionExecutingStateSet.DeletesEntry
Field |
Type |
Description |
Label |
---|---|---|---|
key |
|||
value |
aelf.TransactionExecutingStateSet.ReadsEntry
Field |
Type |
Description |
Label |
---|---|---|---|
key |
|||
value |
aelf.TransactionExecutingStateSet.WritesEntry
Field |
Type |
Description |
Label |
---|---|---|---|
key |
|||
value |
aelf.TransactionResult
Field |
Type |
Description |
Label |
---|---|---|---|
transaction_id |
The transaction id. |
||
status |
The transaction result status. |
||
logs |
The log events. |
repeated |
|
bloom |
Bloom filter for transaction logs. A transaction log event can be defined in the contract and stored in the bloom filter after the transaction is executed. Through this filter, we can quickly search for and determine whether a log exists in the transaction result. |
||
return_value |
The return value of the transaction execution. |
||
block_number |
The height of the block hat packages the transaction. |
||
block_hash |
The hash of the block hat packages the transaction. |
||
error |
Failed execution error message. |
aelf.TransactionResultStatus
Name |
Number |
Description |
---|---|---|
NOT_EXISTED |
0 |
The execution result of the transaction does not exist. |
PENDING |
1 |
The transaction is in the transaction pool waiting to be packaged. |
FAILED |
2 |
Transaction execution failed. |
MINED |
3 |
The transaction was successfully executed and successfully packaged into a block. |
CONFLICT |
4 |
When executed in parallel, there are conflicts with other transactions. |
PENDING_VALIDATION |
5 |
The transaction is waiting for validation. |
NODE_VALIDATION_FAILED |
6 |
Transaction validation failed. |