compiler *

Package compiler wraps the Solidity compiler executable (solc).

// Contract contains information about a compiled contract, alongside its code.
type Contract struct {
    Code string       `json:"code"`
    Info ContractInfo `json:"info"`
}

ContractInfo

// ContractInfo contains information about a compiled contract, including access
// to the ABI definition, user and developer docs, and metadata.
//
// Depending on the source, language version, compiler version, and compiler
// options will provide information about how the contract was compiled.
type ContractInfo struct {
    Source          string      `json:"source"`
    Language        string      `json:"language"`
    LanguageVersion string      `json:"languageVersion"`
    CompilerVersion string      `json:"compilerVersion"`
    CompilerOptions string      `json:"compilerOptions"`
    AbiDefinition   interface{} `json:"abiDefinition"`
    UserDoc         interface{} `json:"userDoc"`
    DeveloperDoc    interface{} `json:"developerDoc"`
    Metadata        string      `json:"metadata"`
}

Solidity

// Solidity contains information about the solidity compiler.
type Solidity struct {
    Path, Version, FullVersion string
    Major, Minor, Patch        int
}

solcOutput

// --combined-output format
type solcOutput struct {
    Contracts map[string]struct {
        Bin, Abi, Devdoc, Userdoc, Metadata string
    }
    Version string
}

Last updated

Was this helpful?