Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Magic is a magic File header constant. Magic uint32 = 0x3346454E // MaxScriptLength is the maximum allowed contract script length. MaxScriptLength = 512 * 1024 // MaxSourceURLLength is the maximum allowed source URL length. MaxSourceURLLength = 256 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { Header Source string `json:"source"` Tokens []MethodToken `json:"tokens"` Script []byte `json:"script"` Checksum uint32 `json:"checksum"` }
File represents compiled contract file structure according to the NEF3 standard.
func FileFromBytes ¶
FileFromBytes returns NEF File deserialized from given bytes.
func (*File) CalculateChecksum ¶ added in v0.92.0
CalculateChecksum returns first 4 bytes of double-SHA256(Header) converted to uint32.
func (*File) DecodeBinary ¶
DecodeBinary implements io.Serializable interface.
func (*File) EncodeBinary ¶
EncodeBinary implements io.Serializable interface.
type Header ¶
Header represents File header.
func (*Header) DecodeBinary ¶
DecodeBinary implements io.Serializable interface.
func (*Header) EncodeBinary ¶
EncodeBinary implements io.Serializable interface.
type MethodToken ¶ added in v0.93.0
type MethodToken struct { // Hash is contract hash. Hash util.Uint160 `json:"hash"` // Method is method name. Method string `json:"method"` // ParamCount is method parameter count. ParamCount uint16 `json:"paramcount"` // HasReturn is true if method returns value. HasReturn bool `json:"hasreturnvalue"` // CallFlag is a set of call flags the method will be called with. CallFlag callflag.CallFlag `json:"callflags"` }
MethodToken is contract method description.
func (*MethodToken) DecodeBinary ¶ added in v0.93.0
func (t *MethodToken) DecodeBinary(r *io.BinReader)
DecodeBinary implements io.Serializable.
func (*MethodToken) EncodeBinary ¶ added in v0.93.0
func (t *MethodToken) EncodeBinary(w *io.BinWriter)
EncodeBinary implements io.Serializable.
Click to show internal directories.
Click to hide internal directories.