contract

package
v0.97.3-pre Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 2 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, f CallFlag, args ...interface{}) interface{}

Call 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.Call` syscall.

func CreateMultisigAccount added in v0.94.0

func CreateMultisigAccount(m int, pubs []interop.PublicKey) []byte

CreateMultisigAccount calculates script hash of an m out of n multisignature script using given m and a set of public keys bytes. This function uses `System.Contract.CreateMultisigAccount` 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.

Types

type CallFlag added in v0.92.0

type CallFlag byte

CallFlag specifies valid call flags.

func GetCallFlags added in v0.91.0

func GetCallFlags() CallFlag

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

Jump to

Keyboard shortcuts

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