Skip to main content

Economic Contract

The Economic contract establishes the economic system of the aelf. When the blockchain starts to work, this contract will initialize other contracts related to economic activities. Implements aelf Standards ACS1.

Contract Methods

Method NameRequest TypeResponse TypeDescription
IssueNativeTokenEconomic.IssueNativeTokenInputgoogle.protobuf.EmptyOnly ZeroContract is able to issue the native token.
InitialEconomicSystemEconomic.InitialEconomicSystemInputgoogle.protobuf.EmptyIt will initialize other contracts related to economic activities (For instance, create the native token). This transaction only can be sent once because after the first sending, its state will be set to initialized.

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.

Contract Types

AElf.Contracts.Economic

Economic.InitialEconomicSystemInput

FieldTypeDescriptionLabel
native_token_symbolstringThe native token symbol.
native_token_namestringThe native token name.
native_token_total_supplyint64 The native token total supply.
native_token_decimalsint32 The accuracy of the native token.
is_native_token_burnablebool It indicates if the token is burnable.
mining_reward_total_amountint64It determines how much native token is used to reward the miners.
transaction_size_fee_unit_priceint64todo: remove unused fields

Economic.IssueNativeTokenInput

FieldTypeDescriptionLabel
amountint64The amount of token.
memostringThe memo.
toaelf.AddressThe recipient of the token.

Economic.IssueResourceTokenInput

FieldTypeDescriptionLabel
symbolstringThe symbol of resource token.
amountint64The amount of resource token.
memostringThe memo.
toaelf.AddressThe recipient of the token.

AElf.Standards.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.

AElf.Types

aelf.Address

FieldTypeDescriptionLabel
valuebytes

aelf.BinaryMerkleTree

FieldTypeDescriptionLabel
nodesHashThe leaf nodes.repeated
rootHashThe root node hash.
leaf_countint32The 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.ReadsEntryThe 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. 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_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.Address The contract address of the controller.
owner_addressaelf.Address The address of the owner of the contract.