Documentation ¶
Index ¶
- func ContractParameterTypeToByte(c []ContractParameterType) []byte
- func CreateMultiSigRedeemScript(m int, pubkeys []*crypto.PubKey) ([]byte, error)
- func CreateSignatureRedeemScript(pubkey *crypto.PubKey) ([]byte, error)
- type Contract
- type ContractContext
- func (ctx *ContractContext) Add(contract *Contract, index int, parameter []byte) error
- func (ctx *ContractContext) AddContract(contract *Contract, pubkey *crypto.PubKey, parameter []byte) error
- func (ctx *ContractContext) AddMultiSignatures(index int, contract *Contract, pubkey *crypto.PubKey, parameter []byte) error
- func (ctx *ContractContext) AddSignatureToMultiList(contractIndex int, contract *Contract, pubkey *crypto.PubKey, parameter []byte) error
- func (ctx *ContractContext) GetIndex(programHash Uint160) int
- func (ctx *ContractContext) GetPrograms() []*pg.Program
- func (ctx *ContractContext) IsCompleted() bool
- func (ctx *ContractContext) ParseContractPubKeys(contract *Contract) (map[string]int, error)
- type ContractParameterType
- type ContractType
- type ParameterIndex
- type ParameterIndexSlice
- type PubkeyParameter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContractParameterTypeToByte ¶
func ContractParameterTypeToByte(c []ContractParameterType) []byte
Types ¶
type Contract ¶
type Contract struct { //the contract program code,which will be run on VM or specific envrionment Code []byte //the Contract Parameter type list // describe the number of contract program parameters and the parameter type Parameters []ContractParameterType //The program hash as contract address ProgramHash Uint160 //owner's pubkey hash indicate the owner of contract OwnerPubkeyHash Uint160 }
Contract include the program codes with parameters which can be executed on specific evnrioment
func CreateMultiSigContract ¶
func CreateMultiSigContract(publicKeyHash Uint160, m int, publicKeys []*crypto.PubKey) (*Contract, error)
create a Multi Singature contract for owner 。
func CreateSignatureContract ¶
create a Single Singature contract for owner
func (*Contract) GetType ¶
func (c *Contract) GetType() ContractType
func (*Contract) IsMultiSigContract ¶
func (*Contract) IsStandard ¶
type ContractContext ¶
type ContractContext struct { Data sig.SignableData ProgramHashes []Uint160 Codes [][]byte Parameters [][][]byte MultiPubkeyPara [][]PubkeyParameter // contains filtered or unexported fields }
func NewContractContext ¶
func NewContractContext(data sig.SignableData) *ContractContext
func (*ContractContext) Add ¶
func (ctx *ContractContext) Add(contract *Contract, index int, parameter []byte) error
func (*ContractContext) AddContract ¶
func (*ContractContext) AddMultiSignatures ¶
func (*ContractContext) AddSignatureToMultiList ¶
func (*ContractContext) GetIndex ¶
func (ctx *ContractContext) GetIndex(programHash Uint160) int
func (*ContractContext) GetPrograms ¶
func (ctx *ContractContext) GetPrograms() []*pg.Program
func (*ContractContext) IsCompleted ¶
func (ctx *ContractContext) IsCompleted() bool
func (*ContractContext) ParseContractPubKeys ¶
func (ctx *ContractContext) ParseContractPubKeys(contract *Contract) (map[string]int, error)
type ContractParameterType ¶
type ContractParameterType byte
parameter defined type.
const ( Signature ContractParameterType = iota Boolean Integer Hash160 Hash256 ByteArray PublicKey String Object Array = 0x10 Void = 0xff )
func ByteToContractParameterType ¶
func ByteToContractParameterType(b []byte) []ContractParameterType
type ContractType ¶
type ContractType byte
const ( SignatureContract ContractType = iota MultiSigContract CustomContract )
type ParameterIndex ¶
type ParameterIndexSlice ¶
type ParameterIndexSlice []ParameterIndex
func (ParameterIndexSlice) Len ¶
func (p ParameterIndexSlice) Len() int
func (ParameterIndexSlice) Less ¶
func (p ParameterIndexSlice) Less(i, j int) bool
func (ParameterIndexSlice) Swap ¶
func (p ParameterIndexSlice) Swap(i, j int)
type PubkeyParameter ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.