contract

package
v0.0.0-...-5566e35 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 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

func Call(scriptHash interop.Hash160, method string, f CallFlag, args ...any) any

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

func CreateMultisigAccount

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

CreateMultisigAccount calculates a script hash of an m out of n multisignature script using the given m and a set of public keys bytes. This function uses `System.Contract.CreateMultisigAccount` syscall.

func CreateStandardAccount

func CreateStandardAccount(pub interop.PublicKey) []byte

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

Types

type CallFlag

type CallFlag byte

CallFlag specifies valid call flags.

func GetCallFlags

func GetCallFlags() CallFlag

GetCallFlags returns the 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