@@ -35,8 +35,8 @@ import (
3535)
3636
3737var (
38- versionRegExp = regexp .MustCompile ("[0-9]+\\ .[0-9]+\\ .[0-9]+" )
39- newAPIRegexp = regexp .MustCompile ("0\\ .1\\ .[2-9][0-9]* " )
38+ versionRegexp = regexp .MustCompile ("[0-9]+\\ .[0-9]+\\ .[0-9]+" )
39+ legacyRegexp = regexp .MustCompile ("0\\ .(9 \\ ..*| 1\\ .[01]) " )
4040 paramsLegacy = []string {
4141 "--binary" , // Request to output the contract in binary (hexadecimal).
4242 "file" , //
@@ -50,13 +50,13 @@ var (
5050 "1" ,
5151 }
5252 paramsNew = []string {
53- "--bin" , // Request to output the contract in binary (hexadecimal).
54- "--abi" , // Request to output the contract's JSON ABI interface.
55- "--userdoc" , // Request to output the contract's Natspec user documentation.
56- "--devdoc" , // Request to output the contract's Natspec developer documentation.
57- "--add-std" , // include standard lib contracts
58- "--optimize=1 " , // code optimizer switched on
59- "-o" , // output directory
53+ "--bin" , // Request to output the contract in binary (hexadecimal).
54+ "--abi" , // Request to output the contract's JSON ABI interface.
55+ "--userdoc" , // Request to output the contract's Natspec user documentation.
56+ "--devdoc" , // Request to output the contract's Natspec developer documentation.
57+ "--add-std" , // include standard lib contracts
58+ "--optimize" , // code optimizer switched on
59+ "-o" , // output directory
6060 }
6161)
6262
@@ -102,8 +102,8 @@ func New(solcPath string) (sol *Solidity, err error) {
102102 }
103103
104104 fullVersion := out .String ()
105- version := versionRegExp .FindString (fullVersion )
106- legacy := ! newAPIRegexp .MatchString (version )
105+ version := versionRegexp .FindString (fullVersion )
106+ legacy := legacyRegexp .MatchString (version )
107107
108108 sol = & Solidity {
109109 solcPath : solcPath ,
0 commit comments