Skip to content

Commit

Permalink
cmd/abigen: require either '--abi' or '--combined-json' (ethereum#31045)
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Jan 21, 2025
1 parent 2a5737f commit 963b37b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmd/abigen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,20 @@ func init() {

func abigen(c *cli.Context) error {
utils.CheckExclusive(c, abiFlag, jsonFlag) // Only one source can be selected.

if c.String(pkgFlag.Name) == "" {
utils.Fatalf("No destination package specified (--pkg)")
}
lang := bind.LangGo
if c.String(abiFlag.Name) == "" && c.String(jsonFlag.Name) == "" {
utils.Fatalf("Either contract ABI source (--abi) or combined-json (--combined-json) are required")
}
var lang bind.Lang
switch c.String(langFlag.Name) {
case "go":
lang = bind.LangGo
default:
utils.Fatalf("Unsupported destination language \"%s\" (--lang)", c.String(langFlag.Name))
}
// If the entire solidity code was specified, build and bind based on that
var (
abis []string
Expand Down

0 comments on commit 963b37b

Please sign in to comment.