compiler

package
v0.0.0-...-99888be Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SolcVersion = "0.8.19"
)

Variables

This section is empty.

Functions

func DownloadSolidity

func DownloadSolidity(version string, dst string, renameDst bool) error

DownloadSolidity downloads the solidity compiler

Types

type AbiField

type AbiField struct {
	Type            string     `json:"type"`
	Name            string     `json:"name"`
	Inputs          []*IOField `json:"inputs"`
	Outputs         []*IOField `json:"outputs"`
	StateMutability string     `json:"stateMutability"`
	Anonymous       bool       `json:"anonymous"`
	Constant        bool       `json:"constant"`
}

type Artifact

type Artifact struct {
	Abi           []AbiField `json:"abi"`
	Bin           string
	BinRuntime    string `json:"bin-runtime"`
	SrcMap        string `json:"srcmap"`
	SrcMapRuntime string `json:"srcmap-runtime"`
}

type IOField

type IOField struct {
	Name         string     `json:"name"`
	Type         string     `json:"type"`
	Indexed      bool       `json:"indexed"`
	Components   []*IOField `json:"components"`
	InternalType string     `json:"internalType"`
}

type Output

type Output struct {
	Contracts map[string]*Artifact
	Sources   map[string]*Source
	Version   string
}

type Solidity

type Solidity struct {
	// contains filtered or unexported fields
}

Solidity is the solidity compiler

func NewSolidityCompiler

func NewSolidityCompiler(path string) *Solidity

NewSolidityCompiler instantiates a new solidity compiler

func (*Solidity) Compile

func (s *Solidity) Compile(files ...string) (*Output, error)

Compile implements the compiler interface

func (*Solidity) CompileCode

func (s *Solidity) CompileCode(code string) (*Output, error)

CompileCode compiles a solidity code

type Source

type Source struct {
	AST map[string]interface{}
}

Jump to

Keyboard shortcuts

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