|
|
@ -55,7 +55,7 @@ var ( |
|
|
|
} |
|
|
|
} |
|
|
|
jsonFlag = cli.StringFlag{ |
|
|
|
jsonFlag = cli.StringFlag{ |
|
|
|
Name: "combined-json", |
|
|
|
Name: "combined-json", |
|
|
|
Usage: "Path to the combined-json file generated by compiler", |
|
|
|
Usage: "Path to the combined-json file generated by compiler, - for STDIN", |
|
|
|
} |
|
|
|
} |
|
|
|
excFlag = cli.StringFlag{ |
|
|
|
excFlag = cli.StringFlag{ |
|
|
|
Name: "exc", |
|
|
|
Name: "exc", |
|
|
@ -165,9 +165,18 @@ func abigen(c *cli.Context) error { |
|
|
|
var contracts map[string]*compiler.Contract |
|
|
|
var contracts map[string]*compiler.Contract |
|
|
|
|
|
|
|
|
|
|
|
if c.GlobalIsSet(jsonFlag.Name) { |
|
|
|
if c.GlobalIsSet(jsonFlag.Name) { |
|
|
|
jsonOutput, err := os.ReadFile(c.GlobalString(jsonFlag.Name)) |
|
|
|
var ( |
|
|
|
|
|
|
|
input = c.GlobalString(jsonFlag.Name) |
|
|
|
|
|
|
|
jsonOutput []byte |
|
|
|
|
|
|
|
err error |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
if input == "-" { |
|
|
|
|
|
|
|
jsonOutput, err = io.ReadAll(os.Stdin) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
jsonOutput, err = os.ReadFile(input) |
|
|
|
|
|
|
|
} |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
utils.Fatalf("Failed to read combined-json from compiler: %v", err) |
|
|
|
utils.Fatalf("Failed to read combined-json: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
contracts, err = compiler.ParseCombinedJSON(jsonOutput, "", "", "", "") |
|
|
|
contracts, err = compiler.ParseCombinedJSON(jsonOutput, "", "", "", "") |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|