Documentation ¶
Overview ¶
Package debug is a common contract store for local stacktraces and remote stacktraces.
Index ¶
- func MakeClient(rpcURL, chainID, projectSlug string, chainConfig *params.ChainConfig) (*ethereum.Client, error)
- type Backend
- type ContractMetadata
- type ContractSettings
- type ContractSource
- func (c *ContractSource) AddContract(ctx context.Context, chn chain.Chain, contractType contracts.ContractType, ...) (resultingContract *providers.Contract, err error)
- func (c *ContractSource) FetchLocalContracts() (resContracts []providers.Contract)
- func (c *ContractSource) Get(id string) (*stacktrace.ContractDetails, error)
- func (c *ContractSource) GetContract(id string) (*MappedContract, error)
- type MappedContract
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeClient ¶
func MakeClient(rpcURL, chainID, projectSlug string, chainConfig *params.ChainConfig) (*ethereum.Client, error)
MakeClient makes a evm processor client project slug is optional.
Types ¶
type Backend ¶
type Backend interface { // RPCAddress is the rpc address RPCAddress() string // GetBigChainID gets the chainid GetBigChainID() *big.Int }
Backend is the backend used for generating stack traces.
type ContractMetadata ¶
type ContractMetadata struct { Compiler struct { Version string `json:"version"` } `json:"compiler"` Language string `json:"language"` Output interface{} `json:"output"` Settings ContractSettings `json:"settings"` Sources map[string]interface{} `json:"sources"` Version int `json:"version"` }
ContractMetadata is metadata produced by solc.
type ContractSettings ¶
type ContractSettings struct { CompilationTarget map[string]string `json:"compilationTarget"` EvmVersion string `json:"evmVersion"` // TODO implement w/ ast Libraries struct{} `json:"libraries"` Metadata map[string]string `json:"metadata"` Optimizer struct { Enabled bool `json:"enabled"` Runs int `json:"runs"` } `json:"optimizer"` Remappings []interface{} `json:"remappings"` }
ContractSettings outed by solc.
type ContractSource ¶
type ContractSource struct {
// contains filtered or unexported fields
}
ContractSource is a contract source for tenderly to pull from.
func NewContractSource ¶
func NewContractSource() *ContractSource
NewContractSource creates a new contract source store.
func (*ContractSource) AddContract ¶
func (c *ContractSource) AddContract(ctx context.Context, chn chain.Chain, contractType contracts.ContractType, contract contracts.DeployedContract) (resultingContract *providers.Contract, err error)
AddContract adds a contract to the deploy.
func (*ContractSource) FetchLocalContracts ¶
func (c *ContractSource) FetchLocalContracts() (resContracts []providers.Contract)
FetchLocalContracts gets local contracts.
func (*ContractSource) Get ¶
func (c *ContractSource) Get(id string) (*stacktrace.ContractDetails, error)
Get gets the stacktrace.
func (*ContractSource) GetContract ¶
func (c *ContractSource) GetContract(id string) (*MappedContract, error)
GetContract gets the raw contract address.
type MappedContract ¶
type MappedContract struct { *providers.Contract // DeployedSourceMap is the currently deployed source map DeployedSourceMap *stacktrace.SourceMap // ContractType is the raw contract type ContractType contracts.ContractType }
MappedContract is the contract map.
type Provider ¶
type Provider struct { // contractSource is the source of the contract *ContractSource }
Provider provides stack trace errors.
func NewStackTraceProvider ¶
func NewStackTraceProvider() *Provider
NewStackTraceProvider creates a new stack trace provider. Note: this currently doesn't work see: https://ethereum.stackexchange.com/questions/25479/how-to-map-evm-trace-to-contract-source for details. this will be fixed in a future version.
func (Provider) GenerateStackTrace ¶
func (p Provider) GenerateStackTrace(backend Backend, tx *types.Transaction) (stackTrace string, err error)
GenerateStackTrace generates a stack trace for a failed tx.