- class ContractManifest
Represents the manifest of a smart contract 1.
When a smart contract is deployed, it must explicitly declare the features and permissions it will use.
When it is running, it will be limited by its declared list of features and permissions, and cannot make any behavior beyond the scope of the list.
For more details, see NEP-15.
name (str) – The name of the contract.
groups (List[ContractGroup]) – The groups of the contract.
supported_standards (List[str]) – Indicates which standards the contract supports. It can be a list of NEPs.
abi (ContractAbi) – The ABI of the contract.
permissions (List[ContractPermission]) – The permissions of the contract.
trusts (List[ContractPermissionDescriptor] or None) –
The trusted contracts and groups of the contract.
If a contract is trusted, the user interface will not give any warnings when called by the contract.
extras (str) – Custom user data as a json string.
- class ContractPermission
Represents a permission of a contract. It describes which contracts may be invoked and which methods are called.
If a contract invokes a contract or method that is not declared in the manifest at runtime, the invocation will fail.
contract (ContractPermissionDescriptor or None) –
Indicates which contract to be invoked.
It can be a hash of a contract, a public key of a group, or a wildcard *.
If it specifies a hash of a contract, then the contract will be invoked; If it specifies a public key of a group, then any contract in this group may be invoked; If it specifies a wildcard *, then any contract may be invoked.
methods (List[str] or None) –
Indicates which methods to be called.
- class ContractPermissionDescriptor
Indicates which contracts are authorized to be called.
- class ContractGroup
Represents a set of mutually trusted contracts.
A contract will trust and allow any contract in the same group to invoke it, and the user interface will not give any warnings.
A group is identified by a public key and must be accompanied by a signature for the contract hash to prove that the contract is indeed included in the group.
- class ContractAbi
Represents the ABI of a smart contract 2.
For more details, see NEP-14.
- class ContractMethodDescriptor
Represents a method in a smart contract ABI.
name (str) – The name of the method.
parameters (List[ContractParameterDefinition]) – The parameters of the method.
return_type (ContractParameterType) – Indicates the return type of the method.
offset (int) – The position of the method in the contract script.
safe (bool) –
Indicates whether the method is a safe method.
If a method is marked as safe, the user interface will not give any warnings when it is called by other contracts.
- class ContractEventDescriptor
Represents an event in a smart contract ABI.