Documentation
¶
Index ¶
- type AbiSpecStorageLayoutEntry
- type AbiType
- type Ast
- type AstBaseContract
- type AstBlock
- type AstDocumentation
- type AstNode
- type AstParameterList
- type AstTypeDescriptions
- type AstTypeName
- type CompilerInput
- type CompilerInputMetadata
- type CompilerOutput
- type CompilerOutputBytecode
- type CompilerOutputContract
- type CompilerOutputContracts
- type CompilerOutputEvm
- type CompilerOutputSource
- type CompilerOutputSources
- type CompilerSettings
- type Expression
- type ForgeArtifact
- type ForgeCompilerInfo
- type ForgeCompilerMetadata
- type ForgeDocObject
- type ForgeMetadataOutput
- type ForgeSourceInfo
- type LinkReference
- type LinkReferenceOffset
- type LinkReferences
- type OptimizerSettings
- type StorageLayout
- type StorageLayoutEntry
- type StorageLayoutType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbiSpecStorageLayoutEntry ¶ added in v1.11.0
type AbiType ¶ added in v1.11.0
func (*AbiType) UnmarshalJSON ¶ added in v1.11.0
type AstBaseContract ¶ added in v1.11.0
type AstBaseContract struct {
BaseName *AstTypeName `json:"baseName"`
Id int `json:"id"`
NodeType string `json:"nodeType"`
Src string `json:"src"`
}
type AstDocumentation ¶ added in v1.11.0
type AstNode ¶ added in v1.11.0
type AstNode struct {
Id int `json:"id"`
NodeType string `json:"nodeType"`
Src string `json:"src"`
Nodes []AstNode `json:"nodes,omitempty"`
Abstract bool `json:"abstract,omitempty"`
BaseContracts []AstBaseContract `json:"baseContracts,omitempty"`
CanonicalName string `json:"canonicalName,omitempty"`
ContractDependencies []int `json:"contractDependencies,omitempty"`
ContractKind string `json:"contractKind,omitempty"`
Documentation interface{} `json:"documentation,omitempty"`
FullyImplemented bool `json:"fullyImplemented,omitempty"`
LinearizedBaseContracts []int `json:"linearizedBaseContracts,omitempty"`
Name string `json:"name,omitempty"`
NameLocation string `json:"nameLocation,omitempty"`
Scope int `json:"scope,omitempty"`
UsedErrors []int `json:"usedErrors,omitempty"`
UsedEvents []int `json:"usedEvents,omitempty"`
// Function specific
Body *AstBlock `json:"body,omitempty"`
Parameters *AstParameterList `json:"parameters,omitempty"`
ReturnParameters *AstParameterList `json:"returnParameters,omitempty"`
StateMutability string `json:"stateMutability,omitempty"`
Virtual bool `json:"virtual,omitempty"`
Visibility string `json:"visibility,omitempty"`
// Variable specific
Constant bool `json:"constant,omitempty"`
Mutability string `json:"mutability,omitempty"`
StateVariable bool `json:"stateVariable,omitempty"`
StorageLocation string `json:"storageLocation,omitempty"`
TypeDescriptions *AstTypeDescriptions `json:"typeDescriptions,omitempty"`
TypeName *AstTypeName `json:"typeName,omitempty"`
// Expression specific
Expression *Expression `json:"expression,omitempty"`
IsConstant bool `json:"isConstant,omitempty"`
IsLValue bool `json:"isLValue,omitempty"`
IsPure bool `json:"isPure,omitempty"`
LValueRequested bool `json:"lValueRequested,omitempty"`
// Literal specific
HexValue string `json:"hexValue,omitempty"`
Kind string `json:"kind,omitempty"`
Value interface{} `json:"value,omitempty"`
// Other fields
ModifierName *Expression `json:"modifierName,omitempty"`
Modifiers []AstNode `json:"modifiers,omitempty"`
Arguments []Expression `json:"arguments,omitempty"`
Condition *Expression `json:"condition,omitempty"`
TrueBody *AstBlock `json:"trueBody,omitempty"`
FalseBody *AstBlock `json:"falseBody,omitempty"`
Operator string `json:"operator,omitempty"`
}
type AstParameterList ¶ added in v1.11.0
type AstTypeDescriptions ¶ added in v1.11.0
type AstTypeName ¶ added in v1.11.0
type CompilerInput ¶
type CompilerInput struct {
Language string `json:"language"`
Sources map[string]map[string]string `json:"sources"`
Settings CompilerSettings `json:"settings"`
}
type CompilerInputMetadata ¶
type CompilerInputMetadata struct {
UseLiteralContent bool `json:"useLiteralContent"`
}
type CompilerOutput ¶
type CompilerOutput struct {
Contracts map[string]CompilerOutputContracts `json:"contracts"`
Sources CompilerOutputSources `json:"sources"`
}
type CompilerOutputBytecode ¶
type CompilerOutputBytecode struct {
Object string `json:"object"`
Opcodes string `json:"opcodes"`
SourceMap string `json:"sourceMap"`
LinkReferences LinkReferences `json:"linkReferences"`
}
Object must be a string because its not guaranteed to be a hex string
type CompilerOutputContract ¶
type CompilerOutputContract struct {
Abi AbiType `json:"abi"`
Evm CompilerOutputEvm `json:"evm"`
Metadata string `json:"metadata"`
StorageLayout StorageLayout `json:"storageLayout"`
}
CompilerOutputContract represents the solc compiler output for a contract. Ignoring some fields such as devdoc and userdoc.
type CompilerOutputContracts ¶
type CompilerOutputContracts map[string]CompilerOutputContract
type CompilerOutputEvm ¶
type CompilerOutputEvm struct {
Bytecode CompilerOutputBytecode `json:"bytecode"`
DeployedBytecode CompilerOutputBytecode `json:"deployedBytecode"`
GasEstimates map[string]map[string]string `json:"gasEstimates"`
MethodIdentifiers map[string]string `json:"methodIdentifiers"`
}
type CompilerOutputSource ¶
type CompilerOutputSources ¶
type CompilerOutputSources map[string]CompilerOutputSource
type CompilerSettings ¶
type CompilerSettings struct {
Optimizer OptimizerSettings `json:"optimizer"`
Metadata CompilerInputMetadata `json:"metadata"`
CompilationTarget map[string]string `json:"compilationTarget"`
OutputSelection map[string]map[string][]string `json:"outputSelection"`
EvmVersion string `json:"evmVersion,omitempty"`
Libraries map[string]map[string]string `json:"libraries,omitempty"`
}
type Expression ¶ added in v1.11.0
type Expression struct {
Id int `json:"id"`
NodeType string `json:"nodeType"`
Src string `json:"src"`
TypeDescriptions *AstTypeDescriptions `json:"typeDescriptions,omitempty"`
Name string `json:"name,omitempty"`
OverloadedDeclarations []int `json:"overloadedDeclarations,omitempty"`
ReferencedDeclaration int `json:"referencedDeclaration,omitempty"`
ArgumentTypes []AstTypeDescriptions `json:"argumentTypes,omitempty"`
Value interface{} `json:"value,omitempty"`
Kind string `json:"kind,omitempty"`
Expression *Expression `json:"expression,omitempty"`
}
type ForgeArtifact ¶ added in v1.11.0
type ForgeArtifact struct {
Abi AbiType `json:"abi"`
Bytecode CompilerOutputBytecode `json:"bytecode"`
DeployedBytecode CompilerOutputBytecode `json:"deployedBytecode"`
MethodIdentifiers map[string]string `json:"methodIdentifiers"`
RawMetadata string `json:"rawMetadata"`
Metadata ForgeCompilerMetadata `json:"metadata"`
StorageLayout *StorageLayout `json:"storageLayout,omitempty"`
Ast Ast `json:"ast"`
Id int `json:"id"`
}
type ForgeCompilerInfo ¶ added in v1.11.0
type ForgeCompilerInfo struct {
Version string `json:"version"`
}
type ForgeCompilerMetadata ¶ added in v1.11.0
type ForgeCompilerMetadata struct {
Compiler ForgeCompilerInfo `json:"compiler"`
Language string `json:"language"`
Output ForgeMetadataOutput `json:"output"`
Settings CompilerSettings `json:"settings"`
Sources map[string]ForgeSourceInfo `json:"sources"`
Version int `json:"version"`
}
type ForgeDocObject ¶ added in v1.11.0
type ForgeMetadataOutput ¶ added in v1.11.0
type ForgeMetadataOutput struct {
Abi AbiType `json:"abi"`
DevDoc ForgeDocObject `json:"devdoc"`
UserDoc ForgeDocObject `json:"userdoc"`
}
type ForgeSourceInfo ¶ added in v1.11.0
type LinkReference ¶
type LinkReference map[string][]LinkReferenceOffset
type LinkReferenceOffset ¶
type LinkReferences ¶
type LinkReferences map[string]LinkReference
type OptimizerSettings ¶
type StorageLayout ¶
type StorageLayout struct {
Storage []StorageLayoutEntry `json:"storage"`
Types map[string]StorageLayoutType `json:"types"`
}
StorageLayout represents the solc compilers output storage layout for a contract.
func (*StorageLayout) GetStorageLayoutEntry ¶
func (s *StorageLayout) GetStorageLayoutEntry(name string) (StorageLayoutEntry, error)
GetStorageLayoutEntry returns the StorageLayoutEntry where the label matches the provided name.
func (*StorageLayout) GetStorageLayoutType ¶
func (s *StorageLayout) GetStorageLayoutType(name string) (StorageLayoutType, error)
GetStorageLayoutType returns the StorageLayoutType where the label matches the provided name.
type StorageLayoutEntry ¶
type StorageLayoutType ¶
type StorageLayoutType struct {
Encoding string `json:"encoding"`
Label string `json:"label"`
NumberOfBytes uint `json:"numberOfBytes,string"`
Key string `json:"key,omitempty"`
Value string `json:"value,omitempty"`
Base string `json:"base,omitempty"`
Members []StorageLayoutEntry `json:"members,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.