contract

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: MIT Imports: 8 Imported by: 73

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMultiSig added in v0.2.2

func IsMultiSig(code []byte) bool

func IsStandard added in v0.2.2

func IsStandard(code []byte) bool

func PublicKeyToDepositProgramHash added in v0.2.2

func PublicKeyToDepositProgramHash(pubKey []byte) (*common.Uint168, error)

func PublicKeyToStandardCodeHash added in v0.2.2

func PublicKeyToStandardCodeHash(pubKey []byte) (*common.Uint160, error)

func PublicKeyToStandardProgramHash added in v0.2.2

func PublicKeyToStandardProgramHash(pubKey []byte) (*common.Uint168, error)

Types

type Contract

type Contract struct {
	Code       []byte
	HashPrefix PrefixType
}

Contract include the redeem script and hash prefix

func CreateCrossChainContractByPubKey added in v0.2.2

func CreateCrossChainContractByPubKey(m int, pubkeys []*crypto.PublicKey) (*Contract, error)

func CreateDepositContractByCode added in v0.2.2

func CreateDepositContractByCode(code []byte) (*Contract, error)

func CreateDepositContractByPubKey added in v0.2.2

func CreateDepositContractByPubKey(pubkey *crypto.PublicKey) (*Contract, error)

func CreateMultiSigContractByCode added in v0.2.2

func CreateMultiSigContractByCode(code []byte) (*Contract, error)

func CreateMultiSigContractByPubKey added in v0.2.2

func CreateMultiSigContractByPubKey(m int, pubkeys []*crypto.PublicKey) (*Contract, error)

func CreateStandardContractByPubKey added in v0.2.2

func CreateStandardContractByPubKey(pubkey *crypto.PublicKey) (*Contract, error)

func (*Contract) ToCodeHash added in v0.2.2

func (c *Contract) ToCodeHash() *common.Uint160

func (*Contract) ToProgramHash added in v0.2.2

func (c *Contract) ToProgramHash() (*common.Uint168, error)

type ContractType added in v0.2.2

type ContractType byte
const (
	Signature ContractType = iota
	MultiSig
	Custom
)

func GetCodeType added in v0.2.2

func GetCodeType(code []byte) ContractType

type PrefixType added in v0.2.2

type PrefixType byte
const (
	PrefixStandard   PrefixType = 0x21
	PrefixMultiSig   PrefixType = 0x12
	PrefixCrossChain PrefixType = 0x4B
	PrefixDeposit    PrefixType = 0x1F
)

func GetPrefixType added in v0.2.2

func GetPrefixType(programHash common.Uint168) PrefixType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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