truffle

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: GPL-3.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NewTruffleConfigFile = "truffle-config.js"
	OldTruffleConfigFile = "truffle.js"
)

Variables

This section is empty.

Functions

func CheckIfTruffleStructure added in v0.1.6

func CheckIfTruffleStructure(directory string) bool

func FindTruffleDirectories added in v0.1.6

func FindTruffleDirectories() []string

func NewContractSource

func NewContractSource(path string, networkId string, client client.Client) (stacktrace.ContractSource, error)

NewContractSource builds the Contract Source from the provided config, and scoped to the provided network.

func Parse

func Parse(contracts map[string]*Contract) (map[string]stacktrace.SourceMap, map[string][]byte, error)

func ParseContract

func ParseContract(contract *Contract) (stacktrace.SourceMap, error)

Types

type ApiContract added in v0.2.5

type ApiContract struct {
	ID string `json:"id"`

	AccountID string `json:"account_id"`
	ProjectID string `json:"project_id"`

	NetworkID string `json:"network_id"`
	Public    bool   `json:"public"`

	Address string `json:"address"`

	Name string `json:"contract_name"`

	Abi       string `json:"abi"`
	Bytecode  string `json:"bytecode"`
	Source    string `json:"source"`
	SourceMap string `json:"source_map"`

	CreatedAt time.Time `json:"created_at"`
}

type ApiDeploymentInformation added in v0.2.5

type ApiDeploymentInformation struct {
	NetworkID string `json:"network_id"`
	Address   string `json:"address"`
}

type Compiler added in v0.3.0

type Compiler struct {
	Version  string            `json:"version"`
	Settings *CompilerSettings `json:"settings"`
}

type CompilerSettings added in v0.3.1

type CompilerSettings struct {
	Optimizer  *Optimizer `json:"optimizer"`
	EvmVersion *string    `json:"evmVersion"`
}

type Config

type Config struct {
	ProjectDirectory string                   `json:"project_directory"`
	BuildDirectory   string                   `json:"contracts_build_directory"`
	Networks         map[string]NetworkConfig `json:"networks"`
	Solc             map[string]Optimizer     `json:"solc"`
	Compilers        map[string]Compiler      `json:"compilers"`
}

func GetTruffleConfig added in v0.4.0

func GetTruffleConfig(configName string, projectDir string) (*Config, error)

func (*Config) AbsoluteBuildDirectoryPath

func (c *Config) AbsoluteBuildDirectoryPath() string

type Contract

type Contract struct {
	Name              string                     `json:"contractName"`
	Abi               interface{}                `json:"abi"`
	Bytecode          string                     `json:"bytecode"`
	DeployedBytecode  string                     `json:"deployedBytecode"`
	SourceMap         string                     `json:"sourceMap"`
	DeployedSourceMap string                     `json:"deployedSourceMap"`
	Source            string                     `json:"source"`
	SourcePath        string                     `json:"sourcePath"`
	Ast               ContractAst                `json:"legacyAST"`
	Compiler          ContractCompiler           `json:"compiler"`
	Networks          map[string]ContractNetwork `json:"networks"`

	SchemaVersion string    `json:"schemaVersion"`
	UpdatedAt     time.Time `json:"updatedAt"`
}

func GetTruffleContracts added in v0.4.0

func GetTruffleContracts(buildDir string) ([]Contract, int, error)

type ContractAst

type ContractAst struct {
	AbsolutePath    string           `json:"absolutePath"`
	ExportedSymbols map[string][]int `json:"exportedSymbols"`
	Id              int              `json:"id"`
	NodeType        string           `json:"nodeType"`
	Nodes           interface{}      `json:"nodes"`
	Src             string           `json:"src"`
}

type ContractCompiler

type ContractCompiler struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type ContractNetwork

type ContractNetwork struct {
	Events          interface{} `json:"events"`
	Links           interface{} `json:"links"`
	Address         string      `json:"address"`
	TransactionHash string      `json:"transactionHash"`
}

type ContractSource

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

func (*ContractSource) Get

type NetworkConfig

type NetworkConfig struct {
	Host      string      `json:"host"`
	Port      int         `json:"port"`
	NetworkID interface{} `json:"network_id"`
}

type Optimizer added in v0.3.0

type Optimizer struct {
	Enabled *bool `json:"enabled"`
	Runs    *int  `json:"runs"`
}

Jump to

Keyboard shortcuts

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