-
This is the error message I got from forge create. Here's the weird thing: My tests run fine, and I could swear I've used forge create with a library before. So, questions:
Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 6 replies
-
The error message tells you what to do: Deploy the library contract and then link it at compile time :) You need to specify |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick reply! That said, this really defeats the purpose. I went from a 2 line script to compile, deploy and initialize my contracts to... Well, I'm not exactly sure (dealing with solc?) but I guess I'll figure it out. Are there any plans to support dynamic linking in the future? |
Beta Was this translation helpful? Give feedback.
-
Well, problem is, I get the same message when trying to deploy the library, so I assumed I had to do that manually. Here's the code: https://github.com/evronm/Attributions/blob/e030c5fa13f18246c11d4fff6983177bdce6126b/src/Common.sol and here's the command I used: forge create --legacy --rpc-url $RPC_URL --private-key $KEY ./src/Common.sol:Kvs Do I need to specify all the libraries in the file? If so, how? Or do I need to split the libraries into separate files? I really appreciate all the help. |
Beta Was this translation helpful? Give feedback.
-
OK, I'm SO close now! I think my remaining issue is how to specify multiple libraries on the command line (I really don't want to mess with config files). I've tried the following: --libraries $UTILS_LIB $KVMS_LIB $STR_ADDRS_LIB $TAGS_LIB The last one gives: "failed to parse, too many arguments passed: Utils" which I thought was interesting. What am I doing wrong? When I figure this out, I'm pretty sure I'm all set. |
Beta Was this translation helpful? Give feedback.
-
NVM, figured it out. FWIW, one of my variables was set incorrectly. The correct syntax is a --libraries for each library. Thanks again for all your help! |
Beta Was this translation helpful? Give feedback.
-
Crap! I hate to reopen this, but I've made a few changes in my code, none of which involve any new libraries, and I'm getting the same error again. I've checked and all the libraries are accounted for in my script. Is there any way of figuring out what libraries the compiler is expecting? The docs don't say anything about a verbose option or logging, but is there a different way? Thanks again. |
Beta Was this translation helpful? Give feedback.
NVM, figured it out. FWIW, one of my variables was set incorrectly. The correct syntax is a --libraries for each library.
Thanks again for all your help!