Documentation ¶
Overview ¶
Package solc provides bindings for the Solidity compiler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SolcVersions []SolcVersion
SolcVersions is a list of all available solc versions.
Functions ¶
Types ¶
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
func New ¶
func New(version SolcVersion) *Compiler
func (*Compiler) Compile ¶
Compile all contracts in the given directory and return the contract code of the contract with the given name.
func (*Compiler) MustCompile ¶
MustCompile is like Compiler.Compile but panics on error.
type Contract ¶
type Contract struct { Runtime []byte // The runtime bytecode of the contract. Constructor []byte // The constructor bytecode of the contract. Code []byte // Deprecated: The bytecode of the contract after deployment. DeployCode []byte // Deprecated: The bytecode to deploy the contract. }
Contract represents a compiled contract.
type EVMVersion ¶
type EVMVersion string
EVMVersion represents the EVM version to compile for.
const ( EVMVersionPrague EVMVersion = "prague" EVMVersionCancun EVMVersion = "cancun" EVMVersionShanghai EVMVersion = "shanghai" EVMVersionParis EVMVersion = "paris" EVMVersionLondon EVMVersion = "london" EVMVersionBerlin EVMVersion = "berlin" EVMVersionIstanbul EVMVersion = "istanbul" EVMVersionPetersburg EVMVersion = "petersburg" EVMVersionByzantium EVMVersion = "byzantium" )
type Option ¶
type Option func(*Settings)
An Option configures the compilation Settings.
func WithEVMVersion ¶
func WithEVMVersion(evmVersion EVMVersion) Option
WithEVMVersion configures the compilation Settings to set the given EVM version.
func WithOptimizer ¶
WithOptimizer configures the compilation Settings to set the given Optimizer.
type Settings ¶
type Settings struct { Remappings []string `json:"remappings,omitempty"` Optimizer *Optimizer `json:"optimizer"` ViaIR bool `json:"viaIR,omitempty"` EVMVersion EVMVersion `json:"evmVersion"` OutputSelection map[string]map[string][]string `json:"outputSelection"` // contains filtered or unexported fields }
Settings for the compilation.
type SolcVersion ¶ added in v0.3.0
type SolcVersion string
SolcVersion represents a solc version.
const ( SolcVersion0_5_0 SolcVersion = "0.5.0" SolcVersion0_5_1 SolcVersion = "0.5.1" SolcVersion0_5_2 SolcVersion = "0.5.2" SolcVersion0_5_3 SolcVersion = "0.5.3" SolcVersion0_5_4 SolcVersion = "0.5.4" SolcVersion0_5_5 SolcVersion = "0.5.5" SolcVersion0_5_6 SolcVersion = "0.5.6" SolcVersion0_5_7 SolcVersion = "0.5.7" SolcVersion0_5_8 SolcVersion = "0.5.8" SolcVersion0_5_9 SolcVersion = "0.5.9" SolcVersion0_5_10 SolcVersion = "0.5.10" SolcVersion0_5_11 SolcVersion = "0.5.11" SolcVersion0_5_12 SolcVersion = "0.5.12" SolcVersion0_5_13 SolcVersion = "0.5.13" SolcVersion0_5_14 SolcVersion = "0.5.14" SolcVersion0_5_15 SolcVersion = "0.5.15" SolcVersion0_5_16 SolcVersion = "0.5.16" SolcVersion0_5_17 SolcVersion = "0.5.17" SolcVersion0_6_0 SolcVersion = "0.6.0" SolcVersion0_6_1 SolcVersion = "0.6.1" SolcVersion0_6_2 SolcVersion = "0.6.2" SolcVersion0_6_3 SolcVersion = "0.6.3" SolcVersion0_6_4 SolcVersion = "0.6.4" SolcVersion0_6_5 SolcVersion = "0.6.5" SolcVersion0_6_6 SolcVersion = "0.6.6" SolcVersion0_6_7 SolcVersion = "0.6.7" SolcVersion0_6_8 SolcVersion = "0.6.8" SolcVersion0_6_9 SolcVersion = "0.6.9" SolcVersion0_6_10 SolcVersion = "0.6.10" SolcVersion0_6_11 SolcVersion = "0.6.11" SolcVersion0_6_12 SolcVersion = "0.6.12" SolcVersion0_7_0 SolcVersion = "0.7.0" SolcVersion0_7_1 SolcVersion = "0.7.1" SolcVersion0_7_2 SolcVersion = "0.7.2" SolcVersion0_7_3 SolcVersion = "0.7.3" SolcVersion0_7_4 SolcVersion = "0.7.4" SolcVersion0_7_5 SolcVersion = "0.7.5" SolcVersion0_7_6 SolcVersion = "0.7.6" SolcVersion0_8_0 SolcVersion = "0.8.0" SolcVersion0_8_1 SolcVersion = "0.8.1" SolcVersion0_8_2 SolcVersion = "0.8.2" SolcVersion0_8_3 SolcVersion = "0.8.3" SolcVersion0_8_4 SolcVersion = "0.8.4" SolcVersion0_8_5 SolcVersion = "0.8.5" SolcVersion0_8_6 SolcVersion = "0.8.6" SolcVersion0_8_7 SolcVersion = "0.8.7" SolcVersion0_8_8 SolcVersion = "0.8.8" SolcVersion0_8_9 SolcVersion = "0.8.9" SolcVersion0_8_10 SolcVersion = "0.8.10" SolcVersion0_8_11 SolcVersion = "0.8.11" SolcVersion0_8_12 SolcVersion = "0.8.12" SolcVersion0_8_13 SolcVersion = "0.8.13" SolcVersion0_8_14 SolcVersion = "0.8.14" SolcVersion0_8_15 SolcVersion = "0.8.15" SolcVersion0_8_16 SolcVersion = "0.8.16" SolcVersion0_8_17 SolcVersion = "0.8.17" SolcVersion0_8_18 SolcVersion = "0.8.18" SolcVersion0_8_19 SolcVersion = "0.8.19" SolcVersion0_8_20 SolcVersion = "0.8.20" SolcVersion0_8_21 SolcVersion = "0.8.21" SolcVersion0_8_22 SolcVersion = "0.8.22" SolcVersion0_8_23 SolcVersion = "0.8.23" SolcVersion0_8_24 SolcVersion = "0.8.24" SolcVersion0_8_25 SolcVersion = "0.8.25" SolcVersion0_8_26 SolcVersion = "0.8.26" SolcVersion0_8_27 SolcVersion = "0.8.27" SolcVersion0_8_28 SolcVersion = "0.8.28" // Latest version of solc. SolcVersionLatest = SolcVersion0_8_28 )
func (SolcVersion) Cmp ¶ added in v0.3.0
func (v SolcVersion) Cmp(other SolcVersion) int
Compare returns -1, 0, or +1 depending on whether v < other, v == other, or v > other
func (SolcVersion) String ¶ added in v0.3.0
func (v SolcVersion) String() string