lib

package
v0.0.0-...-e5e96f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ABIDirective string = "abi: "

Variables

View Source
var (
	FailureCode = Lit(0)
	SuccessCode = Lit(0)
)

Functions

func GenContract

func GenContract(modID string, cont *Contract, out *os.File) error

func ToSelector

func ToSelector(in []byte) uint32

Types

type Contract

type Contract struct {
	Name      string
	Functions []*Function
	Fields    []*Variable
}

func ProcessFile

func ProcessFile(filepath string, verbose bool) (*Contract, error)

type FuncMetadata

type FuncMetadata struct {
	Signature string
	Selector  FuncSelector
	Modifiers []Modifier
}

func NewFuncMetadata

func NewFuncMetadata(comment string) (*FuncMetadata, error)

func (*FuncMetadata) IsPayable

func (f *FuncMetadata) IsPayable() bool

func (*FuncMetadata) IsPure

func (f *FuncMetadata) IsPure() bool

func (*FuncMetadata) IsView

func (f *FuncMetadata) IsView() bool

type FuncSelector

type FuncSelector []byte

func (FuncSelector) Hex

func (s FuncSelector) Hex() string

func (FuncSelector) Hex0x

func (s FuncSelector) Hex0x() string

func (FuncSelector) UInt32

func (s FuncSelector) UInt32() uint32

type Function

type Function struct {
	Name    string
	Params  []*Variable
	Returns []string
	*FuncMetadata
}

func (*Function) Print

func (f *Function) Print()

type Modifier

type Modifier int
const (
	Payable Modifier = 1
	Pure    Modifier = 2
	View    Modifier = 3
)

type Variable

type Variable struct {
	Name string
	Type string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL