From ff3f7e76de2305884565c318f6e9ee190fb58ca9 Mon Sep 17 00:00:00 2001 From: Nico Serrano <38594836+NicoSerranoP@users.noreply.github.com> Date: Thu, 2 Jun 2022 10:09:38 -0500 Subject: [PATCH] Add another mode supported in abigen Adding the new commands requested [here](https://github.com/ethereum/go-ethereum/pull/25008#discussion_r887431130) --- docs/_dapp/native-bindings.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/_dapp/native-bindings.md b/docs/_dapp/native-bindings.md index 5ad617deda..f525051388 100644 --- a/docs/_dapp/native-bindings.md +++ b/docs/_dapp/native-bindings.md @@ -343,6 +343,14 @@ $ solc --abi --bin token.sol -o tokenDirectory $ abigen --abi tokenDirectory/token.abi --bin tokenDirectory/token.bin --pkg main --type token --out token.go ``` +You can use the ```solc``` compiler to get a single ```.json``` file containing ABI and bytecode, and then use +it as input to ```abigen``` to generate the Go package in a shorter command: +``` +$ solc token.sol --combined-json abi,bin -o . +$ abigen --combined-json combined.json --pkg main --type token --out token.go +``` + + ### Project integration (i.e. `go generate`) The `abigen` command was made in such a way as to play beautifully together with existing