contractmanagement¶
- class ContractManagement¶
Bases:
object
A class used to represent the ContractManagement native contract
- classmethod get_minimum_deployment_fee() → int¶
Gets the minimum fee of contract deployment.
- Returns
the minimum fee of contract deployment
- classmethod get_contract(script_hash: boa3.builtin.type.UInt160) → boa3.builtin.interop.contract.contract.Contract¶
Gets a contract with a given hash.
- classmethod has_method(hash: boa3.builtin.type.UInt160, method: str, parameter_count: int) → bool¶
Check if a method exists in a contract.
- Parameters
- Returns
whether the method exists or not
- Return type
- Raises
Exception – raised if hash length isn’t 20 bytes or if the parameter_count is less than 0.
- classmethod deploy(nef_file: bytes, manifest: bytes, data: Optional[Any] = None) → boa3.builtin.interop.contract.contract.Contract¶
Creates a smart contract given the script and the manifest.
- Parameters
- Returns
the contract that was created
- Return type
- Raises
Exception – raised if the nef or the manifest are not a valid smart contract.
- classmethod update(nef_file: bytes, manifest: bytes, data: Optional[Any] = None)¶
Updates the executing smart contract given the script and the manifest.
- Parameters
- Raises
Exception – raised if the nef and the manifest are not a valid smart contract or the new contract is the same as the old one.
- classmethod destroy()¶
Destroy the executing smart contract.
- class Contract¶
Bases:
object
Represents a contract that can be invoked.
- Variables
id (int) – the serial number of the contract
update_counter (int) – the number of times the contract was updated
hash (UInt160) – the hash of the contract
nef (bytes) – the serialized Neo Executable Format (NEF) object holding of the smart contract code and compiler information
manifest (ContractManifest) – the manifest of the contract