mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-14 20:16:36 +00:00
Add another mode supported in abigen
Adding the new commands requested [here](https://github.com/ethereum/go-ethereum/pull/25008#discussion_r887431130)
This commit is contained in:
parent
4712997df5
commit
ff3f7e76de
1 changed files with 8 additions and 0 deletions
|
|
@ -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
|
$ 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`)
|
### Project integration (i.e. `go generate`)
|
||||||
|
|
||||||
The `abigen` command was made in such a way as to play beautifully together with existing
|
The `abigen` command was made in such a way as to play beautifully together with existing
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue