Skip to main content

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

FieldTypeDescriptionLabel
organization_addressaelf.Address Address of the created organization.

ac3.organizationHashAddressPair

FieldTypeDescriptionLabel
organization_hashaelf.Hash ID of the organization.
organization_addressaelf.Address Address of the organization.

ac3.organizationThresholdChanged

FieldTypeDescriptionLabel
organization_addressaelf.Address Organization address
proposer_release_thresholdProposalReleaseThreshold New release threshold.

ac3.organizationWhiteListChanged

FieldTypeDescriptionLabel
organization_addressaelf.Address Organization address
proposer_white_listProposerWhiteListNew proposer whitelist.

ac3.proposalCreated

FieldTypeDescriptionLabel
proposal_idaelf.Hash ID of the created proposal.
organization_addressaelf.Address Organization address of the created proposal.

ac3.proposalOutput

FieldTypeDescriptionLabel
proposal_idaelf.Hash ID of the proposal.
contract_method_namestring Method called when the proposal is released.
to_addressaelf.Address Address of the target contract.
paramsbytes Parameters of the release transaction.
expired_timegoogle.protobuf.Timestamp Expiry date of the proposal.
organization_addressaelf.Address Organization's address for the proposal.
proposeraelf.Address Address of the proposer.
to_be_releasedbool Indicates if the proposal is releasable.
approval_countint64 Number of approvals.
rejection_countint64 Number of rejections.
abstention_countint64 Number of abstentions.

ac3.proposalReleaseThreshold

FieldTypeDescriptionLabel
minimal_approval_thresholdint64 Minimum approval threshold.
maximal_rejection_thresholdint64 Maximum rejection threshold.
maximal_abstention_thresholdint64 Maximum abstention threshold.
minimal_vote_thresholdint64 Minimum vote threshold.

ac3.proposalReleased

FieldTypeDescriptionLabel
proposal_idaelf.Hash ID of the released proposal.
organization_addressaelf.Address Organization's address of the released proposal.

ac3.proposerWhiteList

FieldTypeDescriptionLabel
proposersaelf.Address Addresses of the proposers.repeated

ac3.receiptCreated

FieldTypeDescriptionLabel
proposal_idaelf.Hash ID of the proposal.
addressaelf.Address Sender's address.
receipt_typestring Type of receipt (Approve, Reject, or Abstain).
timegoogle.protobuf.TimestampTimestamp of the method call.
organization_addressaelf.Address Organization's address.

acs3.ValidateProposerInWhiteListInput

FieldTypeDescriptionLabel
proposeraelf.Address The address to search/check.
organization_addressaelf.Address The address of the organization.

AElf.Types

aelf.Address

FieldTypeDescriptionLabel
valuebytes

aelf.BinaryMerkleTree

FieldTypeDescriptionLabel
nodesHash The leaf nodes.repeated
rootHash The root node hash.
leaf_countint32 The count of leaf node.

aelf.Hash

FieldTypeDescriptionLabel
valuebytes

aelf.LogEvent

FieldTypeDescriptionLabel
addressAddress The contract address.
namestring The name of the log event.
indexedbytes The indexed data, used to calculate bloom.repeated
non_indexedbytes The non indexed data.

aelf.MerklePath

FieldTypeDescriptionLabel
merkle_path_nodesMerklePathNode The merkle path nodes.repeated

aelf.MerklePathNode

FieldTypeDescriptionLabel
hashHash The node hash.
is_left_child_nodebool Whether it is a left child node.

aelf.SInt32Value

FieldTypeDescriptionLabel
valuesint32

aelf.SInt64Value

FieldTypeDescriptionLabel
valuesint64

aelf.ScopedStatePath

FieldTypeDescriptionLabel
addressAddress The scope address, which will be the contract address.
pathStatePath The path of contract state.

aelf.SmartContractRegistration

FieldTypeDescriptionLabel
categorysint32 The category of contract code(0: C#).
codebytes The byte array of the contract code.
code_hashHash The hash of the contract code.
is_system_contractbool Whether it is a system contract.
versionint32 The version of the current contract.

aelf.StatePath

FieldTypeDescriptionLabel
partsstring The partial path of the state path.repeated

aelf.Transaction

FieldTypeDescriptionLabel
fromAddress The address of the sender of the transaction.
toAddress The address of the contract when calling a contract.
ref_block_numberint64 The height of the referenced block hash.
ref_block_prefixbytes The first four bytes of the referenced block hash.
method_namestring The name of a method in the smart contract at the To address.
paramsbytes The parameters to pass to the smart contract method.
signaturebytes 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

FieldTypeDescriptionLabel
writesTransactionExecutingStateSet.WritesEntry The changed states.repeated
readsTransactionExecutingStateSet.ReadsEntry The read states.repeated
deletesTransactionExecutingStateSet.DeletesEntry The deleted states.repeated

aelf.TransactionExecutingStateSet.DeletesEntry

FieldTypeDescriptionLabel
keystring
valuebool

aelf.TransactionExecutingStateSet.ReadsEntry

FieldTypeDescriptionLabel
keystring
valuebool

aelf.TransactionExecutingStateSet.WritesEntry

FieldTypeDescriptionLabel
keystring
valuebytes

aelf.TransactionResult

FieldTypeDescriptionLabel
transaction_idHash The transaction id.
statusTransactionResultStatus The transaction result status.
logsLogEvent The log events.repeated
bloombytes Bloom filter for transaction logs.
return_valuebytes The return value of the transaction execution.
block_numberint64 The height of the block hat packages the transaction.
block_hashHash The hash of the block hat packages the transaction.
errorstring Failed execution error message.

aelf.TransactionResultStatus

NameNumberDescription
NOT_EXISTED0The 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

FieldTypeDescriptionLabel
contract_addressaelf.AddressThe contract address of the controller.
owner_addressaelf.Address The address of the owner of the contract.