ACS0 - Contract Deployment Standard
ACS0 is used to manage the deployment and update of contracts.
Interface
The contract inherited from ACS0 need implement the following interfaces:
Methods
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. |
Types
acs0.DeployUserSmartContractOutput
Field |
Type |
Description |
Label |
---|---|---|---|
code_hash |
The deployed or updated contract code hash. |
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. |
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. |
Example
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.