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
Currently, Forge returns null when there are multiple contracts with the same name.
For example, if you make two contracts with the same name, deploy them using forge script, and look at the broadcast file, some data will be null.
We had to work around this, and assume that all contract will have unique names.
As for the the file name, the idea is that the file name should reflect the name of the main contract inside it. If there is more that one 'main' contract in the file, they should be moved to their separate files.
You are correct that this is not indicated, and we should add it to the readme.
Thanks for the feedback on this. I agree that having multiple contracts with the same name should not be a supported use case, since foundry doesn't itself populate the broadcast files accordingly. However, having a contract with a different name from the source filename should in my opinion be supported. Likewise, having multiple contracts in the same file should be supported. Forge chronicles could probably be smart about it and try to find the source file containing a given contract, if its name is unique accross the project.
The portion of code below looks for the artifact file in the
out
directory and uses the contract name for both the folder and json filename.However, if a contract has a different name from the solidity file that contains it, this fails:
Assume the file is named
SomeFile.sol
The path should be
/home/myproject/out/SomeFile.sol/MyContract.json
The culprit:
forge-chronicles/extractor.js
Line 313 in c2be7a4
The text was updated successfully, but these errors were encountered: