contract

package
v0.93.0-pre Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 1 Imported by: 41

Documentation

Overview

Package contract provides functions to work with contracts.

Index

Constants

View Source
const (
	ReadStates CallFlag = 1 << iota
	WriteStates
	AllowCall
	AllowNotify
	States            = ReadStates | WriteStates
	ReadOnly          = ReadStates | AllowCall
	All               = States | AllowCall | AllowNotify
	NoneFlag CallFlag = 0
)

Using `smartcontract` package from compiled contract requires moderate compiler refactoring, thus all flags are mirrored here.

Variables

This section is empty.

Functions

func Call added in v0.92.0

func Call(scriptHash interop.Hash160, method string, args ...interface{}) interface{}

Call executes previously deployed blockchain contract with specified hash (20 bytes in BE form) using provided arguments. It returns whatever this contract returns. This function uses `System.Contract.Call` syscall.

func CallEx added in v0.92.0

func CallEx(f CallFlag, scriptHash interop.Hash160, method string, args ...interface{}) interface{}

CallEx executes previously deployed blockchain contract with specified hash (20 bytes in BE form) using provided arguments and call flags. It returns whatever this contract returns. This function uses `System.Contract.CallEx` syscall.

func CreateStandardAccount added in v0.90.0

func CreateStandardAccount(pub interop.PublicKey) []byte

CreateStandardAccount calculates script hash of a given public key. This function uses `System.Contract.CreateStandardAccount` syscall.

func GetCallFlags added in v0.91.0

func GetCallFlags() int64

GetCallFlags returns calling flags which execution context was created with. This function uses `System.Contract.GetCallFlags` syscall.

func IsStandard added in v0.90.0

func IsStandard(h interop.Hash160) bool

IsStandard checks if contract with provided hash is a standard signature/multisig contract. This function uses `System.Contract.IsStandard` syscall.

Types

type CallFlag added in v0.92.0

type CallFlag byte

CallFlag specifies valid call flags.

Jump to

Keyboard shortcuts

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