Documentation ¶
Index ¶
- func CreateMultiSigRedeemScript(m int, publicKeys keys.PublicKeys) ([]byte, error)
- func GetDeploymentPrice(props PropertyState) util.Fixed8
- type ParamType
- func (pt *ParamType) DecodeBinary(r *io.BinReader)
- func (pt ParamType) EncodeBinary(w *io.BinWriter)
- func (pt ParamType) MarshalJSON() ([]byte, error)
- func (pt *ParamType) MarshalYAML() (interface{}, error)
- func (pt ParamType) String() string
- func (pt *ParamType) UnmarshalJSON(data []byte) error
- func (pt *ParamType) UnmarshalYAML(unmarshal func(interface{}) error) error
- type Parameter
- type Params
- type PropertyState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMultiSigRedeemScript ¶
func CreateMultiSigRedeemScript(m int, publicKeys keys.PublicKeys) ([]byte, error)
CreateMultiSigRedeemScript creates a script runnable by the VM.
func GetDeploymentPrice ¶
func GetDeploymentPrice(props PropertyState) util.Fixed8
GetDeploymentPrice returns contract deployment price based on its properties.
Types ¶
type ParamType ¶
type ParamType int
ParamType represents the Type of the smart contract parameter.
const ( UnknownType ParamType = -1 SignatureType ParamType = 0x00 BoolType ParamType = 0x01 IntegerType ParamType = 0x02 Hash160Type ParamType = 0x03 Hash256Type ParamType = 0x04 ByteArrayType ParamType = 0x05 PublicKeyType ParamType = 0x06 StringType ParamType = 0x07 ArrayType ParamType = 0x10 MapType ParamType = 0x12 InteropInterfaceType ParamType = 0xf0 VoidType ParamType = 0xff )
A list of supported smart contract parameter types.
func ParseParamType ¶
ParseParamType is a user-friendly string to ParamType converter, it's case-insensitive and makes the following conversions:
signature -> SignatureType bool, boolean -> BoolType int, integer -> IntegerType hash160 -> Hash160Type hash256 -> Hash256Type bytes, bytearray -> ByteArrayType key, publickey -> PublicKeyType string -> StringType array, struct -> ArrayType map -> MapType interopinterface -> InteropInterfaceType void -> VoidType
anything else generates an error.
func (*ParamType) DecodeBinary ¶
DecodeBinary implements io.Serializable interface.
func (ParamType) EncodeBinary ¶
EncodeBinary implements io.Serializable interface.
func (ParamType) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*ParamType) MarshalYAML ¶
MarshalYAML implements the YAML Marshaler interface.
func (*ParamType) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface.
func (*ParamType) UnmarshalYAML ¶
UnmarshalYAML implements the YAML Unmarshaler interface.
type Parameter ¶
type Parameter struct { // Type of the parameter. Type ParamType `json:"type"` // The actual value of the parameter. Value interface{} `json:"value"` }
Parameter represents a smart contract parameter.
func NewParameter ¶
NewParameter returns a Parameter with proper initialized Value of the given ParamType.
func NewParameterFromString ¶
NewParameterFromString returns a new Parameter initialized from the given string in neo-go-specific format. It is intended to be used in user-facing interfaces and has some heuristics in it to simplify parameter passing. Exact syntax is documented in the cli documentation.
func (*Parameter) MarshalJSON ¶
MarshalJSON implements Marshaler interface.
func (*Parameter) UnmarshalJSON ¶
UnmarshalJSON implements Unmarshaler interface.
type Params ¶
type Params []Parameter
Params is an array of Parameter (TODO: drop it?).
func (Params) TryParseArray ¶
TryParseArray converts an array of Parameter into an array of more appropriate things.
type PropertyState ¶
type PropertyState byte
PropertyState represents contract properties (flags).
const ( HasStorage PropertyState = 1 << iota HasDynamicInvoke IsPayable NoProperties = 0 )
List of supported properties.