@@ -35,8 +35,8 @@ import (
35
35
)
36
36
37
37
var (
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]) " )
40
40
paramsLegacy = []string {
41
41
"--binary" , // Request to output the contract in binary (hexadecimal).
42
42
"file" , //
@@ -50,13 +50,13 @@ var (
50
50
"1" ,
51
51
}
52
52
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
60
60
}
61
61
)
62
62
@@ -102,8 +102,8 @@ func New(solcPath string) (sol *Solidity, err error) {
102
102
}
103
103
104
104
fullVersion := out .String ()
105
- version := versionRegExp .FindString (fullVersion )
106
- legacy := ! newAPIRegexp .MatchString (version )
105
+ version := versionRegexp .FindString (fullVersion )
106
+ legacy := legacyRegexp .MatchString (version )
107
107
108
108
sol = & Solidity {
109
109
solcPath : solcPath ,
0 commit comments