ACS7 - Contract CrossChain Standard
ACS7 is for cross chain related contract implementation.
This involves methods for chain creation and indexing:
acs7.AdjustIndexingFeeInput
Field
Type
Description
Label
side_chain_id
int32
The side chain id to adjust.
indexing_fee
int64
The new price of indexing fee.
acs7.ChainIdAndHeightDict
acs7.ChainIdAndHeightDict.IdHeightDictEntry
Field
Type
Description
Label
key
int32
value
int64
acs7.ChainInitializationConsensusInfo
Field
Type
Description
Label
initial_consensus_data
bytes
Initial consensus data.
acs7.ChainInitializationData
Field
Type
Description
Label
chain_id
int32
The id of side chain.
creator
aelf.Address
The side chain creator.
creation_timestamp
google.protobuf.Timestamp
The timestamp for side chain creation.
creation_height_on_parent_chain
int64
The height of side chain creation on parent chain.
chain_creator_privilege_preserved
bool
Creator privilege boolean flag: True if chain creator privilege preserved, otherwise false.
parent_chain_token_contract_address
aelf.Address
Parent chain token contract address.
chain_initialization_consensus_info
ChainInitializationConsensusInfo
Initial consensus information.
native_token_info_data
bytes
The native token info.
resource_token_info
ResourceTokenInfo
The resource token information.
chain_primary_token_info
ChainPrimaryTokenInfo
The chain primary token information.
acs7.ChainPrimaryTokenInfo
Field
Type
Description
Label
chain_primary_token_data
bytes
The side chain primary token data.
side_chain_token_initial_issue_list
SideChainTokenInitialIssue
The side chain primary token initial issue list.
repeated
acs7.CreateSideChainInput
Field
Type
Description
Label
side_chain_creation_request
SideChainCreationRequest
The request information of the side chain creation.
proposer
aelf.Address
The proposer of the side chain creation.
Field
Type
Description
Label
side_chain_block_data_list
SideChainBlockData
The side chain block data list to index.
repeated
parent_chain_block_data_list
ParentChainBlockData
The parent chain block data list to index.
repeated
Field
Type
Description
Label
transaction_status_merkle_tree_root
aelf.Hash
Merkle tree root of side chain block transaction status root.
acs7.CrossChainIndexingDataProposedEvent
Field
Type
Description
Label
proposed_cross_chain_data
CrossChainBlockData
Proposed cross chain data to be indexed.
proposal_id
aelf.Hash
The proposal id.
acs7.CrossChainMerkleProofContext
Field
Type
Description
Label
bound_parent_chain_height
int64
The height of parent chain bound up with side chain.
merkle_path_from_parent_chain
aelf.MerklePath
The merkle path generated from parent chain.
acs7.IndexedParentChainBlockData
Field
Type
Description
Label
local_chain_height
int64
The height of the local chain when indexing the parent chain.
parent_chain_block_data_list
ParentChainBlockData
Parent chain block data.
repeated
acs7.IndexedSideChainBlockData
Field
Type
Description
Label
side_chain_block_data_list
SideChainBlockData
Side chain block data.
repeated
acs7.ParentChainBlockData
acs7.ParentChainBlockData.IndexedMerklePathEntry
Field
Type
Description
Label
chain_id
int32
The chain id to recharge.
amount
int64
The amount to recharge.
acs7.ReleaseCrossChainIndexingProposalInput
Field
Type
Description
Label
chain_id_list
int32
List of chain ids to release.
repeated
acs7.ReleaseSideChainCreationInput
Field
Type
Description
Label
proposal_id
aelf.Hash
The proposal id of side chain creation.
acs7.ResourceTokenInfo.InitialResourceAmountEntry
Field
Type
Description
Label
height
int64
The height of side chain block.
block_header_hash
aelf.Hash
The hash of side chain block.
transaction_status_merkle_tree_root
aelf.Hash
The merkle tree root computing from transactions status in side chain block.
chain_id
int32
The id of side chain.
acs7.SideChainBlockDataIndexed
acs7.SideChainCreationRequest
Field
Type
Description
Label
indexing_price
int64
The cross chain indexing price.
locked_token_amount
int64
Initial locked balance for a new side chain.
is_privilege_preserved
bool
Creator privilege boolean flag: True if chain creator privilege preserved, otherwise false.
side_chain_token_creation_request
SideChainTokenCreationRequest
Side chain token information.
side_chain_token_initial_issue_list
SideChainTokenInitialIssue
A list of accounts and amounts that will be issued when the chain starts.
repeated
initial_resource_amount
SideChainCreationRequest.InitialResourceAmountEntry
The initial rent resources.
repeated
acs7.SideChainCreationRequest.InitialResourceAmountEntry
acs7.SideChainIndexingInformation
Field
Type
Description
Label
chain_id
int32
The side chain id.
indexed_height
int64
The indexed height.
acs7.SideChainIndexingInformationList
Field
Type
Description
Label
indexing_information_list
SideChainIndexingInformation
A list contains indexing information of side chains.
repeated
acs7.SideChainTokenCreationRequest
Field
Type
Description
Label
side_chain_token_symbol
string
Token symbol of the side chain to be created
side_chain_token_name
string
Token name of the side chain to be created
side_chain_token_total_supply
int64
Token total supply of the side chain to be created
side_chain_token_decimals
int32
Token decimals of the side chain to be created
acs7.SideChainTokenInitialIssue
Field
Type
Description
Label
address
aelf.Address
The account that will be issued.
amount
int64
The amount that will be issued.
acs7.VerifyTransactionInput
Field
Type
Description
Label
transaction_id
aelf.Hash
The cross chain transaction id to verify.
path
aelf.MerklePath
The merkle path of the transaction.
parent_chain_height
int64
The height of parent chain that indexing this transaction.
verified_chain_id
int32
The chain if to verify.
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.
ACS7 declares methods for the scenes about cross chain. AElf provides the implementation for ACS7, CrossChainContract
. You can refer to the implementation of the Cross chain contract api<../smart-contract-api/cross-chain>
.