compile

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintResponse

func PrintResponse(resp Response, cli bool)

Types

type Response

type Response struct {
	Objects []ResponseItem `json:"objects"`
	Warning string         `json:"warning"`
	Version string         `json:"version"`
	Error   string         `json:"error"`
}

func Compile added in v0.22.0

func Compile(file string, optimize bool, libraries map[string]string) (*Response, error)

type ResponseItem

type ResponseItem struct {
	Filename   string           `json:"filename"`
	Objectname string           `json:"objectname"`
	Contract   SolidityContract `json:"binary"`
}

Compile response object

type SolidityContract added in v0.23.0

type SolidityContract struct {
	Abi json.RawMessage
	Evm struct {
		Bytecode struct {
			Object         string
			Opcodes        string
			LinkReferences json.RawMessage
		}
	}
	Devdoc   json.RawMessage
	Userdoc  json.RawMessage
	Metadata string
}

func LoadSolidityContract added in v0.23.0

func LoadSolidityContract(file string) (*SolidityContract, error)
func (contract *SolidityContract) Link(libraries map[string]string) error

func (*SolidityContract) Save added in v0.23.0

func (contract *SolidityContract) Save(dir, file string) error

type SolidityInput

type SolidityInput struct {
	Language string                         `json:"language"`
	Sources  map[string]SolidityInputSource `json:"sources"`
	Settings struct {
		Libraries map[string]map[string]string `json:"libraries"`
		Optimizer struct {
			Enabled bool `json:"enabled"`
		} `json:"optimizer"`
		OutputSelection struct {
			File struct {
				OutputType []string `json:"*"`
			} `json:"*"`
		} `json:"outputSelection"`
	} `json:"settings"`
}

type SolidityInputSource

type SolidityInputSource struct {
	Content string   `json:"content,omitempty"`
	Urls    []string `json:"urls,omitempty"`
}

type SolidityOutput

type SolidityOutput struct {
	Contracts map[string]map[string]SolidityContract
	Errors    []struct {
		Component        string
		FormattedMessage string
		Message          string
		Severity         string
		Type             string
	}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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