providers

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: GPL-3.0 Imports: 18 Imported by: 3

Documentation

Index

Constants

View Source
const (
	TruffleDeploymentProvider      DeploymentProviderName = "Truffle"
	OpenZeppelinDeploymentProvider DeploymentProviderName = "OpenZeppelin"
	BuidlerDeploymentProvider      DeploymentProviderName = "Buidler"
	HardhatDeploymentProvider      DeploymentProviderName = "Hardhat"
	BrownieDeploymentProvider      DeploymentProviderName = "Brownie"

	HardhatConfigFile   = "hardhat.config.js"
	HardhatConfigFileTs = "hardhat.config.ts"

	BuidlerConfigFile = "buidler.config.js"

	NewTruffleConfigFile = "truffle-config.js"
	OldTruffleConfigFile = "truffle.js"

	OpenzeppelinConfigFile        = "networks.js"
	OpenZeppelinProjectConfigFile = "project.json"

	BrownieConfigFile = "brownie-config.yaml"
)

Variables

Functions

func CheckIfFileDoesNotExist added in v0.9.0

func CheckIfFileDoesNotExist(path string) bool

func ExtractConfigWithDivider

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

func GetGlobalPathForModule added in v0.9.0

func GetGlobalPathForModule(localPath string) string

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

func ValidProviderStructure added in v1.5.0

func ValidProviderStructure(baseDirectory string, providerDirectories []string) bool

ValidProviderStructure validates that the provider directories are present on the file system

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"`

	Tags []*ContractTag `json:"tags,omitempty"`

	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" yaml:"version"`
	Settings   *CompilerSettings `json:"settings" yaml:"settings"`
	Optimizer  *Optimizer        `json:"optimizer" yaml:"optimizer"`
	EvmVersion *string           `json:"evmVersion" yaml:"evm_version"`
	Remappings []string          `json:"remappings" yaml:"remappings"`
}

type CompilerSettings

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

type Config

type Config struct {
	ProjectDirectory string                   `json:"project_directory" yaml:"project_directory"`
	BuildDirectory   string                   `json:"contracts_build_directory" yaml:"build_directory"`
	Networks         map[string]NetworkConfig `json:"networks" yaml:"-"`
	Solc             map[string]Optimizer     `json:"solc" yaml:"solc"`
	Compilers        map[string]Compiler      `json:"compilers" yaml:"compiler"`
	ConfigType       string                   `json:"-"`
	Paths            Paths                    `json:"paths" yaml:"paths"`
}

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"`
}

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 ContractSources added in v0.9.0

type ContractSources struct {
	Content string `json:"content"`
}

type ContractTag added in v1.4.0

type ContractTag struct {
	Tag string `json:"tag"`

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

type DeploymentProvider

type DeploymentProvider interface {
	MustGetConfig() (*Config, error)
	GetDirectoryStructure() []string
	GetProviderName() DeploymentProviderName
	GetContracts(buildDir string, networkIDs []string, objects ...*model.StateObject) ([]Contract, int, error)
}

type DeploymentProviderName

type DeploymentProviderName string

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

type Node

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

type OZCompilerSettings added in v0.9.1

type OZCompilerSettings struct {
	Optimizer *OZOptimizer `json:"optimizer"`
}

type OZOptimizer added in v0.9.1

type OZOptimizer struct {
	Enabled bool   `json:"enabled"`
	Runs    string `json:"runs"`
}

type OZProjectData added in v0.9.1

type OZProjectData struct {
	Compiler *OzCompilerData `json:"compiler"`
}

type Optimizer

type Optimizer struct {
	Enabled *bool             `json:"enabled"`
	Runs    *int              `json:"runs"`
	Details *OptimizerDetails `json:"details,omitempty"`
}

type OptimizerDetails added in v1.2.2

type OptimizerDetails struct {
	Peephole          *bool       `json:"peephole,omitempty"`
	JumpdestRemover   *bool       `json:"jumpdestRemover,omitempty"`
	OrderLiterals     *bool       `json:"orderLiterals,omitempty"`
	Deduplicate       *bool       `json:"deduplicate,omitempty"`
	Cse               *bool       `json:"cse,omitempty"`
	ConstantOptimizer *bool       `json:"constantOptimizer,omitempty"`
	Yul               *bool       `json:"yul,omitempty"`
	Inliner           *bool       `json:"inliner,omitempty"`
	YulDetails        *YulDetails `json:"yulDetails,omitempty"`
}

type OzCompilerData added in v0.9.1

type OzCompilerData struct {
	CompilerSettings *OZCompilerSettings `json:"compilerSettings"`
	Version          string              `json:"solcVersion"`
}

type Paths added in v1.1.0

type Paths struct {
	Sources     string `json:"sources,omitempty"`
	Tests       string `json:"tests,omitempty"`
	Cache       string `json:"cache,omitempty"`
	Artifacts   string `json:"artifacts,omitempty"`
	Deployments string `json:"deployments,omitempty"`
}

type YulDetails added in v1.2.2

type YulDetails struct {
	StackAllocation *bool   `json:"stackAllocation,omitempty"`
	OptimizerSteps  *string `json:"optimizerSteps,omitempty"`
}

Jump to

Keyboard shortcuts

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