logo

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 NameRequest TypeResponse TypeDescription
CreateOrganizationAssociation.CreateOrganizationInputaelf.AddressCreate an organization and return its address.
CreateOrganizationBySystemContractAssociation.CreateOrganizationBySystemContractInputaelf.AddressCreates an organization by system contract and return its address.
AddMemberaelf.Addressgoogle.protobuf.EmptyAdd organization members.
RemoveMemberaelf.Addressgoogle.protobuf.EmptyRemove organization members.
ChangeMemberAssociation.ChangeMemberInputgoogle.protobuf.EmptyReplace organization member with a new member.
GetOrganizationaelf.AddressAssociation.OrganizationGet the organization according to the organization address.
CalculateOrganizationAddressAssociation.CreateOrganizationInputaelf.AddressCalculate the input and return the organization address.

AElf.Standards.ACS1#

Method NameRequest TypeResponse TypeDescription
SetMethodFeeacs1.MethodFeesgoogle.protobuf.EmptySet the method fees for the specified method. Note that this will override all fees of the method.
ChangeMethodFeeControllerAuthorityInfogoogle.protobuf.EmptyChange the method fee controller, the default is parliament and default organization.
GetMethodFeegoogle.protobuf.StringValueacs1.MethodFeesQuery method fee information by method name.
GetMethodFeeControllergoogle.protobuf.EmptyAuthorityInfoQuery the method fee controller.

AElf.Standards.ACS3#

Method NameRequest TypeResponse TypeDescription
CreateProposalacs3.CreateProposalInputaelf.HashCreate 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.
Approveaelf.Hashgoogle.protobuf.EmptyApprove a proposal according to the proposal ID.
Rejectaelf.Hashgoogle.protobuf.EmptyReject a proposal according to the proposal ID.
Abstainaelf.Hashgoogle.protobuf.EmptyAbstain a proposal according to the proposal ID.
Releaseaelf.Hashgoogle.protobuf.EmptyRelease a proposal according to the proposal ID and send a transaction to the specified contract.
ChangeOrganizationThresholdacs3.ProposalReleaseThresholdgoogle.protobuf.EmptyChange 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.
ChangeOrganizationProposerWhiteListacs3.ProposerWhiteListgoogle.protobuf.EmptyChange the white list of organization proposer. This method overrides the list of whitelisted proposers.
CreateProposalBySystemContractacs3.CreateProposalBySystemContractInputaelf.HashCreate a proposal by system contracts, and return id of the newly created proposal.
ClearProposalaelf.Hashgoogle.protobuf.EmptyRemove the specified proposal. If the proposal is in effect, the cleanup fails.
GetProposalaelf.Hashacs3.ProposalOutputGet the proposal according to the proposal ID.
ValidateOrganizationExistaelf.Addressgoogle.protobuf.BoolValueCheck the existence of an organization.
ValidateProposerInWhiteListacs3.ValidateProposerInWhiteListInputgoogle.protobuf.BoolValueCheck if the proposer is whitelisted.

Contract Types#

AElf.Contracts.Association#

Association.ChangeMemberInput#

FieldTypeDescriptionLabel
old_memberaelf.AddressThe old member address.
new_memberaelf.AddressThe new member address.

Association.CreateOrganizationBySystemContractInput#

FieldTypeDescriptionLabel
organization_creation_inputCreateOrganizationInputThe parameters of creating organization.
organization_address_feedback_methodstringThe organization address callback method which replies the organization address to caller contract.

Association.CreateOrganizationInput#

FieldTypeDescriptionLabel
organization_member_listOrganizationMemberListInitial organization members.
proposal_release_thresholdacs3.ProposalReleaseThresholdThe threshold for releasing the proposal.
proposer_white_listacs3.ProposerWhiteListThe proposer whitelist.
creation_tokenaelf.HashThe creation token is for organization address generation.

Association.MemberAdded#

FieldTypeDescriptionLabel
memberaelf.AddressThe added member address.
organization_addressaelf.AddressThe organization address.

Association.MemberChanged#

FieldTypeDescriptionLabel
old_memberaelf.AddressThe old member address.
new_memberaelf.AddressThe new member address.
organization_addressaelf.AddressThe organization address.

Association.MemberRemoved#

FieldTypeDescriptionLabel
memberaelf.AddressThe removed member address.
organization_addressaelf.AddressThe organization address.

Association.Organization#

FieldTypeDescriptionLabel
organization_member_listOrganizationMemberListThe organization members.
proposal_release_thresholdacs3.ProposalReleaseThresholdThe threshold for releasing the proposal.
proposer_white_listacs3.ProposerWhiteListThe proposer whitelist.
organization_addressaelf.AddressThe address of organization.
organization_hashaelf.HashThe organizations id.
creation_tokenaelf.HashThe creation token is for organization address generation.

Association.OrganizationMemberList#

FieldTypeDescriptionLabel
organization_membersaelf.AddressThe address of organization members.repeated

Association.ProposalInfo#

FieldTypeDescriptionLabel
proposal_idaelf.HashThe proposal ID.
contract_method_namestringThe method that this proposal will call when being released.
to_addressaelf.AddressThe address of the target contract.
paramsbytesThe parameters of the release transaction.
expired_timegoogle.protobuf.TimestampThe date at which this proposal will expire.
proposeraelf.AddressThe address of the proposer of this proposal.
organization_addressaelf.AddressThe address of this proposals organization.
approvalsaelf.AddressAddress list of approved.repeated
rejectionsaelf.AddressAddress list of rejected.repeated
abstentionsaelf.AddressAddress list of abstained.repeated
proposal_description_urlstringUrl is used for proposal describing.

ACS1#

acs1.MethodFee#

FieldTypeDescriptionLabel
symbolstringThe token symbol of the method fee.
basic_feeint64The amount of fees to be charged.

acs1.MethodFees#

FieldTypeDescriptionLabel
method_namestringThe name of the method to be charged.
feesMethodFeeList of fees to be charged.repeated
is_size_fee_freeboolOptional based on the implementation of SetMethodFee method.

ACS3#

acs3.CreateProposalBySystemContractInput#

FieldTypeDescriptionLabel
proposal_inputCreateProposalInputThe parameters of creating proposal.
origin_proposeraelf.AddressThe actor that trigger the call.

acs3.CreateProposalInput#

FieldTypeDescriptionLabel
contract_method_namestringThe name of the method to call after release.
to_addressaelf.AddressThe address of the contract to call after release.
paramsbytesThe parameter of the method to be called after the release.
expired_timegoogle.protobuf.TimestampThe timestamp at which this proposal will expire.
organization_addressaelf.AddressThe address of the organization.
proposal_description_urlstringUrl is used for proposal describing.
tokenaelf.HashThe token is for proposal id generation and with this token, proposal id can be calculated before proposing.

ac3.organizationCreated#

ac3.organizationHashAddressPair#

FieldTypeDescriptionLabel
organization_hashaelf.HashID of the organization.
organization_addressaelf.AddressAddress of the organization.

ac3.organizationThresholdChanged#

FieldTypeDescriptionLabel
organization_addressaelf.AddressOrganization address
proposer_release_thresholdProposalReleaseThresholdNew release threshold.

ac3.organizationWhiteListChanged#

ac3.proposalCreated#

FieldTypeDescriptionLabel
proposal_idaelf.HashID of the created proposal.
organization_addressaelf.AddressOrganization address of the created proposal.

ac3.proposalOutput#

FieldTypeDescriptionLabel
proposal_idaelf.HashID of the proposal.
contract_method_namestringMethod called when the proposal is released.
to_addressaelf.AddressAddress of the target contract.
paramsbytesParameters of the release transaction.
expired_timegoogle.protobuf.TimestampExpiry date of the proposal.
organization_addressaelf.AddressOrganization's address for the proposal.
proposeraelf.AddressAddress of the proposer.
to_be_releasedboolIndicates if the proposal is releasable.
approval_countint64Number of approvals.
rejection_countint64Number of rejections.
abstention_countint64Number 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#

NameNumberDescription
NOT_EXISTEDThe execution result of the transaction does not exist.
PENDING1The transaction is in the transaction pool waiting to be packaged.
FAILED2Transaction execution failed.
MINED3The transaction was successfully executed and successfully packaged into a block.
CONFLICT4When executed in parallel, there are conflicts with other transactions.
PENDING_VALIDATION5The transaction is waiting for validation.
NODE_VALIDATION_FAILED6Transaction validation failed.

AuthorityInfo#

Edited on: 14 July 2024 05:01:58 GMT+0