management

package
v0.97.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2021 License: MIT Imports: 2 Imported by: 40

Documentation

Overview

Package management provides interface to ContractManagement native contract. It allows to get/deploy/update contracts as well as get/set deployment fee.

Index

Constants

View Source
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 Destroy

func Destroy()

Destroy represents `destroy` method of Management native contract.

func GetMinimumDeploymentFee

func GetMinimumDeploymentFee() int

GetMinimumDeploymentFee represents `getMinimumDeploymentFee` method of Management native contract.

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

func UpdateWithData(script, manifest []byte, data interface{})

UpdateWithData represents `update` method of Management native contract.

Types

type ABI

type ABI struct {
	Methods []Method
	Events  []Event
}

ABI represents contract's ABI.

type Contract

type Contract struct {
	ID            int
	UpdateCounter int
	Hash          interop.Hash160
	NEF           []byte
	Manifest      Manifest
}

Contract represents deployed contract.

func Deploy

func Deploy(script, manifest []byte) *Contract

Deploy represents `deploy` method of Management native contract.

func DeployWithData

func DeployWithData(script, manifest []byte, data interface{}) *Contract

DeployWithData represents `deploy` method of Management native contract.

func GetContract

func GetContract(addr interop.Hash160) *Contract

GetContract represents `getContract` method of Management native contract.

type Event

type Event struct {
	Name   string
	Params []Parameter
}

Event represents contract event.

type Group

type Group struct {
	PublicKey interop.PublicKey
	Signature interop.Signature
}

Group represents manifest group.

type Manifest

type Manifest struct {
	Name               string
	Groups             []Group
	Features           map[string]string
	SupportedStandards []string
	ABI                ABI
	Permissions        []Permission
	Trusts             []interop.Hash160
	Extra              interface{}
}

Manifest represents contract's manifest.

type Method

type Method struct {
	Name       string
	Params     []Parameter
	ReturnType ParameterType
	Offset     int
	Safe       bool
}

Method represents contract method.

type Parameter

type Parameter struct {
	Name string
	Type ParameterType
}

Parameter represents 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

type Permission struct {
	Contract interop.Hash160
	Methods  []string
}

Permission represents contract permission.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL