ACS0 - Contract Deployment Standard
ACS0 is used to manage the deployment and update of contracts.
The contract inherited from ACS0 need implement the following interfaces:
Field
Type
Description
Label
code
bytes
The byte array of the contract code.
proposed_contract_input_hash
aelf.Hash
The id of the proposed contract.
category
sint32
The category of contract code(0: C#).
is_system_contract
bool
Indicates if the contract is the system contract.
Field
Type
Description
Label
address
aelf.Address
The address of the updated contract.
old_code_hash
aelf.Hash
The byte array of the old contract code.
new_code_hash
aelf.Hash
The byte array of the new contract code.
version
int32
The version of the current contract.
acs0.ContractCodeCheckInput
Field
Type
Description
Label
contract_input
bytes
The byte array of the contract code to be checked.
is_contract_deployment
bool
Whether the input contract is to be deployed or updated.
code_check_release_method
string
Method to call after code check complete(DeploySmartContract or UpdateSmartContract).
proposed_contract_input_hash
aelf.Hash
The id of the proposed contract.
category
sint32
The category of contract code(0: C#).
is_system_contract
bool
Indicates if the contract is the system contract.
Field
Type
Description
Label
author
aelf.Address
The author of the contract, this is the person who deployed the contract.
code_hash
aelf.Hash
The hash of the contract code.
address
aelf.Address
The address of the contract.
version
int32
The version of the current contract.
Name
aelf.Hash
The name of the contract. It has to be unique.
acs0.ContractDeploymentInput
Field
Type
Description
Label
category
sint32
The category of contract code(0: C#).
code
bytes
The byte array of the contract code.
Field
Type
Description
Label
serial_number
int64
The serial number of the contract.
author
aelf.Address
The author of the contract, this is the person who deployed the contract.
category
sint32
The category of contract code(0: C#).
code_hash
aelf.Hash
The hash of the contract code.
is_system_contract
bool
Whether it is a system contract.
version
int32
The version of the current contract.
Field
Type
Description
Label
proposed_contract_input_hash
aelf.Hash
The id of the proposed contract.
Field
Type
Description
Label
address
aelf.Address
The contract address that needs to be updated.
code
bytes
The byte array of the new contract code.
acs0.ReleaseContractInput
Field
Type
Description
Label
proposal_id
aelf.Hash
The hash of the proposal.
proposed_contract_input_hash
aelf.Hash
The id of the proposed contract.
acs0.SystemContractDeploymentInput
acs0.SystemContractDeploymentInput.SystemTransactionMethodCall
Field
Type
Description
Label
method_name
string
The method name of system transaction.
params
bytes
The params of system transaction method.
acs0.SystemContractDeploymentInput.SystemTransactionMethodCallList
acs0.ValidateSystemContractAddressInput
Field
Type
Description
Label
system_contract_hash_name
aelf.Hash
The name hash of the contract.
address
aelf.Address
The address of the contract.
Field
Type
Description
Label
value
bytes
Field
Type
Description
Label
nodes
Hash
The leaf nodes.
repeated
root
Hash
The root node hash.
leaf_count
int32
The count of leaf node.
Field
Type
Description
Label
value
bytes
Field
Type
Description
Label
address
Address
The contract address.
name
string
The name of the log event.
indexed
bytes
The indexed data, used to calculate bloom.
repeated
non_indexed
bytes
The non indexed data.
Field
Type
Description
Label
merkle_path_nodes
MerklePathNode
The merkle path nodes.
repeated
Field
Type
Description
Label
hash
Hash
The node hash.
is_left_child_node
bool
Whether it is a left child node.
Field
Type
Description
Label
value
sint32
Field
Type
Description
Label
value
sint64
Field
Type
Description
Label
address
Address
The scope address, which will be the contract address.
path
StatePath
The path of contract state.
aelf.SmartContractRegistration
Field
Type
Description
Label
category
sint32
The category of contract code(0: C#).
code
bytes
The byte array of the contract code.
code_hash
Hash
The hash of the contract code.
is_system_contract
bool
Whether it is a system contract.
version
int32
The version of the current contract.
Field
Type
Description
Label
parts
string
The partial path of the state path.
repeated
Field
Type
Description
Label
from
Address
The address of the sender of the transaction.
to
Address
The address of the contract when calling a contract.
ref_block_number
int64
The height of the referenced block hash.
ref_block_prefix
bytes
The first four bytes of the referenced block hash.
method_name
string
The name of a method in the smart contract at the To address.
params
bytes
The parameters to pass to the smart contract method.
signature
bytes
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
aelf.TransactionExecutingStateSet.DeletesEntry
Field
Type
Description
Label
key
string
value
bool
aelf.TransactionExecutingStateSet.ReadsEntry
Field
Type
Description
Label
key
string
value
bool
aelf.TransactionExecutingStateSet.WritesEntry
Field
Type
Description
Label
transaction_id
Hash
The transaction id.
status
TransactionResultStatus
The transaction result status.
logs
LogEvent
The log events.
repeated
bloom
bytes
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
bytes
The return value of the transaction execution.
block_number
int64
The height of the block hat packages the transaction.
block_hash
Hash
The hash of the block hat packages the transaction.
error
string
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.
ACS0 declares methods for the scenes about contract deployment and update. AElf provides the implementation for ACS0, Genesis Contract
. You can refer to the implementation of the Genesis contract api<../smart-contract-api/genesis>
.