common

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: GPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const OwnerKey = "contractOwner"

Variables

This section is empty.

Functions

func AlphabetAddress added in v0.6.0

func AlphabetAddress() []byte

AlphabetAddress returns multi address of alphabet public keys.

func BurnTransferDetails added in v0.7.0

func BurnTransferDetails(txDetails []byte) []byte

func BytesEqual

func BytesEqual(a []byte, b []byte) bool

BytesEqual compares two slice of bytes by wrapping them into strings, which is necessary with new util.Equal interop behaviour, see neo-go#1176.

func ContainerFeeTransferDetails added in v0.7.0

func ContainerFeeTransferDetails(cid []byte) []byte

func FromKnownContract added in v0.7.0

func FromKnownContract(ctx storage.Context, caller interop.Hash160, key string) bool

func GetList

func GetList(ctx storage.Context, key interface{}) [][]byte

func HasUpdateAccess

func HasUpdateAccess(ctx storage.Context) bool

HasUpdateAccess returns true if contract can be initialized, re-initialized or migrated.

func InitVote

func InitVote(ctx storage.Context)

func InnerRingInvoker

func InnerRingInvoker(ir []IRNode) interop.PublicKey

InnerRingInvoker returns public key of inner ring node that invoked contract. Work around for environments without notary support.

func InvokeID

func InvokeID(args []interface{}, prefix []byte) []byte

InvokeID returns hashed value of prefix and args concatenation. Used to identify different ballots.

func LockTransferDetails added in v0.7.0

func LockTransferDetails(txDetails []byte) []byte

func MintTransferDetails added in v0.7.0

func MintTransferDetails(txDetails []byte) []byte

func Multiaddress added in v0.6.0

func Multiaddress(n []interop.PublicKey, committee bool) []byte

Multiaddress returns default multi signature account address for N keys. If committee set to true, then it is `M = N/2+1` committee account.

func RemoveVotes

func RemoveVotes(ctx storage.Context, id []byte)

RemoveVotes clears ballots of the decision that has been accepted by inner ring nodes.

func SetSerialized

func SetSerialized(ctx storage.Context, key interface{}, value interface{})

SetSerialized serializes data and puts it into contract storage.

func UnlockTransferDetails added in v0.7.0

func UnlockTransferDetails(epoch int) []byte

func Vote

func Vote(ctx storage.Context, id, from []byte) int

Vote adds ballot for the decision with specific 'id' and returns amount on unique voters for that decision.

func WalletToScriptHash added in v0.7.0

func WalletToScriptHash(wallet []byte) []byte

Types

type Ballot

type Ballot struct {
	// ID of the voting decision.
	ID []byte

	// Public keys of already voted inner ring nodes.
	Voters []interop.PublicKey

	// Height of block with the last vote.
	Height int
}

type IRNode

type IRNode struct {
	PublicKey interop.PublicKey
}

func AlphabetNodes added in v0.6.0

func AlphabetNodes() []IRNode

AlphabetNodes return list of alphabet nodes from committee in side chain.

func InnerRingNodes added in v0.6.0

func InnerRingNodes() []IRNode

InnerRingNodes return list of inner ring nodes from state validator role in side chain.

func InnerRingNodesFromNetmap added in v0.7.0

func InnerRingNodesFromNetmap(sc interop.Hash160) []IRNode

InnerRingNodesFromNetmap gets list of inner ring through calling "innerRingList" method of smart contract. Work around for environments without notary support.

Jump to

Keyboard shortcuts

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