neo-go/pkg/interop/native/management/contract.go
Anna Shaleva 6b21ad9922 *: replace interface{} with any keyword
Everywhere including examples, external interop APIs, bindings generators
code and in other valuable places. A couple of `interface{}` usages are
intentionally left in the CHANGELOG.md, documentation and tests.
2023-04-04 13:22:42 +03:00

83 lines
1.9 KiB
Go

package management
import "github.com/nspcc-dev/neo-go/pkg/interop"
// Contract represents a deployed contract.
type Contract struct {
ID int
UpdateCounter int
Hash interop.Hash160
NEF []byte
Manifest Manifest
}
// ParameterType represents smartcontract parameter type.
type ParameterType byte
// Various parameter types.
const (
AnyType ParameterType = 0x00
BoolType ParameterType = 0x10
IntegerType ParameterType = 0x11
ByteArrayType ParameterType = 0x12
StringType ParameterType = 0x13
Hash160Type ParameterType = 0x14
Hash256Type ParameterType = 0x15
PublicKeyType ParameterType = 0x16
SignatureType ParameterType = 0x17
ArrayType ParameterType = 0x20
MapType ParameterType = 0x22
InteropInterfaceType ParameterType = 0x30
VoidType ParameterType = 0xff
)
// Manifest represents contract's manifest.
type Manifest struct {
Name string
Groups []Group
Features map[string]string
SupportedStandards []string
ABI ABI
Permissions []Permission
Trusts []interop.Hash160
Extra any
}
// ABI represents contract's ABI.
type ABI struct {
Methods []Method
Events []Event
}
// Method represents a contract method.
type Method struct {
Name string
Params []Parameter
ReturnType ParameterType
Offset int
Safe bool
}
// Event represents a contract event.
type Event struct {
Name string
Params []Parameter
}
// Parameter represents a method parameter.
type Parameter struct {
Name string
Type ParameterType
}
// Permission represents contract permission.
type Permission struct {
Contract interop.Hash160
Methods []string
}
// Group represents a manifest group.
type Group struct {
PublicKey interop.PublicKey
Signature interop.Signature
}