Documentation ¶
Overview ¶
Package management provides an interface to ContractManagement native contract. It allows to get/deploy/update contracts as well as get/set deployment fee.
Index ¶
- Constants
- func Destroy()
- func GetContractHashes() iterator.Iterator
- func GetMinimumDeploymentFee() int
- func HasMethod(hash interop.Hash160, method string, pcount int) bool
- func SetMinimumDeploymentFee(value int)
- func Update(script, manifest []byte)
- func UpdateWithData(script, manifest []byte, data any)
- type ABI
- type Contract
- type Event
- type Group
- type IDHash
- type Manifest
- type Method
- type Parameter
- type ParameterType
- type Permission
Constants ¶
const Hash = "\xfd\xa3\xfa\x43\x46\xea\x53\x2a\x25\x8f\xc4\x97\xdd\xad\xdb\x64\x37\xc9\xfd\xff"
Hash represents Management contract hash.
Variables ¶
This section is empty.
Functions ¶
func GetContractHashes ¶
GetContractHashes represents `getContractHashes` method of the Management native contract. It returns an Iterator over the list of non-native contract hashes. Each iterator value can be cast to IDHash. Use iterator interop package to work with the returned Iterator.
func GetMinimumDeploymentFee ¶
func GetMinimumDeploymentFee() int
GetMinimumDeploymentFee represents `getMinimumDeploymentFee` method of Management native contract.
func HasMethod ¶
HasMethod represents `hasMethod` method of Management native contract. It allows to check if the "hash" contract has a method named "method" with parameters number equal to "pcount".
func SetMinimumDeploymentFee ¶
func SetMinimumDeploymentFee(value int)
SetMinimumDeploymentFee represents `setMinimumDeploymentFee` method of Management native contract.
func Update ¶
func Update(script, manifest []byte)
Update represents `update` method of Management native contract.
func UpdateWithData ¶
UpdateWithData represents `update` method of Management native contract.
Types ¶
type Contract ¶
Contract represents a deployed contract.
func DeployWithData ¶
DeployWithData represents `deploy` method of Management native contract.
func GetContract ¶
GetContract represents `getContract` method of Management native contract.
func GetContractByID ¶
GetContractByID represents `getContractById` method of the Management native contract.
type IDHash ¶
type IDHash struct { // ID is a 32-bit number, but it's represented in big endian form // natively, because that's the key scheme used by ContractManagement. ID []byte Hash interop.Hash160 }
IDHash is an ID/Hash pair returned by the iterator from the GetContractHashes method.
type Manifest ¶
type Manifest struct { Name string Groups []Group Features map[string]string SupportedStandards []string ABI ABI Permissions []Permission Trusts []interop.Hash160 Extra any }
Manifest represents contract's manifest.
type Method ¶
type Method struct { Name string Params []Parameter ReturnType ParameterType Offset int Safe bool }
Method represents a contract method.
type Parameter ¶
type Parameter struct { Name string Type ParameterType }
Parameter represents a method parameter.
type ParameterType ¶
type ParameterType byte
ParameterType represents smartcontract parameter type.
const ( AnyType ParameterType = 0x00 BoolType ParameterType = 0x10 IntegerType ParameterType = 0x11 ByteArrayType ParameterType = 0x12 StringType ParameterType = 0x13 Hash160Type ParameterType = 0x14 Hash256Type ParameterType = 0x15 PublicKeyType ParameterType = 0x16 SignatureType ParameterType = 0x17 ArrayType ParameterType = 0x20 MapType ParameterType = 0x22 InteropInterfaceType ParameterType = 0x30 VoidType ParameterType = 0xff )
Various parameter types.
type Permission ¶
Permission represents contract permission.