Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

types.gno

0.78 Kb · 45 lines
 1package abi
 2
 3import "errors"
 4
 5// Type identifies a Solidity ABI field kind supported by this package.
 6type Type int
 7
 8const (
 9	TypeUint8 Type = iota
10	TypeUint32
11	TypeUint64
12	TypeUint256
13	TypeBytes32
14	TypeBytes
15	TypeString
16	TypeBool
17	TypeAddress
18	TypeStruct
19	TypeArray
20)
21
22var (
23	ErrUnsupportedType = errors.New("abi: unsupported type")
24	ErrInvalidSchema   = errors.New("abi: invalid schema")
25	ErrInvalidValue    = errors.New("abi: invalid value")
26	ErrInvalidData     = errors.New("abi: invalid data")
27	ErrDepthLimit      = errors.New("abi: depth limit exceeded")
28)
29
30// Field describes one ABI tuple field.
31type Field struct {
32	Type Type
33	Sub  *Schema
34	Elem *Field
35}
36
37// Schema describes a Solidity ABI tuple.
38type Schema struct {
39	Fields []Field
40}
41
42const (
43	wordSize        = 32
44	maxDecodeDepth  = 256
45)