contract

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: MIT Imports: 7 Imported by: 73

Documentation

Index

Constants

View Source
const (
	CROSSCHAIN = 0xAF
)

Extension OP_CODE

Variables

This section is empty.

Functions

func CreateCrossChainRedeemScript added in v0.3.0

func CreateCrossChainRedeemScript(genesisHash common.Uint256) []byte

func CreateMultiSigRedeemScript added in v0.3.0

func CreateMultiSigRedeemScript(m int, pubkeys []*crypto.PublicKey) ([]byte, error)

func CreateStandardRedeemScript added in v0.3.0

func CreateStandardRedeemScript(pubKey *crypto.PublicKey) ([]byte, error)

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
	Prefix PrefixType
}

Contract include the redeem script and hash prefix

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 CreateMultiSigContract added in v0.3.0

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

func CreateMultiSigContractByCode added in v0.2.2

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

func CreateStandardContract added in v0.3.0

func CreateStandardContract(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

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