Association Contract
Association contract#
Organizations established to achieve specific goals can use this contract to cooperatively handle transactions within the organization.
Implements aelf Standards ACS1 and ACS3.
Contract Methods#
| Method Name | Request Type | Response Type | Description |
|---|---|---|---|
| CreateOrganization | Association.CreateOrganizationInput | aelf.Address | Create an organization and return its address. |
| CreateOrganizationBySystemContract | Association.CreateOrganizationBySystemContractInput | aelf.Address | Creates an organization by system contract and return its address. |
| AddMember | aelf.Address | google.protobuf.Empty | Add organization members. |
| RemoveMember | aelf.Address | google.protobuf.Empty | Remove organization members. |
| ChangeMember | Association.ChangeMemberInput | google.protobuf.Empty | Replace organization member with a new member. |
| GetOrganization | aelf.Address | Association.Organization | Get the organization according to the organization address. |
| CalculateOrganizationAddress | Association.CreateOrganizationInput | aelf.Address | Calculate the input and return the organization address. |
AElf.Standards.ACS1#
| Method Name | Request Type | Response Type | Description |
|---|---|---|---|
| SetMethodFee | acs1.MethodFees | google.protobuf.Empty | Set the method fees for the specified method. Note that this will override all fees of the method. |
| ChangeMethodFeeController | AuthorityInfo | google.protobuf.Empty | Change the method fee controller, the default is parliament and default organization. |
| GetMethodFee | google.protobuf.StringValue | acs1.MethodFees | Query method fee information by method name. |
| GetMethodFeeController | google.protobuf.Empty | AuthorityInfo | Query the method fee controller. |
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.Association#
Association.ChangeMemberInput#
| Field | Type | Description | Label |
|---|---|---|---|
| old_member | aelf.Address | The old member address. | |
| new_member | aelf.Address | The new member address. |
Association.CreateOrganizationBySystemContractInput#
| Field | Type | Description | Label |
|---|---|---|---|
| organization_creation_input | CreateOrganizationInput | The parameters of creating organization. | |
| organization_address_feedback_method | string | The organization address callback method which replies the organization address to caller contract. |
Association.CreateOrganizationInput#
| Field | Type | Description | Label |
|---|---|---|---|
| organization_member_list | OrganizationMemberList | Initial organization members. | |
| proposal_release_threshold | acs3.ProposalReleaseThreshold | The threshold for releasing the proposal. | |
| proposer_white_list | acs3.ProposerWhiteList | The proposer whitelist. | |
| creation_token | aelf.Hash | The creation token is for organization address generation. |
Association.MemberAdded#
| Field | Type | Description | Label |
|---|---|---|---|
| member | aelf.Address | The added member address. | |
| organization_address | aelf.Address | The organization address. |
Association.MemberChanged#
| Field | Type | Description | Label |
|---|---|---|---|
| old_member | aelf.Address | The old member address. | |
| new_member | aelf.Address | The new member address. | |
| organization_address | aelf.Address | The organization address. |
Association.MemberRemoved#
| Field | Type | Description | Label |
|---|---|---|---|
| member | aelf.Address | The removed member address. | |
| organization_address | aelf.Address | The organization address. |
Association.Organization#
| Field | Type | Description | Label |
|---|---|---|---|
| organization_member_list | OrganizationMemberList | The organization members. | |
| proposal_release_threshold | acs3.ProposalReleaseThreshold | The threshold for releasing the proposal. | |
| proposer_white_list | acs3.ProposerWhiteList | The proposer whitelist. | |
| organization_address | aelf.Address | The address of organization. | |
| organization_hash | aelf.Hash | The organizations id. | |
| creation_token | aelf.Hash | The creation token is for organization address generation. |
Association.OrganizationMemberList#
| Field | Type | Description | Label |
|---|---|---|---|
| organization_members | aelf.Address | The address of organization members. | repeated |
Association.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 proposals organization. | |
| approvals | aelf.Address | Address list of approved. | repeated |
| rejections | aelf.Address | Address list of rejected. | repeated |
| abstentions | aelf.Address | Address list of abstained. | repeated |
| proposal_description_url | string | Url is used for proposal describing. |
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 of SetMethodFee method. |
ACS3#
acs3.CreateProposalBySystemContractInput#
| Field | Type | Description | Label |
|---|---|---|---|
| proposal_input | CreateProposalInput | The parameters of creating proposal. | |
| origin_proposer | aelf.Address | The actor that trigger 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 is used for proposal describing. | |
| token | aelf.Hash | The token is for proposal id generation and with this token, proposal id can be calculated before proposing. |
ac3.organizationCreated#
ac3.organizationHashAddressPair#
| Field | Type | Description | Label |
|---|---|---|---|
| organization_hash | aelf.Hash | ID of the organization. | |
| organization_address | aelf.Address | Address of the organization. |
ac3.organizationThresholdChanged#
| Field | Type | Description | Label |
|---|---|---|---|
| organization_address | aelf.Address | Organization address | |
| proposer_release_threshold | ProposalReleaseThreshold | New release threshold. |
ac3.organizationWhiteListChanged#
ac3.proposalCreated#
| Field | Type | Description | Label |
|---|---|---|---|
| proposal_id | aelf.Hash | ID of the created proposal. | |
| organization_address | aelf.Address | Organization address of the created proposal. |
ac3.proposalOutput#
| Field | Type | Description | Label |
|---|---|---|---|
| proposal_id | aelf.Hash | ID of the proposal. | |
| contract_method_name | string | Method called when the proposal is released. | |
| to_address | aelf.Address | Address of the target contract. | |
| params | bytes | Parameters of the release transaction. | |
| expired_time | google.protobuf.Timestamp | Expiry date of the proposal. | |
| organization_address | aelf.Address | Organization's address for the proposal. | |
| proposer | aelf.Address | Address of the proposer. | |
| to_be_released | bool | Indicates if the proposal is releasable. | |
| approval_count | int64 | Number of approvals. | |
| rejection_count | int64 | Number of rejections. | |
| abstention_count | int64 | Number of abstentions. |
ac3.proposalReleaseThreshold#
ac3.proposalReleased#
ac3.proposerWhiteList#
ac3.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#
| Name | Number | Description |
|---|---|---|
| NOT_EXISTED | 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. |
AuthorityInfo#
Edited on: 14 July 2024 05:01:58 GMT+0