Documentation
¶
Overview ¶
Package detector provides helpers for accessing solgo packages. It's basically a wrapper around solgo. Most of the features supported by solgo are implemented in this package.
Index ¶
- type Detector
- func (d *Detector) Build() error
- func (d *Detector) GetABI() *abi.Builder
- func (d *Detector) GetAST() *ast.ASTBuilder
- func (d *Detector) GetContext() context.Context
- func (d *Detector) GetIR() *ir.Builder
- func (d *Detector) GetOpcodes(data []byte) (*opcode.Decompiler, error)
- func (d *Detector) GetOpcodesFromHex(data string) (*opcode.Decompiler, error)
- func (d *Detector) GetParser() *solgo.Parser
- func (d *Detector) GetSolc() *solc.Select
- func (d *Detector) GetSources() solgo.Sources
- func (d *Detector) Parse() []error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector is a utility structure that provides functionalities to detect and analyze Solidity source code. It encapsulates the context, sources, ABI builder, and solc compiler selector.
func NewDetectorFromSources ¶
NewDetectorFromSources initializes a new Detector instance using the provided sources. It sets up the ABI builder and solc compiler selector which provide access to Global parser, AST and IR.
func (*Detector) Build ¶ added in v0.1.9
Build builds the ABI from the parsed source code and returns the errors encountered during the process.
func (*Detector) GetAST ¶
func (d *Detector) GetAST() *ast.ASTBuilder
GetAST returns the abstract syntax tree (AST) builder associated with the Detector.
func (*Detector) GetContext ¶
GetContext returns the context associated with the Detector.
func (*Detector) GetIR ¶
GetIR returns the intermediate representation (IR) builder associated with the Detector.
func (*Detector) GetOpcodes ¶
func (d *Detector) GetOpcodes(data []byte) (*opcode.Decompiler, error)
GetOpcodes returns the opcodes decompiler from provided byte array. It decompiles the bytecode of the contract, transaction, log to EVM opcodes.
func (*Detector) GetOpcodesFromHex ¶
func (d *Detector) GetOpcodesFromHex(data string) (*opcode.Decompiler, error)
GetOpcodesFromHex returns the opcodes decompiler from provided hexadecimal string. It decompiles the bytecode of the contract, transaction, log to EVM opcodes.
func (*Detector) GetSources ¶
GetSources returns the Solidity source files associated with the Detector.