-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolver for non-local imports in compileSol function? #246
Comments
Hello there. Currently package supports only resolvers that you mentioned. We also provide solc-typed-ast/src/bin/compile.ts Lines 205 to 208 in 36ee1b0
You can pre-download necessary referenced sources and reference them via path remappings (similarly to what Solidity compiler supports). Package not yet support remote source downloading and we not yet received any feature requests for this functionality. |
As the other option, you can compile Solidity on your own (with external logic), and the supply resulting compiler AST to an |
@blitz-1306 great, thank you very much for the quick & helpful reply! |
@blitz-1306 another question - can you tell me how such a path remapping could be implemented (simplified)? Also, with the classic solc something like this is possible:
Would defining such an import resolver function also work in solc-typed-ast? Please excuse me, I know my request is quite specific but I think there may also be others who will find this helpful. Thank you very much in advance! |
Description
Hello, I am not sure if this is a feature request or support request.
Can I compile smart contracts that contain external imports using
solc-typed-ast
?Trying to compile the above contract with
solc-typed-ast
results in:CompileInferenceError: Couldn't find @openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol
For example, in the
@remix-project/remix-solidity
package, I can specify a callback function like this and pass it to the compile function, which leads to compiling the above contract like a charm :Is it possible to resolve external imports like this in
solc-typed-ast
?In the codebase, I have only found
LocalNpmResolver
andFileSystemResolver
.Thank you very much in advance.
The text was updated successfully, but these errors were encountered: