@@ -24,20 +24,18 @@ import (
2424 "fmt"
2525 "io"
2626 "os"
27- "path/filepath"
2827 "regexp"
2928 "strings"
3029
3130 "github.com/urfave/cli/v2"
3231
3332 "github.com/erigontech/erigon-lib/common"
34- "github.com/erigontech/erigon-lib/common/compiler"
3533 "github.com/erigontech/erigon-lib/crypto"
3634 "github.com/erigontech/erigon-lib/log/v3"
3735 "github.com/erigontech/erigon/cmd/utils"
3836 "github.com/erigontech/erigon/db/version"
39- "github.com/erigontech/erigon/execution/abi"
4037 "github.com/erigontech/erigon/execution/abi/bind"
38+ "github.com/erigontech/erigon/execution/abi/compiler"
4139 cli2 "github.com/erigontech/erigon/turbo/cli"
4240)
4341
6159 Name : "combined-json" ,
6260 Usage : "Path to the combined-json file generated by compiler" ,
6361 }
64- solFlag = cli.StringFlag {
65- Name : "sol" ,
66- Usage : "Path to the Ethereum contract Solidity source to build and bind" ,
67- }
68- solcFlag = cli.StringFlag {
69- Name : "solc" ,
70- Usage : "Solidity compiler to use if source builds are requested" ,
71- Value : "solc" ,
72- }
73- vyFlag = cli.StringFlag {
74- Name : "vy" ,
75- Usage : "Path to the Ethereum contract Vyper source to build and bind" ,
76- }
77- vyperFlag = cli.StringFlag {
78- Name : "vyper" ,
79- Usage : "Vyper compiler to use if source builds are requested" ,
80- Value : "vyper" ,
81- }
8262 excFlag = cli.StringFlag {
8363 Name : "exc" ,
8464 Usage : "Comma separated types to exclude from binding" ,
@@ -109,10 +89,6 @@ func init() {
10989 & binFlag ,
11090 & typeFlag ,
11191 & jsonFlag ,
112- & solFlag ,
113- & solcFlag ,
114- & vyFlag ,
115- & vyperFlag ,
11692 & excFlag ,
11793 & pkgFlag ,
11894 & outFlag ,
@@ -123,7 +99,7 @@ func init() {
12399}
124100
125101func abigen (c * cli.Context ) error {
126- utils .CheckExclusive (c , & abiFlag , & jsonFlag , & solFlag , & vyFlag ) // Only one source can be selected.
102+ utils .CheckExclusive (c , & abiFlag , & jsonFlag ) // Only one source can be selected.
127103 if c .String (pkgFlag .Name ) == "" {
128104 utils .Fatalf ("No destination package specified (--pkg)" )
129105 }
@@ -187,33 +163,9 @@ func abigen(c *cli.Context) error {
187163 for _ , kind := range common .CliString2Array (c .String (excFlag .Name )) {
188164 exclude [strings .ToLower (kind )] = true
189165 }
190- var err error
191166 var contracts map [string ]* compiler.Contract
192167
193- switch {
194- case c .IsSet (solFlag .Name ):
195- contracts , err = compiler .CompileSolidity (c .Context , c .String (solcFlag .Name ), c .String (solFlag .Name ))
196- if err != nil {
197- utils .Fatalf ("Failed to build Solidity contract: %v" , err )
198- }
199- case c .IsSet (vyFlag .Name ):
200- output , err := compiler .CompileVyper (c .Context , c .String (vyperFlag .Name ), c .String (vyFlag .Name ))
201- if err != nil {
202- utils .Fatalf ("Failed to build Vyper contract: %v" , err )
203- }
204- contracts = make (map [string ]* compiler.Contract )
205- for n , contract := range output {
206- name := n
207- // Sanitize the combined json names to match the
208- // format expected by solidity.
209- if ! strings .Contains (n , ":" ) {
210- // Remove extra path components
211- name = abi .ToCamelCase (strings .TrimSuffix (filepath .Base (name ), ".vy" ))
212- }
213- contracts [name ] = contract
214- }
215-
216- case c .IsSet (jsonFlag .Name ):
168+ if c .IsSet (jsonFlag .Name ) {
217169 jsonOutput , err := os .ReadFile (c .String (jsonFlag .Name ))
218170 if err != nil {
219171 utils .Fatalf ("Failed to read combined-json from compiler: %v" , err )
0 commit comments