AElf.Contracts.Genesis
Genesis contract.
Used to manage the deployment and update of contracts.
Implement AElf Standards ACS0 and ACS1.
Contract Methods
Method Name |
Request Type |
Response Type |
Description |
---|---|---|---|
Initialize |
Initialize the genesis contract. |
||
SetInitialControllerAddress |
Set initial controller address for CodeCheckController and ContractDeploymentController. |
||
ChangeContractDeploymentController |
Modify the contract deployment controller authority. Note: Only old controller has permission to do this. |
||
ChangeCodeCheckController |
Modify the contract code check controller authority. Note: Only old controller has permission to do this. |
||
GetContractDeploymentController |
Query the ContractDeploymentController authority info. |
||
GetCodeCheckController |
Query the CodeCheckController authority info. |
||
SetContractProposalExpirationTimePeriod |
Set expiration time for contract proposals, 72 hours by default |
||
GetCurrentContractProposalExpirationTimePeriod |
get the expiration time for the current contract proposal |
AElf.Standards.ACS0
Method Name |
Request Type |
Response Type |
Description |
---|---|---|---|
DeploySystemSmartContract |
Deploy a system smart contract on chain and return the address of the system contract deployed. |
||
DeploySmartContract |
Deploy a smart contract on chain and return the address of the contract deployed. |
||
UpdateSmartContract |
Update a smart contract on chain. |
||
ProposeNewContract |
Create a proposal to deploy a new contract and returns the id of the proposed contract. |
||
ProposeContractCodeCheck |
Create a proposal to check the code of a contract and return the id of the proposed contract. |
||
ProposeUpdateContract |
Create a proposal to update the specified contract and return the id of the proposed contract. |
||
ReleaseApprovedContract |
Release the contract proposal which has been approved. |
||
ReleaseCodeCheckedContract |
Release the proposal which has passed the code check. |
||
ValidateSystemContractAddress |
Validate whether the input system contract exists. |
||
SetContractProposerRequiredState |
Set authority of contract deployment. |
||
CurrentContractSerialNumber |
Get the current serial number of genesis contract (corresponds to the serial number that will be given to the next deployed contract). |
||
GetContractInfo |
Get detailed information about the specified contract. |
||
GetContractAuthor |
Get author of the specified contract. |
||
GetContractHash |
Get the code hash of the contract about the specified address. |
||
GetContractAddressByName |
Get the address of a system contract by its name. |
||
GetSmartContractRegistrationByAddress |
Get the registration of a smart contract by its address. |
||
GetSmartContractRegistrationByCodeHash |
Get the registration of a smart contract by code hash. |
||
DeployUserSmartContract |
Deploy a user smart contract on chain and return the hash of the contract code. |
||
UpdateUserSmartContract |
Update a user smart contract on chain. |
||
ReleaseApprovedUserSmartContract |
Release the proposal which has passed the code check. |
||
PerformDeployUserSmartContract |
Perform user contract deployment. |
||
PerformUpdateUserSmartContract |
Perform user contract update. |
||
SetContractAuthor |
Set author of the specified contract. |
||
SetSigner |
Set proxy signer that provides signature for contract deployment/update. |
||
RemoveSigner |
Remove proxy signer that provides signature for contract deployment/update. |
||
GetSigner |
Query signer of specified address. |
AElf.Standards.ACS1
Method Name |
Request Type |
Response Type |
Description |
---|---|---|---|
SetMethodFee |
Set the method fees for the specified method. Note that this will override all fees of the method. |
||
ChangeMethodFeeController |
Change the method fee controller, the default is parliament and default organization. |
||
GetMethodFee |
Query method fee information by method name. |
||
GetMethodFeeController |
Query the method fee controller. |
Contract Types
AElf.Contracts.Genesis
Zero.ContractProposingInput
Field |
Type |
Description |
Label |
---|---|---|---|
proposer |
The address of proposer for contract deployment/update. |
||
status |
The status of proposal. |
||
expired_time |
The expiration time of proposal. |
Zero.InitializeInput
Field |
Type |
Description |
Label |
---|---|---|---|
contract_deployment_authority_required |
Whether contract deployment/update requires authority. |
Zero.ContractProposingInputStatus
Name |
Number |
Description |
---|---|---|
PROPOSED |
0 |
Proposal is proposed. |
APPROVED |
1 |
Proposal is approved by parliament. |
CODE_CHECK_PROPOSED |
2 |
Code check is proposed. |
CODE_CHECKED |
3 |
Passed code checks. |
Zero.SetContractProposalExpirationTimePeriodInput
Field |
Type |
Description |
Label |
---|---|---|---|
expiration_time_period |
the period of expiration time |
AElf.Standards.ACS0
acs0.CodeCheckRequired
Field |
Type |
Description |
Label |
---|---|---|---|
code |
The byte array of the contract code. |
||
proposed_contract_input_hash |
The id of the proposed contract. |
||
category |
The category of contract code(0: C#). |
||
is_system_contract |
Indicates if the contract is the system contract. |
||
is_user_contract |
Indicates if the contract is the user contract. |
acs0.CodeUpdated
Field |
Type |
Description |
Label |
---|---|---|---|
address |
The address of the updated contract. |
||
old_code_hash |
The byte array of the old contract code. |
||
new_code_hash |
The byte array of the new contract code. |
||
version |
The version of the current contract. |
acs0.ContractCodeCheckInput
Field |
Type |
Description |
Label |
---|---|---|---|
contract_input |
The byte array of the contract code to be checked. |
||
is_contract_deployment |
Whether the input contract is to be deployed or updated. |
||
code_check_release_method |
Method to call after code check complete(DeploySmartContract or UpdateSmartContract). |
||
proposed_contract_input_hash |
The id of the proposed contract. |
||
category |
The category of contract code(0: C#). |
||
is_system_contract |
Indicates if the contract is the system contract. |
acs0.ContractDeployed
Field |
Type |
Description |
Label |
---|---|---|---|
author |
The author of the contract, this is the person who deployed the contract. |
||
code_hash |
The hash of the contract code. |
||
address |
The address of the contract. |
||
version |
The version of the current contract. |
||
name |
The name of the contract. It has to be unique. |
||
contract_version |
The version of the current contract. |
||
deployer |
The actual address that initiate the contract deployment. |
acs0.ContractDeploymentInput
Field |
Type |
Description |
Label |
---|---|---|---|
category |
The category of contract code(0: C#). |
||
code |
The byte array of the contract code. |
||
contract_operation |
The information needed for contract deployment. |
acs0.ContractInfo
Field |
Type |
Description |
Label |
---|---|---|---|
serial_number |
The serial number of the contract. |
||
author |
The author of the contract, this is the person who deployed the contract. |
||
category |
The category of contract code(0: C#). |
||
code_hash |
The hash of the contract code. |
||
is_system_contract |
Whether it is a system contract. |
||
version |
The version of the current contract. |
||
contract_version |
The version of the current contract. |
||
is_user_contract |
Indicates if the contract is the user contract. |
||
deployer |
The actual address that initiate the contract deployment. |
acs0.ContractProposed
Field |
Type |
Description |
Label |
---|---|---|---|
proposed_contract_input_hash |
The id of the proposed contract. |
acs0.ContractUpdateInput
Field |
Type |
Description |
Label |
---|---|---|---|
address |
The contract address that needs to be updated. |
||
code |
The byte array of the new contract code. |
||
contract_operation |
The information needed for contract update. |
acs0.UserContractUpdateInput
Field |
Type |
Description |
Label |
---|---|---|---|
address |
The user contract address that needs to be updated. |
||
code |
The byte array of the new user contract code. |
acs0.ReleaseContractInput
Field |
Type |
Description |
Label |
---|---|---|---|
proposal_id |
The hash of the proposal. |
||
proposed_contract_input_hash |
The id of the proposed contract. |
acs0.SystemContractDeploymentInput
Field |
Type |
Description |
Label |
---|---|---|---|
category |
The category of contract code(0: C#). |
||
code |
The byte array of the contract code. |
||
name |
The name of the contract. It has to be unique. |
||
transaction_method_call_list |
SystemContractDeploymentInput.SystemTransactionMethodCallList |
An initial list of transactions for the system contract, which is executed in sequence when the contract is deployed. |
acs0.SystemContractDeploymentInput.SystemTransactionMethodCall
Field |
Type |
Description |
Label |
---|---|---|---|
method_name |
The method name of system transaction. |
||
params |
The params of system transaction method. |
acs0.SystemContractDeploymentInput.SystemTransactionMethodCallList
Field |
Type |
Description |
Label |
---|---|---|---|
value |
The list of system transactions. |
repeated |
acs0.ValidateSystemContractAddressInput
Field |
Type |
Description |
Label |
---|---|---|---|
system_contract_hash_name |
The name hash of the contract. |
||
address |
The address of the contract. |
acs0.DeployUserSmartContractOutput
Field |
Type |
Description |
Label |
---|---|---|---|
code_hash |
The deployed or updated contract code hash. |
acs0.ContractOperation
Field |
Type |
Description |
Label |
---|---|---|---|
chain_id |
The ID of the chain where the contract is deployed/updated. |
||
code_hash |
The hash of the contract code. |
||
deployer |
The actual address that initiate the contract deployment. |
||
salt |
The hash based on which user contract address is generated. |
||
version |
The version of the deployed/updated contract. |
||
signature |
The signature for deployer verification. |
acs0.UserContractDeploymentInput
Field |
Type |
Description |
Label |
---|---|---|---|
category |
The category of contract code(0: C#). |
||
code |
The byte array of the contract code. |
||
salt |
The hash based on which user contract address is generated. |
AElf.Standards.ACS1
acs1.MethodFee
Field |
Type |
Description |
Label |
---|---|---|---|
symbol |
The token symbol of the method fee. |
||
basic_fee |
The amount of fees to be charged. |
acs1.MethodFees
Field |
Type |
Description |
Label |
---|---|---|---|
method_name |
The name of the method to be charged. |
||
fees |
List of fees to be charged. |
repeated |
|
is_size_fee_free |
Optional based on the implementation of SetMethodFee method. |
AElf.Types
aelf.Address
Field |
Type |
Description |
Label |
---|---|---|---|
value |
aelf.BinaryMerkleTree
Field |
Type |
Description |
Label |
---|---|---|---|
nodes |
The leaf nodes. |
repeated |
|
root |
The root node hash. |
||
leaf_count |
The count of leaf node. |
aelf.Hash
Field |
Type |
Description |
Label |
---|---|---|---|
value |
aelf.LogEvent
Field |
Type |
Description |
Label |
---|---|---|---|
address |
The contract address. |
||
name |
The name of the log event. |
||
indexed |
The indexed data, used to calculate bloom. |
repeated |
|
non_indexed |
The non indexed data. |
aelf.MerklePath
Field |
Type |
Description |
Label |
---|---|---|---|
merkle_path_nodes |
The merkle path nodes. |
repeated |
aelf.MerklePathNode
Field |
Type |
Description |
Label |
---|---|---|---|
hash |
The node hash. |
||
is_left_child_node |
Whether it is a left child node. |
aelf.SInt32Value
Field |
Type |
Description |
Label |
---|---|---|---|
value |
aelf.SInt64Value
Field |
Type |
Description |
Label |
---|---|---|---|
value |
aelf.ScopedStatePath
Field |
Type |
Description |
Label |
---|---|---|---|
address |
The scope address, which will be the contract address. |
||
path |
The path of contract state. |
aelf.SmartContractRegistration
Field |
Type |
Description |
Label |
---|---|---|---|
category |
The category of contract code(0: C#). |
||
code |
The byte array of the contract code. |
||
code_hash |
The hash of the contract code. |
||
is_system_contract |
Whether it is a system contract. |
||
version |
The version of the current contract. |
aelf.StatePath
Field |
Type |
Description |
Label |
---|---|---|---|
parts |
The partial path of the state path. |
repeated |
aelf.Transaction
Field |
Type |
Description |
Label |
---|---|---|---|
from |
The address of the sender of the transaction. |
||
to |
The address of the contract when calling a contract. |
||
ref_block_number |
The height of the referenced block hash. |
||
ref_block_prefix |
The first four bytes of the referenced block hash. |
||
method_name |
The name of a method in the smart contract at the To address. |
||
params |
The parameters to pass to the smart contract method. |
||
signature |
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
Field |
Type |
Description |
Label |
---|---|---|---|
writes |
The changed states. |
repeated |
|
reads |
The read states. |
repeated |
|
deletes |
The deleted states. |
repeated |
aelf.TransactionExecutingStateSet.DeletesEntry
Field |
Type |
Description |
Label |
---|---|---|---|
key |
|||
value |
aelf.TransactionExecutingStateSet.ReadsEntry
Field |
Type |
Description |
Label |
---|---|---|---|
key |
|||
value |
aelf.TransactionExecutingStateSet.WritesEntry
Field |
Type |
Description |
Label |
---|---|---|---|
key |
|||
value |
aelf.TransactionResult
Field |
Type |
Description |
Label |
---|---|---|---|
transaction_id |
The transaction id. |
||
status |
The transaction result status. |
||
logs |
The log events. |
repeated |
|
bloom |
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_value |
The return value of the transaction execution. |
||
block_number |
The height of the block hat packages the transaction. |
||
block_hash |
The hash of the block hat packages the transaction. |
||
error |
Failed execution error message. |
aelf.TransactionResultStatus
Name |
Number |
Description |
---|---|---|
NOT_EXISTED |
0 |
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. |