providers

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: GPL-3.0 Imports: 22 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ExtractConfigWithDivider

func ExtractConfigWithDivider(config, divider string) (string, error)

func Parse

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

func ParseBytecode

func ParseBytecode(raw string) ([]byte, error)

func ParseContract

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

func RandSeq

func RandSeq(n int) string

Types

type ApiContract

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

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

type Compiler

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

type CompilerSettings

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"`
	ConfigType       string                   `json:"-"`
}

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 GetContracts

func GetContracts(
	buildDir string,
	networkIDs []string,
	objects ...*model.StateObject,
) ([]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           []Node           `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 {
	Contracts map[string]*stacktrace.ContractDetails
	Client    ethereum.Client
}

func (*ContractSource) Get

type DeploymentProvider

type DeploymentProvider interface {
	GetConfig(configName string, configDir string) (*Config, error)
	MustGetConfig() (*Config, error)
	CheckIfProviderStructure(directory string) bool
	NewContractSource(path string, networkId string, client ethereum.Client) (stacktrace.ContractSource, error)
	GetProviderName() DeploymentProviderName
}

type DeploymentProviderName

type DeploymentProviderName string
const (
	TruffleDeploymentProvider      DeploymentProviderName = "Truffle"
	OpenZeppelinDeploymentProvider DeploymentProviderName = "OpenZeppelin"
)

func (DeploymentProviderName) String added in v0.8.2

func (d DeploymentProviderName) String() string

type NetworkConfig

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

type Node

type Node struct {
	NodeType     string `json:"nodeType"`
	AbsolutePath string `json:"absolutePath"`
}

type Optimizer

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