-
Notifications
You must be signed in to change notification settings - Fork 21.5k
Description
We are trying to set up a go:generate call to generate our Go interfaces from our Solidity files. Unfortunately, abigen seems to be unable to support imports with the same diversity as solc or truffle. For example, our code imports code from a third-party library that is pulled in via npm. Truffle handles this relatively transparently. For solc, we can deal with the situation by mapping the import path to the node_modules import path and then specifying --allow-paths appropriately. Unfortunately, there's no way to ask abigen to pass any flags to solc when invoking it with a Solidity file, and abigen doesn't have first-class support for --allow-paths or import path mapping.
My next attempt was to pipe the output of solc to abigen. Unfortunately, there doesn't seem to be a way to ask abigen to read its contents from stdin.
It's not immediately obvious if one or the other (passing flags to solc or reading from stdin) would be preferable. stdin is probably most easily supported, by allowing --abi - to be interpreted as reading the ABI from standard input, a fairly common idiom.
I'm willing to put in some legwork and issue a PR here if either or both of these are acceptable ideas.
Thanks for all the tooling!
System information
Geth version: 1.8.1-stable
OS & Version: macOS