You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
There needs to be a way to specify a "PATH" with multiple components. This is like "bash" or "sh" PATH that will be searched for files. To get both truffle and solc and abigen to work together seems at present to require copying of an entire library from node_modules/zepplin-* to the ./contracts directory. I think that a copy like this is a bad thing. abigen and solc need to be able to search for the files. Also solcjs seems to work differently with relative paths.
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 assolc
ortruffle
. For example, our code imports code from a third-party library that is pulled in vianpm
. Truffle handles this relatively transparently. Forsolc
, we can deal with the situation by mapping the import path to thenode_modules
import path and then specifying--allow-paths
appropriately. Unfortunately, there's no way to askabigen
to pass any flags tosolc
when invoking it with a Solidity file, andabigen
doesn't have first-class support for--allow-paths
or import path mapping.My next attempt was to pipe the output of
solc
toabigen
. Unfortunately, there doesn't seem to be a way to askabigen
to read its contents fromstdin
.It's not immediately obvious if one or the other (passing flags to
solc
or reading fromstdin
) 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
The text was updated successfully, but these errors were encountered: