Referendum Contract
Referendum#
Production nodes or associations cannot determine all decisions. Some extremely important decisions, especially those involving user rights and interests, should involve all users and give full control to the user's voting for governance. The Referendum contract is built for this.
Implement aelf Standards ACS1 and ACS3.
Contract Methods#
Method Name | Request Type | Response Type | Description |
---|---|---|---|
ReclaimVoteToken | aelf.Hash | google.protobuf.Empty | Unlock the token used for voting according to proposal id. |
CreateOrganization | Referendum.CreateOrganizationInput | aelf.Address | Create an organization and return its address. |
CreateOrganizationBySystemContract | Referendum.CreateOrganizationBySystemContractInput | aelf.Address | Creates an organization by system contract and return its address. |
GetOrganization | aelf.Address | Referendum.Organization | Get the organization according to the organization address. |
CalculateOrganizationAddress | Referendum.CreateOrganizationInput | aelf.Address | Calculate the input and return the organization address. |
GetProposalVirtualAddress | aelf.Hash | aelf.Address | Get the virtual address of a proposal based on the proposal id. |
AElf.Standards.ACS1#
AElf.Standards.ACS3#
Method Name | Request Type | Response Type | Description |
---|---|---|---|
CreateProposal | acs3.CreateProposalInput | aelf.Hash | Create a proposal for which organization members can vote. When the proposal is released, a transaction will be sent to the specified contract. Return id of the newly created proposal. |
Approve | aelf.Hash | google.protobuf.Empty | Approve a proposal according to the proposal ID. |
Reject | aelf.Hash | google.protobuf.Empty | Reject a proposal according to the proposal ID. |
Abstain | aelf.Hash | google.protobuf.Empty | Abstain a proposal according to the proposal ID. |
Release | aelf.Hash | google.protobuf.Empty | Release a proposal according to the proposal ID and send a transaction to the specified contract. |
ChangeOrganizationThreshold | acs3.ProposalReleaseThreshold | google.protobuf.Empty | Change the thresholds associated with proposals. All fields will be overwritten by the input value and this will affect all current proposals of the organization. Note: only the organization can execute this through a proposal. |
ChangeOrganizationProposerWhiteList | acs3.ProposerWhiteList | google.protobuf.Empty | Change the white list of organization proposer. This method overrides the list of whitelisted proposers. |
CreateProposalBySystemContract | acs3.CreateProposalBySystemContractInput | aelf.Hash | Create a proposal by system contracts, and return id of the newly created proposal. |
ClearProposal | aelf.Hash | google.protobuf.Empty | Remove the specified proposal. If the proposal is in effect, the cleanup fails. |
GetProposal | aelf.Hash | acs3.ProposalOutput | Get the proposal according to the proposal ID. |
ValidateOrganizationExist | aelf.Address | google.protobuf.BoolValue | Check the existence of an organization. |
ValidateProposerInWhiteList | acs3.ValidateProposerInWhiteListInput | google.protobuf.BoolValue | Check if the proposer is whitelisted. |
Contract Types#
AElf.Contracts.Referendum#
Referendum.CreateOrganizationBySystemContractInput#
Referendum.CreateOrganizationInput#
Referendum.Organization#
Field | Type | Description | Label |
---|---|---|---|
proposal_release_threshold | acs3.ProposalReleaseThreshold | The threshold for releasing the proposal. | |
token_symbol | string | The token used during proposal operations. | |
organization_address | aelf.Address | The address of organization. | |
organization_hash | aelf.Hash | The organization's id. | |
proposer_white_list | acs3.ProposerWhiteList | The proposer whitelist. | |
creation_token | aelf.Hash | The creation token is for organization address generation. |
Referendum.ProposalInfo#
Field | Type | Description | Label |
---|---|---|---|
proposal_id | aelf.Hash | The proposal ID. | |
contract_method_name | string | The method that this proposal will call when being released. | |
to_address | aelf.Address | The address of the target contract. | |
params | bytes | The parameters of the release transaction. | |
expired_time | google.protobuf.Timestamp | The date at which this proposal will expire. | |
proposer | aelf.Address | The address of the proposer of this proposal. | |
organization_address | aelf.Address | The address of this proposal's organization. | |
approval_count | int64 | The count of approved. | |
rejection_count | int64 | The count of rejected. | |
abstention_count | int64 | The count of abstained. | |
proposal_description_url | string | URL used for proposal describing. |
Referendum.Receipt#
Field | Type | Description | Label |
---|---|---|---|
amount | int64 | The amount of token locked. | |
token_symbol | string | The symbol of token locked. | |
lock_id | aelf.Hash | The lock ID. |
Referendum.ReferendumReceiptCreated#
AElf.Standards.ACS1#
acs1.MethodFee#
Field | Type | Description | Label |
---|---|---|---|
symbol | string | The token symbol of the method fee. | |
basic_fee | int64 | The amount of fees to be charged. |
acs1.MethodFees#
Field | Type | Description | Label |
---|---|---|---|
method_name | string | The name of the method to be charged. | |
fees | MethodFee | List of fees to be charged. | repeated |
is_size_fee_free | bool | Optional based on the implementation. |
AElf.Standards.ACS3#
acs3.CreateProposalBySystemContractInput#
acs3.CreateProposalInput#
Field | Type | Description | Label |
---|---|---|---|
contract_method_name | string | The name of the method to call after release. | |
to_address | aelf.Address | The address of the contract to call after release. | |
params | bytes | The parameter of the method to be called after the release. | |
expired_time | google.protobuf.Timestamp | The timestamp at which this proposal will expire. | |
organization_address | aelf.Address | The address of the organization. | |
proposal_description_url | string | URL used for proposal description. | |
token | aelf.Hash | The token for proposal ID generation. |
acs3.OrganizationCreated#
Field | Type | Description | Label |
---|---|---|---|
organization_address | aelf.Address | The address of the created organization. |
acs3.OrganizationHashAddressPair#
Field | Type | Description | Label |
---|---|---|---|
organization_hash | aelf.Hash | The ID of the organization. | |
organization_address | aelf.Address | The address of organization. |
acs3.OrganizationThresholdChanged#
acs3.OrganizationWhiteListChanged#
acs3.ProposalCreated#
Field | Type | Description | Label |
---|---|---|---|
proposal_id | aelf.Hash | The ID of the created proposal. | |
organization_address | aelf.Address | The organization address of the created proposal. |
acs3.ProposalOutput#
Field | Type | Description | Label |
---|---|---|---|
proposal_id | aelf.Hash | The ID of the proposal. | |
contract_method_name | string | The method that this proposal will call when being released. | |
to_address | aelf.Address | The address of the target contract. | |
params | bytes | The parameters of the release transaction. | |
expired_time | google.protobuf.Timestamp | The date at which this proposal will expire. | |
organization_address | aelf.Address | The address of this proposal's organization. | |
proposer | aelf.Address | The address of the proposer of this proposal. | |
to_be_released | bool | Indicates if this proposal is releasable. | |
approval_count | int64 | Approval count for this proposal. | |
rejection_count | int64 | Rejection count for this proposal. | |
abstention_count | int64 | Abstention count for this proposal. |
acs3.ProposalReleaseThreshold#
AElf.Standards.ACS1#
acs1.MethodFee#
Field | Type | Description | Label |
---|---|---|---|
symbol | string | The token symbol of the method fee. | |
basic_fee | int64 | The amount of fees to be charged. |
acs1.MethodFees#
Field | Type | Description | Label |
---|---|---|---|
method_name | string | The name of the method to be charged. | |
fees | MethodFee | List of fees to be charged. | repeated |
is_size_fee_free | bool | Optional based on the implementation. |
AElf.Standards.ACS3#
acs3.CreateProposalBySystemContractInput#
Field | Type | Description | Label |
---|---|---|---|
proposal_input | CreateProposalInput | The parameters of creating proposal. | |
origin_proposer | aelf.Address | The actor that triggers the call. |
acs3.CreateProposalInput#
Field | Type | Description | Label |
---|---|---|---|
contract_method_name | string | The name of the method to call after release. | |
to_address | aelf.Address | The address of the contract to call after release. | |
params | bytes | The parameter of the method to be called after the release. | |
expired_time | google.protobuf.Timestamp | The timestamp at which this proposal will expire. | |
organization_address | aelf.Address | The address of the organization. | |
proposal_description_url | string | URL used for proposal description. | |
token | aelf.Hash | The token for proposal ID generation. |
acs3.OrganizationCreated#
acs3.OrganizationHashAddressPair#
acs3.OrganizationThresholdChanged#
acs3.OrganizationWhiteListChanged#
Field | Type | Description | Label |
---|---|---|---|
organization_address | aelf.Address | The organization address. | |
proposer_white_list | ProposerWhiteList | The new proposer whitelist. |
acs3.ProposalCreated#
acs3.ProposalOutput#
acs3.ProposalReleaseThreshold#
acs3.ProposalReleased#
acs3.ProposerWhiteList#
acs3.ReceiptCreated#
acs3.ValidateProposerInWhiteListInput#
AElf.Types#
aelf.Address#
aelf.BinaryMerkleTree#
aelf.Hash#
aelf.LogEvent#
aelf.MerklePath#
aelf.MerklePathNode#
aelf.SInt32Value#
aelf.SInt64Value#
aelf.ScopedStatePath#
aelf.SmartContractRegistration#
aelf.StatePath#
aelf.Transaction#
aelf.TransactionExecutingStateSet#
aelf.TransactionExecutingStateSet.DeletesEntry#
aelf.TransactionExecutingStateSet.ReadsEntry#
aelf.TransactionExecutingStateSet.WritesEntry#
aelf.TransactionResult#
aelf.TransactionResultStatus#
AuthorityInfo#
Edited on: 14 July 2024 05:03:34 GMT+0