miguelmota / ethereum-development-with-go-book

📖 A little guide book on Ethereum Development with Go (golang)
https://goethereumbook.org
Other
1.74k stars 427 forks source link

Smart contract compile abi edits #24

Closed zeddee closed 5 years ago

zeddee commented 5 years ago

Corrections:

Improvements:

zeddee commented 5 years ago

it appears that instead of solc --abi --bin ..., we can just invoke

abigen --sol helloworld.sol --pkg main --out helloworld.go

to produce a .go binding file that contains the necessary abi and bin values that we would get going about the long way. We don't have to replace the steps, because it's useful for the reader to know what goes into creating the .go binding file, but attaching this one-liner would be helpful.

source: https://medium.com/coinmonks/unit-testing-solidity-contracts-on-ethereum-with-go-3cc924091281

the article uses solc ^0.4.23 and abigen from geth 1.8.7

if you're okay with this, I'll continue updating the PR (and make other PRs re: later chapters)

miguelmota commented 5 years ago

reviewing..

miguelmota commented 5 years ago

@zeddee the abigen --sol helloworld.sol --pkg main --out helloworld.go example would be great for sure. You can make a separate PR for this if you like and would be happy to merge

miguelmota commented 5 years ago

Also thanks for this PR 👍

zeddee commented 5 years ago

glad to help! will have to slot this on my todo list — a bit busy at the moment. will try to get it done ✨