Documentation ¶
Overview ¶
Package interop contains smart contract API functions and type synonyms. Its subpackages can be imported into smart contracts written in Go to provide various functionality. Upon compilation, functions from these packages will be substituted with appropriate NeoVM system calls implemented by Neo. Usually these system calls have additional price in NeoVM, so they're explicitly written in the documentation of respective functions.
Types defined here are used for proper manifest generation. Here is how Go types correspond to smartcontract and VM types:
int-like - Integer bool - Boolean []byte - ByteArray (Buffer in VM) string - String (ByteString in VM) (interface{})(nil) - Any non-byte slice - Array map[K]V - map
Other types are defined explicitly in this pkg:
Hash160, Hash256, Interface, PublicKey, Signature
Note that unless written otherwise structures defined in this packages can't be correctly created by new() or composite literals, they should be received from some interop functions (and then used as parameters for some other interop functions).
Index ¶
Constants ¶
const ( // Hash160Len is the length of proper Hash160 in bytes, use it to // sanitize input parameters. Hash160Len = 20 // Hash256Len is the length of proper Hash256 in bytes, use it to // sanitize input parameters. Hash256Len = 32 // PublicKeyCompressedLen is the length of compressed public key (which // is the most common public key type), use it to sanitize input // parameters. PublicKeyCompressedLen = 33 // PublicKeyUncompressedLen is the length of uncompressed public key // (but you're not likely to ever encounter that), use it to sanitize // input parameters. PublicKeyUncompressedLen = 65 // SignatureLen is the length of standard signature, use it to sanitize // input parameters. SignatureLen = 64 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Directories ¶
Path | Synopsis |
---|---|
Package contract provides functions to work with contracts.
|
Package contract provides functions to work with contracts. |
Package convert provides functions for type conversion.
|
Package convert provides functions for type conversion. |
Package crypto provides an interface to cryptographic syscalls.
|
Package crypto provides an interface to cryptographic syscalls. |
Package iterator provides functions to work with Neo iterators.
|
Package iterator provides functions to work with Neo iterators. |
Package math provides access to useful numeric functions available in Neo VM.
|
Package math provides access to useful numeric functions available in Neo VM. |
native
|
|
crypto
Package crypto provides interface to CryptoLib native contract.
|
Package crypto provides interface to CryptoLib native contract. |
gas
Package gas provides interface to GasToken native contract.
|
Package gas provides interface to GasToken native contract. |
ledger
Package ledger provides interface to LedgerContract native contract.
|
Package ledger provides interface to LedgerContract native contract. |
management
Package management provides interface to ContractManagement native contract.
|
Package management provides interface to ContractManagement native contract. |
neo
Package neo provides interface to NeoToken native contract.
|
Package neo provides interface to NeoToken native contract. |
notary
Package notary provides interface to Notary native contract.
|
Package notary provides interface to Notary native contract. |
oracle
Package oracle provides interface to OracleContract native contract.
|
Package oracle provides interface to OracleContract native contract. |
policy
Package policy provides interface to PolicyContract native contract.
|
Package policy provides interface to PolicyContract native contract. |
roles
Package roles provides interface to RoleManagement native contract.
|
Package roles provides interface to RoleManagement native contract. |
std
Package std provides interface to StdLib native contract.
|
Package std provides interface to StdLib native contract. |
Package neogointernal contains definitions of compiler intrinsics.
|
Package neogointernal contains definitions of compiler intrinsics. |
Package runtime provides various service functions related to execution environment.
|
Package runtime provides various service functions related to execution environment. |
Package storage provides functions to access and modify contract's storage.
|
Package storage provides functions to access and modify contract's storage. |
Package util contains some special useful functions that are provided by compiler and VM.
|
Package util contains some special useful functions that are provided by compiler and VM. |