Documentation ¶
Index ¶
- func ContractParameterTypeToByte(c []ContractParameterType) []byte
- func CreateMultiSigRedeemScript(m int, pubkeys []keypair.PublicKey) ([]byte, error)
- func CreateSignatureRedeemScript(pubkey keypair.PublicKey) ([]byte, error)
- type Contract
- type ContractContext
- func (cxt *ContractContext) Add(contract *Contract, index int, parameter []byte) error
- func (cxt *ContractContext) AddContract(contract *Contract, pubkey keypair.PublicKey, parameter []byte) error
- func (cxt *ContractContext) AddMultiSignatures(index int, contract *Contract, pubkey keypair.PublicKey, parameter []byte) error
- func (cxt *ContractContext) AddSignatureToMultiList(contractIndex int, contract *Contract, pubkey keypair.PublicKey, ...) error
- func (cxt *ContractContext) GetIndex(programHash common.Address) int
- func (cxt *ContractContext) GetPrograms() []*pg.Program
- func (cxt *ContractContext) IsCompleted() bool
- func (cxt *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 common.Address //owner's pubkey hash indicate the owner of contract OwnerPubkeyHash common.Address }
Contract include the program codes with parameters which can be executed on specific evnrioment
func CreateMultiSigContract ¶
func CreateMultiSigContract(publicKeyHash common.Address, m int, publicKeys []keypair.PublicKey) (*Contract, error)
create a Multi Signature contract for owner 。
func CreateSignatureContract ¶
create a Single Signature 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 []common.Address Codes [][]byte Parameters [][][]byte MultiPubkeyPara [][]PubkeyParameter // contains filtered or unexported fields }
func NewContractContext ¶
func NewContractContext(data sig.SignableData) *ContractContext
func (*ContractContext) Add ¶
func (cxt *ContractContext) Add(contract *Contract, index int, parameter []byte) error
func (*ContractContext) AddContract ¶
func (*ContractContext) AddMultiSignatures ¶
func (*ContractContext) AddSignatureToMultiList ¶
func (*ContractContext) GetIndex ¶
func (cxt *ContractContext) GetIndex(programHash common.Address) int
func (*ContractContext) GetPrograms ¶
func (cxt *ContractContext) GetPrograms() []*pg.Program
func (*ContractContext) IsCompleted ¶
func (cxt *ContractContext) IsCompleted() bool
func (*ContractContext) ParseContractPubKeys ¶
func (cxt *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 Array = 0x10 InteropInterface = 0xf0 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.