-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Dynamic linking not supported in create
command
#1338
Comments
Do you have multiple contracts that use the library, or do you use multiple libraries? They all need to be specified, otherwise the bytecode is unlinked. Also, can you try running |
Interesting, @mattsse any insight? AFAIK this happens in |
Is Chainlink TWAP actually a library? I.e. is it defined with Also, I'm very interested in figuring out what the root cause of this is, since I cannot reproduce the behavior myself. If you're available through a more real-time channel like Telegram (https://t.me/foundry_support, ping @onbjerg) please let me know. |
sry guys overlooked this one... what contract is causing this error when being deployed? |
This comment was marked as resolved.
This comment was marked as resolved.
A lot of the source files mentioned in your original screenshot are not present in the Solidity cache file (e.g. Auction.sol and AuctionOracle.sol). Can you post an updated config with the correct file names? 😄 |
Hey @onbjerg, thanks for taking a look. here is the current
|
Is this line a typo:
It says You also specify libraries for some of the tests - this is not needed, unless you are running fork tests. In that case, there seems to be additional tests which make use of libraries that do not appear in What contract are you trying to deploy? |
Ok, seems I was wrong as well: The path is to the library contract, I will make sure the book reflects this Another person had this issue on Telegram, and using absolute paths worked for them. This indicates that we probably do have a regression somewhere, since relative paths used to work |
Thanks for picking up that typo - but it still doesn't work hmm. Actually, my fork (kovan) testing has been working fine - even the tests with I included those extra libraries as a safe measure but probs don't need them because they are all internal funcs? They get embedded as bytecode right?
|
what does if you could provide a simple repro that be helpful. |
it's the lib file because we're populating the so solc will we able to link them. actually, I better have another look at the docs again. |
Clean repo: https://github.com/evmcheb/chainlink-test Steps taken:
|
thank you! |
Yo I got it to deploy! Changing the relative path to absolute path.
You're right, it should Thanks for being a huge help. quicc note for people that might have similar issues
|
can you clarify because this is ::
🤔 "src/Contract.sol": {
"ChainlinkTWAP": "0xc154fde3374125a29df92b0957ff80be897ff1dc"
} only this works "libraries": {
"src/libraries/ChainlinkTWAP.sol": {
"ChainlinkTWAP": "0xb77fffcdcf99b8a3a380f5e163071f3640831c40"
}
} you should be able to declare the
|
am referencing this part of the docs https://book.getfoundry.sh/reference/config.html#libraries An array of libraries to link against in the following format: file:lib:address, for example: except
|
hmm can't reproduce this on master because relative paths and "src/.." should be supported now |
Haven't had any trouble with relative paths anywhere else in Just confirmed in This doesn't work
Nor does this work
But this does work
m1 mac - in vscode zsh terminal with solidity plugin. forge 0.2.0 |
what's your |
forge 0.2.0 (a84a281 2022-04-16T00:15:54.385011+00:00) will update now |
oh that's outdated, can you try after updating, the fix should be in |
works with relative paths now - thx mbd!!!! |
Will close this since it seems your issue was fixed? 😄 |
I still have this error "Dynamic linking not supported in create command" when trying to pass libraries in to create on command line, i.e. |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (a84a281 2022-04-16T00:15:54.385011+00:00)
What command(s) is the bug in?
forge create
Operating System
macOS (M1)
Describe the bug
Still getting a
Dynamic linking not supported in create command
error after changingfoundry.toml
when deploying to a testnet.First ran
forge create Library
which works fine.Got the address from that then add the following line to
foundry.toml
libraries= ['./src/lib/LibraryContract.sol:Library:0xaddress']
I've also tried adding the contract that imports the library:
libraries= ['./src/Contract.sol:Library:0xaddress']
The text was updated successfully, but these errors were encountered: